Skip to content

Instantly share code, notes, and snippets.

View vchakoshy's full-sized avatar

Vahid Chakoshy vchakoshy

View GitHub Profile
#
# https://docs.openstack.org/newton/install-guide-ubuntu/launch-instance-provider.html
#
sudo useradd -s /bin/bash -d /opt/stack -m stack
mkdir /opt/stack/log
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
sudo su - stack
git clone https://github.com/openstack-dev/devstack.git -b stable/queens devstack/
@Davor111
Davor111 / sshuttle.sh
Created February 17, 2017 08:34
How to use sshuttle with .key, .csr or .pem files for authentication
#It's not directly mentioned in the documentation on how to do this, so here you go. This command will tunnel everything including DNS:
sshuttle --dns -vr [email protected] 0/0 --ssh-cmd 'ssh -i /your/key/path.pem'
@walm
walm / main.go
Last active September 21, 2025 16:52
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@widnyana
widnyana / dump.sh
Created June 24, 2016 06:01
Dump Current Nginx Config
# Set pid of nginx master process here
pid=8192
# generate gdb commands from the process's memory mappings using awk
cat /proc/$pid/maps | awk '$6 !~ "^/" {split ($1,addrs,"-"); print "dump memory mem_" addrs[1] " 0x" addrs[1] " 0x" addrs[2] ;}END{print "quit"}' > gdb-commands
# use gdb with the -x option to dump these memory regions to mem_* files
gdb -p $pid -x gdb-commands
# look for some (any) nginx.conf text
@mz1988
mz1988 / main.go
Created July 14, 2015 22:04
Confidence Comment Algorithm by Go (golang)
package main
import (
"fmt"
"math"
)
func _confidence(ups int32, downs int32) float64 {
d := ups + downs
var n float64 = float64(d)
@bpedro
bpedro / postman2apiblueprint
Created March 10, 2015 19:49
Generates API Blueprint documentation from a POSTMAN Collection JSON file.
#!/usr/bin/env node
var fs = require('fs')
, url = require('url');
if (process.argv.length < 3) {
console.log('Usage:\n', process.argv[1] + ' <postman collection JSON file>\n\n');
process.exit();
}
@hpcorona
hpcorona / squid.conf
Created March 1, 2013 16:06
simple squid3 configuration to allow all to connect to all
#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
@mhluongo
mhluongo / gist:4645421
Last active December 11, 2015 18:58
A quick bit of Cypher demonstrating how you can change the default null-ordering in ORDER BY. Note that the trick is in the null predicate and STR cast.
START n=node({startId})
MATCH (n)-[?:DID]->(thing)
WITH thing, (thing.year? = null) AS year_is_null
WITH thing, STR(year_is_null) as null_year
ORDER BY null_year, thing.year? DESC
RETURN thing, thing.year? as year