Skip to content

Instantly share code, notes, and snippets.

View rm77's full-sized avatar
💭
(to be) or not (to be) = (to be)

Roy rm77

💭
(to be) or not (to be) = (to be)
  • surabaya, indonesia
View GitHub Profile
@programmer131
programmer131 / Linux Virtualization using Iproute2.md
Last active February 18, 2024 05:08
using linux Iproute2 utility, Setup VLAN, double VLAN, VLAN with outer s-tag, VXLAN, VXLAN inside VXLAN,

How to clear ip addr, link
ip link delete vxlan2
ip addr del 192.168.0.55/24 dev vxlan2
VxLAN setup
Machine 1
ip link add vxlan1 type vxlan id 1 remote 192.168.18.48 dstport 4789 dev wlp2s0
ip link set vxlan1 up
ip addr add 192.168.0.6/24 dev vxlan1
Machine 2
ip link add vxlan1 type vxlan id 1 remote 192.168.18.24 dstport 4789 dev wlp3s0\

@nasirhafeez
nasirhafeez / freeradius-advanced-use-cases.md
Last active August 15, 2024 13:51
FreeRADIUS Advanced Use Cases
@djoreilly
djoreilly / mk-vxlan.sh
Created February 17, 2020 10:08
Linux VxLAN performance test setup script
#!/bin/bash
set -xe
# $0 host dev remote_ip
# host is 1 or 2
# on vmA
# ./mk-vx.sh 1 ens3 10.10.10.9
# on vmB
# ./mk-vx.sh 2 ens3 10.10.10.15
@vaughany
vaughany / .tmux.conf
Last active July 16, 2024 23:03
A shell script to open tmux with a selection of windows and panes.
# Remap prefix from 'C-b' to 'C-a'.
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Reload config file.
bind-key r source-file ~/.tmux.conf\; display ' Reloaded tmux config.'
# Split panes using | and -.
bind-key | split-window -h -c '#{pane_current_path}'
@jnovack
jnovack / break.go
Last active August 30, 2024 05:22
Handle CTRL-C in Golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"time"
)
@aspyct
aspyct / wpa_supplicant.conf
Created September 17, 2018 13:10
Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file. I used this to connect to my university's wireless network.
# Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file.
# I used this to connect to my university's wireless network on Arch linux.
# Here's the command I used:
#
# wpa_supplicant -i wlan0 -c ./wpa_supplicant.conf
#
network={
ssid="YOUR_SSID"
scan_ssid=1
@fabiand
fabiand / qemu-pod.yaml
Last active September 18, 2024 22:38
Connecting qemu to the pod's network
apiVersioin: v1
kind: Pod
metadata:
name: qemu
spec:
securityContext:
runAsUser: 0
volumes:
- name: host-dev
hostPath:
@UdaykiranGudepu
UdaykiranGudepu / app.py
Last active July 17, 2024 09:04
Flask REST ful service basics with basic authentication - ( Python 3, IDE - pycharm, HTTPBasicAuth )
#! usr!bin
from flask import Flask, jsonify, abort, make_response, url_for
from flask import request
from socket import *
from flask_httpauth import HTTPBasicAuth
sock = socket(AF_INET, SOCK_STREAM)
sock.setsockopt(SOL_SOCKET, SO_REUSEADDR,1)
sock.bind(('0.0.0.0',0))
sudo modprobe 8021q
lsmod | grep 8021q
ip link add link eth1 name eth1.10 type vlan id 10
https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/
@aurbano
aurbano / timeBetween.php
Last active May 13, 2024 01:48
Display the time between two dates in a human readable format (i.e. 3 seconds, 4 days, 1 week... )
<?php
/**
* Calculate the elapsed time between two timestamps
* and display in a pretty human way.
* @param integer $start Initial timestamp
* @param integer $end Final timestamp, set to -1 for current time.
* @return string Formatted elapsed time.
*/
function timeBetween($start, $end=-1){
if($end < 0) $end = time();