Skip to content

Instantly share code, notes, and snippets.

View heruka's full-sized avatar

Juan Taylor heruka

  • Stellenbosch, South Africa
View GitHub Profile
@heruka
heruka / linux_disk_commands.md
Last active October 16, 2023 08:00
Linux disk commands

Unmount a disk

umount /dev/sda1

Disk usage

df -h

Check disk for bad blocks

@heruka
heruka / gist:3785435892addd9f24f748789f11c66b
Created February 20, 2017 13:27
Delete files older than
find path/to/folder -name "somenameorpattern*" -mtime +numberofdays -print (if you want to see it) -exec rm {} \;
Do ls first before rm just to make sure you don't delete the universe.
find ./ -name "*" -mtime +300 -print -exec rm {} \;
@heruka
heruka / gist:7f331a5059573d3247e1b44def5a2ace
Last active February 15, 2024 14:12
Find big files and folders on Linux
To list the top 10 largest files from the current directory: du . | sort -nr | head -n10
To list the largest directories from the current directory: du -s * | sort -nr | head -n10
To list the largest directories from the current directory in human readable format:
du -sh * | sort -hr | head -n10
Credit: http://unix.stackexchange.com/questions/37221/finding-files-that-use-the-most-disk-space
@heruka
heruka / gist:503ceaf834673d7a54f8b28c345121ca
Created February 17, 2017 09:40
MySQL Workbench failing to connect using tcp over ssh
sudo apt-get install libssl-dev
sudo apt-get install python-dev
sudo pip install pycrypto --upgrade
sudo pip install paramiko --upgrade
@heruka
heruka / http.js
Created September 7, 2016 15:01
Redirecting http to https in Sails app behind AWS ELB load balancer
/**
* HTTP Server Settings
* (sails.config.http)
*
* Configuration for the underlying HTTP server in Sails.
* Only applies to HTTP requests (not WebSockets)
*
* For more information on configuration, check out:
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.http.html
*/