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

problem:

ls 
qv01
qv02
qv03

solution:

for i in *; do mv $i $i.jpg; done
ls
qv01.jpg
qv02.jpg
qv03.jpg

Pages