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
| --- | |
| - name: ensure required packages are installed for Java 7 | |
| apt: name=$item state=latest update_cache=yes | |
| with_items: | |
| - python-software-properties | |
| - name: Add Java repository to sources | |
| action: apt_repository repo='ppa:webupd8team/java' |
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
| # | |
| # A CORS (Cross-Origin Resouce Sharing) config for nginx | |
| # | |
| # == Purpose | |
| # | |
| # This nginx configuration enables CORS requests in the following way: | |
| # - enables CORS just for origins on a whitelist specified by a regular expression | |
| # - CORS preflight request (OPTIONS) are responded immediately | |
| # - Access-Control-Allow-Credentials=true for GET and POST requests |
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
| pdftk original.pdf output uncompressed.pdf uncompress | |
| LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf | |
| pdftk stripped.pdf output final.pdf compress |
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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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 | |
| # A simple script to backup an organization's GitHub repositories. | |
| #------------------------------------------------------------------------------- | |
| # NOTES: | |
| #------------------------------------------------------------------------------- | |
| # * User @jimklimov (and probably some others called out in the long comment | |
| # thread below) have modified this script to make it more robust and keep | |
| # up with various changes in the GitHub API and response format at: | |
| # https://github.com/jimklimov/github-scripts |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
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 | |
| # SPDX-License-Identifier: MIT | |
| ## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> | |
| ## | |
| ## This script is licensed under the terms of the MIT license. | |
| ## https://opensource.org/licenses/MIT | |
| # | |
| # Lockable script boilerplate | |