Skip to content

Instantly share code, notes, and snippets.

@samayo
Last active October 12, 2019 10:46
Show Gist options
  • Save samayo/3adfa7d7ff8772d3b5d67161df7b56aa to your computer and use it in GitHub Desktop.
Save samayo/3adfa7d7ff8772d3b5d67161df7b56aa to your computer and use it in GitHub Desktop.

mysql

# create user
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';    
# grant all privileges    
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';   
# flush privileges   
FLUSH PRIVILEGES;   
GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;    
REVOKE type_of_permission ON database_name.table_name FROM ‘username’@‘localhost’;   
SHOW GRANTS username;
DROP USER ‘username’@‘localhost’;

GIT

git revert #SHA
git commit --amend -m "Fixes bug #42" (before push)
git checkout -- #FILENAME (before commit/add)
git reset --hard #LAST-SHA (go to previous state : before commit/add) (--hard == no recovery)

CSS

height:60vmin; width: 19vmax

UBUNTU

sudo ufw disable
find / -iname "make" 2>/dev/null 

INSTALL Node/Npm/Npx

yum install -y gcc-c++ make
sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum install nodejs
node -v 
npm -v 
npm i -g npx

docker stop/remove

docker stop $(docker ps -a -q)
winpty docker exec -it nginx bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment