This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Chroot Part of ArchLinux Virtualbox Guest Install Script | |
# timezone and hwclock | |
echo 'Asia/Shanghai' > /etc/timezone | |
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |
# hardware clock in local time | |
hwclock --systohc --localtime | |
# hostname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# LiveISO Part of ArchLinux Virtualbox Guest Install Script | |
# system clock | |
# date `date +%m%d%H%M%Y.%S --date='-8 hour'` | |
ntpdate time.asia.apple.com | |
# partitions | |
sgdisk --zap-all /dev/sda | |
sgdisk \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from UserDict import IterableUserDict | |
import collections | |
__author__ = 'github.com/hangtwenty' | |
def tupperware(mapping): | |
""" Convert mappings to 'tupperwares' recursively. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import DBus | |
import DBus.Client | |
spotifyCtrl :: Client -> MemberName -> X () | |
spotifyCtrl client command = liftIO $ do | |
call_ client | |
(methodCall "/org/mpris/MediaPlayer2" "org.mpris.MediaPlayer2.Player" command) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.18556660413742065</real> | |
<key>Green Component</key> | |
<real>0.21965453028678894</real> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
####################################################################### | |
# this is a helper script that keeps SnapRAID parity info in sync with | |
# your data. Here's how it works: | |
# 1) it first calls diff to figure out if the parity info is out of sync | |
# 2) if there are changed files (i.e. new, changed, moved or removed), | |
# it then checks how many files were removed. | |
# 3) if the deleted files exceed X (configurable), it triggers an | |
# alert email and stops. (in case of accidental deletions) | |
# 4) otherwise, it will call sync. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SCRIPT_PATH=$(readlink -f ${BASH_SOURCE[0]}) | |
WD=$(dirname ${SCRIPT_PATH}) | |
export PW_HOME=${WD} | |
if [[ -f ~/anaconda/bin/activate ]];then | |
source ~/anaconda/bin/activate ~/anaconda | |
fi | |
INST_CACHE_ROOT=~/.pw_install_cache | |
function check_if_updated() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Render any jsonnet value (except functions) to TOML format. | |
local | |
inlineTable(body) = | |
"{" + | |
std.join(", ", ["%s = %s" % [escapeKeyToml(k), renderBody(body[k])] for k in std.objectFields(body)]) + | |
"}", | |
renderArray(body) = | |
local |
OlderNewer