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
-- PostgreSQL cheat sheet | |
--postgres is set up to use local.6 which is syslog'd to sflog001 | |
--slow query log is /var/log/localmessages | |
--config files are always in /data/friend/*.conf | |
--vacuums are set via cfengine, we use both manual and auto. vacuums/analyze help with frozen id's being recouped, and thus TX'id's not going over 2b thus causing massing shutdown/reset. Fix it to exp/imp high TX tables. | |
--to log into psql: psql -U postgres -d <DB> (usually friend) |
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
###### | |
# Author: Marcello de Sales ([email protected]) | |
# Description: Create Environment Variables in EC2 Hosts from EC2 Host Tags | |
# | |
### Requirements: | |
# * Install jq library (sudo apt-get install -y jq) | |
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825) | |
# | |
### Installation: | |
# * Add the Policy EC2:DescribeTags to a User |
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
# Moved to https://github.com/elifarley/docker-jenkins-uidfv/blob/master/hgbkp-jenkins.hgignore |
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
-- num <= 430804206899405823: <= 10 digits | |
-- num > 430804206899405823: 11 digits | |
CREATE FUNCTION opb58enc (@num bigint) RETURNS char(11) WITH SCHEMABINDING AS | |
BEGIN | |
DECLARE @alphabet char(58) = '0123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz' | |
DECLARE @encoded varchar(11) | |
DECLARE @divisor bigint | |
DECLARE @mode int = 0 | |
SET @encoded = '' |
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
JIRA_REST_URL="${JIRA_REST_URL:-https://MYCOMPANY.jira.com/rest/api/2}" | |
JIRA_CREDENTIALS="${JIRA_CREDENTIALS:-user:password}" | |
# https://developer.atlassian.com/jiradev/api-reference/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-discovering-meta-data-for-creating-issues | |
# https://MYCOMPANY.jira.com/rest/api/2/issue/createmeta?projectKeys=MYPROJ&issuetypeNames=MyIssueType&expand=projects.issuetypes.fields | |
# customfield_10171: My Custom Field Name 1 | |
# customfield_10172: My Custom Field Name 2 | |
# This methods create a new issue of type 'MyIssueType' in project 'MYPROJ' with 2 custom fields |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
> load('functions.js') | |
> db.stuff.drop() | |
false | |
> db.stuff.insert({value:1}) | |
> db.stuff.insert({value:2}) | |
> db.stuff.insert({value:2}) | |
> db.stuff.insert({value:2}) | |
> db.stuff.insert({value:3}) | |
> db.stuff.mapReduce(map, reduce, {finalize:finalize, out:{inline:1}}).results[0] | |
{ |