Supermind Search Consulting Blog 
Solr - Elasticsearch - Big Data

Reset wireless in Ubuntu 10.04 Lucid

Posted by Kelvin on 04 Mar 2011 | Tagged as: Ubuntu

Ever had your Intel wireless card play up on you in Ubuntu? You can't seem to reset it like the ethernet cards (i.e. with ifup and ifdown). Do this instead: sudo rmmod iwlagn && sudo modprobe iwlagn Replace iwlagn with your wireless card module name if you don't have an intel wireless card.

Download google video and youtube from command-line

Posted by Kelvin on 22 Feb 2011 | Tagged as: Ubuntu

clive is an awesome tool for downloading google video and youtube flash videos from the command-line. sudo apt-get install clive   # download google video in flv clive http://video.google.com/videoplay?docid=-1388254997387483895   # download youtube in mp4 clive –format=mp4 http://www.youtube.com/watch?v=JPyuH4qXLZ0   # download list of URLs in file cat urls.txt | clive

Recursively copy only files with certain extension with rsync

Posted by Kelvin on 16 Jan 2011 | Tagged as: Ubuntu

Sometimes you want to get to all MP3 or PDF files which are nested in a deep directory tree. Here's what you do.. rsync -rvtW –delay-updates –modify-window=1 –progress –include='*.pdf' –include='*.xml' –exclude='*.*' source dest

Useful ffmpeg commands

Posted by Kelvin on 06 Dec 2010 | Tagged as: Ubuntu

Shameless ripped from http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs Getting infos from a video file ffmpeg -i video.avi Turn X images to a video sequence ffmpeg -f image2 -i image%d.jpg video.mpg This command will transform all the images from the current directory (named image1.jpg, image2.jpg, etc…) to a video file named video.mpg. Turn a video to X images ffmpeg -i […]

Download youtube videos as mp3

Posted by Kelvin on 04 Dec 2010 | Tagged as: Ubuntu

For Ubuntu.. sudo apt-get install ffmpeg   cd ~/bin wget https://github.com/rg3/youtube-dl/raw/2010.11.19/youtube-dl chmod +x youtube-dl   wget http://www.supermind.org/scripts/youtube2mp3 chmod +x youtube2mp3 The contents of youtube2mp3 is simple: #!/bin/bash #!/bin/bash   x=/tmp/.youtube-dl-$RANDOM-$RANDOM.flv youtube-dl –output=$x –format=18 "$1" ffmpeg -i $x -vn -ar 44100 -ac 2 -ab 256k -f mp3 "$2" Now get the youtube URL you want to […]

Move up multiple directories in bash

Posted by Kelvin on 04 Dec 2010 | Tagged as: Ubuntu

Ever thought typing cd.. 5 times was silly? Try this up() function! Add this to .bash_profile or .bashrc up () { if [ -z $1 ]; then cd .. elif [ $1 -gt 0 ]; then let count=0 while [ $count -lt $1 ]; do cd .. let count=count+1 done else echo "Argument must be […]

Recursively delete .svn folders

Posted by Kelvin on 04 Dec 2010 | Tagged as: Ubuntu

#!/bin/bash find ./ -name ".svn" | xargs rm -Rf

Introducing Bash-whacking

Posted by Kelvin on 04 Dec 2010 | Tagged as: Ubuntu

Starting a new blog series on bash scripts you shouldn't live without. Installation for scripts is simple: either add them to /usr/bin or add ~/bin to your bash path and place your scripts there. Don't forget to make the scripts executable! Here's a complete example: Suppose you wanted to create a script called foobar and […]

Recursive directory listing sorted by file size

Posted by Kelvin on 03 Dec 2010 | Tagged as: Ubuntu

Ever wanted to list a directory sorted by decreasing file size? Useful for finding large files.. du -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh Courtesy of LinuxQuestions.org

« Previous Page