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
| #!/bin/bash | |
| ########################################### | |
| # | |
| # Simple Shell script to clean/remove all container/images | |
| # | |
| # The script will | |
| # - first stop all running containers (if any), | |
| # - remove containers | |
| # - remove images | |
| # - remove volumes |
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
| #!/bin/sh | |
| # Set up the Heroku scheduler to run this command every hour. See example setup at https://goo.gl/nMCSH3 | |
| # | |
| # Requires env vars to be set in Heroku with `heroku config:set`: | |
| # - HEROKU_APP_NAME: this is just the app name in Heroku, i.e. `heroku apps` will list all apps you have access to | |
| # - HEROKU_CLI_USER: Once Heroku CLI is authenticated (https://goo.gl/Qypr4x), check `cat .netrc` (or `_netrc` on Windows), | |
| # look for `login` under `machine api.heroku.com` | |
| # - HEROKU_CLI_TOKEN: As above, but use the `password` field | |
| # |
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
| #!/bin/bash | |
| # | |
| # Digital Ocean Ubuntu 16.04.6 Droplet | |
| # Running: | |
| # wget https://gist.github.com/stroebs/54fc09734a3911e91eeeb43434f117df/raw/1ede2fb162d404171122db0c84a9eeea468a92cd/make-chr.sh | |
| # chmod +x make-chr.sh | |
| # ./make-chr.sh | |
| # | |
| wget http://download2.mikrotik.com/routeros/6.37/chr-6.37.img.zip -O chr.img.zip && \ | |
| gunzip -c chr.img.zip > chr.img && \ |
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
| #!/bin/bash | |
| # This script will extract the certificate and key from an .ovpn file | |
| # into their own files, which makes it possible to use them to configure | |
| # the VPN using Ubuntu's network manager | |
| # Usage example: | |
| # >> ovpnconvert username.dev.ovpn | |
| # You can keep following these instructions here: |
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
| RewriteEngine On | |
| RewriteRule ^$ http://127.0.0.1:8080/ [P,L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule ^(.*)$ http://127.0.0.1:1337/$1 [P,L] |
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
| // https://www.compose.com/articles/finding-duplicate-documents-in-mongodb/ | |
| db.hotels.aggregate([{ $group: { _id: { hid: "$hid" }, uniqueIds: { $addToSet: "$_id" }, count: {$sum: 1} } }, {$match: {count: {"$gt": 1}}}, {$sort: {count: -1}} ]).forEach(function(doc){ db.hotels.remove({ _id: doc.uniqueIds[1] }) }); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.