Skip to content

Instantly share code, notes, and snippets.

@illucent
illucent / reconfigure-display.sh
Created March 20, 2016 11:52 — forked from trustin/reconfigure-display.sh
Trustin's single/dual monitor setup script for laptops with nVidia GPU
#!/bin/bash
if [[ $# -gt 0 ]]; then
CLONE=1
else
CLONE=0
fi
function get_max_resolution() {
xrandr | grep -A100 "^$1 " | grep -P '^\s+[0-9]+x[0-9]+\s+[0-9\.]+\s*\*?\+.*$' | head -1 | awk '{ print $1; }'
}
--- tools.py 2015-11-12 18:46:13.489194658 +0100
+++ tools.new.py 2015-11-12 18:45:35.178614760 +0100
@@ -239,8 +239,8 @@ def message_if_missing(filename):
return _CLIENT_SECRETS_MESSAGE % filename
try:
- from oauth2client.old_run import run
- from oauth2client.old_run import FLAGS
+ from oauth2client1412.old_run import run
+ from oauth2client1412.old_run import FLAGS
@illucent
illucent / gist:57c1153dadf6374d49af
Created March 16, 2016 19:19 — forked from su-v/gist:9965739
Inkscape / SVG on GitHub
@illucent
illucent / cf-ddns.sh
Created March 15, 2016 19:45 — forked from larrybolt/cf-ddns.sh
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
#
# See /usr/share/doc/unbound/examples/unbound.conf for a commented
# reference config file.
server:
# The following line will configure unbound to perform cryptographic
# DNSSEC validation using the root trust anchor.
auto-trust-anchor-file: "/var/lib/unbound/root.key"
do-not-query-localhost: no
local-zone: "168.192.in-addr.arpa" transparent
@illucent
illucent / dnsmasq-gfwlist.py
Created March 6, 2016 20:31 — forked from lanceliao/dnsmasq-gfwlist.py
将gfwlist转换成带ipset的dnsmasq规则,适用于OpenWrt智能上网
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@illucent
illucent / about-rpi.md
Created March 6, 2016 19:31 — forked from arpanpal010/about-rpi.md
Raspberry Pi configurations

##Configurations for Raspberry Pi Home Server## #####Using Raspbian##### (although the procedures are similar/compatible with most debian based systems.)

###Added###

  • [sysctl.conf mods] (#file-sysctl-md)
  • [Firewall config] (#file-firewall-md)
  • [DNS Server] (#file-dns-md)
  • [Dynamic Dns] (#file-dyndns-md)
  • [Git Server] (#file-git-server-md)
@illucent
illucent / latest-chrome.sh
Created March 6, 2016 14:01 — forked from ruario/latest-chrome.sh
This script will find the latest Google Chrome binary package, download it and repackage it into Slackware format.
#!/bin/bash
# latest-chrome Version 1.3.1
# This script will find the latest Google Chrome binary package,
# download it and repackage it into Slackware format.
# I don't use Chrome for regular browsing but it is handy for
# comparative tests against Vivaldi. :P
# Copyright 2015 Ruari Oedegaard, Oslo, Norway
@illucent
illucent / README.md
Created March 5, 2016 17:59
Local DNS cache with pdnsd. Uses DHCP configured DNS with fallback on Google DNS
  1. Installation

    $ sudo pacman -Sy
    $ sudo pacman -S pdnsd
  2. Configure pdnsd

    $ sudo vi /etc/resolvconf.conf

$ sudo vi /etc/pdnsd.conf

@illucent
illucent / jquery_handling_click_event.js
Created March 4, 2016 14:18 — forked from do9iigane/jquery_handling_click_event.js
jqueryのtapイベントハンドラについて
jQuery( ".selector" ).click(function( event ) { ... } )
//でも駄目なら
jQuery( ".selector" ).on( "tap", function( event ) { ... } )
//まだ駄目なら
jQuery( ".selector" ).live( "tap", function( event ) { ... } )