Skip to content

Instantly share code, notes, and snippets.

Avatar
👶

Jaime Pillora jpillora

👶
View GitHub Profile
View samizdat-shell-help.bash
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@nolanlawson
nolanlawson / index.html
Created Aug 25, 2017
iframe blob uri src
View index.html
<!doctype html>
<html lang="en">
<body>
<iframe id="theIframe" width="400" height="600" sandbox="true"></iframe>
<script>
var html = '<html><h1>hello world!</h1></html>'
var blob = new Blob([html], {type: 'text/html'})
var url = URL.createObjectURL(blob)
theIframe.src = url
</script>
@ekwoodrich
ekwoodrich / DVRIP-Sonia Reference Codes.md
Last active May 8, 2021
Reference codes for the DVRIP/Sonia TCP protocol used by the Net Surveillance ActiveX plugin
View DVRIP-Sonia Reference Codes.md

DVRIP/Sonia Protocol

DVRIP/Sonia TCP protocol used by the Net Surveillance ActiveX plugin

1. Response Codes

Return code Definition
100 Success
101 Unknown error
102 Version not supported
103 Illegal request
View main.go
package main
import (
"fmt"
"net/http"
"github.com/apex/go-apex"
"github.com/apex/go-apex/proxy"
)
@abimaelmartell
abimaelmartell / default_gateway.go
Created Oct 19, 2016
Get default gateway by parsing RIB information using the net/route package. BSD Only.
View default_gateway.go
package main
import (
"fmt"
"golang.org/x/net/route"
)
var defaultRoute = [4]byte{0, 0, 0, 0}
func main() {
@dancannon
dancannon / listen.go
Created Mar 21, 2015
New channel based iterator in GoRethink v1.0
View listen.go
cursor, err := r.Expr([]int{1,2,3}).Run(session)
if err != nil {
panic(err)
}
ch := make(chan int)
cursor.Listen(ch)
<- ch // 1
<- ch // 2
<- ch // 3
@mietek
mietek / set-up-l2tp-ipsec-vpn-on-debian.md
Last active Aug 29, 2021
Set up L2TP/IPsec VPN on Debian
View set-up-l2tp-ipsec-vpn-on-debian.md

Set up L2TP/IPsec VPN on Debian

Set up IPsec

Set up networking

@elwinar
elwinar / snake.go
Created Nov 18, 2014
ToSnake function for golang, convention-compliant
View snake.go
package main
import (
"unicode"
)
// ToSnake convert the given string to snake case following the Golang format:
// acronyms are converted to lower-case and preceded by an underscore.
func ToSnake(in string) string {
runes := []rune(in)
@fatih
fatih / gist:cd1ee734803f27526f74
Created Aug 7, 2014
CoreOS Cloudformation with VPC
View gist:cd1ee734803f27526f74
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"ap-northeast-1" : {
"AMI" : "ami-19fba518"
},
@sameersbn
sameersbn / gitlab-ce
Created Jul 28, 2014
gitlab-ce nginx load balance config
View gitlab-ce
upstream gitlab {
server 172.17.42.1:10080;
}
## This is a normal HTTP host which redirects all traffic to the HTTPS host.
server {
listen 80;
server_name git.example.com;
server_tokens off;
root /dev/null;