Skip to content

Instantly share code, notes, and snippets.

Ben Charlton bcc

Block or report user

Report or block bcc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bcc
bcc / pskc.pl
Created Mar 14, 2016
Extract OATH token seeds from a Gemalto provided PSKC v1 XML file.
View pskc.pl
#!/usr/bin/perl
# Extract OATH token seeds from a Gemalto provided PSKC v1 XML file.
# This script will *only* work if the data is aes128-cbc encrypted, and the
# passphrase is strengthened using PBKDF2.
# I've tested this with a file provided for the IDProve 100 / Easy OTP Token v3.
# ben@spod.cx, 2013
use strict;
@bcc
bcc / xmastree.py
Created Dec 9, 2017
The Pi Hut LED Christmas Tree serene mode
View xmastree.py
from gpiozero import LEDBoard
from signal import pause
from time import sleep
steps=30
brightness = 0.1/steps
delay=0.01
leds = LEDBoard(*range(2,28),pwm=True)
while True:
@bcc
bcc / Fix-SplunkBuckets.ps1
Last active Mar 11, 2019
Fix splunk bucket ID clashes
View Fix-SplunkBuckets.ps1
# Used this to merge buckets from a cluster that was being deprecated into a single node for archive purposes.
# You can leave the node GUID, but the IDs do need to be unique. It's not pretty but it works.
#
# 0. Stop splunk
# 1. Copy {index}/db/db_* directories from each indexer (you can ignore the rb_ ones, those are replicated buckets). On windows, this works well over RDP: robocopy "\\tsclient\D\Splunk\var\lib\splunk" f:\indexes /MIR /XD "rb_*" /XD "hot_*" /XD "GlobalMetaData"
# 2. Add missing indexes to etc/system/local/indexes.conf
# 3. Run this script in the db directory for any index with conflicting bucket IDs (probably all of them that you've messed with)
# 4. If the internal indexes are fine and splunk starts (if not, check splunkd.log), check the index list for any other disabled indexes and enable them. This search will find any further conflicts: index="_internal" "id conflicts"
# 5. You might also need to handle colddb - easiest thing is to bump $id to a safe value (greater than number of buck
View keybase.md

Keybase proof

I hereby claim:

  • I am bcc on github.
  • I am bcc (https://keybase.io/bcc) on keybase.
  • I have a public key ASD_WK1Gu7hEsrx3pTDFzfXg1UdtrUJ3oAga0KnouFnmwQo

To claim this, I am signing this object:

You can’t perform that action at this time.