This file contains 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
#!/bin/bash | |
# http://stackoverflow.com/a/32074098 | |
docker rm $(docker stop $(docker ps -a -q --filter ancestor=<IMAGE_NAME> --format="{{.ID}}")) |
This file contains 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
#!/bin/bash | |
# remove exited containers: | |
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v | |
# remove unused images: | |
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi | |
# remove unused volumes: | |
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( |
This file contains 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
jQuery('.sidebar a').each(function(){ window.open($(this).attr('href'), '_blank'); }) |
This file contains 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
# Move found files modified the 5 minutes before, depth level 1, to "DIR" directory ... | |
mv $(find ./ -maxdepth 1 -mmin -5) DIR/ |
This file contains 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
rm -rf $(find ./ -maxdepth 1 -mmin -5 -not -path './.git') |
This file contains 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
// http://stackoverflow.com/a/6432824 | |
var request = require('request'); | |
request.post({ | |
headers: {'content-type' : 'application/x-www-form-urlencoded'}, | |
url: 'http://localhost/test2.php', | |
body: "mes=heydude" | |
}, function(error, response, body){ | |
console.log(body); | |
}); |
This file contains 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
#!/bin/bash | |
rename 's/word_a/word_b/' $(find * -name "*word_a*") |
This file contains 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
# Not a really a solution, just a reminder to how "reset" docker network | |
rm -rf /var/lib/docker/network/files/local-kv.db |
This file contains 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
#/bin/bash | |
# Go back in time and apply some tests to | |
# obtain enough data to check project evolutions (QA, Perf, etc) | |
# i in range of desired days i.e: 0-70 | |
for i in {0..70} | |
do | |
# Change directory to targeted project | |
cd ~/some/project/using/git |
This file contains 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
# Install GEOS lib and GEOS php mod on PHP7 | |
# http://www.saintsjd.com/2014/06/05/howto-intsall-libgeos-with-php5-bindings-ubuntu-trusty-14.04.html | |
# /etc/php/7.0/mods-available/geos.ini | |
apt-get install -y apache2 php5 libapache2-mod-php5 php5-dev phpunit | |
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2 | |
tar -xjvf geos-3.4.2.tar.bz2 | |
cd geos-3.4.2/ | |
./configure --enable-php | |
make | |
sudo make install |