Skip to content

Instantly share code, notes, and snippets.

View yzf's full-sized avatar
🎯
Focusing

Jeff Yuan yzf

🎯
Focusing
  • Netease Games
  • GuangZhou, China
View GitHub Profile
@yzf
yzf / update_git_author.sh
Last active July 6, 2016 02:15
更新仓库的commit的提交者信息
#!/bin/bash
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "original_email_addr" ]
@yzf
yzf / install_parallel_tools.sh
Last active July 6, 2016 02:15
无图形界面时,安装PD tools
#!/bin/bash
umount /media/cdrom
mount -o exec /media/cdrom
cd /media/cdrom
./install
shutdown now
@yzf
yzf / fix_redis_warning.sh
Last active July 6, 2016 02:14
解决redis安装后的几个warning
#!/bin/bash
# Or add `vm.overcommit_memory=1` in `/etc/sysctl.conf` and call `sudo sysctl -p`
sudo sysctl vm.overcommit_memory=1
# Or add `echo never > /sys/kernel/mm/transparent_hugepage/enabled` in `/etc/rc.local`
sudo echo never > /sys/kernel/mm/transparent_hugepage/enabled
@yzf
yzf / add_mysql_user
Created August 8, 2016 02:56
添加mysql用户
# grant privileges for user
CREATE USER 'user_name'@'%' identified by 'password';
GRANT ALL PRIVILEGES ON db_name.* TO 'user_name'@'%';
FLUSH PRIVILEGES;
# create database pigeon
CREATE DATABASE db_name DEFAULT CHARSET utf8;
@yzf
yzf / ssh_tunnel.sh
Created August 10, 2016 02:18
ssh隧道
ssh -C -f -N -g -R remote_listen_port:destination_host:destination_port user@remote_host
@yzf
yzf / close_auto_start.sh
Created August 10, 2016 02:39
mac关闭apache开机自动启动
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
@yzf
yzf / set_up_ejabberd.sh
Last active August 20, 2016 11:17
搭建ejabberd的开发环境
# add to /etc/apt/sources.list
deb https://packages.erlang-solutions.com/debian jessie contrib
# install erlang from erlang-solution
apt-get install apt-transport-https
wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc
apt-key add erlang_solutions.asc
apt-get update
apt-get install esl-erlang
# install other deps
@yzf
yzf / set_up_hadoop.sh
Created August 25, 2016 09:08
搭建hadoop环境
# set env
export HADOOP_HOME='/home/yzf/Software/hadoop-2.7.2'
export PATH=$HADOOP_HOME/bin:$PATH
export PATH=$HADOOP_HOME/sbin:$PATH
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADDOP_HDFS_HOME=$HADOOP_HOME
export HADOOP_YARN_HOME=$HADOOP_HOME
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
@yzf
yzf / sh
Created October 31, 2016 05:02
生成自签名的证书
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
@yzf
yzf / vmware.sh
Created January 16, 2017 04:12
vmware tools
apt-get install build-essential uuid-runtime linux-headers-3.16.0-4-all