Hoofdpagina: verschil tussen versies
| Regel 1: | Regel 1: | ||
| − | ''' | + | '''Rolandow's wiki''' |
| − | + | Vergaarbak van allerlei informatie die ik in de loop der tijd heb verzameld, en niet mag vergeten. | |
| + | |||
| + | = Linux = | ||
| + | |||
| + | == Passive FTP == | ||
| + | |||
| + | Als passive FTP niet werkt, dan moeten er modules geactiveerd worden. In ''/etc/modules'' toevoegen ''ip_conntrack_ftp'' en ''ip_nat_ftp''. | ||
| + | |||
| + | |||
| + | == Linux trics == | ||
| + | |||
| + | Create snoop file of a port: | ||
| + | <source lang="bash">tcpdump -nvv -s 0 -w snoopport10295.snoop port 10295</source> | ||
| + | |||
| + | Check the number of hits per IP, in the Apache access logs: | ||
| + | <source lang="bash">cat logs/access_log|grep 05/Feb/2007:14|awk '{print $1}'|sort|uniq -c</source> | ||
| + | |||
| + | See what a process is doing: | ||
| + | <source lang="bash">lsof -p #PID</source> | ||
| + | |||
| + | Last file in a directory: | ||
| + | <source lang="bash">ls -ltr|tail -n1</source> | ||
| + | |||
| + | Partially extract a tarbal: | ||
| + | <source lang="bash">tar xvfz backup.tar.gz home/www/login.mobilebridges.com --exclude=*.log --exclude=*.xml</source> | ||
| + | Use the t parameter instead of x to test tar. | ||
| + | <source lang="bash">tar tvfz backup.tar.gz home/www/login.mobilebridges.com --exclude=*.log --exclude=*.xml</source> | ||
| + | |||
| + | Format your server: | ||
| + | <source lang="bash">dd if=/dev/zero of=/dev/hda bs=1M</source> | ||
| + | |||
| + | This writes zero's to /dev/hda, so it will erase all data. | ||
| + | |||
| + | Format disk, using fat32: | ||
| + | <pre> | ||
| + | 1. Use fdisk to create the filesystem: fdisk /dev/hda - follow the prompts | ||
| + | 2. Format it using mkfs.vfat -F 32 /dev/hda6 | ||
| + | 3. Add it to fstab | ||
| + | </pre> | ||
| + | |||
| + | Add user: | ||
| + | <source lang="bash">adduser --gid 1010 --shell /usr/bin/false --home /home/www/peru charly</source> | ||
| + | |||
| + | The GID should be the same for dutch and peru users. The home directory is different though. | ||
| + | |||
| + | Delete files older than 5 days: | ||
| + | <source lang="bash">find /home/www/login.mobilebridges.com/htdocs/Delivery/Error/ -mtime +5 -exec rm {} \;</source> | ||
| + | |||
| + | Rename *.11.csv to *.csv: | ||
| + | <source lang="bash">rename 's/\.11\.csv$/\.csv/' *.csv</source> | ||
| + | The ereg takes care of the rename action... the *.csv after that just selects the files that need to be renamed with this ereg. | ||
| + | |||
| + | '''Check projectsize Peru on developement:''' | ||
| + | <source lang="bash">/home/www/peru# du --max-depth=1 -h</source> | ||
| + | |||
| + | Check if PING's are reaching the server: | ||
| + | |||
| + | <source lang="bash">tcpdump host 85.146.37.248 and icmp</source> | ||
| + | |||
| + | 85.146.37.248 is the source address. | ||
| + | |||
| + | |||
| + | See the number of connections to port 80 by ip: | ||
| + | <source lang="bash">netstat -pan|grep :80|sed 's/:/ /g'|awk '{print $6}'|sort|uniq -c</source> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
== Meer hulp over MediaWiki == | == Meer hulp over MediaWiki == | ||
Versie van 13 jul 2010 om 13:56
Rolandow's wiki
Vergaarbak van allerlei informatie die ik in de loop der tijd heb verzameld, en niet mag vergeten.
Linux
Passive FTP
Als passive FTP niet werkt, dan moeten er modules geactiveerd worden. In /etc/modules toevoegen ip_conntrack_ftp en ip_nat_ftp.
Linux trics
Create snoop file of a port:
tcpdump -nvv -s 0 -w snoopport10295.snoop port 10295Check the number of hits per IP, in the Apache access logs:
cat logs/access_log|grep 05/Feb/2007:14|awk '{print $1}'|sort|uniq -cSee what a process is doing:
lsof -p #PIDLast file in a directory:
ls -ltr|tail -n1Partially extract a tarbal:
tar xvfz backup.tar.gz home/www/login.mobilebridges.com --exclude=*.log --exclude=*.xmlUse the t parameter instead of x to test tar.
tar tvfz backup.tar.gz home/www/login.mobilebridges.com --exclude=*.log --exclude=*.xmlFormat your server:
dd if=/dev/zero of=/dev/hda bs=1MThis writes zero's to /dev/hda, so it will erase all data.
Format disk, using fat32:
1. Use fdisk to create the filesystem: fdisk /dev/hda - follow the prompts 2. Format it using mkfs.vfat -F 32 /dev/hda6 3. Add it to fstab
Add user:
adduser --gid 1010 --shell /usr/bin/false --home /home/www/peru charlyThe GID should be the same for dutch and peru users. The home directory is different though.
Delete files older than 5 days:
find /home/www/login.mobilebridges.com/htdocs/Delivery/Error/ -mtime +5 -exec rm {} \;Rename *.11.csv to *.csv:
rename 's/\.11\.csv$/\.csv/' *.csvThe ereg takes care of the rename action... the *.csv after that just selects the files that need to be renamed with this ereg.
Check projectsize Peru on developement:
/home/www/peru# du --max-depth=1 -hCheck if PING's are reaching the server:
tcpdump host 85.146.37.248 and icmp85.146.37.248 is the source address.
See the number of connections to port 80 by ip:
netstat -pan|grep :80|sed 's/:/ /g'|awk '{print $6}'|sort|uniq -c