wiki'd

by JoKeru

Use SSHFS to mount remote file systems over SSH

If you need a quick solution to "attach" a remote directory to your local server, SSHFS (Secure SHell FileSystem) is the answer. On the local computer, the remote share is mounted using FUSE (Filesystem in Userspace) kernel module.

[cc lang='bash']
# install
\$ apt-get install sshfs -y
# check
\$ lsmod | grep fuse …

HeartBleed aka CVE-2014-0160

This is not a post about what is HeartBleed and how "evil" it is, I'm assuming you already heard about it ...

Anyway, you should find all the details at http://heartbleed.com/

Here is a collection of nice tools to play with:

  • website to test online a server against heartbleed …

Put your logs on Google Cloud Storage

You're running a service and you need to keep all the logs for a certain period of time (legal constraints or just internal retention policy). The logs are pretty big to be stored locally, so you need a big disk somewhere in the cloud - Google Cloud Storage comes to the …

TCP: time wait bucket table overflow

This is not really an error, it's just an info message saying that the system cannot put the socket connection into time-wait state (buffer is full) and the socket will be closed. The reason for setting this limit is to resist simple DoS attacks.

[cc lang='bash']
\$ dmesg | tail
[660665 …

Minimum PostFix configuration for sending emails only

A null client is a machine that can only send mail. It receives no mail from the network, and it does not deliver any mail locally.

This setup is useful when you need to receive the output of your cron scripts.

[cc lang='bash']
\$ apt-get install postfix heirloom-mailx
\$ cat \< /etc …

Routing traffic from one CentOS to another CentOS

Setup
[cc lang='bash']
Client: ping from 50.50.50.50 to 30.30.30.30, gateway is 10.10.10.10

Server1: eth0 - 10.10.10.10 - public
ipip1 - 192.168.1.1 - ipip tunnel to Server2

Server2: eth0 - 20.20.20.20 - public
ipip1 - 192.168.1.2 …

Using strace to monitor System Calls

[cc lang='bash']
# execute a process via "strace"
\$ strace sleep 1
execve("/bin/sleep", ["sleep", "1"], [/* 17 vars */]) = 0
brk(0) = 0x753000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f74b3eea000
access("/etc/ld.so.preload …

Managing Disk IOs

[cc lang='bash']
\$ iotop --only --accumulated
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
2264 be/4 root 0.00 B 0.00 B 0.00 % 0.34 % [flush-254:0]
162 be/3 root …

Packets larger than the MTU in tcpdump ?

The network adapter will not send frames larger than the configured MTU !

TCPdump hooks above the driver, and does not see what is sent on the wire. Rather it sees what is sent from the stack to the driver. The stack will send TCP LSO frames up to about 64K …