influx -username <username> -password <password>
SHOW DATABASES
use <dbname>
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 | |
TMPFILE=`mktemp /tmp/vipe.bashXXXXXXXX` | |
command="ls" | |
$(command) > ${TMPFILE} | |
confirm_changes_and_update() { | |
while true; do |
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
# Put this file to /etc/monit.d/mongo | |
check process mongod with pidfile /var/run/mongodb/mongod.pid | |
group mongod | |
start program = "/etc/init.d/mongod start" | |
stop program = "/etc/init.d/mongod stop" | |
if failed host localhost port 27017 type TCP with timeout 15 seconds then restart | |
if 5 restarts within 5 cycles then timeout |
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
/var/log/mongodb/*.log { | |
daily | |
rotate 3 | |
copytruncate | |
delaycompress | |
compress | |
dateext | |
notifempty | |
missingok | |
} |
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
# List mongo collections with count, size and storageSize. Output format is csv | |
# Usage: | |
# mongo export_mongo_collection_size.js --eval "var dbName = 'something'" | |
const conn = new Mongo(); | |
const database = conn.getDB(dbName); | |
const collectionNames = database.getCollectionNames(); | |
const fields = [ | |
"count", |
- Open keybindings
- cmd+k cmd+s
- Install extensions
- shift+cmd+x
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
require 'sshkit' | |
require 'sshkit/dsl' | |
include SSHKit::DSL | |
require 'aws-sdk' | |
region = 'us-west-2' | |
user = 'ec2-user' | |
ssh_options = { | |
keys: ['~/.ssh/id_rsa'], |
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
require 'net/https' | |
require 'uri' | |
require 'json' | |
require 'csv' | |
token = "*******" | |
def retrieve_stats(token) | |
url = "*******" | |
uri = URI.parse("https://api.agent-stats.com/groups/#{url}/now") |