Skip to content

Instantly share code, notes, and snippets.

@andretw
andretw / bind_dlz.md
Last active August 29, 2015 14:04
Bind and DLZ Memo

Bind, DLZ

  • After Bind v9.6, DLZ included.

Disable the recusive query other than internal domains or ips

acl corpnets {
  36.231.157.56/32;
  114.34.18.168/32;
}
allow-recursion { corpnets; };
@andretw
andretw / glusterfs.md
Last active August 29, 2015 14:04
GlusterFS Memo

GlsterFS

  • At least 2 instances, otherwise needs to use different ports.

Client

  1. Install glusterfs-client package

    yum install glusterfs-client
    
  2. Create mount point

@andretw
andretw / redis_memo.sh
Created July 29, 2014 07:41
Redis Memo
#
# Use daemon mode for supervisord
#
daemonize yes
#
# Save data to disk every 5 min.
#
save 300 10
@andretw
andretw / git.md
Last active September 17, 2015 04:00
Useful Git tips.

(Seems like) To move n commits (not pushed to remote branch yet) from master branch to a new branch (mynewbranch)

git branch mynewbranch        # copy current commits to the new branch
git reset --hard HEAD~1       # reset 1 commit, replace 1 to n or any other natural number you want. 

To change last commit message.

git commit --amend -m 'new message'
@andretw
andretw / hosts
Created July 23, 2014 01:47
Default /etc/hosts on Mac OS X
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
@andretw
andretw / build_fireapp_on_mac_osx.md
Last active August 29, 2015 14:03
Build Fire.app on Mac OS X
@andretw
andretw / re-position-menu.js
Created May 27, 2014 04:37
Re-position the floating menu
function rePositionMenu(){
if($(window).height() < 720){
$('.guide-sidebar').css('position', '');
}else{
$('.guide-sidebar').css('position', 'fixed');
}
}
$('document').ready(function(){
rePositionMenu();
@andretw
andretw / mac_os_x.sh
Last active August 29, 2015 14:01
Some useful tips for Mac OS X
## change the default location (path) of screen shots.
defaults write com.apple.screencapture location ~/Desktop/screenshots/
#
# Disable/Enable Spotlight
#
## Disable Spotlight
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
## Enable Spotlight
@andretw
andretw / regex_ide_search_and_replace
Last active August 29, 2015 14:01
Search and replace by RegEx in Sublime or Atom. (IDE)
# find and replace ' to \' in the middle of '@ and @' (escape)
Find What: '\@(.+)'(.+)\@'
Replace With: '@$1\\'$2@'