Linux Scroll

Just another WordPress.com site

Monthly Archives: March 2011

Ubuntu am64 install Zend Optimizer

The Zend Optimizer enables you to run Zend Guard encoded files.

Download a copy of Zend Optimizer:
Zend Optimizer

Extract:

$ tar -zxvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz

Create a directory to contain Zend optimizer:

$ mkdir /usr/local/lib64/zend

Move the Zend optimizer lib to:

$ sudo mv ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so 
/usr/local/lib64/zend/

Add to your php.ini:

$ sudo nano /etc/php5/apache2/php.ini

Add:

zend_extension = /usr/local/lib64/zend/ZendOptimizer.so
zend_optimizer.optimization_level = 15

Restart apache

$ sudo /etc/init.d/apache2 restart
Advertisements

Ubuntu crack password rar | 7z | zip

You need to download Rarcrack.

For Ubuntu, intsall required lib:

$ sudo apt-get -y install libxml2-dev

Install Rarcrack:

$ tar -xvjf rarcrack-0.2.tar.bz2

$ cd rarcrack-0.2
$ sudo make
$ sudo make install

Crack password compress file:

$ rarcrack file.rar --type rar

Your password is locate at:

file.rar.xml

wget – download entire website

Wget able to download an entire website:

wget –random-wait -r -p -e robots=off -U mozilla http://www.targetwebsite.com/

* -random-wait: to let wget chose a random number of seconds to wait
* -r: recursive
* -p: all files
* -e robots=off: You don’t want wget to obey by the robots.txt
* -U mozilla: browsers

Ubuntu merge multiple pdfs to one pdf

Install gs Ghostscript:

$ sudo apt-get -y install gs pdftk

To merge pdfs:

$ gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=output.pdf -dBATCH 1.pdf 2.pdf 3.pdf

YUM – Yellow Dog Updater

YUM use in Redhat, Fedora, Centos. YUM is powerful software utility used to automatically update and install/remove rpm packages.

Keep the Yum cache for future use:

$ vi /etc/yum.conf

keepcache=1

Yum cache directory:

/var/cache/yum 

Yum install fastest mirror:

$ yum install yum-fastestmirror

Only install security update:

$ yum install yum-security

$ yum --security update

Skip broken dependency:

$ yum install yum-skipbroken

$ yum --skip-broken update

Lists the packages that are not installed but available:

$ yum list php

Lists updates that are available for the installed packages:

$ yum list updates php

Lists all the installed packages:

$ yum list installed php

Install php:

$ yum install php

Remove php:

$ yum remove php

Update php:

$ yum update php

Info php:

$ yum info php

yum whatprovides [file name]:

$ yum whatprovides /usr/bin/php

Group install:

$ yum groupinstall "Development Tools"

$ yum groupinstall "Development Libraries"

Group list:

$ yum grouplist "Development Tools"

Group remove:

$ yum groupremove "Development Tools"

Linus File System Hierarchy Standard (FHS)

FHS:

/boot = Boot Directory

/ = Root Directory
/home = User Directory
/etc = Confguration Files
/root = Administrator Directory
/bin = Essential Binaries
/sbin = System Binaries
/var = Variable Files
/dev = Device Files
/proc = Process Files
/sys = System Information Directory
/lib = Libraries
/media = Mount point for removable media
/opt = Application Directory
/usr = Unix System Resources
/tmp = Temporary Area

vi Editor

vi

Insert:

i = insert mode

a = append after cursor
I = insert at beginning of current line
A = append at end of current line

Changing characters, words, and lines

r = replaces the current character

R = overtype mode, press ESC after you done
cw = replace the current word, press ESC after you done

Delete:

x = delete a character

X = delete a character before the cursor
dd = delete a line
dw = delete a word
D or d$ = delete the rest to the end of line
4x = delete 4 characters
4X = delete the 4 characters before the cursor
3dw = delete 3 words
5dd = delete 5 lines

Copy paste (y=yank):

yy = copy a line

yw = copy a word
p = paste
P = paste before the cursor
7yw = copy 7 words
3yy = copy 3 lines

Search:

/pattern = search pattern

?pattern = search pattern (backward)
n = repeat search
N = repeat search (backward)

Undo:

u = undo last change

U = undo last change to the current line
uu = undo the undo

Save:

Esc

:wq or 😡 or ZZ = save and quit vi
:w = save
:w filename = save to new filename

Quit:

Esc

:q = quit vi
:q! = quit vi without save changes
:e! = reads the original file so that you can start over

Insert blank line:

o = insert a blank line

O = insert a blank line above the line cursor located

Arrow key:

k = up

j = down
h = left
l = right

Joining lines:

J = move a line up to merge 

4J = move a 4 lines up to morge

Moving around words:

w = moves to next word 

b = oves to the beginning of the current word
e = moves to the end of a word
W, B, E = ignore punctuation

Moving around lines:

$ = move to the end of a line

0 = move to the beginning of a line

Moving around screen/page:

H = move to top of the screen

M = move to middle of the screen
L = move to last line of the screen

1G = move to top of the line
G = move to end of the file

Ctrl-b = PgUp
Ctrl-f = PgDn
Ctrl-u = PgUp half
Ctrl-d = PgDn half

Repeat a command:

. (dot) = repeat previous command

Misc:

:sh = escape temporarily to a shell

^d = return from shell to vi

:!command = execute UNIX command without leaving vi
:r!command = read output of command into vi
:^g = list current line number
:set number = show line numbers

Linux Software Shared Library

Library Naming Syntax

libname.so.version

Static Software Library

.a

Dynamic Software Library

.so

ldd – print shared library dependencies

$ ldd /usr/bin/ssh

List all pci devices under ubuntu

lspci – list all pci devices

List all PCI in simple info:

$ sudo lspci -v | less

List all PCI in more detail info:

$ sudo lspci -vv

ifconfig command

ifconfig – configure a network interface

Display info on all network interfaces:

$ ifconfig -a

* eth0 – Network card
* wlan0 – Wireless network card

Display current config for eth0:

$ ifconfig eth0

Activate eth0:

$ ifconfig eth0 up

Deactivate eth0:

$ ifconfig eth0 down

Assign IP address:

$ ifconfig eth0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255

Assign default gateway:

$ route add default gw 192.168.1.254

Assign multiple IP’s:

$ ifconfig eth0:0 192.168.1.2

$ ifconfig eth0:1 192.168.1.3

View current routing table:

$ route -n

# netstat -rn