Random Bits
I haven't come across anything that deserves a full post this week, so here's 5 interesting technologies I've come across recently:
- umask
- How to set default permissions when creating files in linux
- DoHop.com
- Find Cheap Flights
- Twubble
- Friends of Friends for Twitter
- JTwitter
- Java Library for the Twitter API
- TwitterLocal
- Find tweets by location
And here's some more randomness:
"Switching to VoIP" by Ted Wallingford is very related to that 4IF1 are currently studying in Real Time Systems. Chapter 6 in particular.
When ordering books from Amazon, do not screw around during the ordering stage unless you want two of the same book. /me hangs head in shame.
The 3 wireless dongle works perfectly in Ubuntu.
World of Goo is a very addictive game.
Finally, congrats to Emma Conway for her win in the NUIG Student Union elections. Unfortunately, Pofla didn't get in. I hoarded as many whispa's as I possibly could to prevent their dispersal to the general populace to no avail.
Recovering Files From an Unmountable USB Key
The other night, myself and Rory managed to recover his friend's thesis from a wonky USB thumb drive. We used PhotoRec on Ubuntu Linux. PhotoRec comes with the TestDisk utility. You can install TestDisk via:
$apt-get update
$apt-get install testdisk
The first thing we did was run dmesg in a terminal to get a bit of info on what was going on. We ran dmesg before and after we plugged in the drive and noted the relevant output. The device eventually settled and was given the device location sdb by the kernel, but no filesystem was found.
The partition was likely corrupted somehow.
TestDisk could be used to try to repair the partition on the disk, but it could also damage the data further. We decided to make an image to work with using dd:
$sudo dd if=/dev/sdb ou=./disk_image
Use dd with care! Consult the man page for more info.
This copied the contents of the usb key block-by-block to a file called "disk_image". The was a 2G image (the total capacity) of the wonky drive.
We then used photorec to try to recover any files from the image.
$photorec ./disk_image
- 1. Select the image to use
- 2. Select the partition table type
- 3. Select the partition
- 4. Select the filesystem type
- 5. Select where to save recovered files
- 6. Search in progress
Et voila! PhotoRec worked its magic and we recovered the thesis, along with all the other files.
Webcam Motion Detection in Ubuntu Linux
I bought a cheap usb webcam to add to the list of devices for my fyp. The idea is to push presence updates when motion is detected. I'll be using Motion to handle motion detection. Detailed installation and configuration instructions can be found at InfectedProject.
You can set motion to run commands when certain events happen, such as an image is saved or a movie ends. For example, you could add the following to /etc/motion/motion.conf so that you get an email to you're email account when a movie ends.
# Command to be executed when a movie file (.mpg|.avi) is closed. (default: none)
# To give the filename as an argument to a command append it with %f
on_movie_end echo %f | mutt -s "[Motion]" -a %f joe@bloggs.com





