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\
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersioin: v1 | |
kind: Pod | |
metadata: | |
name: qemu | |
spec: | |
securityContext: | |
runAsUser: 0 | |
volumes: | |
- name: host-dev | |
hostPath: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! 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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
NewerOlder