Additions:
Additions:
LVM overhead:
GA_L: z00dax6: because of the LVM overhead
(08:40:37 PM) z00dax6: GA_L: how much is it ?
(08:41:05 PM) GA_L: z00dax6: never quantified it just gut feeling and what I read on the web
(08:41:17 PM) z00dax6: its about 2.6% per layer
...
(08:45:25 PM) GA_L: z00dax6: how do you know about the 2.6%?
(08:46:02 PM) z00dax6: measured it, many times in various situations.
(08:46:09 PM) z00dax6: it varries between 1.8% to 5%
(08:46:29 PM) z00dax6: 2.6% is my ballpark though :)
Additions:
- strace: used when launching a process
- mpstat: used for multiprocessing
Deletions:
Additions:
Additions:
Additions:
In ~/.screenrc
multiuser on
acladd jose,serkan
Deletions:
echo multiuser on > ~/.screenrc
Additions:
echo multiuser on > ~/.screenrc
Deletions:
Audio Encoding
mplayer file.mov -ao pcm:file=file.wav
lame file.wav file.mp3
Additions:
Audio Encoding
mplayer file.mov -ao pcm:file=file.wav
lame file.wav file.mp3
Additions:
In order to see what is happening multicast-wise.
tcpdump -n ether multicast
Additions:
To get any TCP traffic on port 3306
tcpdump -pni any tcp port 3306
To get any traffic from 10.10.5.6 on eth0
tcpdump -pni eth0 src 10.10.5.6
Deletions:
tcpdump -pni any tcp port 3306%%
Additions:
time
symlink /etc/localtime pointing to your time zone change it to link to GMT in /usr/share/zoneinfo%%
Additions:
set incsearch
Additions:
tcpdump
tcpdump -pni any tcp port 3306%%
Additions:
email redirection
Update the file /etc/aliases and add the email address you want the email sent to as follow:
root: gael@coincoin.com
Then run the command:
Additions:
To search a pattern across an entire file, go onto the work and press the start "*" key.
Additions:
Edit: ~/.bashrc
And add:
alias screen='TERM=screen screen'
(bash)
%%(bash)
Deletions:
Try editing: ~/.bashrc
And adding: alias screen='TERM=screen screen'
Additions:
useful command for stopping indentation when pasting: set paste
My .vimrc file:
%%(vim)
syntax on
set nu
set hlsearch
set autoindent
Deletions:
set autoindent
Deletions:
SSH Tips
Password-less SSH login:
Creation of private/public keys using SSH2 and uploading it to the appropriate server so I will not be prompted for my password any time I want to get there.
ssh-keygen -t dsa
ssh-copy-id -i /home/gael/.ssh/id_dsa.pub gael@the-doors.enix.org : this will put the public key in ~/.ssh/authorized_keys
ssh $remoteHost "{ cd $remoteBackupFolder; md5sum $i; }"
Tutorial for SSH password less authentication:
http://www.hackinglinuxexposed.com/articles/20021211.html∞
$SSH_ORIGINAL_COMMAND is the environment variable which is sent by SSH when using any SSH client
ITTips
General tips
getent: then use passwd or ldap for checking the users in those files
During the startup of a
CentOS, you can hit the i key to enter the interactive mode and choose which module to load.
pstree: to show the dependences of a process
sed -e "regexp" i.e.: sed -e s/blah/boup/g = sed -e s,blah,bloup,g This is useful when you are scripting and using variables containing path as you cannot do \/ in the variable ...
awk '{print $1}'
Using
less then press Shift+F will do the equivalent as
tail -f with the advantages of
less
When a process is in an interruptable sleep, you do not have any other choice than restarting the box to get rid of it.
Number of maximum open files:
cat /proc/sys/fs/file-max
/etc/sysctl.conf : to tweak the kernel at startup
sysctl -A: displays the runtime kernel parameters.
Fosco Tips:
grep -rH 'You are now configured to use the Fleet St HQ' /etc/
rsync and ssh on another port than port 22:
rsync -av --progress --inplace --rsh='ssh -p8023' somefile user@host:somedir/
Switch User
su - user -c '
command': this allows you to run a command while changing user.
SCREEN
CTRL+AC: creates a new screen in a screen session
CTRL+A
space key: Move to the screen on the right
CTRL+A
return key: Move to the screen on the left
CTRL+AA: move between the 2 last accessed screen
CTRL+A shift+A: Change the name of a screen window
When running screen sometimes there is a problem using the backspace or delete key and you get the dreaded “Wuff Wuff” message.
Try editing: ~/.bashrc
And adding: alias screen='TERM=screen screen'
Status line:
hardstatus alwayslastline
hardstatus string "%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %Y-%m-%d %{W}%c %{g}]"
hardstatus alwayslastline
hardstatus string "%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %Y-%m-%d %{W}%c %{g}]"
In case of a message like:
Must run suid root for multiuser support.
Do
First of all, in screen you have to hit C^a and then the colon (":") key to enter commands (much like vi). when you do that, you'll see a highlighted colon prompt at the bottom of the screen. Then turn on multiuser and grant permissions like Sanjay said.
Second, you may have to do some other things. I installed screen with the Debian package, and multiuser mode didn't work out of the box. You could add people to the acl list, but when you did:
screen -ls otheruser/
you'd get the error:
Must run suid root for multiuser support.
To make screen run as suid root, as the root user do:
chmod +s /usr/bin/screen
(or whatever the path to your screen executable is)
There is also a command called aclgrp, whereby you can assigna group of users similar access to screen. Note that this doesn't mean you can automatically give everyone in a particular Unix group access to a screen session, though. I might work on a little script to do that. If I figure it out, I'll post it here.
You have to
chmod 755 /var/run/screen/
More information on this web page:
http://www.softpanorama.org/Utilities/screen.shtml∞
chkconfig --list: will display which service are started in the different run levels
chkconfig servicename on/off: starts the servicename in appropriate runlevel
SSH Tips
Password-less SSH login:
Creation of private/public keys using SSH2 and uploading it to the appropriate server so I will not be prompted for my password any time I want to get there.
ssh-keygen -t dsa
ssh-copy-id -i /home/gael/.ssh/id_dsa.pub gael@the-doors.enix.org : this will put the public key in ~/.ssh/authorized_keys
ssh $remoteHost "{ cd $remoteBackupFolder; md5sum $i; }"
Tutorial for SSH password less authentication:
http://www.hackinglinuxexposed.com/articles/20021211.html∞
$SSH_ORIGINAL_COMMAND is the environment variable which is sent by SSH when using any SSH client
Check library dependency
ldd executable_file
Reload .bash_profile
source .bash_profile
Change display color setting for a shell
dircolors
Startup message
/etc/motd
/etc/profile
VIM
This is a really nice bit of information:
http://www.vim.org/tips/tip.php?tip_id=305∞
Doing some tricks on a all set of lines:
- v to enter visual mode
- Select your text
- press colon : The following will appear: :'<,'> this is your selected text
- then enter your replace string: :'<,'> s/this/This/g
- Press enter and you will be an happy bunny!
Syntax highlighting:
:syntax enable
The
g command explanation:
http://www.vim.org/tips/tip.php?tip_id=227∞
set autoindent
To get some help for ctrl+w for instance:
:h CTRL-W
LVM
Extend a partition:
1. lvextend -L+5G /dev/vg_data/Movies
2. resize2fs /dev/vg_data/Movies
Channel bonding
# cat /etc/modprobe.d/bonding.local
alias bond0 bonding
options bonding miimon=100 mode=balance-rr
http://smhteam.info/wiki/index.linux.php5?wiki=ChannelBonding∞
SSL
Generate a new private key: openssl genrsa -des3 -out domain.name.key 1024
Generate a CSR: openssl req -new -key domain.name.key -out domain.name.csr
digicert is good
tar
tar -cvvf destination.tar source