sudo find . -name "*.pdf" -print0 | sudo xargs -0 rm
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
BREAK="===============================================================";echo -ne "\n $BREAK \n \t Disk Usage for $(pwd) $(date +'%F') \n $BREAK \n\n";df -h $(pwd); echo -e '\n\n Volume Group Usage: \n'; vgs $(df -h $(pwd) | grep dev | awk '{print $1}'| cut -d\- -f1| cut -d\/ -f4); echo -e '\n'; echo -e "Largest Folders:\n"; du -xSk $(pwd) | sort -rn | head -30|awk '{printf "%d MB\t%s\n",($1/1024),$NF}' && echo -e "\n\n"; echo -e "Largest Files:\n"; find $(pwd) -mount -type f -ls|sort -rnk7 |head -30|awk '{printf "%d MB\t%s\n",($7/1024)/1024,$NF}';echo -e "\n\n Open Deleted Files:\n" ;lsof | grep $(pwd) | grep deleted| awk '{ if($7 > 1048576) print $7/1048576, "MB ",$9,$1 }' | sort -n -u | tail; echo -e "\n $BREAK" |
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
source: https://www.freelancingdigest.com/articles/capistrano-variables/ | |
application – required | |
repository – required | |
scm – defaults to :subversion | |
deploy_via – defaults to :checkout | |
revision – defaults to the latest head version | |
rails_env – defaults to ‘production’ | |
rake – defaults to ‘rake’ | |
source – Capistrano::Deploy::SCM object |
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
#!/usr/bin/env bash | |
FILES=$(find "/etc/nginx" -type f) |
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 . -type f -printf '%TY-%Tm-%Td\n' | sort | uniq -c |
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
# put branch list to file "git branch -l | grep some-filter-text > branch-list.txt" | |
# serve branch list from file | |
BRANCHES=$(cat branch-list.txt) | |
for BRANCH in $BRANCHES; do | |
git branch -d $BRANCH -f; | |
done |
Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.
The following steps assume you've got a set-up like mine, where:
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
# See http://www.rabbitmq.com/ssl.html | |
# | |
# (c) Stan Angeloff / http://www.gnu.org/licenses/agpl-3.0.html | |
SHELL := /bin/bash | |
HOSTNAME ?= $(shell hostname) | |
PASSPHRASE ?= $(shell cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
PASSPHRASE_FILE = $(HOSTNAME)/.passphrase |
tcpdump -A -s 10240 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g'
sudo tcpdump -i lo -s0 -nl -w- dst port postgres | strings -n8