Skip to content

Instantly share code, notes, and snippets.

@bom-d-van
bom-d-van / setup.sh
Last active September 27, 2016 07:12
NFS: OSX Server and Linux Client
# http://www.barryodonovan.com/2012/12/12/apple-os-x-as-an-nfs-server-with-linux-clients
echo "/Volumes/DATA-1 -maproot=root:wheel -network 192.168.56.0 -mask 255.255.255.0" >> /etc/exports
sudo nfsd enable
sudo nfsd start
# http://www.tldp.org/LDP/nag2/x-087-2-nfs.mountd.html
# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/System_Administration_Guide/s1-nfs-mount.html
# checking
showmount -e moonshot
@bom-d-van
bom-d-van / web-servers.md
Created September 6, 2016 01:58 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bom-d-van
bom-d-van / tips.md
Last active February 28, 2020 16:58 — forked from bahayman/gist:9369651
tcpdump http monitor

Use TCPDUMP to Monitor HTTP Traffic

  1. To monitor HTTP traffic including request and response headers and message body:

tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'

  1. To monitor HTTP traffic including request and response headers and message body from a particular source:

tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'

@bom-d-van
bom-d-van / 32.asm
Created December 27, 2015 12:18 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@bom-d-van
bom-d-van / ssh
Created December 25, 2015 06:21 — forked from zxvdr/ssh
SSH proxy
package main
import (
"bytes"
"code.google.com/p/go.crypto/ssh"
"fmt"
"log"
"net"
"os"
)
@bom-d-van
bom-d-van / go_scp.go
Created December 7, 2015 06:11 — forked from jedy/go_scp.go
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@bom-d-van
bom-d-van / Makefile
Last active August 29, 2015 14:17 — forked from tobstarr/Makefile
default:
@go get code.google.com/p/go.crypto/ssh
go build -o bin/test_ssh_client *.go
# Install MacTex: http://mirror.ctan.org/systems/mac/mactex/mactex-basic.pkg
$ sudo chown -R `whoami` /usr/local/texlive
$ tlmgr update --self
$ tlmgr install ucs
$ tlmgr install etoolbox
# Install pandoc view homebrew