Skip to content

Instantly share code, notes, and snippets.

augroup CursorLineOnlyInActiveWindow
autocmd!
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
augroup END
@hyperwang
hyperwang / yosemite ntfs read+write.txt
Created October 18, 2015 06:15 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@hyperwang
hyperwang / install_jenkins_plugins.sh
Last active January 12, 2016 03:28 — forked from basmussen/install_jenkins_plugins.sh
Install Jenkins plugins
#!/bin/bash
user='USER_NAME'
token='API_TOKEN_OF_USER'
host='http://'$user':'$token'@localhost:8080'
url=/pluginManager/installNecessaryPlugins
# git plugin https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
curl -X POST -d '<jenkins><install plugin="git@2.0" /></jenkins>' --header 'Content-Type: text/xml' $host$url
# artifactory plugin https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+Plugin
@hyperwang
hyperwang / default
Created April 21, 2016 04:16 — forked from mzsanford/default
Init script and defaults file for etcd on Ubuntu
# Set the pper listening address
# export ETCD_PEER_ADDR=127.0.0.1:7001
# Set other command line options like the name and discovery url
# from https://discovery.etcd.io/new
# export ETCD_OPTS="-name=name_here -discovery=https://discovery.etcd.io/token_here"
export ETCD_OPTS=""
@hyperwang
hyperwang / _service.md
Created April 28, 2016 09:17 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@hyperwang
hyperwang / 0_reuse_code.js
Created March 20, 2017 08:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console