Skip to content

Instantly share code, notes, and snippets.

@rendoaw
rendoaw / linux_lldp.md
Last active July 11, 2023 17:20
Linux Enable LLDP
@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
@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 / 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.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 / 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;
            }
#!/usr/bin/python
import paramiko
import cmd
class RunCommand(cmd.Cmd):
""" Simple shell to run a command on the host """
prompt = 'ssh > '
@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
@rendoaw
rendoaw / kvm.clone.guest.md
Created June 6, 2015 22:00
Clone KVM Guest