Showing posts with label triks. Show all posts
Showing posts with label triks. Show all posts

Unmount busy drives



You are probably all too familiar with the situation - you are trying to unmount a drive, but keep getting told by your system that it's busy. But what application is tying it up? A quick one-liner will tell you:
lsof +D /mnt/windows
This will return the command and process ID of any tasks currently accessing the /mnt/windows directory. You can then locate them, or use the kill command to finish them off.

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Grabbing a screenshot without X



There are plenty of screen-capture tools, but a lot of them are based on X. This leads to a problem when running an X application would interfere with the application you wanted to grab - perhaps a game or even a Linux installer. If you use the venerable ImageMagick import command though, you can grab from an X session via the console. Simply go to a virtual terminal (Ctrl+Alt+F1 for example) and enter the following:

chvt 7; sleep 2; import -display :0.0 -window root sshot1.png; chvt 1;
The chvt command changes the virtual terminal, and the sleep command gives it a while to redraw the screen. The import command then captures the whole display and saves it to a file before the final chvt command sticks you back in the virtual terminal again. Make sure you type the whole command on one line.

This can even work on Linux installers, many of which leave a console running in the background - just load up a floppy/CD with import and the few libraries it requires for a first-rate run-anywhere screen grabber.

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Finding the biggest files



A common problem with computers is when you have a number of large files (such as audio/video clips) that you may want to get rid of. You can find the biggest files in the current directory with:

ls -lSrh
The "r" causes the large files to be listed at the end and the "h" gives human readable output (MB and such). You could also search for the biggest MP3/MPEGs:

ls -lSrh *.mp*
You can also look for the largest directories with:

du -kx | egrep -v "\./.+/" | sort -n


Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Backing up Master Boot Record



The MBR is a 512 byte segment on the very first sector of your hard drive composed of three parts: 1) the boot code which is 446 bytes long, 2) the partiton table which is 64 btyes long, and 3) the boot code signature which is 2 bytes long.
The core of the backup command is dd—which will be familiar to every system administrator, especially to those who intend to clone an entire hard disk. To see all the options type man dd. As we want to back up only the first 512 bytes we need to append some arguments to it. Here is the full command you need (and remember to run it as the root user, su (and sudo for Ubuntu users):

dd if=/dev/hda of=/home/richmondg/mbr_backup bs=512 count=1
Restoring the MBR
You can use a live CD to access your hard drive and read the backup off any removable media such as a USB stick. Here is the command:

dd if=/dev/sda/mbr_backup of=/dev/hda bs=512 count=1
Again, amend sda to read where you saved the MBR and run the command as root. If you wish to kill the MBR altogether, including the partition table, then you can overwrite it with a series of zeros:

dd if=/dev/zero of=/dev/hda bs=512 count=1
If you want to kill the MBR but leave the partition table intact then simply change 512 to 446.
Another way to repair the mbr of your HDD device is install LILO then type (replacing x with the letter of your HDDdevice) :

lilo -M /dev/sdx


Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Make Sure You Have A Profile Picture in twitter



Marketing software maker HubSpot has analyzed close to 9 million Twitter profiles based on data collected through its Twitter Grader tool, and has come to the conclusion that accounts with a profile picture average about 10 times more followers than those without.

That on itself is not so surprising; a Twitter profile associated with the default avatar generally screams ‘newbie’, which is generally an incentive not to follow someone unless you know that person in real life or on other social networks. There’s a good reason why spammers who create fake Twitter accounts tend to include pictures in profiles – it’s human nature to instantly trust personalized online accounts more than generic ones.




But we love stats here at TechCrunch, so here you go:

source: www.crunchbase.com


Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Popular Posts