记住密码(15分钟)
git config --global credential.helper cache
长期记住密码
git config --global credential.helper store
记住密码(15分钟)
git config --global credential.helper cache
长期记住密码
git config --global credential.helper store
visudo
%wheel ALL=(ALL) NOPASSWD: ALL
yum groupinstall "Development tools" -y
yum install nautilus-open-terminal
setenforce 0
vi /etc/selinux/config
SELINUX=disabled
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
yum install vim git hg subversion
yum install mariadb nginx php-cli php-devel php-mbstring php-opcache php-mysqlnd php-intl php-mcrypt php-pdo php-xml php-pecl-memcache php-pecl-redis php-pecl-sphinx php-pecl-zip php-pgsql php-xdebug php-gd php-pecl-redis php-pecl-imagick php-fpm
yum install python-virtualenv pyvenv ~/py cd ~/py/bin source activate wget https://bootstrap.pypa.io/get-pip.py python get-pip.py
wget http://golang.org/dl/go1.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.3.linux-amd64.tar.gz
mkdir ~/gosrc
vim ~/.bash_profile
设置GOROOT与GOPATH
GOPATH=$HOME/gosrc
GOROOT=/usr/local/go
export GOROOT
export GOPATH
PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export PATH
vi /etc/sysctl.conf
fs.file-max = 500000
vi /etc/security/limits.conf
* soft nofile 60000
* hard nofile 60000
vi /etc/security/limits.d/90-nproc.conf
* soft nproc 4096
root soft nproc unlimited
go get github.com/mattn/go-sqlite3
时失败,提示exec: "gcc": executable file not found in %PATH%
,是因为没有安装gcc。
去http://tdm-gcc.tdragon.net/download下载一个,32位windows下载 tdm-gcc-4.8.1-3.exe,64位下载 tdm64-gcc-4.8.1-3.exe
# sudo visudo
your_user_name ALL=(ALL) NOPASSWD: ALL
原因是被后面的group的设置覆盖了,需要把group的设置也改为nopasswd
%wheel ALL=(ALL) NOPASSWD: ALL
go get -u packageurl
goose是一个golang的数据库迁移工具
go get bitbucket.org/liamstask/goose/cmd/goose
mkdir db
# vim db/dbconf.yml
development:
driver: mymysql
open: dbname/username/password
import: github.com/ziutek/mymysql/godrv
dialect: mysql
goose create init sql
goose up
goose down
goose redo
goose status
-- +goose Up
CREATE TABLE post (
id int NOT NULL,
title text,
body text,
PRIMARY KEY(id)
);
-- +goose Down
DROP TABLE post;