Skip to content

Instantly share code, notes, and snippets.

@Bigcircle
Bigcircle / gist:9477868
Last active August 29, 2015 13:57
rbenv in centos
# https://github.com/sstephenson/rbenv#installing-ruby-versions
# rbenv script
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile # echo $PATH查看是否正确
# ruby-build script,提供rbenv的所有命令
@Bigcircle
Bigcircle / centos ruby zlib
Created March 27, 2014 07:04
centos ruby zlib
# 安装zlib
yum install zlib zlib-devel
# 进入ruby源码,安装扩展
cd ruby-1.9.3-p545/ext/zlib
ruby extconf.rb
make && make install
@Bigcircle
Bigcircle / gist:9da173919147e82480a7
Created December 13, 2014 09:08
karabiner config
<?xml version="1.0"?>
<root>
<!-- 使用 Home / PageUp / PageDown 来 静音 / 增大 / 减小 音量 -->
<item>
<name>Volume Keys</name>
<appendix>Mute, Up, Down</appendix>
<identifier>remap.volumeKeys</identifier>
<autogen>
--KeyToConsumer--
KeyCode::HOME,
@Bigcircle
Bigcircle / gist:2635181
Created May 8, 2012 13:49
itunes 添加歌词
--使用说明:
--1、打开iTunes,选择要添加歌词的歌曲,可以批量选择
--2、点击脚本上的“运行”即可,整理结束时iTunes会有提示
--3、虽然脚本支持批量整理,但是程序自动化整理永远不可能那么智能,不能保证歌曲歌词全部正确,可能需要您后期再次加工
--4、如果您的歌曲中含有繁体汉字,程序无法自动搜索歌词
tell application "iTunes"
if selection is not {} then
set k to count (item of selection)
else
@Bigcircle
Bigcircle / gist:2686138
Created May 13, 2012 05:53
centos搭ror环境
# 163源
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
mv CentOS6-Base-163.repo CentOS-Base.repo
# 更新yum并立即生效
yum check-update
yum update
yum makecache
@Bigcircle
Bigcircle / gist:2686453
Created May 13, 2012 06:21
*nix下常用命令
# 在线时间统计 / 时间/ 日历
ac / date /cal
# 查看进程
ps aux|grep mysql
# 关机/重启 shutdown -r重启 -h关机后关闭电源(halt), reboot
# 显示挂载的空间列表
df -h
# 以文件大小排列来显示文件和目录
ls -lSr |more
# 估计dir1目录使用的磁盘空间
@Bigcircle
Bigcircle / gist:2686391
Last active October 4, 2015 19:27
ubuntu/mac安装rvm
# debain类linux安装ruby
sudo apt-get install curl
sudo apt-get install git
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
type rvm | head -1 # 返回rvm是个函数安装成功
rvm notes # 查找依赖包
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
rvm list # 显示现在可安装的稳定版本
rvm install 1.8.7
@Bigcircle
Bigcircle / gist:2686427
Created May 13, 2012 06:09
常用启动命令&svn&node.js
# redis开机自启动
cp /usr/local/Cellar/redis/2.4.8/homebrew.mxcl.redis.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
# 启动redmine
ruby script/server webrick -e production
# Finder 显示隐藏文件
defaults write com.apple.finder AppleShowAllFiles -bool true
# 隐藏文件
@Bigcircle
Bigcircle / gist:2698632
Created May 15, 2012 02:26
安装postfix log分析工具 pflogsumm
1 下载
postfix 地址 http://www.postfix.org/addon.html
pflogsumm下载地址 http://jimsun.linxnet.com/postfix_contrib.html
2 安装 Date::Calc
#perl -MCPAN -e shell
cpan> install Date::Calc
3 安装 pflogsumm
tar zxvf pflogsumm-1.1.0.tar.gz
@Bigcircle
Bigcircle / gist:2814261
Created May 27, 2012 13:44
some musics
kelly mack - One Last Time (chelsea 欧冠决赛)