Skip to content

Instantly share code, notes, and snippets.

@farhany
farhany / plink-plonk.js
Created April 1, 2020 20:08 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@farhany
farhany / _service.md
Created March 29, 2020 16:45 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@farhany
farhany / tcpdump IPv6 router advertisement
Created March 16, 2020 23:29 — forked from hgn/tcpdump IPv6 router advertisement
Capture of IPv6 advertisement message via tcpdump
@virgo:~ $ sudo tcpdump -vvvv -ttt -i eth1 icmp6 and 'ip6[40] = 134'
00:00:00.000000 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 200) fe80::b675:eff:fefa:1cb > ip6-allnodes: [icmp6 sum ok] ICMP6, router advertisement, length 200
hop limit 0, Flags [managed, other stateful], pref medium, router lifetime 1800s, reachable time 0s, retrans time 0s
source link-address option (1), length 8 (1): b4:75:0e:fa:01:cb
0x0000: b475 0efa 01cb
mtu option (5), length 8 (1): 1280
0x0000: 0000 0000 0500
prefix info option (3), length 32 (4): 2a01:ffff:43f::/64, Flags [onlink, auto], valid time 7200s, pref. time 1800s
0x0000: 40c0 0000 1c20 0000 0708 0000 0000 2a01
0x0010: ffff 043f 0000 0000 0000 0000 0000
@farhany
farhany / 01-curl.go
Created February 27, 2020 21:58 — forked from jmoiron/01-curl.go
io.Reader & io.Writer fun
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func init() {
package main
import "net"
func echoServer(c net.Conn) {
for {
buf := make([]byte, 512)
nr, err := c.Read(buf)
if err != nil {
return
@farhany
farhany / tmux-cheatsheet.markdown
Created October 11, 2019 05:36 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
package gziphandler
import (
"compress/gzip"
"log"
"net/http"
"strings"
"sync"
)
@farhany
farhany / FIRE.PAS
Created June 20, 2019 03:40 — forked from specht/FIRE.PAS
program firetest;
{ Classic fire animation using VGA mode 13h and colors 0 to 63... wee !!! }
uses Crt, VGA;
var i, heat: Integer;
quit: Boolean;
c: Char;
@farhany
farhany / gist:2ede31c2dcdeede5744688a17e810008
Created June 11, 2019 06:53 — forked from schmichael/gist:7379338
Transparently compress and upload a file in golang
package main
import (
"bufio"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@farhany
farhany / exec.go
Created May 30, 2019 04:31 — forked from danesparza/exec.go
Go exec.Command example
package main
import (
"bytes"
"fmt"
"os/exec"
"strings"
)
func main() {