Monthly Archives: November 2013

centos – reload new kernel without reboot

uname -r
2.6.32-71.29.1.el6.i686

yum update kernel*

then:
yum install kexec-tools

Now we get last installed kernel version release and put it on a var:

# latestkernel=`ls -t /boot/vmlinuz-* | sed “s/\/boot\/vmlinuz-//g” | head -n1`

# echo $latestkernel
2.6.32-220.4.1.el6.i686

Now we need to load the new kernel version in memory:

kexec -l /boot/vmlinuz-${latestkernel} –initrd=/boot/initramfs-${latestkernel}.img –append=”`cat /proc/cmdline`”

realod new kernel:
kexec -e

The system will “restart without restarting”..something like a fast reboot, without performing BIOS checks

name -r
2.6.32-220.4.1.el6.i686

rsnapshot backups

Rsnapshot is an open source utility that provides incremental backups.

yum install rsnapshot

config_version 1.2 = Configuration file version
snapshot_root = Destination on where to store snapshots
cmd_cp = Path to copy command
cmd_rm = Path to remove command
cmd_rsync = Path to rsync
cmd_ssh = Path to SSH
cmd_logger = Path to shell command interface to syslog
cmd_du = Path to disk usage command
interval hourly = How many hourly backups to keep.
interval daily = How many daily backups to keep.
interval weekly = How many weekly backups to keep.
interval monthly = How many monthly backups to keep.
verbose = Self-explanatory
loglevel = Self-explanatory
logfile = Path to logfile
ssh_args = Optional SSH arguments, such as a different port (-p )
exclude_file = Path to the exclude file (will be explained in more detail)
rsync_long_args = Long arguments to pass to rsync
lockfile = Self-explanatory
backup = Full path to what to be backed up followed by relative path of placement.
backup_script = Full path to an executable script followed by relative path of placement.

Abyss Web Server

Abyss Web Server is a compact web server available for Windows, Mac OS X, and Linux operating systems.

Despite its small footprint, it supports HTTP/1.1, secure SSL/TLS connections (HTTPS), IPv6, on-the-fly HTTP compression, dynamic content generation through CGI/FastCGI scripts, ISAPI extensions, native ASP.NET, reverse proxying, eXtended Side Includes (XSSI), custom error pages, password protection, IP address control, anti-leeching, bandwidth throttling, and log rotation.

It also features an automatic antihacking system as well as a multilingual remote web management interface that makes its configuration as easy as browsing a web site.

kexec – reload new kernel without reboot

Kexec is a system call that enables you to load and boot into another kernel from the currently running kernel. This is useful for kernel developers or other people who need to reboot very quickly without waiting for the whole BIOS boot process to finish. Note that there may appear some problems and kexec may not work correctly for you because the devices won’t fully reinitiate when using this method.

yum install kexec-tools
vi /etc/systemd/system/[email protected]
[Unit]
Description=load %i kernel into the current kernel
Documentation=man:kexec(8)
DefaultDependencies=no
Before=shutdown.target umount.target final.target

[Service]
Type=oneshot
ExecStart=/usr/bin/kexec -l /boot/vmlinuz-%i –initrd=/boot/initramfs-%i.img –reuse-cmdline

[Install]
WantedBy=kexec.target

systemctl enable kexec-load@linux
systemctl kexec

If you wish to load a different kernel for the next kexec, for example linux-lts, disable the service for the current kernel and enable the one for the new kernel:
systemctl disable kexec-load@linux
systemctl enable kexec-load@linux-lts

It is also perfectly legal to invoke kexec manually:
kexec -l /boot/vmlinuz-linux –initrd=/boot/initramfs-linux.img –reuse-cmdline
exec -e

ttcp vs iperf

You can use the Test TCP utility (TTCP) to measure TCP throughput through an IP path. In order to use it, start the receiver on one side of the path, then start the transmitter on the other side. The transmitting side sends a specified number of TCP packets to the receiving side. At the end of the test, the two sides display the number of bytes transmitted and the time elapsed for the packets to pass from one end to the other. You can then use these figures to calculate the actual throughput on the link. For general information on TTCP, refer to Network Performance Testing with TTCP .

The TTCP utility can be effective in determining the actual bit rate of a particular WAN or modem connection. However, you can also use this feature to test the connection speed between any two devices with IP connectivity between them.

Server:./ttcp -r -s -p 9999

Client: ./ttcp -s -p 9999 < /boot/vmLinuz