Skip to content

Instantly share code, notes, and snippets.

View tonykwon's full-sized avatar
💭
😃

Tony Kwon tonykwon

💭
😃
View GitHub Profile
@tonykwon
tonykwon / .babelrc
Last active July 16, 2017 21:11
Current workflow
{
"presets": [ "es2015" ]
}
@tonykwon
tonykwon / pf.conf
Created July 7, 2017 16:48
OpenBSD PF Queue Example
# based on https://www.openbsd.org/faq/pf/example1.html
#
int_if="{ msk0 }"
ext_if="{ axe0 }"
table <martians> { 0.0.0.0/8 127.0.0.0/8 169.254.0.0/16 \
172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 224.0.0.0/3 \
192.168.0.0/16 198.18.0.0/15 198.51.100.0/24 \
203.0.113.0/24 }
set block-policy drop
@tonykwon
tonykwon / Steps
Last active August 23, 2019 21:34
tinydns and dnscache setup on OS X
0. create users then hide dnsrun and dnslog users from the login window
$ sh create-user-group.sh
$ sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add dnsrun dnslog
1. Install daemontools -> http://cr.yp.to/daemontools.html
$ mkdir /package
$ cd /package
$ curl http://cr.yp.to/daemontools/daemontools-0.76.tar.gz -o daemontools-0.76.tar.gz
$ tar -xvzf daemontools-0.76.tar.gz
@tonykwon
tonykwon / docker-machine-use-nfs.sh
Created October 16, 2015 22:39 — forked from olalonde/docker-machine-use-nfs.sh
Use NFS instead of vboxsf in Docker Machine
#!/bin/bash
#
# This script will mount /Users in the boot2docker VM using NFS (instead of the
# default vboxsf). It's probably not a good idea to run it while there are
# Docker containers running in boot2docker.
#
# Usage: sudo ./boot2docker-use-nfs.sh
#
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
# if it is sluggish and has issues fetching stuff via network
#
$ docker-machine restart default # Restart the environment
$ eval $(docker-machine env default) # Refresh your environment settings
# get the container ID of by container Name
@tonykwon
tonykwon / Page Extraction.txt
Last active July 17, 2017 02:35
Extract PDF Pages and save them as images
# convert some.pdf[15-19] some.png
# convert some.pdf[15-19] some.jpg
# convert some.pdf[15-19] some.gif
# convert -density 200 some.pdf some.png
# convert some.pdf -resize 50% some.png
$imagick = new Imagick();
<?php
/*
* router.php
* from https://docs.docker.com/compose/wordpress/
*
*/
$root = $_SERVER['DOCUMENT_ROOT'];
chdir($root);
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/');
Verifying I am +tonykwon on my passcard. https://onename.com/tonykwon
@tonykwon
tonykwon / gist:7e6422ea84669046706c
Created May 5, 2015 03:37
Virtual Box - Arch Linux
pacman -S virtualbox-guest-utils
pacman -S virtualbox-guest-modules
pacman -S virtualbox-guest-modules-lts
pacman -S virtualbox-guest-dkms
/etc/modules-load.d/virtualbox.conf
vboxguest
vboxsf
vboxvideo
@tonykwon
tonykwon / gist:405251858843e9cfefb2
Created November 3, 2014 20:24
Customizing admin menus which are created by Wordpress MVC plugin
bootstrap.php
MvcConfiguration::append(array(
'AdminPages' => array(
'flakes' => array(
'add',
'other1',
),
)
));