This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
word-break: keep-all; | |
overflow-wrap: break-word; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.on('SIGTERM', () => { | |
process.exit() | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm /var/folders/*/*/*/com.apple.dock.iconcache;killall Dock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find | |
sudo lsof -i :3000 | |
# Kill | |
kill -9 <PID> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 711 | |
# chroot | |
compgen -u # list all users | |
compgen -g # list all groups | |
cut -d: -f1 /etc/passwd # list local users | |
cut -d: -f1,3 /etc/passwd | egrep ':[0-9]{4}$' | cut -d: -f1 # human users | |
cat /etc/group # list all groups on system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
FLUSH PRIVILEGES; | |
GRANT type_of_permission ON database_name.table_name TO 'username'@'localhost'; | |
REVOKE ~ ; | |
-- ALL PRIVILEGES- as we saw previously, this would allow a MySQL user full access to a designated database (or if no database is selected, global access across the system) | |
-- CREATE- allows them to create new tables or databases | |
-- DROP- allows them to them to delete tables or databases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture> | |
<source srcset="image-night.jpg" media="(prefers-color-scheme: dark)"> | |
<img src="image-day.jpg"> | |
</picture> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# view | |
nano /var/log/syslog | |
# clear | |
sudo truncate -s 0 /var/log/syslog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# user specific crontab | |
# edit crontab | |
crontab -e | |
# view the contents of crontab | |
crontab -l | |
# erase crontab | |
# WARNING: The following command will not ask you to confirm that you want to erase your crontab. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name example.com; | |
# optional | |
client_max_body_size 100M; | |
# remove ending / | |
# [warn] it may not need for Next.js | |
# [warn] it may generate an error when establish socket.io connection | |
# rewrite ^/(.*)/$ /$1 permanent; |
NewerOlder