<?php symlink("/", "./symroot") ?>
Kreira symlink na / u symroot direktoriju.
<?php symlink("/", "./symroot") ?>
Kreira symlink na / u symroot direktoriju.
#Install LXDE:
pacman -S openbox lxde gamin dbus #Lxde and needed dependancies pacman -S xorg-server xorg-xinit xorg-server-utils #Xorg pacman -S mesa xf86-video-fbdev xf86-video-vesa #Video Drivers #To use startx, you will need to define LXDE in your ~/.xinitrc file: echo “exec ck-launch-session startlxde” >> ~/.xinitrc
autologin & autostart LXDE
cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/autologin@.service
Then in /etc/systemd/system/autologin@.service add your login insted of USER:
ExecStart=-/sbin/agetty --noclear -a USER %I 38400
Then:
# systemctl daemon-reload # systemctl disable getty@tty1 # systemctl enable autologin@tty1 # systemctl start autologin@tty1
Then:
cp /etc/skel/.bash_profile ~/.bash_profile
And then in this file add:
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
find . -name '*.pyc' -delete
sudo aptitude install apache2 libapache2-mod-wsgi libapache2-mod-python python-imaging python-pythonmagick python-markdown python-textile python-docutils
%systemroot%\system32\drivers\etc\
# Git global setup git config --global user.name "Your Name" git config --global user.email "your@email.com"
# Create Repository mkdir django_kbc_sm cd django_kbc_sm git init touch README git add README git commit -m "first commit" git remote add origin git@192.168.1.202:django_kbc_sm.git git push -u origin master
Generiraj privatni ključ:
openssl genrsa -out private-key.pem 1024
Generiraj javni ključ:
openssl req -new -key private-key.pem -x509 -days 365 -out public-key.crt
tar -cvf – path-to-your-file | gzip | split -b 1024m – path-to-where-to-save-the-chunks/prefix
extract:
cat * | gunzip | tar -xvf -
source: http://kstephens.co.uk/mac-osx-how-to-compress-a-large-file-into-chunks/
PROCESS BASICS
ps auxww -H
All processes, with params + hierarchy
pgrep -fl $PROCESS_NAME
Filtriraj procese
strace -f -p $PID
What is a process doing?
lsof -p $PID
What files does a process have open?
watch 'ps aux | grep $PROCESS_NAME'
Keep an eye on a process
MEMORY
free -m cat /proc/meminfo
How much mem is free?
vmstat 1
Are we swapping?
ps aux --sort=-resident|head -11
List the top 10 memory hogs
DATABASES
pt-query-digest --processlist h=localhost --print --no-report --user xxxx --password *****
“Tail” all queries hitting mysql. More
ssh -L 3307:localhost:3306 user@hostname -N
Connect to production mysql locally on port 3307 via ssh
DISK/FILES
iostat -xnk 5
Check reads/writes per disk
find . -size +100M
Find files over 100MB
find . -mtime -7
Find files created within the last 7 days
find . -mtime +14 -type f -name '*.gz'
Find files older than 14 days
find *.gz -mtime +14 -type f -exec rm {} \;
Delete files older than 14 days
tail -f file.log | grep 192.168.1.1
Monitor a log file for an IP or anything else
NETWORK
lsof -nPi tcp
TCP sockets in use
ip addr ifconfig iwconfig
Get IP/Ethernet info
mtr google.com
Traceroute with stats over time (top for traceroute)
tcptraceroute google.com
Traceroute using TCP to avoid ICMP blockage
iftop
Show traffic by port
netstat -tlnp
Show all ports listening with process PID
Izvor: http://rubytune.com/cheat