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)
View GitHub Profile
@DavidVentura
DavidVentura / tap-linux.py
Created August 2, 2021 21:18 — forked from makcuk/tap-linux.py
A simple python tun/tap udp tunnel example
# Simple linux tun/tap device example tunnel over udp
# create tap device with ip tuntap add device0 tap
# set ip address on it and run tap-linux on that device and set desitation ip
# run same on another node, changing dst ip to first node
import fcntl
import struct
import os
import socket
import threading
@mikesager
mikesager / runcmd.md
Created July 20, 2020 04:00
SOLVED: cloud-init runcmd doesn't work

If you've added some runcmd lines to your cloud-init config, and the commands don't seem to be executing, here's a few things you should know:

WTF is going on?

  1. runcmd only has code to "shellify" your strings or array of strings (i.e: turns them into a shell script)
  2. runcmd will only write a shell script into the file /var/lib/cloud/instance/scripts/runcmd
  3. runcmd is part of the cloud_config_modules boot stage
  4. You need to execute that runcmd shell script using the scripts-user module
  5. scripts-user is part of the cloud_final_modules boot stage
@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 January 27, 2026 07:37
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 February 19, 2026 19:42
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}'
@raveenb
raveenb / ssh_into_android.md
Last active April 13, 2026 03:15
SSH into Android

Connecting to an Android device over SSH

Initial Setup

Install Android App Termux from APKPure or AppStore. If the app exists, just delete and re-install it to get the latest version, The APK can be downloaded from https://apkpure.com/termux/com.termux/ Install the APK using by running

adb install ~/Downloads/Termux_v0.73_apkpure.com.apk
@vicsperry
vicsperry / glx-vnc.md
Last active March 5, 2026 16:51
Enable GLX Support in a VNC Environment on Ubuntu 16.04 - TurboVNC and VirtualGL

Enable GLX Support in a VNC Environment on Ubuntu 16.04 - TurboVNC and VirtualGL

Vic Sperry, 02 Jun 2019

Problem

I've been using a *nix VNC server and client since about 2004. Within the last several years, however, I am increasingly running into applications that demand support for GLX. On Ubuntu, GLX works out of the box if you're sitting at a physical terminal connected to your Linux machine, but if you're using a headless server or some other virtual X-windows environment, you might see something like this:

Xlib:  extension "GLX" missing on display ":1"

One solution for this problem is to run TurboVNC and VirtualGL to create your VNC server. That's what I address here. If you're trying to use something like VirtualBox on Windows to create a virtual Ubuntu, that's out of my realm of experience.

@edwintcloud
edwintcloud / circular_buffer.py
Created May 7, 2019 18:16
Circular Buffer in Python Full Implementation
#!python
class CircularBuffer(object):
def __init__(self, max_size=10):
"""Initialize the CircularBuffer with a max_size if set, otherwise
max_size will elementsdefault to 10"""
self.buffer = [None] * max_size
self.head = 0
@nileshsimaria
nileshsimaria / docker-default-directory
Last active October 27, 2025 02:15
Change docker's default /var/lib/docker to different directory on Ubuntu
1. Take a backup of docker.service file.
$ cp /lib/systemd/system/docker.service /lib/systemd/system/docker.service.orig
2. Modify /lib/systemd/system/docker.service to tell docker to use our own directory
instead of default /var/lib/docker. In this example, I am using /p/var/lib/docker
Apply below patch.
$ diff -uP -N /lib/systemd/system/docker.service.orig /lib/systemd/system/docker.service
--- /lib/systemd/system/docker.service.orig 2018-12-05 21:24:20.544852391 -0800