Skip to content

Instantly share code, notes, and snippets.

@rendoaw
rendoaw / linux.lvm.tutorial.md
Created June 7, 2015 01:37
Linux Basics – LVM (Logical Volume Manager) Tutorial

original source: https://ostechnix.wordpress.com/2013/02/03/linux-basics-lvm-logical-volume-manager-tutorial/

Linux Basics – LVM (Logical Volume Manager) Tutorial

February 3, 2013 ~ Admin Logical Volume Manager (LVM);

LVM is a tool for logical volume management which is used to allocating disks, striping, mirroring and resizing logical volumes. With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks. Since a physical volume cannot span over multiple drives, to span over more than one drive, create one or more physical volumes per drive. The volume groups can be divided into logical volumes, which are assigned mount points, such as /home and / and file system types, such as ext2 or ext3 or ext4. When “partitions” reach their full capacity, free space from the volume group can be added to the logical volume to increase the size of the partition. When a new hard drive is added to th

@rendoaw
rendoaw / kvm.clone.guest.md
Created June 6, 2015 22:00
Clone KVM Guest
@rendoaw
rendoaw / java.log.file.location.md
Last active February 24, 2020 07:44
JAVA Log File Location

The default location (directory) of the trace and log files is:

* <user.home>/.java/deployment/log on UNIX, Linux
* ~/Library/Application Support/Oracle/Java/Deployment/log on Mac OS X
* <User Application Data Folder>\Sun\Java\Deployment\log on Windows

If the environment variable USER_JPI_PROFILE is set to then the trace and log files will be written to:

* /.java/deployment/log on UNIX, Linux
#!/usr/bin/python
import paramiko
import cmd
class RunCommand(cmd.Cmd):
""" Simple shell to run a command on the host """
prompt = 'ssh > '
@rendoaw
rendoaw / junos.snmpv3.sample.md
Created June 4, 2015 04:08
JunOS SNMPv3 example

sample config

user@mx04> show configuration snmp | no-more
location "lab";
v3 {
    usm {
        local-engine {
            user user1_noauth {
                authentication-none;
            }
@rendoaw
rendoaw / linux.tcp.offload.md
Created June 4, 2015 03:59
Linux TCP Offload

original source: http://stackoverflow.com/questions/26716722/tcp-receives-packets-but-it-ignores-them

TCP receives packets, but it ignores them

The problem was that I disabled the TSO (tcp-segmentation-offload) on the virtual bridge to which my Dockers are attached with the command:

ethtool -K IFACE_NAME tso off

It turns off only TSO, whereas the checksumming offload remains on. Evidently, this creates some problem and though Wireshark showed me that TCP checksum was OK, actually it wasn't. So the host ignored the packet due to the bad TCP checksum.

@rendoaw
rendoaw / perl.oneliner.md
Created June 4, 2015 03:58
Perl Oneliner example

for junos, it will remove the whole interface em0 section (multiline) from config file

perl -ni -e 'print unless /^    em0 {/ .. /^    }/' *.conf
@rendoaw
rendoaw / linux.tcp.keepalive.md
Created June 4, 2015 03:55
Linux TCP Keepalive
echo 3 > /proc/sys/net/ipv4/tcp_keepalive_probes
echo 10 > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo 60 > /proc/sys/net/ipv4/tcp_keepalive_time

cat /proc/sys/net/ipv4/tcp_keepalive_probes
cat /proc/sys/net/ipv4/tcp_keepalive_intvl
cat /proc/sys/net/ipv4/tcp_keepalive_time

sysctl -w net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_probes=3 net.ipv4.tcp_keepalive_intvl=10
@rendoaw
rendoaw / vde.sample.md
Created June 4, 2015 03:40
Example of vde switch and dpipe

connect local interface eth2 to remote vde switch @192.168.1.100 over ssh

/usr/bin/vde_switch -unix /tmp/vde2 -t tap2  -d --dirmode 777 --mode 666 --mgmtmode 666 -T -c mgmt0 -n 4096
dpipe vde_plug /tmp/vde2 = ssh 192.168.1.100 /tmp/vde2

brctl addbr br101
brctl addif br101 eth2
brctl addif br101 tap2
ifconfig br101 up