Skip to content

Instantly share code, notes, and snippets.

View darkgeek's full-sized avatar
🎯
Focusing

Justin Yang darkgeek

🎯
Focusing
View GitHub Profile
# Suppose we have this history:
$ git log --oneline
2750b94 Finally fix bug #84.
da52aaa Fix bug #84.
31f5476 Fixing bug #84.
# We enter rebasing with:
git rebase --interactive HEAD~3
# HEAD~3 says from HEAD include 3 commits
@darkgeek
darkgeek / build_redshift_on_freebsd_10.2
Created January 11, 2016 18:15
Build Redshift on FreeBSD 10.2
1 sudo pkg install autoconf devel/py-xdg x11-toolkits/py-gtk2 intltool libtool automake
2 Remove `#include <alloca.h>` line in `src/gamma-drm.c`
3 Follow official guide as normal
@darkgeek
darkgeek / how_to_add_proxy_on_firefox_os
Last active December 23, 2015 06:57
How to add proxy on Firefox OS?
Append the following lines to `/system/b2g/defaults/pref/user.js`:
pref("network.proxy.backup.ssl", "IP");
pref("network.proxy.backup.ssl_port", PORT);
pref("network.proxy.http", "IP");
pref("network.proxy.http_port", PORT);
pref("network.proxy.no_proxies_on", "");
pref("network.proxy.share_proxy_settings", true);
pref("network.proxy.ssl", "IP");
pref("network.proxy.ssl_port", PORT);
@darkgeek
darkgeek / xmodemap_on_startup_xfce4
Created November 26, 2015 15:59
Use xmodmap to change keymap under Xfce4 on startup
/bin/sh -c "sleep 20; /usr/local/bin/xmodmap /home/justin/.keyboard_config"
@darkgeek
darkgeek / message-process
Created October 13, 2015 14:18
message-process
root@rpi [/root] # tail -f /var/log/messages <
Oct 12 03:05:30 rpi ntpd[1359]: ntpd 4.2.8p3-o Fri Jul 10 09:17:47 EDT 2015 (import): Starting
Oct 12 03:05:30 rpi ntpd[1359]: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g
Oct 12 03:05:30 rpi ntpd[1156]: proto: precision = 4.000 usec (-18)
Oct 12 03:05:31 rpi ntpd[1156]: restrict default: KOD does nothing without LIMITED.
Oct 12 03:05:31 rpi ntpd[1156]: Listen and drop on 0 v6wildcard [::]:123
Oct 12 03:05:31 rpi ntpd[1156]: Listen and drop on 1 v4wildcard 0.0.0.0:123
Oct 12 03:05:31 rpi ntpd[1156]: Listen normally on 2 lo0 127.0.0.1:123
Oct 12 03:05:31 rpi ntpd[1156]: Listen normally on 3 lo0 [::1]:123
Oct 12 03:05:31 rpi ntpd[1156]: Listen normally on 4 lo0 [fe80::1%3]:123
@darkgeek
darkgeek / netstat-nr
Created October 13, 2015 14:10
netstat-nr
root@rpi [/root] # netstat -nr
Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu Interface
10.1.16/24 link#2 UC - - -L urtwn0
10.1.16.11 00:11:94:d8:33:00 UHLc - - -L urtwn0
10.1.16.21 link#2 UHLl - - -L urtwn0
127/8 127.0.0.1 UGRS - - 33192L lo0
127.0.0.1 127.0.0.1 UHl - - 33192L lo0
@darkgeek
darkgeek / start-hostapd-and-dhcpd-log
Created October 13, 2015 14:09
start-hostapd-and-dhcpd-log
root@rpi [/root] # service hostapd onestart
Starting hostapd.
Configuration file: /etc/hostapd.conf
Using interface urtwn0 with hwaddr e8:4e:06:1f:fc:6f and ssid "darkgeek-wifi"
urtwn0: interface state UNINITIALIZED->ENABLED
urtwn0: AP-ENABLED
root@rpi [/root] # ifconfig
usmsc0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
ec_capabilities=1<VLAN_MTU>
ec_enabled=0
@darkgeek
darkgeek / After-set-address-ifconfig
Created October 13, 2015 14:08
After-set-address-ifconfig
root@rpi [/root] # ifconfig urtwn0 inet 10.1.16.21/24
root@rpi [/root] # ifconfig
usmsc0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
ec_capabilities=1<VLAN_MTU>
ec_enabled=0
address: b8:27:eb:5e:22:6b
media: Ethernet autoselect (100baseTX full-duplex)
status: active
urtwn0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ssid CMCC-WEB
@darkgeek
darkgeek / freshly-boot-ifconfig
Created October 13, 2015 14:07
freshly-boot-ifconfig
root@rpi [/root] # ifconfig
usmsc0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
ec_capabilities=1<VLAN_MTU>
ec_enabled=0
address: b8:27:eb:5e:22:6b
media: Ethernet autoselect (100baseTX full-duplex)
status: active
urtwn0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
ssid ""
powersave off
@darkgeek
darkgeek / pf.conf
Created October 12, 2015 06:22
pf.conf
allowed_ports="{8000, 8001, 6600, 3000, 4231, https}"
icmp_types="echoreq"
set skip on lo0
pass in on pppoe0 from pppoe0:network to urtwn0:network keep state
pass out on urtwn0 from pppoe0:network to urtwn0:network keep state
block in all
pass out all keep state