Apr 192013

Just finished up with PiParted v0.03

Changes –
No longer needs 4 gigs of ram as it will uncompress and image on the fly.
Tested it on a laptop with 1.5 gigs of ram and it worked ok.

Installing from SD Card –
Works with both zip and .gz file, haven’t tested properly with .tar.gz but should still work

Also checks SHA1 hash when downloaded from the Pi site.

Incremental update really.
Download it from here
SHA1 Hash –
f91e53df56aec6cc7d1b27041e0750b0f4763bfd PiParted-0.03.iso

Apr 082013

After some tweaking, I have improved PiParted.
Please note this is a very early testing version, so some things may break or not work properly.

Download it here !

New features –
Flash OS from zip file on SD Card:
If the SD card only has one partition, and there is one zip file on that partition, the script will use that to flash an OS on.

Reset SD Card:
This will format an SD Card back to defaults, i.e. one vfat partition.

dd will now show it’s status when it’s flashing a SD card.

I’m looking for testers, so if anyone tries this out, please give me some feedback, either on this post or in the forum thread @ http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=39160

Apr 022013

After going through the forums, I recently had an idea that hopefully will make installing distros onto an SD card much easier.

A lot of issues come from people not knowing how to do it right, e.g. just dropping the img file onto an SD card.
So I’ve customised a GParted LiveCD ISO and written up a custom script to *hopefully* install a distro straight onto an SD card.
This is a very early iteration of this idea, but hopefully will develop into something useful.

At the moment, essentially what it will do is

1. Grab the list of Distros from the RPI Download page
2. Let the user select which distro he wants to install
3. Select the Disk device that he wants to install it onto
4. dd the image onto the disk device.

Later on, I’m hoping to add more functionality including –
resizing image files
resizing sd card partitions
wiping SD cards back to a normal usable (by windows) state
Installing distributions from other sites
auto-resizing of the root partition after installing a distribution

Grab the iso from here

Feedback can be left here or on the forum topic

Mar 102013

I’ve had a few queries regarding streaming audio as well as video on the Raspberry Pi, so tonight I set up my little Raspberry Pi with a Logitech C110. This webcam also has a microphone integrated which the Pi can use to record audio.
Everything has been setup as per part 3 of my ffmpeg streaming guide.

A little investigation reveals which hardware device the microphone is recognised as.

# arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: C110 [Webcam C110], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

So the device is recognised as card 1. This comes in later when we are setting up the audio part of the streaming.

I’ve updated the webcam.sh script to reflect the fact that we are now recording sound –

ffserver -f /root/ff.conf & ffmpeg -vcodec mjpeg -v verbose -r 15 -s 176x128 -f video4linux2 -i /dev/video0 -f alsa -ac 1 -i hw:1 http://localhost:81/webcam.ffm

And I also need to update ff.conf with the new streaming settings
The Stream webcam section has now turned into this –
<Stream webcam.avi>
Feed webcam.ffm
Format avi
VideoSize 176x128
VideoFrameRate 15
VideoBufferSize 40
VideoBitRate 64
AudioBitRate 32
AudioChannels 1
AudioSampleRate 11025
VideoQMin 1
VideoQMax 20

With this configuration, I could start ffmpeg with audio and video streaming. However I could not get my laptop with vlc to connect to it for now, so I’ll have to keep investigating that.
Hopefully this helps though.

Please support the continued development of any useful scripts and tutorials that you have found useful !

Mar 102013

There’s been a few threads recently on the Raspberry Pi forums regarding SD Card images too big to fit on other SD cards.
So I’ve come up with a script to automatically resize SD Cards to the smallest size possible. At the moment it is Linux only unfortunately, but I may release a windows version if there’s demand.

The script can be downloaded from here

or copied and pasted from here

# Automatic Image file resizer
# Written by SirLagz

if [[ ! $(whoami) =~ "root" ]]; then
echo ""
echo "**********************************"
echo "*** This should be run as root ***"
echo "**********************************"
echo ""

if [[ -z $1 ]]; then
echo "Usage: ./autosizer.sh "

if [[ ! -e $1 || ! $(file $1) =~ "x86" ]]; then
echo "Error : Not an image file, or file doesn't exist"

partinfo=`parted -m $1 unit B print`
partnumber=`echo "$partinfo" | grep ext4 | awk -F: ' { print $1 } '`
partstart=`echo "$partinfo" | grep ext4 | awk -F: ' { print substr($2,0,length($2)-1) } '`
loopback=`losetup -f --show -o $partstart $1`
e2fsck -f $loopback
minsize=`resize2fs -P $loopback | awk -F': ' ' { print $2 } '`
minsize=`echo $minsize+1000 | bc`
resize2fs -p $loopback $minsize
sleep 1
losetup -d $loopback
partnewsize=`echo "$minsize * 4096" | bc`
newpartend=`echo "$partstart + $partnewsize" | bc`
part1=`parted $1 rm 2`
part2=`parted $1 unit B mkpart primary $partstart $newpartend`
endresult=`parted -m $1 unit B print free | tail -1 | awk -F: ' { print substr($2,0,length($2)-1) } '`
truncate -s $endresult $1

Please support the continued development of any useful scripts and tutorials that you have found useful !