Skip to content

Instantly share code, notes, and snippets.

#Open vSwitch Lab kaskdaksdkdaks

Get started with Open vSwitch, flows and OpenFlow controllers.

##Pre-reqs

Linux system with OVS installed.

##Setup

@ziplex
ziplex / load_dotenv.sh
Created November 10, 2022 06:55 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@ziplex
ziplex / ssh-ed25519-freebsd.md
Created October 25, 2022 13:05 — forked from denji/ssh-ed25519-freebsd.md
Could not load host key: /etc/ssh/ssh_host_ed25519_key

Generate keys for system SSH deamon

System openssh

Generate all key types:

/etc/rc.d/sshd keygen
@ziplex
ziplex / blog20201221-01.cfg
Created July 15, 2022 16:26 — forked from haproxytechblog/blog20201221-01.cfg
Route SSH Connections with HAProxy
frontend fe_ssh
bind *:2222 ssl crt /etc/haproxy/certs/ssl.pem
mode tcp
log-format "%ci:%cp [%t] %ft %b/%s %Tw/%Tc/%Tt %B %ts %ac/%fc/%bc/%sc/%rc %sq/%bq dst:%[var(sess.dst)] "
tcp-request content set-var(sess.dst) ssl_fc_sni
use_backend %[ssl_fc_sni]
@ziplex
ziplex / Fix.md
Created May 5, 2022 07:57 — forked from reytech-dev/Fix.md
ZONE_CONFLICT: 'docker0' already bound to a zone
  1. Check if docker zone exists in firewall-cmd
$ firewall-cmd --get-active-zones
  1. If "docker" zone is available, change interface to docker0 (not persisted)
$ sudo firewall-cmd --zone=docker --change-interface=docker0
  1. If "docker" zone is available, change interface to docker0 (persisted, thanks rbjorklin)
@ziplex
ziplex / native-mem-tracking.md
Created April 11, 2022 11:45 — forked from prasanthj/native-mem-tracking.md
Native memory tracking in JVM

Enable native memory tracking in JVM by specifying the following flag

-XX:NativeMemoryTracking=detail

Know the <PID> of the java process

jps

To print ps based RSS

ps -p <PID> -o pcpu,rss,size,vsize

To print native memory tracking summary

## YOUTUBE VIDEO PART I: https://youtu.be/iZzx1keKztY
##
import pyautogui
from time import sleep
##
# пауза и досрочное прекращение
pyautogui.PAUSE = 1.5
pyautogui.FAILSAFE = True
##
@ziplex
ziplex / How to install tcpping on Linux.md
Created December 22, 2021 08:13 — forked from cnDelbert/How to install tcpping on Linux.md
How to install tcpping on Linux

To install tcptraceroute on Debian/Ubuntu:

$ sudo apt-get install tcptraceroute

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute
@ziplex
ziplex / dhcp_option119.py
Created November 29, 2021 13:08 — forked from SmartFinn/dhcp_option119.py
a script for converting domain names to DHCP Option 119 (Domain Search Option)
#!/usr/bin/env python3
"""Command generator for setting DHCP Option 119
This script converts the specified domain names to DHCP Option 119
(Domain Search Option) and prints commands for various DHCP servers.
USAGE:
./dhcp_option119.py DOMAIN ...
EXAMPLE:
@ziplex
ziplex / remove_old_builds.sql
Created November 5, 2021 11:00 — forked from david-zw-liu/remove_old_builds.sql
Keep 1000 builds per repos for DroneCI (sqlite3 version >= 3.25 required)
-- Thank @sbengo to figure out foreign_keys constraints is defaults to false in sqlite
-- Enable to delete logs by cascading delete
PRAGMA foreign_keys = ON;
WITH n_build_ids_per_repo as (
SELECT build_id
FROM (
SELECT
build_id,
build_repo_id,