Skip to content

Instantly share code, notes, and snippets.

Avatar

Lattapon Yodsuwan clozed2u

View GitHub Profile
@clozed2u
clozed2u / uninstallgems.sh
Created Feb 3, 2014
Uninstall all ruby gems.
View uninstallgems.sh
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
@clozed2u
clozed2u / mysql.md
Last active Aug 29, 2015
Manaully install mysql on OS X from binary.
View mysql.md

#Install MySQL from binary on Maverick.

  1. Download MySQL from http://dev.mysql.com/downloads/mysql/
  2. Extract, rename folder, and place into directory you want.
  3. Add MySQL's bin and MySQL's man to your $PATH and $MANPATH.
  4. Go to scripts directory and execute mysql_install_db with parameters you want. For example
    ./mysql_install_db --verbose
    --user=clozed2u
    

--basedir=/usr/local/mysql

@clozed2u
clozed2u / vim.sh
Last active Aug 29, 2015
Compiled vim on os x.
View vim.sh
./configure --prefix=/usr/local --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-perlinterp=yes --enable-luainterp --with-luajit --enable-multibyte --disable-gui --with-tlib=ncurses --with-features=huge --with-compiledby=i@clozed2u.com --without-x --enable-cscope && make && make install
@clozed2u
clozed2u / tmux.md
Created Aug 27, 2014
Manual install tmux on os x
View tmux.md

Download Libevent and Tmux.

mkdir ~/build
cd ~/build
curl -OL http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
curl -OL http://downloads.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.16-stable.tar.gz
@clozed2u
clozed2u / uninstallnodemodule.sh
Created Oct 11, 2014
Uninstall all node modules globally except for npm
View uninstallnodemodule.sh
npm -g ls | grep -v 'npm@' | awk '/@/ {print $2}' | awk -F@ '{print $1}' | xargs npm -g rm
@clozed2u
clozed2u / prompt_colors.sh
Created Nov 26, 2014
Display 256 colors in your terminal.
View prompt_colors.sh
for code in {0..255}; do echo -e "\e[38;05;${code}m $code: Test"; done
View iTermColorsToTerminalColors.swift
#!/usr/bin/xcrun swift
import AppKit
enum iTermColors: String {
case Ansi0 = "Ansi 0 Color"
case Ansi1 = "Ansi 1 Color"
case Ansi2 = "Ansi 2 Color"
case Ansi3 = "Ansi 3 Color"
case Ansi4 = "Ansi 4 Color"
View uninstall_java.sh
#!/usr/bin/env bash
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk*
sudo rm -rf /Library/PreferencePanes/Java*
sudo rm -rf /Library/Internet\ Plug-Ins/Java*