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
# This hook depends on helm creating the target namespace if it doesn't exist | |
# before the hook is called. This is the case on Helm v2.9.1 | |
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: label-ns | |
namespace: cicd | |
labels: | |
release: {{ .Release.Name }} | |
heritage: {{ .Release.Service }} |
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
[GET] Started GET "/v1/conferences/ws17/attendances?auth_token=eyJ0e...&per_page=250" for 213.233.132.168 at 2017-10-02 10:27:54 +0000 | |
[GET] Started GET "/v1/conferences/ws17/timeslots?auth_token=eyJ0e..." for 213.233.132.168 at 2017-10-02 10:27:54 +0000 | |
[GET] Started GET "/v1/conferences/ws17/me/appearances/popular?auth_token=eyJ0e...&q=pass" for 213.233.132.168 at 2017-10-02 10:27:54 +0000 | |
[GET] Started GET "/v1/conferences/ws17/me/attendances/personalised?auth_token=eyJ0e...&q=pass" for 213.233.132.168 at 2017-10-02 10:27:55 +0000 | |
[GET] Started GET "/v1/conferences/ws17/timeslot_locations?auth_token=eyJ0e..." for 213.233.132.168 at 2017-10-02 10:27:55 +0000 | |
[GET] Started GET "/v1/conferences/ws17/me/attendances/popular?auth_token=eyJ0e...&q=pass" for 213.233.132.168 at 2017-10-02 10:27:55 +0000 | |
[GET] Started GET "/v1/conferences/ws17/attendances?auth_token=eyJ0e...&per_page=250" for 213.233.132.168 at 2017-10-02 10:27:55 +0000 | |
[GET] Started GET "/v1/conferences/ws17/me/appearances/popular?auth_token=eyJ0e. |
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
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
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
$redis = Redis.new | |
keys = $redis.keys('*') | |
keys_with_values = keys.inject({}) do |kwv, key| | |
type = $redis.type(key) | |
value = $redis.get(key) if type == 'string' | |
value = $redis.scard(key) if type == 'set' | |
value = $redis.hkeys(key) if type == 'hash' | |
value = $redis.llen(key) if type == 'list' |
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 | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the branch/status of the current git repository | |
# * the branch of the current subversion repository | |
# * the return value of the previous command | |
# | |
# USAGE: |
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
#!bash | |
# | |
# bash/zsh completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# |
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
### | |
Pokemon Go(c) MITM node proxy | |
by Michael Strassburger <[email protected]> | |
This example just dumps all in-/outgoing messages and responses | |
### | |
PokemonGoMITM = require './lib/pokemon-go-mitm' |
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
nodes=(rs0p rs0s) | |
for i in "${nodes[@]}"; do ssh -ti ~/.ec2/your_aws_key_pair.pem "ec2-user@$i.onliquid.com" 'sudo touch /etc/init.d/disable-transparent-hugepages && sudo bash -c "echo \"#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: disable-transparent-hugepages | |
# Required-Start: $local_fs | |
# Required-Stop: | |
# X-Start-Before: mongod mongodb-mms-automation-agent | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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
/** | |
* MongoDB Shell mongos helper functions and custom prompt | |
* | |
* https://gist.github.com/jasoares/3b21af33a7d62263010f | |
*/ | |
sh.getBalancerSummary = function(since) { | |
// 24 hours by default | |
since = since || new Date(ISODate().getTime() - 1000 * 60 * 60 * 24); | |
print("Printing Summary since " + since); |
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
var hugeCollections = db.chunks.aggregate([{ '$group': { _id: { ns: '$ns', shard: '$shard' }, count: { '$sum': 1 } } }, { '$match': { count: { '$gt': 100 } } }, { '$group': { _id: { ns: '$_id.ns' }, count: { '$max': '$count' } } }, { '$project': { _id: 0, coll: '$_id.ns', shard: '$_id.shard', count: '$count' } }, { '$sort': { count: -1 } }]); while(hugeCollections.hasNext()) { var coll = hugeCollections.next()['coll']; sh.enableBalancing(coll); } | |
var allCollections = db.collections.find(); while(allCollections.hasNext()) { var coll = allCollections.next()['_id']; sh.disableBalancing(coll); } | |
var allCollections = db.collections.find(); while(allCollections.hasNext()) { var coll = allCollections.next()['_id']; if(db.getSiblingDB('config').collections.findOne({ _id: coll }).noBalance == false) { print(coll + ': ' + db.getSiblingDB('config').collections.findOne({ _id: coll }).noBalance); } } | |
db.chunks.aggregate([{ '$match': { _id: /db_name/ } }, { '$group': { _id: { ns: '$ns', shard: '$shard' }, count: { '$sum': |
NewerOlder