Skip to content

Instantly share code, notes, and snippets.

View si9ma's full-sized avatar
👏
Go Go Go

si9ma si9ma

👏
Go Go Go
View GitHub Profile
@si9ma
si9ma / wpa_supplicant.conf
Last active July 24, 2018 01:53
Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file. I used this to connect to my university's wireless network.
# Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file.
# I used this to connect to my university's wireless network on Arch linux.
# Here's the command I used:
#
# wpa_supplicant -i wlan0 -c ./wpa_supplicant.conf
#
network={
ssid="YOUR_SSID"
scan_ssid=1
@si9ma
si9ma / latex-cheatsheet-template.tex
Last active November 6, 2018 13:20 — forked from alexander-yakushev/latex-cheatsheet-template.tex
Beautiful cheatsheet template for key bindings, compiled with XeLaTeX
\documentclass[10pt,landscape]{article}
\usepackage{ctex}
\usepackage{multicol}
\usepackage{calc}
\usepackage[landscape]{geometry}
\usepackage{color,graphicx,overpic}
\usepackage[T1]{fontenc}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[utf8]{inputenc}
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@si9ma
si9ma / osx-brew-gnu-coreutils-man.sh
Last active February 3, 2019 08:56 — forked from quickshiftin/osx-brew-gnu-coreutils-man.sh
Running GNU coreutils via Homebrew on your Mac? Here's a one-liner to get the manpages working!
# Short of learning how to actually configure OSX, here's a hacky way to use
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise
alias man='_() { echo $@; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $@ 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $@; else man $@; fi }; _'
@si9ma
si9ma / web-servers.md
Created January 25, 2019 06:50 — 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
@si9ma
si9ma / gist:507df1f86d698b1ddc78e1daa4783555
Created February 4, 2019 05:07 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
# http2
import BaseHTTPServer, SimpleHTTPServer
@si9ma
si9ma / gist:a92a7536c060320c5028acc4885d68df
Created February 28, 2019 05:22 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@si9ma
si9ma / bash.generate.random.alphanumeric.string.sh
Created February 28, 2019 17:27 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1