Skip to content

Instantly share code, notes, and snippets.

# <modulepath>/aix_reload/examples/test.pp
user { 'newuser007':
ensure => present,
provider => aix_reload,
before => Notify['foo'],
}
notify { 'foo': }
@task
def stats():
with tempfile.NamedTemporaryFile() as f:
f.write('first line')
execute(collect, f.name)
import pdb; pdb.set_trace()
# from pdb, get f.name, and cat the file shows N lines in the file without "first line"
f.seek(0)
@rstruber
rstruber / elasticsearch-update-settings.py
Created August 25, 2015 16:30
Example of how to use curator and elasticsearch python api to update index settings
import elasticsearch
import curator
import json
client = elasticsearch.Elasticsearch()
indices = curator.get_indices(client)
# Filter anything older than or equal to 3 days
_filter = curator.build_filter(kindOf='newer_than', value=3, time_unit='days', timestring='%Y.%m.%d')
indices = curator.apply_filter(indices, **_filter)
@rstruber
rstruber / NumberConv.php
Last active August 29, 2015 14:27
PHP class convert an arbitrary number to an english string
<?php
class NumberConv {
protected $single = [
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
5 => 'five',
6 => 'six',
$ openssl ciphers -v 'ALL:!ADH:!EXP:!LOW:!RC2:!3DES:!SEED:!RC4:+HIGH:+MEDIUM'
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384
ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384
ECDHE-RSA-AES256-SHA SSLv3 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA1
ECDHE-ECDSA-AES256-SHA SSLv3 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA1
SRP-DSS-AES-256-CBC-SHA SSLv3 Kx=SRP Au=DSS Enc=AES(256) Mac=SHA1
SRP-RSA-AES-256-CBC-SHA SSLv3 Kx=SRP Au=RSA Enc=AES(256) Mac=SHA1
[hekad]
share_dir = "/usr/share/heka"
pid_file = "/var/run/hekad.pid"
maxprocs = 4
poolsize = 500
[DashboardOutput]
ticker_interval = 5
[ApiInput]
type = "UdpInput"
^\SIGQUIT: quit
PC=0x4461c1
goroutine 0 [idle]:
runtime.futex(0xf98c18, 0x0, 0x0, 0x0, 0x0, 0xf98060, 0x1, 0x413bef, 0x413e0e, 0xf98c18, ...)
/usr/local/go/src/runtime/sys_linux_amd64.s:277 +0x21
runtime.futexsleep(0xf98c18, 0x0, 0xffffffffffffffff)
/usr/local/go/src/runtime/os_linux.c:49 +0x47
runtime.notesleep(0xf98c18)
/usr/local/go/src/runtime/lock_futex.go:145 +0xae
[hekad]
share_dir = "/usr/share/heka"
pid_file = "/var/run/hekad.pid"
max_message_size = 2097152
maxprocs = 2
[DashboardOutput]
ticker_interval = 5
[ApiInput]