Skip to content

Instantly share code, notes, and snippets.

@Chubby-Chocobo
Last active September 19, 2018 05:43
Show Gist options
  • Save Chubby-Chocobo/2bfe14cd40941e047f5441b24704ac8f to your computer and use it in GitHub Desktop.
Save Chubby-Chocobo/2bfe14cd40941e047f5441b24704ac8f to your computer and use it in GitHub Desktop.
Don't want to google anytime I need them

Download file from Gooogle Drive by wget command

$ wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=INPUT_FILE_ID_HERE' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=INPUT_FILE_ID_HERE" -O chain.acc && rm -rf /tmp/cookies.txt

Laravel update permission for cache/storage folders when selinux is on

# sudo chmod -R +w storage
# sudo chmod -R +w bootstrap/cache
# sudo chcon -t httpd_sys_rw_content_t -R storage
# sudo chcon -t httpd_sys_rw_content_t bootstrap/cache
# sudo setsebool -P nis_enabled

List files and folders' size

$ du -hs .[!.]* * | sort -hr

Cronjob to backup MySQL daily

39 02 * * * mysqldump -uUSER -pPASSWORD --databases DB_NAME | gzip > /data/FILENAME_`date "+\%Y-\%m-\%d_\%H-\%M-\%S"`.sql.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment