Skip to content

Instantly share code, notes, and snippets.

@armancohan
armancohan / compress.md
Last active April 10, 2024 12:09
compress large directory with tar, show progress

You need to have pv installed.

Command:

tar -cf - [Source directory] -P | pv -s $(du -sb [Source dir] | awk '{print $1}') | gzip > [Dest tar.gz file]

Example:

tar -cf - dir/ -P | pv -s $(du -sb dir/ | awk '{print $1}') | gzip > file.tar.gz
@shakhmehedi
shakhmehedi / bash_backup_all_mysql_databases.sh
Created September 2, 2016 19:00
Bash scripts to backup all databases in a MySQL server with the option to exclude some databases.
#!/usr/bin/env bash
#This script backups selected databases in local MySQL server
#REQUIREMENTS
##mysqldump gzip
##mysql database has no root password. This script uses 'root' MySQL user without password as no 'root' password is set.
##This is not good practice. User with more restrictive permission should be used.
#set database user
@tobek
tobek / get-image-urls.js
Last active June 18, 2024 19:24
Save images from chrome inspector/dev tools network tab
/* open up chrome dev tools (Menu > More tools > Developer tools)
* go to network tab, refresh the page, wait for images to load (on some sites you may have to scroll down to the images for them to start loading)
* right click/ctrl click on any entry in the network log, select Copy > Copy All as HAR
* open up JS console and enter: var har = [paste]
* (pasting could take a while if there's a lot of requests)
* paste the following JS code into the console
* copy the output, paste into a text file
* open up a terminal in same directory as text file, then: wget -i [that file]
*/