Skip to content

Instantly share code, notes, and snippets.

@demoriz
Last active May 16, 2024 12:43
Show Gist options
  • Save demoriz/ad7ed64b23750a94fb66197f9f462e73 to your computer and use it in GitHub Desktop.
Save demoriz/ad7ed64b23750a94fb66197f9f462e73 to your computer and use it in GitHub Desktop.
linux server #shell
df -h
du -sh upload/
tar cfvz upload.tgz upload/ > /dev/null
tar cfvj upload.tbz2 upload/ > /dev/null
tar xfvz upload.tgz > /dev/null
tar xfvj upload.tbz2 > /dev/null
ssh-keygen -t ed25519 -C "mail@profycode.pro"
screen -S bla
screen -r
screen -ls
Ctr + A, D Detach
https://eax.me/screen/
grep -lir "user" /etc/passwd
ssh-keygen
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
chmod 400 ~/.ssh/id_rsa
setfacl -R -m d:g:demoriz:rwx,g:demoriz:rwx /var/www/demoriz.ks.saydanke.ru/
setfacl -R -m d:u:demoriz:rwx,u:demoriz:rwx /var/www/demoriz.ks.saydanke.ru/
systemctl restart php-fpm
systemctl restart nginx
mysqldump --no-tablespaces --skip-add-drop-table --skip-add-locks --no-create-info --replace --user=root --password='111' bla > bla.sql
mysqladmin --user=root --password='111' create bla
mysql --user=root --password='111' bla < bla.sql
SELECT host, user, password FROM mysql.user;
SHOW DATABASES;
CREATE DATABASE IF NOT EXISTS dbaaa;
CREATE DATABASE dbaaa DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER newuser@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON dbaaa.* TO newuser@localhost;
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment