Skip to content

Instantly share code, notes, and snippets.

@xiaoysh8
xiaoysh8 / nginx virtual host
Last active July 31, 2017 03:07
Nginx Virtual Host
server {
listen 80;
server_name localhost;
root /vagrant/Code/october/public;
index index.html index.htm index.php;
charset utf-8;
location / {
@xiaoysh8
xiaoysh8 / getcomposer
Created July 24, 2017 03:29
composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
@xiaoysh8
xiaoysh8 / good site
Last active August 20, 2017 05:00
good site
http://weaintplastic.github.io/web-development-field-guide
https://learninglaravel.net/resources
https://laravel-news.com/category/laravel-tutorials
https://ruhighload.com/
https://tekslate.com/mysql-optimization-tutorial/
https://github.com/unicodeveloper/awesome-opensource-apps
https://learn-anything.xyz/
http://docs.rightscale.com/
http://www.studytonight.com/
@xiaoysh8
xiaoysh8 / mysql remote access
Last active January 15, 2019 02:01
mysql remote access
1 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Out of the box, MySQL will only allow access from the localhost address 127.0.0.1. To change this, you need to open the /etc/mysql/mysql.conf.d/mysqld.cnf file and change the line:
2 bind-address = 127.0.0.1
to
@xiaoysh8
xiaoysh8 / config
Last active November 23, 2018 09:13
git
/** git 配置 */
git config --global user.name "edward"
git config --global http.sslVerify false
/** git 下载远程仓库分枝 */
git remote add origin https://github.com/user/repo.git
git fetch origin
git checkout branch
/** 修改远程仓库 */
@xiaoysh8
xiaoysh8 / config
Last active August 4, 2017 23:59
nginx
location /shop/ {
proxy_pass http://shop.jvawa.com/;
proxy_buffers 8 24k;
proxy_buffer_size 2k;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host:$server_port;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
/**
* 创建数据表
* create database ami8 default charset utf8 collate utf8_general_ci;
* 创建用户
* create user ami8@localhost identified by 'amibaplus2016';
* 授权
* grant all on ami8.* to ami8@localhost with grant option;
* 刷新权限
* flush privileges;
*
@xiaoysh8
xiaoysh8 / git
Last active November 23, 2018 06:28
git ignore
How to ignore changed files (temporarily)
In order to ignore changed files to being listed as modified, you can use the following git command:
git update-index --assume-unchanged <file>
To revert that ignorance use the following command:
git update-index --no-assume-unchanged <file>
//回到从前
@xiaoysh8
xiaoysh8 / reset mysql root password
Created September 26, 2017 15:45
reset mysql root password
First things first. Log in as root and stop the mysql daemon. Now lets start up the mysql daemon and skip the grant tables which store the passwords.
mysqld_safe --skip-grant-tables
You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password.
mysql --user=root mysql
update user set Password=PASSWORD('new-password') where user='root';
flush privileges;
exit;
@xiaoysh8
xiaoysh8 / find process and kill
Created September 26, 2017 23:28
find process and kill
ps a | grep ****
kill -9 ****