23 July 2011

get a random 8 character string with < /dev/urandom tr -dc A-Za-z0-9 | head -c8


20 July 2011

take a look at orgmode for emacs

find an elusive command in linux with ls /usr/bin/*string*

comment out lines 1 to 10 in vim with :1,10 s/^/#


:set nu in vim to display line numbers


 

18 July 2011

zoom the terminal in gnome with ctrl++

zoom out with ctrl+-


insert text at the start of the line in vim with shift+i

list swap files in the current directory with vi -r

update to the latest vlc v 1.1.11 in ubuntu http://goo.gl/aj21P

from unixmen.com

VLC 1.1.11 has been released!

VLC 1.1.11 has been released, this is a security release with some other improvements. according to vlc team, this release was necessary due to two security issues in the real and avi demuxers. It also contains improvements in the fullscreen mode of the Win32 mozilla plugin, the MacOSX Media Key handling and Auhal audio output as well as bug fixes in GUI, decoders and demuxers.

The new release is available in GetDeb repositories, for ubuntu and linuxmint users with getdeb installed in their system, simply update your system to have the latest release of vlc. You can also install it from getdeb page

If you are using Unixmen PPA, this one will be updated in the next few days when pirat9 is back from holidays.

sudo add-apt-repository ppa:unixmen-com/vlc
sudo apt-get update
sudo apt-get install vlc vlc-plugin-pulse mozilla-plugin-vlc

try a clipboard manager for gnome with parcellite http://goo.gl/WjhMD

from parcellite.sourceforge.net
About
Parcellite is a lightweight GTK+ clipboard manager. This is a stripped down, basic-features-only clipboard manager with a small memory footprint for those who like simplicity.
Requirements
gtk >= 2.10.0
glib >= 2.14.0
Features
Keeps a clipboard history.
Various view options to display items the way you like it.
Daemon mode; guard your clipboard contents when you close applications.
Global hotkeys to display your items quickly.
Perform custom commands using clipboard contents.
Tracker
Report a bug
Request a new feature
Submit a patch


try firefox nightly build for improved ram usage http://goo.gl/u0WjV

from nightly.mozilla.org and reddit/linux

Linux 64-bit Intel
16MB tar.bz2
Built on 17-Jul-2011

delete the first line of a file with sed -i '1 d' old.txt

from stackoverflow.com

to remove the last line:

sed -i '$ d' foo.txt

 

create a hardware report with: lshw -html > hardware.html

from webupd8

 

Create a nifty overview of the hardware in your computer:

lshw -html > hardware.html

17 July 2011

extract audio from flv files with ffmpeg -i in.flv -f mp3 -vn -acodec copy out.mp3

when extracting archives change the path don't move the archive

remove leading whitespace with cat old.file | sed -e 's/^[ \t]*//' > new.file

from nixcraft
To remove all whitespace (including tabs) from left to first word, enter:

echo " This is a test" | sed -e 's/^[ \t]*//'

 

To delete trailing whitespace from end of each line, enter:

$ cat input.txt | sed 's/[ \t]*$//' > output.txt

 

Better remove all leading and trailing whitespace from end of each line:

$ cat input.txt | sed 's/^[ \t]*//;s/[ \t]*$//' > output.txt

replace tabs with spaces in a file with expand file http://ss64.com/bash/expand.html

convert .ogv to .flv with ffmpeg -i input_file.ogv output_file.flv http://goo.gl/10VeQ

from tuxarena

In today's tip of the day I'll show how to easily convert an OGV (Theora video) file to FLV (Flash video), for uploading to YouTube or other websites. You will need the ffmpeg audio and video encoder.
To convert an OGV file created by recordMyDesktop for example, all you have to do is issue a command like this:

ffmpeg -i inputfile.ogv outputfile.flv

You can shrink the size of the output file using something like this:

ffmpeg -i inputfile.ogv -s 640x512 outputfile.flv

This also reduces the size of the Flash video file.

To select a certain audio codec you can use something which goes like this:

ffmpeg -i inputfile.ogv -acodec libmp3lame outputfile.flv

find the number of occurrences of a string in a file with grep -o "string" < ~/file | wc -w

try drag and drop image searching at http://images.google.com/

a very cool tool images.google.com


replace the first occurrence of foo with bar in a file in vim with :s/foo/bar

extract email address from a file with grep -Eiorh '([[:alnum:]_.]+@[[:alnum:]_]+?\.[[:alpha:].]{2,6})' file.html

swap esc and caps lock in gnome in prefs . keyboard . layout . options . caps

from ubuntuforums.org

select whole line in vim with shift+v http://goo.gl/TICbk

from pixelbeat.org

top vim plugins in action http://youtu.be/_galFWwSDt0



Surround

Snipmate

TComment

MRU

FuzzyFinder

NERDTree

Matchit

Matrix

Pages