Saturday, September 15, 2012

Grep in pdf file for a certain word

find . -name '*.pdf' -exec pdftotext {} - \; | grep -rn "test"

find . -name "*.pdf" -print0| while read -d $'' file; do co=$(pdftotext -q "$file" - |grep -crn "test"); if [ $co -ne 0 ]; then echo $co - "$file" ; fi ; done

Wednesday, September 12, 2012

uninstall a firefox plugin

http://askubuntu.com/questions/150095/how-to-uninstall-a-firefox-plugin


Manually uninstalling a plugin

If you can't use an uninstaller program to remove a plugin, you can remove it manually:

In the Location bar, type about:config and press Enter.

The about:config "This might void your warranty!" warning page may appear. Click I'll be careful, I promise!, to continue to the about:config page.
Search for the preference: plugin.expose_full_path.

Double-click on the plugin.expose_full_path preference in the list to change the value to true.

Enter about:plugins into the Location bar to display the About Plugins page.

Each entry in the About Plugins page will have "File name:" followed by a path. Use Windows Explorer to navigateNavigate to the folder shown for the plugin you want to remove.

Rename the file to something other than its normal name - e.g. npswf32 becomes Xnpswf32

Double-click on the plugin.expose_full_path preference in the list on the about:config page to change the value back to false to avoid exposing the plugin path to websites.

Tuesday, September 11, 2012

Download a web site using wget

wget -r --level=0 -convert-links --page-requisites --no-parent <URL>
httrack <URL>

Thursday, August 9, 2012

download youtube files with youtube-dl-tci

curl -s "http://www.youtube.com/playlist?list=UUuqxLlNgdBCqhTxphhhTbZg&page=2" | grep watch? |cut -d\= -f3 | cut -d\& -f1 | grep -v data | grep -v watch | while read file ; do youtube-dl -tci "http://www.youtube.com/watch?v=$file" ; done

Wednesday, August 8, 2012

Install μTorrent in Ubuntu

wget http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz
sudo cp utorrent-server-3.0-25053.tar.gz /opt/
cd /opt/
sudo tar -xvf utorrent-server-3.0-25053.tar.gz
sudo rm -rf utorrent-server-3.0-25053.tar.gz
sudo chmod 777 -R utorrent-server-v3_0/
sudo ln -s /opt/utorrent-server-v3_0/utserver /usr/bin/utserver

Create a launcher in panel. In name field type utorrent and in command filed type 'utserver -settingspath /opt/utorrent-server-v3_0/ &'


Go to localhost:8080/gui and for user name type admin and password leave it empty.

Start launch application in Ubuntu 12.04 Unity

sudo apt-get install gnome-panel
gnome-desktop-item-edit --create-new ~/Desktop

Sunday, August 5, 2012

Read text with voice in Ubuntu

espeak --stdout -f text.txt | aplay -> read with voice file text.txt
espeak -v en-uk --stdout 'some text' | aplay -> read with voice some text
espeak --voices -> display all available voices

Solution when sound in stuttering in Ubuntu

1. lsof | grep pcm
2. kill all the processes and the sound will work fine

Tuesday, July 10, 2012

Kernel driver not installed (rc=-1908)


The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.


Friday, May 4, 2012

How to get the last modified item using ll command

touch file
echo "test" > file
cat `ll -ltr | tail -1 | awk '{print $8}'`

Result:
test