Skip to content

Instantly share code, notes, and snippets.

View icholy's full-sized avatar
💥
breaking things

Ilia Choly icholy

💥
breaking things
View GitHub Profile
@icholy
icholy / gist:5718005
Created June 5, 2013 23:03
linux wpa connection
# list interfaces
iwconfig
# bring up the interface
ifconfig <IFACE> up
# scan for access points
iwlist <IFACE> scan
# connect & authenticate
@icholy
icholy / src-launch.sh
Last active December 18, 2015 03:59
I want clickable source links.
@icholy
icholy / interfaces
Created July 9, 2013 17:46
static ip config
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.7
netmask 255.255.0.0
network 192.168.1.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
@icholy
icholy / config
Last active December 20, 2015 06:59
~/.ssh/config
Host git.accipiterradar.com
HostName git.accipiterradar.com
IdentityFile ~/.ssh/id_rsa
User git
IdentitiesOnly yes
@icholy
icholy / gist:6116719
Created July 30, 2013 20:41
adding user to sudoers on slackware
$ su
$ groupadd sudo
$ VISUAL=vim sudoedit /etc/sudoers
# uncomment the following or add if it doesn't exist
#
# %sudo ALL=(ALL) ALL
#
@icholy
icholy / gist:6141864
Created August 2, 2013 17:48
playing around with go's ast
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
)
const src = `
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
type gzipResponseWriter struct {
@icholy
icholy / info.md
Last active June 7, 2017 07:59
Go code generation: COG + Jinja2

Install deps

$ sudo pip install cogapp
$ sudo pip install jinja2

Run COG

@icholy
icholy / diff_exec.sh
Created September 13, 2013 18:19
command output diff
#!/bin/sh
#
# Usage:
#
# ./diff_exec.sh lsof -p <PID>
#
# Every time you hit enter it will run the command
# and display the diff between the current and previous output.
#
@icholy
icholy / quick_find.go
Last active December 24, 2015 06:49
Union Find
package main
import "fmt"
type quickFind []int
func NewQuickFind(n int) quickFind {
u := make(quickFind, n)
for i := 0; i < n; i++ {
u[i] = i