Posts Tagged With: Linux

Rename Command

Tagged with: , , , ,

Different way to use the rename command.


rename 's/.html$/.php/' *.html
No Comments »

Create Random Password

Tagged with: , , , , , , , ,

Use this command to create a random password


< /dev/urandom tr -dc A-Za-z0-9_ | head -c8

Also see…

No Comments »

CDPATH

Tagged with: , , , ,

CDPATH is to cd what PATH is to exectable. You can go to a folder inside any of the CDPATH folders by just cd 'folder name' – no mater where you are currently.


export CDPATH='.:~:/var/www/html:~/Scripts'
No Comments »

Use ffmpeg to create a screencast

Tagged with: , , , , ,

You can use this command to create a screencast using ffmpeg.


ffmpeg -f x11grab -s 800x600 -i :0.0 /tmp/screencast.mpg
No Comments »

Backup Del.icio.us posts

Tagged with: , , , , ,

Backup all delicious bookmarks using this command


wget --user=username --password=password https://api.del.icio.us/v1/posts/all -O bookmarks.xml
No Comments »

Replacing in Found Files

Tagged with: , , , , , ,

Replace one string by another in all file found by find.


find . -name *whatyouwant* -exec perl -pi.bak -e 's/TEXT_TO_REPLACE/TEXT_TO_REPLACE_IT_WITH/g' {} \;
No Comments »

Backup and Restore Boot sector

Tagged with: , , , , , , ,

Use these commands to backup/restore your boot sector


dd if=/dev/hda of=bootsector.img bs=512 count=1 # backup
dd if=bootsector.img of=/dev/hda #restore

Original Article

No Comments »

Post to Delicious From Command Line

Tagged with: , , , , ,

Post to Delicious


curl "https://<username>:<password>@api.del.icio.us/v1/posts/add?&url=[URL]&description=[TITLE]&tags=[TAGS]&replace=no" 
No Comments »

Command Line Tool to Set ID3 Tags for MP3

Tagged with: , , , , , ,

Set the ID3 tags for mp3 files using this command…


id3tool -t "$title" -r "$artist" file.mp3
No Comments »

Get Audio from a video file

Tagged with: , , , , ,

Get Audio from a video file


mplayer -dumpaudio -quiet VIDEO_FILE
1 Comment »