Skip to content

Instantly share code, notes, and snippets.

View chouyang's full-sized avatar
🐑
Mie~~

丑羊v3 chouyang

🐑
Mie~~
View GitHub Profile
@chouyang
chouyang / bash_profile.sh
Created July 24, 2018 07:36
[my bash_profile] #bash
# sys env
export PATH="/usr/local/sbin:/Users/{user_name}/.composer/vendor/bin:$PATH"
export PATH="/Users/{user_name}/.go/bin:$PATH"
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# app env
export PGDATA=/usr/local/postgres
export GOROOT=/usr/local/Cellar/go/1.10.2/libexec
export GOPATH=$HOME/.go
export NODE_PATH="/usr/local/lib/node_modules"
@chouyang
chouyang / tgz.sh
Created July 24, 2018 07:27
[compress and delete files] compress and delete files using tar command #tar #tgz
#!/bin/bash
if [ $# -eq 0 ]; then
echo "No arguments supplied."
exit
fi
if [ -n "$2" ]; then # if second argument exists
if [ -e "$2" ]; then # if second argument is a valid path
if [ -d "$2" ]; then # if second argument is a directory
@chouyang
chouyang / initialize.sh
Last active July 25, 2018 01:04
[Initialize mysql database]Initial setup for newly install mysql instance #mysql
# grep initial password for version 5.7 and above
grep 'temporary password' /var/log/mysqld.log
# reinitialize database (create database directories and system databases)
mysqld --initialize --console
# set new password (no hash function or password function called)
set password = 'new password';
# do as it says