Skip to content

Instantly share code, notes, and snippets.

@bumaociyuan
bumaociyuan / private.xml
Created January 27, 2016 07:53
ignore karabiner in xcode
<?xml version="1.0"?>
<root>
<replacementdef>
<replacementname>EMACS_MODE_IGNORE_APPS</replacementname>
<replacementvalue>
EMACS,
TERMINAL,
VI,
XCODE,
</replacementvalue>
@bumaociyuan
bumaociyuan / resolve.md
Last active January 23, 2016 07:29
设备忙的解决办法

这时使用umount 命令,会提示设备忙,无法挂载。

处理方法: Linux umount 报 device is busy 的处理方法

[root@qs-wg-db1 ~]# fuser -km /datatmp
[root@qs-wg-db1 ~]# df -lh

Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb3 125G 3.3G 115G 3% /
@bumaociyuan
bumaociyuan / gist.md
Last active June 4, 2017 11:31
Stuck on `Authenticating with the App Store...`
@bumaociyuan
bumaociyuan / go1.4arc65-ubuntu.sh
Last active September 23, 2015 08:02 — forked from einthusan/go1.4arc65-ubuntu.sh
Install Golang 1.4.1 on Ubuntu 14.04 AWS EC2
#!/bin/sh
# OPTIONAL FLAGS:
#
# -geoip true
# this will install maxmind geoip and auto update crontab file
#
# -cloudwatch true
# this will install aws cloud watch metrics and send them to aws dashboard
#
@bumaociyuan
bumaociyuan / jxaClickAppSubMenuItem.applescript
Last active September 15, 2023 14:24 — forked from RobTrew/jxaClickAppSubMenuItem.applescript
Yosemite JXA Javascript Function for clicking application sub-menu items
// Click an OS X app sub-menu item
// 2nd argument is an array of arbitrary length (exact menu item labels, giving full path)
// e.g. menuItemClick("InqScribe", ['View', 'Aspect Ratio', 'Use Media Ratio'])
// Note that the menu path (spelling & sequence) must be exactly as in the app
// See menuItemTestClick() below for a slower version which reports any errors
// For OS X 10.10 Yosemite JXA JavaScript for Automation
@bumaociyuan
bumaociyuan / debian_shadowsocks.sh
Created August 31, 2015 01:11
Simply install ss on debian
#! /bin/bash
#===============================================================================================
# System Required: Debian or Ubuntu (32bit/64bit)
# Description: Install Shadowsocks(libev) for Debian or Ubuntu
# Author: tennfy <admin@tennfy.com>
# Intro: http://www.tennfy.com
#===============================================================================================
clear
echo "#############################################################"
@bumaociyuan
bumaociyuan / gist:b6fe9ac3378395e28c88
Last active August 29, 2015 14:26 — forked from palimondo/gist:5998280
Concise Auto Layout macros
#define Left NSLayoutAttributeLeft
#define Right NSLayoutAttributeRight
#define Top NSLayoutAttributeTop
#define Bottom NSLayoutAttributeBottom
#define Leading NSLayoutAttributeLeading
#define Trailing NSLayoutAttributeTrailing
#define Width NSLayoutAttributeWidth
#define Height NSLayoutAttributeHeight
#define CenterX NSLayoutAttributeCenterX
#define CenterY NSLayoutAttributeCenterY
@bumaociyuan
bumaociyuan / rename
Created October 25, 2014 16:58
rename files extension
#! /bin/bash
cd `dirname $0`
files=$(find . -name *markdown)
echo $files
for file in { $files }
do
echo $file
fileWithoutUnderbar=${file%markdown}
@bumaociyuan
bumaociyuan / auto create blog template
Created October 25, 2014 16:58
自动生成blog 模板
#! /bin/bash
#cd current path
cd `dirname $0`
#get post name
postName=$1
#split post name with '-'
array=(${postName//,/})
@bumaociyuan
bumaociyuan / gist:1cbe45a3fcf392e1e054
Created October 17, 2014 06:12
apple script get the front window path
tell application "Finder"
set myWin to window 1
set theWin to (quoted form of POSIX path of (target of myWin as alias))
tell application "Terminal"
activate
tell window 1
do script "cd " & theWin
-- do script "cd " & theWin & ";ls -al | more"
end tell
end tell