30 December 2011

execute a bash script with bash script.bash http://goo.gl/d1h4M

To execute the script, type:
$ ./script-name-here
You can also run a script using any one of the following syntax:
$ /path/to/shell/script/backup.sh
Run a script called backup.ksh using ksh shell:
$ ksh backup.ksh
Run a script called backup.bash using BASH shell:
$ bash backup.bash

from nixCraft

process text in table using awk http://goo.gl/47GR0

simple awk tutorial

why awk?

awk is small, fast, and simple, unlike, say, perl. awk also has a clean comprehensible C-like input language, unlike, say, perl. And while it can't do everything you can do in perl, it can do most things that are actually text processing, and it's much easier to work with.

what do you do?

In its simplest usage awk is meant for processing column-oriented text data, such as tables, presented to it on standard input. The variables...

from www.hcs.harvard.edu/~dholland/computers/awk.html

06 November 2011

go to the end of the line in vim with $ (shift 4)

go to the start of the line with ^ (shift 6)
go to the end of the line and change to insert mode with A (shift a)
go to the start of the line and change to insert mode with I (shift i)

05 November 2011

autocomplete in vim with ctrl x ctrl p http://youtu.be/3Q94QSv7Pow

30 October 2011

manage passwords on the cli using ccrypt http://goo.gl/kIR0ge

from linuxbyexample.org:

In today’s screencast, I am going to demonstrate the approach I take, which I hope you’ll find useful. There a several programs available, allowing you to manage your passwords using a nice graphical user interface, but I wanted a command line solution, as ultimately I want to store my master password file on a Linux server, so I can access it from any computer over SSH.
Here I have my master password file, which is just a plain text file...more

28 October 2011

delete preceding word in the command line with ctrl+w http://goo.gl/XhTCU

A few handy movement commands

Sometimes a mistake is noticed before the enter key is pressed. We’ve already talked about terminals that don’t translate cursor-keys properly, so how do you fix a mistake? To make matters worse, sometimes the backspace key gets mapped to ^H or even worse something like ^[[~. Now how do you fix your mistake before hitting the enter key?

Once again, bash comes through for us. Here are some of the movement keystrokes that I use most often:

^w erase word
^u erase from here to beginning of the line (I use this ALL the time.)
^a move the cursor to the beginning of the line
^e move the curor to the end of the line

There are more of course, but those are the ones you simply can't live without. For those who don't know the ^N notation means ctrl+N, don't confuse it with hats mentioned above.

from samrowe.com

25 October 2011

install wireless device driver for hp zd8000 in ubuntu 11.04 natty narwhal http://goo.gl/VNrU

b43 - [with] Internet access

If you have some other kind of Internet access on your computer, you can download the firmware by simply installing the b43-fwcutter package which does the download and setup for you automatically.

Step 1.

To install b43-fwcutter issue the following command in a terminal (under the desktop menu Applications > Accessories > Terminal) and follow the prompts:

~$ sudo apt-get install b43-fwcutter

Since Ubuntu 11.04 Natty Narwhal additional installation of the package firmware-b43-installer can be helpful and/or necessary, respectively:

~$ sudo apt-get install b43-fwcutter firmware-b43-installer

or, if you need a legacy driver, use:

~$ sudo apt-get install firmware-b43legacy-installer 

Step 2.

Under the desktop menu System > Administration > Hardware/Additional Drivers, the b43 drivers can be activated for use.

Note: A computer restart may be required before using the wifi card. LiveCD/LiveUSB

Step 3.

For temporary use with the LiveCD and LiveUSB environments, instead of a computer restart, in a terminal issue the following commands:

~$ sudo modprobe -r b43 ssb ~$ sudo modprobe b43

Note: Allow several seconds for the network manager to scan for available networks before attempting a connection.

from WifiDocs/Driver/bcm43xx - Community Ubuntu Documentation

id wifi device in ubuntu with lspci -vvn http://goo.gl/VNrUn | grep 14e4

Broadcom BCM43xx Chipset (PCI)

Identifying Your Card/Driver

In a terminal the command lspci will display information about all PCI devices attached to your computer. To display only devices manufactured by Broadcom (including wifi cards), apply a filter for "14e4" as follows.

Open a terminal window under the desktop menu Applications > Accessories > Terminal and enter the following command:

~$ lspci -vvnn | grep 14e4

16 September 2011

bulk append .jpg suffix with for i in *; do mv $i $i.jpg; done




for i in *; do mv $i $i.jpg; done

04 September 2011

convert vob format to ipod touch format with handbrake-gtk snapshot

Add the Handbrake Snapshots PPA from Handbrake Snapshots.
sudo add-apt-repository ppa:stebbins/handbrake-snapshot
sudo vim /etc/apt/sources.list append in vim with 
shift g shift a

sources to append with your ubuntu version inserted:

deb http://ppa.launchpad.net/stebbins/handbrake-snapshots/ubuntu UBUNTU_VERSION main 
deb-src http://ppa.launchpad.net/stebbins/handbrake-snapshots/ubuntu UBUNTU_VERSION main

:wq to save and quit vim

sudo apt-get update
sudo apt-get install handbrake-gtk

Open Handbrake from Applications > Sound & Video > Handbrake:

Click 'Source' and navigate to your .vob file and click Ok:

In the Presets area select Devices > Iphone & Ipod Touch:

Click Start

28 August 2011

get lspci in gentoo with emerge sys-apps/pciutils

copy and paste a line in nano with alt+6 then ctrl+u

nano Cheat Sheet from ibi.uchicago.edu

*Capital M on the left of a dash means push and hold the Esc key. (Example: M-D)


^G      (F1)            Display help text

Saving and Exiting

^O      (F3)            Save the current file (Write the current file to disk)
^X      (F2)            Close the current file buffer / Exit from nano

Moving around

^Y      (F7)            Move to the previous screen
^V      (F8)            Move to the next screen
^F                      Move forward one character
^B                      Move back one character
^Space                  Move forward one word
M-Space                 Move back one word
^P                      Move to the previous line
^N                      Move to the next line                          
^A                      Move to the beginning of the current line
^E                      Move to the end of the current line  


^W      (F6)            Search for a string or a regular expression

Copy, Cut, and Paste

M-^             (M-6)   Copy the current line and store it in the cutbuffer
^K      (F9)            Cut the current line and store it in the cutbuffer
^U      (F10)           Paste: Uncut from the cutbuffer into the current line

Other commands

M-D                     Count the number of words, lines, and characters
^C      (F11)           Display the position of the cursor
^J      (F4)            Justify the current paragraph
^T      (F12)           Invoke the spell checker
^R      (F5)            Insert another file into the current one

26 August 2011

visit a primo list of linux links at linux poison http://goo.gl/9Jrc0 @linux_poison

An excellent list from linuxpoison:

List of best Linux blogs - V2
Posted by Nikesh Jauhari

LinuxHelp Good site with great stuff, frequently updated.
HowToGeek Great How to site, not only for Linux but its Linux section is great!.
LinuxScrew good site which is coming real popular these days, with great articles.
Fsckin Frequently updated Linux site, great tutorials, and good posts about games for Linux.
Ubuntu Geek All about Ubuntu, from a real Geek
BashCuresCancer Site devoted to command Line, unfortunately not too frequently updated
http://www.linux-gamers.net/ For Linux games, how tos, forums, etc. about Video
Ars Technica Open Ended section: http://arstechnica.com/journals/linux.ars
DesktopLinux: http://www.desktoplinux.com/
Phoronix: http://www.phoronix.com/ (lots of good Linux stories)
http://www.ubuntux.org Ubuntux
http://www.markshuttleworth.com mark shuttleworth's blog
http://ubuntuliving.blogspot.com ubuntu living
http://planet.gnome.org planet gnome [same as planet kde]
http://planetkde.org planet kde

....more links and excellent posts at linuxpoison.

23 August 2011

add a script to the default applications list in gnome

My previous post explains how to use a script to open vim in the terminal. I used a work-around method to set the script as the default editor for plain text files. With a bit of fiddling I added the script to the list of preferred applications:

Firstly create a new .desktop file for our script in our ~/.local/share/applications directory:
cd ~/.local/share/applications
vim /vim-gnome.desktop
Insert the following contents. Remember to replace '/PATH/TO/vim-gnome with the path to where you have the script saved. Also if you have a custom icon replace '/PATH/TO/vim.svg' with the path to your icon.

[Desktop Entry]
Comment=Edit text files
Comment[af]=Redigeer tekslêers
Comment[am]=የጽሑፍ ፋይሎች ያስተካክሉ
Comment[ar]=حرّر ملفات نصية
Comment[az]=Mətn fayllarını redaktə edin
Comment[be]=Рэдагаваньне тэкставых файлаў
Comment[bg]=Редактиране на текстови файлове
Comment[bn]=টেক্স্ট ফাইল এডিট করুন
Comment[bs]=Izmijeni tekstualne datoteke
Comment[ca]=Edita fitxers de text
Comment[cs]=Úprava textových souborů
Comment[cy]=Golygu ffeiliau testun
Comment[da]=Redigér tekstfiler
Comment[de]=Textdateien bearbeiten
Comment[el]=Επεξεργασία αρχείων κειμένου
Comment[en_CA]=Edit text files
Comment[en_GB]=Edit text files
Comment[es]=Edita archivos de texto
Comment[et]=Redigeeri tekstifaile
Comment[eu]=Editatu testu-fitxategiak
Comment[fa]=ویرایش پرونده‌های متنی
Comment[fi]=Muokkaa tekstitiedostoja
Comment[fr]=Édite des fichiers texte
Comment[ga]=Eagar comhad Téacs
Comment[gu]=લખાણ ફાઇલોમાં ફેરફાર કરો
Comment[he]=ערוך קבצי טקסט
Comment[hi]=पाठ फ़ाइलें संपादित करें
Comment[hr]=Uređivanje tekstualne datoteke
Comment[hu]=Szövegfájlok szerkesztése
Comment[id]=Edit file teks
Comment[it]=Modifica file di testo
Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು
Comment[ko]=텍스트 파일을 편집합니다
Comment[lt]=Redaguoti tekstines bylas
Comment[lv]=Rediģēt teksta failus
Comment[mk]=Уреди текстуални фајлови
Comment[ml]=വാചക രചനകള് തിരുത്തുക
Comment[mn]=Текст файл боловсруулах
Comment[mr]=गद्य फाइल संपादित करा
Comment[ms]=Edit fail teks
Comment[nb]=Rediger tekstfiler
Comment[ne]=पाठ फाइललाई संशोधन गर्नुहोस्
Comment[nl]=Tekstbestanden bewerken
Comment[nn]=Rediger tekstfiler
Comment[no]=Rediger tekstfiler
Comment[or]=ପାଠ୍ଯ ଫାଇଲଗୁଡ଼ିକୁ ସମ୍ପାଦନ କରନ୍ତୁ
Comment[pa]=ਪਾਠ ਫਾਇਲਾਂ ਸੰਪਾਦਨ
Comment[pl]=Edytor plików tekstowych
Comment[pt]=Editar ficheiros de texto
Comment[pt_BR]=Edite arquivos de texto
Comment[ro]=Editare fişiere text
Comment[ru]=Редактор текстовых файлов
Comment[sk]=Úprava textových súborov
Comment[sl]=Urejanje datotek z besedili
Comment[sq]=Përpuno files teksti
Comment[sr@Latn]=Izmeni tekstualne datoteke
Comment[sr]=Измени текстуалне датотеке
Comment[sv]=Redigera textfiler
Comment[ta]=உரை கோப்புகளை தொகுக்கவும்
Comment[tk]=Metin faýllary editle
Comment[tr]=Metin dosyalarını düzenle
Comment[uk]=Редактор текстових файлів
Comment[vi]=Soạn thảo tập tin văn bản
Comment[wa]=Asspougnî des fitchîs tecses
Exec=/PATH/TO/vim-gnome -f %F
Name=Vim Text Editor
 Save the file.

~/.local/share/applications/vim-gnome.desktop is then referenced in ~/.local/share/applications/defaults.list, with:
cd ~/.local/share/applications
echo "text/plain=vim-gnome.desktop" >> defaults.list
That's it. You might need to restart nautilus or log out of gnome to see the change, I don't remember.

If you have made the changes correctly you should now see a new 'Vim Text Editor' entry in your Accessories menu, in your file properties dialog under the 'Open with' tab and in your context menu in Nautilus:

script to use terminal vim as default gnome editor http://goo.gl/OxAtC

Set terminal vim as the default editor instead of using one of the gui vims.

1. Create script:
vim vim-gnome
2. Script contents:
gnome-terminal -t "" -e "vim $ARGS"
3. Write buffer to file and close:
4. Make script executable:
chmod +x vim-gnome
5. Copy script to scripts directory (if you use one) eg.:
cp vim-gnome /home/lxtips/Dropbox/bin/
6. Set it as the default editor (in Ubuntu) right click the file in nautilus (ie. .bashrc) and select Properties > Open With.

7. Click Add > 'Use a custom command' and add the path to the script for example:
Repeat steps 6 and 7 for any other file types that still revert to the previous default editor.

8. Use an alternate gnome-terminal custom color scheme like the one below to match your favorite vim color scheme. If anyone knows how I might get gnome-terminal to replicate bolded text This is my attempt at Desert:

Script contents from vim.wikia.com 

22 August 2011

try a music visualizer for ubuntu with sudo apt-get install projectm-pulseaudio

projectm homepage

install in natty narwhal ubuntu 11.04 with:
sudo apt-get install projectm-pulseaudio
run with
shortcut keys:

m - brings up a menu
f - toggles fullscreen on/off
l - "locks" to a particular preset
y - toggles shuffle mode
n - next preset
p - previous preset
r - selects random preset

F1 - Help menu
F2 - Toggles song title on/off (doesn't work in libvisual or pulseaudio as far as I can tell)
F3 - Toggle preset name on/off
F4 - Toggel rendering info on/off
F5 - Shows fps

21 August 2011

disable gnome-terminal close window warning dialog in gconf

gnome-terminal warns me if I try to close it while it is running something or logged in as root. A useful measure but also a bit annoying depending on your terminal habits. To disable the warning:

  1. Alt+F2 for the run dialog. Type 'gconf-editor' and hit enter.
  2. Navigate to apps > gnome-terminal > global.
  3. Uncheck 'confirm-window-close'.
  4. Close gconf-editor.

add a subscription in google reader with a

google reader shortcut keys from google.com/support/reader

j/kitem down/upselects the next/previous item in the list
space/shift-spacepage down/upmoves the page down/up
n/pscan down/upin list view, selects the next item without opening it
shift-n/pnavigation down/upselects the next/previous subscription or folder in the navigation
shift-xnavigation expand/collapseexpands or collapses a folder selected in the navigation
oopen/close itemin list view, expands or collapses the selected item
enteropen/close itemin list view, expands or collapses the selected item
shift-onavigation open subscriptionopens the subscription or folder currently selected in the navigation
-zoom outdecreases the font size of the current item
=zoom inincreases the font size of the current item
Acting on Items
stoggle starstars or un-stars the selected item
ltoggle likelikes or un-likes the selected item
shift-stoggle shareshares or un-shares the selected item
shift-dshare with noteshares the selected item with a note
vview originalopens the original source for this article in a new window
ttag an itemopens the tagging field for the selected item
mmark as read/unreadswitches the read status of the selected item
shift-amark all as readmarks all items in the current view as read
eemail itemopens the email form to send an item to a friend
g then hgo to homegoes to the Google Reader homepage
g then ago to all itemsgoes to the "All items" view
g then sgo to starred itemsgoes to the "Starred items" view
g then shift-sgo to shared itemsgoes to the "Your shared items" view
g then ugo to subscriptionallows you to navigate to a subscription by entering the subscription name
g then tgo to tagallows you to navigate to a tag by entering the tag name
g then fgo to friendallows you to navigate to a friend's shared items by entering the friend's name
g then shift-fgo to all friends' shared itemsshows all of your friends' shared items
g then shift-tgo to trendsgoes to the "Trends" view
g then dgo to feed discoveryshows the recommendations page, or the browse page if there are no recommendations
rrefreshrefreshes the unread counts in the navigation
ftoggle full screen modedisplays reading list in full screen mode
utoggle subscription list displayhides or shows the list of subscriptions
1expanded viewdisplays the subscription as expanded items
2list viewdisplays the subscription as a list of headlines
/searchmoves your cursor to the search box
aadd a subscriptionopens the "Add a subscription" box in the sidebar
?keyboard shortcuts helpdisplays a quick guide to all of Reader's shortcuts

cd to last directory with cd - http://goo.gl/1mckk

$ cd Downloads/~/Downloads

$ cd -/home/lxtips
from superuser.com

19 August 2011

$ cat file | grep ^[^#] to view file without comments

$ cat .bashrc

#source /etc/profile

extract () {   if [ -f $1 ] ; then      case $1 in...

$ cat .bashrc | grep ^[^#]

extract () {   if [ -f $1 ] ; then      case $1 in...


change your default editor with sudo update-alternatives --config-editor http://goo.gl/x6F1b

$ sudo update-alternatives --config editor

16 August 2011

locate an installation directory with whereis

quick crop images with shotwell photo viewer

my google-chrome extns: adblock plus, context menu search, plus minus and shareaholic

After removing a large number of Google Chrome extensions I really didn't need, I was left with the following 4 essentials. Each of them save me time and effort when browsing (and submitting the occasional web post).

Adblock Plus
If I see a sponsored link to something that sparks my interest I always click it, particularly if I have landed on the page and found something useful. I do however take exception to flash and other animated effects that distract me from reading or poorly marketed advertisements that have almost nothing to do with the page content. Generally these are on pages that will get few revisits from me in any case. Mostly I keep this extension around out of habit I guess.

Context Menu Search
I have been using some form of context search in Firefox and Chrome for nearly 10 years now. I have become very accustomed to defining words, locating online videos and so on, in this manner. My only requirement is that the menu remains refined and search functions can be added easily. The last extension I used Context Search (a different extension) achieved this but I was never comfortable with the user interface. So I am trying Context Menu Search instead which integrates properly with the existing browser context menu: as I think it should.

Plus Minus
I am still assessing this extension. It adds some features to Google Plus that I require: most importantly customizing my stream. There is also a feature to adjust the layout to make better use of view able space. So far it is proving to be worthwhile.

This extension is a time-saver when authoring weblog posts as it provides access to a url shortener, posting interface and sharing tools all from one drop-down menu. The dev team appear to be working to add support for google plus which will be helpful.

15 August 2011

generate passwords with pwgen

Install pwgen in ubuntu 11.04 with:
sudo apt-get install pwgen
excerpt from man pwgen - generate pronounceable passwords
pwgen [ OPTION ] [ pw_length ] [ num_pw ]

The pwgen program generates passwords which are designed to be easily memorized by humans, while being as secure as possible. Human-memorable passwords are never going to be as secure as completely completely random passwords.

The pwgen program is designed to be used both interactively, and in shell scripts.

Used interactively, pwgen will display a screenful of passwords, allowing the user to pick a single password, and then quickly erase the screen. This prevents someone from being able to "shoulder surf" the user's chosen password.

When standard output (stdout) is not a tty, pwgen will only generate one password, as this tends to be much more convenient for shell scripts, and in order to be compatible with previous versions of this program.


-0, --no-numerals Don't include numbers in the generated passwords.
-A, --no-capitalize Don't bother to include any capital letters in the generated passwords.
-B, --ambiguous Don't use characters that could be confused by the user when printed, such as 'l' and '1', or '0' or 'O'. This reduces the number of possible passwords significantly, and as such reduces the quality of the passwords. It may be useful for users who have bad vision, but in general use of this option is not recommended.
-c, --capitalize Include at least one capital letter in the password. This is the default if the standard output is a tty device.
-N, --num-passwords=num Generate num passwords. This defaults to a screenful if passwords are printed by columns, and one password.
-n, --numerals Include at least one number in the password. This is the default if the standard output is a tty device.
-s, --secure Generate completely random, hard-to-memorize passwords. These should only be used for machine passwords, since otherwise it's almost guaranteed that users will simply write the password on a piece of paper taped to the monitor...
-v, --no-vowels Generate random passwords that do not contain vowels or numbers that might be mistaken for vowels. It provides less secure passwords to allow system administrators to not have to worry with random passwords accidentally contain offensive substrings.
-y, --symbols Include at least one special character in the password.

try a command line screenshot app with sudo apt-get install scrot

Install scrot in ubuntu with:
sudo apt-get install scrot
Some scrot usage details. (To see the complete list see man scrot):


-b, --border When selecting a window, grab wm border too
-c, --count Display a countdown when used with delay.
-d, --delay NUM Wait NUM seconds before taking a shot.
-e, --exec APP Exec APP on the saved image.
-q, --quality NUM Image quality (1-100) high value means high size, low compression. Default: 75. (Effect differs depending on file format chosen).
-s, --select Interactively select a window or rectangle with the mouse.

Special Strings 

Both the --exec and filename parameters can take format  specifiers that are expanded by scrot when encountered. There are two types of format specifier. Characters preceded by a '%' are interpretted by strftime(2). See man strftime for examples. These options may be used to refer to the current date and time. The second kind are internal to scrot and are prefixed by '$' The following specifiers are recognised:

$f image path/filename (ignored when used in the filename)
$n image name (ignored when used in the filename)
$s image size (bytes) (ignored when used in the filename)
$p image pixel size
$w image width
$h image height
$t image format
$$ prints a literal '$'
\n prints a newline (ignored when used in the filename)

scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/'
This would create a file called something like 2000-10-30_2560x1024.png and move it to your ~/shots directory.

to show menus in ubuntu screenshots set a delay in 'applications' 'accessories' 'take a screenshot'

create transparent menus with compiz

  1. Install CompizConfig Settings Manager (I usually install the Compiz extra plugins as well). In a terminal:
  2. sudo apt-get install compizconfig-settings-manager compiz-plugins-extra
  3. Open CompizConfig Settings Manager from the "System" > "Preferences" menu.

  4. Open the Accessibility" section. Find the "Opacity Brightness and Saturation adjustments" selection.
  5. Under "Window specific settings", click new.
  6. In the "Windows" field enter:
  7. type=Tooltip | Menu | PopupMenu | DropdownMenu
  8. Set "Window values" slider to the desired transparency level. I use "89".

Make sure not to set the transparency level too low to begin with. If you make any error in the "Windows" field it is possible to make all of your desktop elements invisible (I speak from experience!) If this does happen you can undo your changes after killing compiz either with the run dialog (Alt+F2) or via another login console (Ctrl+Alt+F2).

change window control button order and position in gnome

This is an old tip. Customize the position and order of the gnome window control buttons in ubuntu:
  1. Select "Applications" > "System Tools" > "Configuration Editor". (Alternatively you can hit Alt+F2 to bring up the 'Run' dialog and type in "gconf-editor")
  2. Select "Apps" > "metacity" > "general".
  3. Edit the setting "button_layout". The allowed entries that I know of are "minimize" "maximize" "close" "menu" separated by a comma ",". A colon ":" indicates the middle of title bar: anything to the left will be on the left of title bar and vice versa.
If you know of any other settings please comment.

14 August 2011

get your ip address with curl http://ifconfig.me/

upgrade to gimp 2.7.3 in ubuntu 11.04

Try the gimp 2.7.3 in Natty Narwhal with:
sudo apt-get remove gimp
sudo add-apt-repository ppa:matthaeus123/mrw-gimp-svn
sudo apt-get update
sudo apt-get install gimp
This is a development version so don't expect everything to go perfectly (although it did for me).

13 August 2011

try some window splitting in vim

split window horizontally
split window vertically
open file in new window
:vs filename
move to another window
ctrl+w up,down,left,right
next window
ctrl+w ctrl+w
close window
close all other windows

try screenkey to display keys pressed in screen casts .deb available http://goo.gl/rTWGG

another excellent choice is keymon

09 August 2011

post your tomboy note to a blog with the blogposter plugin

to post to blogger from ubuntu download the binary: http://goo.gl/mXVGx
save it to ~/.config/tomboy/addins
start tomboy
go to edit > preferences > addins > addin > tools > post note to your blog > preferences
fill in your:
blog name
blog id eg (http://www.blogger.com/feeds/xxxxxxxxxxxxxxxxxxxxxx/posts/default) where xxx.. is your blog id number
account name

create your own fortune messages with shuf ~/messages | head

07 August 2011

try a turn based strategy game: webdiplomacy http://goo.gl/oHthS

open run dialog as su in #ubuntu #linux with gksu

from man gksu:

gksu is a frontend to su and gksudo is a frontend to sudo. Their primary purpose is to run graphical commands that need root without the need to run an X terminal emulator and using su directly.

Notice that all the magic is done by the underlying library, libgksu. Also notice that the library will decide if it should use su or sudo as backend using the /apps/gksu/sudo-mode gconf key, if you call the gksu command. You can force the backend by using the gksudo command, or by using the --sudo-mode and --su-mode options.

If no command is given, the gksu program will display a small window that allows you to type in a command to be run, and to select what user the program should be run as. The other options are disregarded, right now, in this mode.

try a web filter and proxy cache solution with dansguardian and squid3

These steps worked for me in ubuntu 11.04. These tools can disable your network so make sure you have a look at some documentation first. ('Dansguardian Docs' and 'Squid Configuration Basics')

1. Install Dansguardian and Squid3:

sudo apt-get install dansguardian squid3

2. Edit /etc/dansguardian/dansguardian.conf so:

filterport = 8080
proxyip =
proxyport = 3128

    3. Edit /etc/squid3/squid3.conf to include:

    http_port 3128

      4. Edit the proxy settings to in your browser:

      5. Restart dansguardian and squid3 with:

      sudo service dansguardian restart; sudo service squid3 restart

      6. Test!

      try an online bash shell at http://cb.vu/

      try http://cb.vu/#<command> to create a shortcut

      replace spaces in filenames with underscores with rename -v 's/\ /\_/g'

      04 August 2011

      a linux file system primer: $man hier

      $man hier

      HIER(7)                                       Linux Programmer's Manual                                       HIER(7)


             hier - Description of the file system hierarchy


             A typical Linux system has, among others, the following directories:

             /      This is the root directory.  This is where the whole tree starts.

             /bin   This  directory contains executable programs which are needed in single user mode and to bring the system up or repair it...

      view 3 googlecl examples at commandlinefu http://goo.gl/hHR6o

      via www.commandlinefu.com/commands/tagged/1440/googlecl

      Create commands to download all of your Google docs

      google docs list |awk 'BEGIN { FS = "," }; {print "\""$1"\""}'|sed s/^/google\ docs\ get\ /|awk ' {print $0,"."}'

      Create commands to download all of your Picasaweb albums

      google picasa list-albums |awk 'BEGIN { FS = "," }; {print "\""$1"\""}'|sed s/^/google\ picasa\ get\ /|awk ' {print $0,"."}'

      Convert GoogleCL gmail contacts to cone adress book

      google contacts list name,name,email|perl -pne 's%^((?!N\/A)(.+?)),((?!N\/A)(.+?)),([a-z0-9\._-]+\@([a-z0-9][a-z0-9-]*[a-z0-9]\.)+([a-z]+\.)?([a-z]+))%${1}:${3} <${5}>%imx' #see below for full command

      check out the new googlecl apis. great stuff Michael

      from googlegroups.com

      Hey all!

      Just added support for the new Discovery APIs to GoogleCL.

      What does this mean? Lots of new APIs are available! Including Tasks,
      Buzz, UrlShortener, Translate, and a dozen or so others.

      So please, go test! Instructions and examples will be up soonish.


      GoogleCL Homepage

      03 August 2011

      convert text to html in vim with :TOhtml

      vim test

      this is a tip


      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Vim/7.3">
      <meta name="plugin-version" content="vim7.3v6">
      <meta name="syntax" content="html">
      <meta name="settings" content="use
      <style type="text/css">
      pre { font-family: monospace; color: #eeeeee; background-color: #262626; }
      body { font-family: monospace; color: #eeeeee; background-color: #262626; }
      this is a test

      vim creates a new buffer named test.html. esc :w to write the buffer to file

      get aria2 to download from the command line with aria2c http://example.org/mylinux.iso

      supports bit torrent and multiple connections. aria2 homepage.

      indent from normal mode in #vim with >>

      remove indent with ==

      search for string at the start of a line in #vim with /^string

      /string - Search forward for string
      ?string- Search back for string
      n - Search for next instance of string
      N -Search for previous instance of string

      01 August 2011

      view cpu information with cat /proc/cpuinfo

      $ cat /proc/cpuinfo

      processor : 0
      vendor_id : GenuineIntel
      cpu family : 6
      model : 13
      model name : Intel(R) Pentium(R) M processor 1.73GHz
      stepping : 8
      cpu MHz : 800.000
      cache size : 2048 KB
      fdiv_bug : no
      hlt_bug : no
      fpu : yes
      cpuid level : GenuineIntel
      flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss tm pbe up bts est tm2
      bogomips : 1596.31
      clflush size : 64

      31 July 2011

      try panel window controls in gnome with #gnome-window-applets

      from gnome-look.org

      delete foo and all subsequent text on every line in #vim with :%s/foo*//

      print line n of a file with sed -n 'n{p;q}' file

      $ cat jack_and_jill
      jack and jill
      went up the hill
      to fetch
      a pail of water
      jack fell down
      and broke his crown
      and jill came tumbling after
      $ sed -n '4{p;q}' jack_and_jill
      a pail of water

      get ubuntu distro details with lsb_release -a

      from help.ubuntu.com/community/UsingTheTerminal

      $ lsb_release -a
      No LSB modules are available.
      Distributor ID: Ubuntu
      Description: Ubuntu 11.04
      Release: 11.04
      Codename: natty

      meta post with googlecl

      a test post using googlecl. get it today from http://code.google.com/p/googlecl/

      play a #roguelike in #ubuntu with sudo apt-get install powder

      Powder website and wiki. Install in ubuntu with:

      sudo apt-get install powder

      remove tabs in a file with tr -d '\011' < old.txt > new.txt #linux #unix

      tr command delete tabs in file: "If you just want to delete the tabs, try:

      tr -d '\011' newfile

      but if you would rather convert the tabs to spaces, then try:

      expand filename >newfile"

      change main menu icon in ubuntu in gconf-editor apps panel objects

      delete all text on the linux command line with ctrl+shift+-

      Some commandline shortcut combinations:

      • ctrl+k deletes all characters after the cursor
      • ctrl+u deletes everything before the cursor
      • ctrl+a: moves to the start of the line
      • ctrl+e: moves to the end of the line
      • ctrl+shift+-: deletes the entire line regardless of where the cursor is


      30 July 2011

      sudo apt-get install unrar to install rar support in ubuntu linux http://goo.gl/pN3li

      unrar - extract files from rar archives


      unrar <command> [-<switch 1> -<switch N>] archive [files...] [path...]


      from linux.die.net

      29 July 2011

      check out a starcraft2 linux interface from @taranasus

      edit the default screensaver dir in natty with vim .../personal-slideshow.desktop

      Change the default folder for your Screensaver Slidershow images:

      1. Open a Terminal.
      2. Open the personal-slideshow.desktop file to line 4 with write permissions:

        sudo vim /usr/share/applications/screensavers/personal-slideshow.desktop +4

      3. Append line 4 with your path so:


        changes to:

        Exec=/usr/lib/gnome-screensaver/gnome-screensaver/slideshow --location=[YOUR PATH WHATEVER]

      4. Esc :qw to close vim!

      The method is not the same for some older releases. I had to use the full reference: "home/lxtips/Pictures..."

      Suggestion: create a single user solution with a symbolic link.

      28 July 2011

      single window screen capture script using ffmpeg

      INFO=$(xwininfo -frame)

      WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+')
      WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/\+/,/' )

      ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 15 -s $WIN_GEO -i :0.0+$WIN_XY -acodec libfaac -vcodec huffyuv -threads 0 -sameq -y $1.avi
      libfaac can be installed in ubuntu 11.04 with:

      sudo wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list --output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q update && sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring && sudo apt-get -q update ; sudo apt-get install ffmpeg libavcodec-extra-52

      search the string under the cursor in vim with *

      via unix.com

      26 July 2011

      add empty lines in vim with o and O http://is.gd/prVQlq

      Quickly adding and deleting empty lines - Vim Tips Wiki

      watch @computerhistory interviews and other videos at youtube http://goo.gl/5HpQ7

      some videos I have watched:

      The Code Breakers, 2006. BBC documentary on Open Source Software. Part 1 (24:42) Part 2 (13:15)

      Revolution OS, 2001. Video (1:25:10)

      The Origins of Linux - Linus Torvalds, 2001. Live presentation. Video (1:25:13)

      Secret History of Silicon Valley - Steve Blank, 2008. Live presentation. Video (1:02:45)

      Stephen Levy -- Author of In the Plex, 2011. Computer history interview. Video (1:24:21)

      Jane Mcgonigal, 2011. Computer history interview. Video (1:19:23)

      Bill Joy, 2008. TED presentation. Video (20:44) 2006. NerdTV, Robert Cringley Interview. Video (57:08).

      Sun Microsystems Founders Panel 2010. Computer History Panel. Video (2:10:37)

      Javascript Tutorial, 2008. by thenewboston Parts: 1, 2, 3, 4, 5, 6, 7, 8...

      XHTML Tutorial, 2008. by thenewboston Parts: 1, 2, 3, 4, 5...


      replace space in file names with rename 's/ /_/g' *

      from metalx1000

      change character case in vim in normal mode with tilde ~

      25 July 2011

      rest your mouse in chrome and firefox with vimium http://youtu.be/OUl2mJnjwbY

      identify a process ID with pgrep -f *string*

      from the Linux / Unix Man Pages


      pgrep, pkill - look up or signal processes based on name and other


      pgrep looks through the currently running processes and lists the pro-
      cess IDs which matches the selection criteria to stdout. All the cri-
      teria have to match. 




         -f     The pattern is normally only matched against the process name.
      When -f is set, the full command line is used.

      SEE ALSO
      ps(1) regex(7) signal(7) killall(1) skill(1) kill(1) kill(2)


      24 July 2011

      check your linux kernel version with uname -r

      from the man pages uname(1) - Linux man page

      uname - print system information


      uname [OPTION]...

      Print certain system information. With no OPTION, same as -s.

      -a, --all
      print all information, in the following order, except omit -p and -i if unknown:
      -s, --kernel-name
      print the kernel name
      -n, --nodename
      print the network node hostname
      -r, --kernel-release
      print the kernel release
      -v, --kernel-version
      print the kernel version
      -m, --machine
      print the machine hardware name
      -p, --processor
      print the processor type or "unknown"
      -i, --hardware-platform
      print the hardware platform or "unknown"
      -o, --operating-system
      print the operating system
      display this help and exit
      output version information and exit

      Written by David MacKenzie.

      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
      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.
      gtk >= 2.10.0
      glib >= 2.14.0
      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.
      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