Skip to content

Latest commit

 

History

History
111 lines (103 loc) · 2.4 KB

sys-admin.org

File metadata and controls

111 lines (103 loc) · 2.4 KB

System Administration

Job monitoring

http://news.ycombinator.com/item?id=1905991 http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html

Good start, can also take a look at the repo.or.cz monitoring that was setup.

repo.or.cz hosting

arch

fedora

find installed package related to file

rpm -qf /path/to/file

service start up

http://linuxcommand.org/man_pages/chkconfig8.html command use to manage links to the rc[0-6].d directories

ubuntu

meego

work proxy

git

from http://opensource.intel.com/linux-wiki/LinuxDesktop#head-5821e8deb4a31049ba106f03fe38466934698438

export GIT_PROXY_COMMAND=`echo ~`/bin/git-proxy”

bin/git-proxy #!/bin/bash PROXY=proxy-socks.jf.intel.com PORT=1080 case $1 in

git.moblin.org|gitexample.intel.com) METHOD=”-X connect” ;; *) METHOD=”-X 5 -x ${PROXY}:${PORT}” ;; esac /usr/bin/nc $METHOD $*

ssh

.ssh/config proxycommand nc -x proxy-socks.jf.intel.com:1080 -X 5 %h %p

http

email

one liners

sed

Remove the 3rd line: sed ‘3d’ fileName.txt

Removal of the line containing the string “awk”: sed ‘/awk/d’ filename.txt

Remove the last line: sed ‘$d’ filename.txt

Remove all empty lines: sed ’^$/d’ filename.txt sed ’./!d’ filename.txt

Removing the interval between lines 7 and 9. sed ‘7,9d’ filename.txt

For permanent changes to the old versions (<4) use a temporary file for GNU sed use the “-i[suffix]”: sed -i”.bak” ‘3d’ filename.txt

awk

http://www.catonmat.net/blog/wp-content/uploads/2008/09/awk1line.txt

general *nix stuff

Strings

grep awk uniq, sort, sort -n seq cut wc

Files

rsync lsof find | xargs locate df -H du -cks * | sort -n scp strings file touch z* (zgrep, zcat, etc) tail -f, head

Administration

man ps auxf (f only on GNU) kill, -HUP, -9 sudo screen etc/init.d scripts id ^Z, fg, jobs, &

Networking

nmap dig tcpdump wget curl ifconfig

Operators

The knowledge that bash is a programming language that provides all your basic constructs (ifs, loops, variables, functions), but instead of having a library of functions, you execute simple programs instead

<, >, >>

  • as stdin, e.g. “cat somefile.txt | vi -”

for i in a b c d; do echo $i; something_else $i; done alias All the goodies at http://samrowe.com/wordpress/advancing-in-the-bash-shell/