most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat| #import <Carbon/Carbon.h> | |
| #import <dlfcn.h> | |
| /* | |
| * Returns an array of CFDictionaryRef types, each of which contains information about one of the processes. | |
| * The processes are ordered in front to back, i.e. in the same order they appear when typing command + tab, from left to right. | |
| * See the ProcessInformationCopyDictionary function documentation for the keys used in the dictionaries. | |
| * If something goes wrong, then this function returns NULL. | |
| */ | |
| CFArrayRef CopyLaunchedApplicationsInFrontToBackOrder(void) |
| #!/bin/sh | |
| # This program has two feature. | |
| # | |
| # 1. Create a disk image on RAM. | |
| # 2. Mount that disk image. | |
| # | |
| # Usage: | |
| # $0 <dir> <size> | |
| # |
| #!/bin/bash | |
| #$Id: keepalivepin,v 1.2 2006/02/27 07:30:41 hmy Exp hmy $ | |
| #use dig check the powerdns's status. | |
| #in the dns database,have a IN TXT RR keepalivepin.vmmatrix.net,content is "AaBbCcDdEeFf" | |
| # Source: http://puppet-manifest-share.googlecode.com/svn/trunk/vmx-puppet/modules/lvs/files/keepalived.dns-pin | |
| # | |
| RR=keepalivepin.vmmatrix.net | |
| [ $# -le 1 ]&&{ echo "usage: ${0} -h <ip>"; exit 126;} | |
| while getopts "h:" OPT;do | |
| case $OPT in |
| """ | |
| Usage: python script.py search_string replace_string dir | |
| Eg. python batchreplace.py galleries productions /Sites/cjc/application/modules/productions/ | |
| And it will search recursively in dir | |
| and replace search_string in contents | |
| and in filenames. | |
| Case-sensitive | |
| """ | |
| from sys import argv |
To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
| % cat t.sh ~ | |
| #!/bin/sh | |
| test -c /dev/stdin && echo "char" | |
| test -p /dev/stdin && echo "named pipe" | |
| test -S /dev/stdin && echo "socket" | |
| test ! -f /dev/stdin && echo "not regular" | |
| test -f /dev/stdin && echo "regular" | |
| % sh ./t.sh ~ | |
| char |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| #!/usr/bin/env sh | |
| # Download lists, unpack and filter, write to stdout | |
| curl -s https://www.iblocklist.com/lists.php \ | |
| | sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| | xargs wget -O - \ | |
| | gunzip \ | |
| | egrep -v '^#' |