Quick way to clear bash/shell history:
1 |
cat /dev/null > ~/.bash_history && history -c && exit |
#DevOps, #PHP, #Laravel & #JS.
Quick way to clear bash/shell history:
1 |
cat /dev/null > ~/.bash_history && history -c && exit |
If you have a file such as php-fpm.cgi that won’t delete no matter what you try, it’s likely immutable. You can remove the immature flag using:
1 |
chattr -i file.name |
I recently came across the git-legit project which creates a few easier to understand aliases for newcomers to Git. Head over to http://www.git-legit.org to read and install.
For a Titanium project I recently needed to install an older version of the Android SDK tools (build tools API 24) to build an old project. Find the path to sdkmanager and then run this command:
1 |
sdkmanager --install "platforms;android-24" |
List all Digital Ocean servers IPv4 addresses using doctl homebrew package:
1 |
doctl compute droplet list --format PublicIPv4 > ips.txt |
Recursively list sizes of your AWS buckets using s3cmd:
1 2 3 4 5 6 7 8 9 |
scott@atlas.local ~ s3cmd du -H -r s3:// 16:19:22 3.81335246842G 51 objects s3://ssx-general-backups/ 52.0762854349G 52 objects s3://ssx-archived-client-websites/ 189.562103216G 565 objects s3://ssx-backups-production/ 664.248046875M 1 objects s3://ssx-backups-git/ 7.44284629263G 74 objects s3://ssx-backups-servers-shared/ 238.997132301M 3579 objects s3://ssx-images/ -------- 253.776662782G Total |
Using ipinfo.io, you can quickly grab some IP data for the current machine:
1 |
curl ipinfo.io |
This will return you something like:
1 2 3 4 5 6 7 8 9 10 |
scott@atlas.local ~ curl ipinfo.io { "ip": "195.62.123.123", "city": "Stafford", "region": "England", "country": "GB", "loc": "52.8052,-2.1164", "org": "AS6717 Internet Central Limited", "postal": "ST16" } |
1 2 |
ServerSignature Off ServerTokens Prod |
1 2 3 4 5 6 7 8 9 10 11 |
<IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 30 seconds" ExpiresByType text/html "access plus 15 days" ExpiresByType image/gif "access plus 1 months" ExpiresByType image/jpg "access plus 1 months" ExpiresByType image/jpeg "access plus 1 months" ExpiresByType image/png "access plus 1 months" ExpiresByType text/js "access plus 1 months" ExpiresByType text/javascript "access plus 1 months" </IfModule> |