Skip to content

Instantly share code, notes, and snippets.

View khsing's full-sized avatar
🎯
Focusing

Guixing Bai khsing

🎯
Focusing
View GitHub Profile
{
"template" : "logstash*",
"settings" : {
"index.refresh_interval" : "5s",
"analysis" : {
"analyzer" : {
"default" : {
"type" : "standard",
"stopwords" : "_none_"
}
#!/sh/bash
cd /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/
for f in DefaultFontFallbacks.plist CTPresetFallbacks.plist;do
plutil -convert xml1 -o - $f| sed 's/STHeitiSC-Light/HiraginoSansGB-W3/g' | sudo plutil -convert binary1 -o $f -
plutil -convert xml1 -o - $f| sed 's/STHeitiSC-Medium/HiraginoSansGB-W6/g' | sudo plutil -convert binary1 -o $f -
done
sudo atsutil databases -remove
target=/var/www/html/deploy/package/wordpress-$WP_VERSION.tgz
md5file=$target.md5
tar zcvf $target wordpress-$WP_VERSION
md5sum $target | cut -d\ -f 1 > $md5file
echo $WP_VERSION > /var/www/html/deploy/lastver
@khsing
khsing / mactips.sh
Last active December 23, 2015 21:29
some hacks for mac
#!/bin/bash
# curl -skL https://gist.github.com/khsing/6697187/raw/mactips.sh | bash
# "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Allow Finder quit.
defaults write com.apple.finder QuitMenuItem -bool true
@khsing
khsing / Markdown.pl.patch
Created August 21, 2012 10:38
patch to support strike for MT's markdown
--- mt.bk/plugins/Markdown/Markdown.pl 2012-05-10 05:03:28.000000000 -0400
+++ mt/plugins/Markdown/Markdown.pl 2012-08-21 04:29:37.000000000 -0400
@@ -971,6 +971,10 @@
$text =~ s{ (\*|_) (?=\S) (.+?) (?<=\S) \1 }
{<em>$2</em>}gsx;
+ # These lines added by Bill Eccles, 2008-07-04
+ $text =~ s{ (\s) (~~) (?=\S) (.+?) (?<=\S) (~~) }
+ {$1<strike>$3</strike>}gsx;
+
@khsing
khsing / hack.sh
Created April 5, 2012 04:10 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Info:
Latest version: http://forums.gentoo.org/viewtopic-p-6183606.html#6183606
xeffects thread: http://forums.gentoo.org/viewtopic-t-511382.html
Alternative: https://wiki.ubuntu.com/Fonts
http://wiki.archlinux.org/index.php/XOrg_Font_Configuration
http://antigrain.com/research/font_rasterization/index.html
#!/bin/sh
#
# Created by Bjorn Nelson 051222
#
# Description: fetch distfiles (more up to date then mirroring freebsd mirrors)
# Set these variables
PORTSDIR="/usr/ports"
IGNOREFILES=". Tools work files Mk Templates distfiles"
SUBPROC=30
#!/bin/sh
cd `dirname $0`
LOG=/tmp/yummirror.log
echo "Start at:: `date \"+%Y-%m-%d %H:%M:%S\"`" > $LOG
for os_ver in 4 5;do
for os_arch in i386 x86_64;do
for centos_repo in os updates;do
mkdir -pv centos/$os_ver/$centos_repo/$os_arch 2>&1 >> $LOG
rsync -rtv rsync://ftp.heanet.ie/pub/centos/RPM-GPG-KEY-CentOS-$os_ver centos/ 2>&1 >> $LOG
rsync -rtv rsync://ftp.heanet.ie/pub/centos/$os_ver/$centos_repo/$os_arch centos/$os_ver/$centos_repo/ 2>&1 >> $LOG