IN 1552060842.6432996 [{"id":1,"channel":"/meta/handshake","supportedConnectionTypes":["websocket"],"version":"1.0","ext":{"ack":true,"timesync":{"tc":1552060842643}}}]
OUT 1552060842.6573672 [{"minimumVersion":"1.0","clientId":"21goxg4y4lnjv5pd5ws3lvpj2o","supportedConnectionTypes":["websocket","long-polling","callback-polling"],"advice":{"interval":0,"timeout":30000,"reconnect":"retry"},"channel":"/meta/handshake","id":"1","version":"1.0","successful":true}]
IN 1552060843.1454756 [{"id":2,"channel":"/meta/connect","connectionType":"websocket","ext":{"ack":1,"timesync":{"tc":1552060843145}},"clientId":"21goxg4y4lnjv5pd5ws3lvpj2o"}]
OUT 1552060843.1552584 [{"channel":"/meta/connect","id":"2","successful":true}]
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 | |
# | |
# Disables the Couchbase access scanner on a list of buckets | |
# Access scanner can cause short outages when buckets are very large. | |
# | |
set -e -x | |
USER='Administrator' |
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
""" | |
Display Ansible inventories as a tree of environments, groups and hosts as leaves. | |
A nice diversion/excuse to dive into the rich console library. | |
It will expand simple host ranges, allowing grep commands to find | |
group names for given hosts. | |
Usage: | |
./inv.py | |
./inv.py | grep -B10 some-hostname |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Update an existing Cloudpassage FirewallZone from an external list of IPs | |
Wanted to use this to block abusive IPs, then I made this work and | |
realized it only accepts max 6000 characters, which in practice translates | |
to ~400 IP addresses, so it's probably not worth using in any case. | |
Usage: |
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
#!/usr/bin/env perl | |
use v5.014; | |
use warnings; | |
# Perl WebSocket test client | |
# Greg Kennedy 2019 | |
# IO::Socket::SSL lets us open encrypted (wss) connections | |
use IO::Socket::SSL; | |
# IO::Select to "peek" IO::Sockets for 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/sh | |
OLDDIST=lenny | |
NEWDIST=squeeze | |
BACKUP_DIR="/var/tmp/backup.$OLDDIST" | |
echo "+ Create backup directory" | |
mkdir -p "$BACKUP_DIR" |
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 | |
# | |
# Test certificate file expire date | |
# | |
# Usage: | |
# test-certificate-expiry my.crt | |
# | |
# | |
# Emit an error/critical if the certificate expire date |
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
#!/usr/bin/env perl | |
=head1 NAME | |
quick-stats.pl - Calculate the basic statistical attributes of a list of numbers | |
=head1 SYNOPSIS | |
echo <list of numbers> | ./quick-stats.pl |
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
#!/usr/bin/env perl | |
=head1 NAME | |
map-size.pl - Shows process memory segment sizes | |
=head1 SYNOPSIS | |
cat /proc/[pid]/maps | ./map-size.pl |
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 | |
INFILE="$1" | |
OUTFILE="$2" | |
which ffmpeg > /dev/null || { | |
echo "You need ffmpeg to convert audio files to Alexa MP3 format" | |
exit 1 | |
} |