Skip to content

Instantly share code, notes, and snippets.

@kocisov
kocisov / next_nginx.md
Last active April 10, 2024 14:27
How to setup next.js app on nginx with letsencrypt
@djoreilly
djoreilly / ovs-cheat.md
Last active March 15, 2024 13:02
OVS cheat sheet

DB

ovs-vsctl list open_vswitch
ovs-vsctl list interface
ovs-vsctl list interface vxlan-ac000344
ovs-vsctl --columns=options list interface vxlan-ac000344
ovs-vsctl --columns=ofport,name list Interface
ovs-vsctl --columns=ofport,name --format=table list Interface
ovs-vsctl -f csv --no-heading --columns=_uuid list controller
ovs-vsctl -f csv --no-heading -d bare --columns=other_config list port
@binkybear
binkybear / gist:18dab6ef15bfb8052f15c12c6b7777f3
Last active October 15, 2022 19:07
Build lxc for android
# Get Pre-reqs
apt-get install libattr1-dev git unzip make gcc automake pkg-config
# Get Android NDK
cd /root
mkdir -p build && cd build
wget http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip -O /tmp/android-ndk-r10e-linux-x86_64.zip
unzip /tmp/android-ndk-r10e-linux-x86_64.zip -d /root/build
# Set paths
@copperlight
copperlight / .bashrc
Created August 11, 2016 16:27
Window Subsystem for Linux ssh-agent Configuraton
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
anonymous
anonymous / vxlan.py
Created May 9, 2016 22:08
root@mininet-vm:/home/mininet/mininet/examples# more vxlan.py
#!/usr/bin/python
"""
This example shows how to create an empty Mininet object
(without a topology object) and add nodes to it manually.
"""
from mininet.net import Mininet
@mamonu
mamonu / qcow2vdi.sh
Last active April 22, 2024 09:39
convert a qcow2 vm to a VirtualBox vm format
qemu-img convert -O vdi gnome.qcow2 gnome.vdi
#if its a raw image then:
VBoxManage convertdd opnstk.raw VBox.vdi --format VDI
@djoreilly
djoreilly / disable_OS_firewalls.md
Last active December 29, 2023 07:07
Howto disable OpenStack firewalls

Howto disable OpenStack firewalls

tested on kilo, juno and liberty. This breaks creating instances in horizon - on liberty anyway, maybe older too.

People usually want to do this because the anti-spoofing rules are dropping packets transmitted by Nova instances that do not have the source MAC or IP address that was allocated to the instance. Note: allowed-addresses-pairs or port-security extension can fix that. Also there is a performance drop using the hybrid plugging strategy (veth+linuxbridge+iptables).

But Nova needs a security groups API or it will refuse to start instances. It needs to be configured to use its own or Neutron's. Here we configure it to use the Nova security groups API, but disable nova-compute (and the Neutron L2 agent - just to be sure) from applying any iptables rules.

On each controller and compute node, change:

@msikma
msikma / rfc5646-language-tags.js
Created February 26, 2015 13:51
RFC 5646 Language Tags
// List of language tags according to RFC 5646.
// See <http://tools.ietf.org/html/rfc5646> for info on how to parse
// these language tags. Some duplicates have been removed.
var RFC5646_LANGUAGE_TAGS = {
'af': 'Afrikaans',
'af-ZA': 'Afrikaans (South Africa)',
'ar': 'Arabic',
'ar-AE': 'Arabic (U.A.E.)',
'ar-BH': 'Arabic (Bahrain)',
'ar-DZ': 'Arabic (Algeria)',
// src: https://cb.qq.com/bank/js/pinyin.js?v=1.0.3
;
(function(global) {
var dict_combo = {
"yā,ā": "吖",
"ā,ē": "阿",
"hē,a,kē": "呵",
"shà,á": "嗄",
"ā,á,ǎ,à,a": "啊",
"ā,yān": "腌",