Skip to content

Instantly share code, notes, and snippets.

@Raboo
Raboo / kontorsnätet.txt
Created March 6, 2018 14:56
kontorsnätet
+-----------------------------------------------------------------------------------------+
|Ena änden av vår lokal Andra änden av vår lokal |
| |
| |
| |
+------------+ +-------------------+
|| Upplänk | 1Gbit/s CAT 6.e/CAT 7 kabel |Switch med ||
|| + +--------------------------------------------------------+anslutning till ||
|| LAN Router| |alla accesspunkter||
|| 1 Gbit/s | +-------------------+
@Raboo
Raboo / coreos_test01.sh
Last active September 26, 2017 22:28
testing CoreOS on Vultr
#!/bin/bash
cat > "cloud-config.yaml" <<EOF
#cloud-config
ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwYfh0FG1DK+VIePvOGKaU/maBFYppeZ8CtwlzSaemx0t8ZjUBkzgXZKiqdqWkm2TR713UHCa2d0ZV4168XaEBrnRHk+zJoH5yOInaByMJ30bR1SDI850adi7Wu6Lp3qwvyW5DLMfAX9gOXFrD40MQyetSNnazEFDuNG0knOTlGeKR5O2aTiQTVI8ich3e35DESS3COmo3gdI7zCJas9sQ5jsDa Macbook"
- "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwSQ36wK1WJIdJBECFL92F0CjKH5u7jYdZ9MEv9wKOzmeFpbw9qWwAjrW++kcj3Kg5QoieYqGDDPvaFlfuH32G8WhXrRPXykjxaNbsylKPtVmpjB9cr6JZ8GhzZW+hdeDx2O2nx8xZikxV08+D/fzqyV5+0OcfY1Q/ooLGtnkVO8wUw30WJp7Wbt9JTUxCpp0hQVVfXkpwIWIF7vKLpOG+QbIkSGzVTwJg95h0gIvkpWdyYF4eK0whYAwR3/rzchvPRsyQJnS9sdWYYBl/wvvFxNUFA05KFxw7r4LUPmw+vzPdYJP0m0uXvw9IgGGTM/3ntPMa1rgoJnBQI1G7bqmFw== Windows"
coreos:
@Raboo
Raboo / consul2etcd.sh
Last active August 22, 2017 08:28
A one liner to migrate data from consul kv to etcd kv.
./consul kv get -http-addr=[CONSUL ADDR]:8500 -recurse | grep : | cut -d: -f1 | while read line ; do ./consul kv get -http-addr=[CONSUL ADDR]:8500 $line |head -c-1 | ./etcdctl --endpoints http://[ETCD ADDR]:2379 set $line ; done
#!/bin/bash
AMBARI_USER='admin'
AMBARI_PASSWORD='PWPWPW'
AMBARI_HOST='ambari.local'
CLUSTER_NAME='hdp'
MOVE_FROM='node1.local'
MOVE_TO='node2.local'
SSH_USER=john.doe
#!/bin/bash
AMBARI_USER='admin'
AMBARI_PASSWORD='PWPWPW'
AMBARI_HOST='localhost'
CLUSTER_NAME='mitate'
MOVE_FROM='old-host.mitate.com'
MOVE_TO='new-host.mitate.com'
SSH_USER=john.doe
@Raboo
Raboo / haproxy_gmetric.rb
Last active October 27, 2015 10:30 — forked from macros/gist:553c2ef4d4b0594154f5
haproxy multi socket gmetric
#!/usr/bin/ruby
require 'socket'
abort('Upgrade ruby or die...') if RUBY_VERSION < "1.9"
pidfile = '/var/run/haproxy_gmetric.pid'
if File.exist?(pidfile)
pid = File.read(pidfile).to_i
begin
Process.kill(0, pid)
@Raboo
Raboo / httperf_tls.patch
Created March 18, 2015 12:01
httperf SSLv3 to TLSv1 patch
--- httperf/src/httperf.c 2015-03-17 15:34:53.523565000 +0100
+++ httperf/src/httperf.c.patch 2015-03-17 15:38:00.748836588 +0100
@@ -808,7 +808,7 @@
SSLeay_add_ssl_algorithms ();
/* for some strange reason, SSLv23_client_method () doesn't work here */
- ssl_ctx = SSL_CTX_new (SSLv3_client_method ());
+ ssl_ctx = SSL_CTX_new (TLSv1_client_method ());
if (!ssl_ctx)
{
import pprint
import httplib
try:
import json
except ImportError:
json = None
import sys
descriptors = list()
@Raboo
Raboo / rrd.py
Created October 12, 2014 18:03
What I think(haven't tested) could be a working class for freenas/gui/reporting/rrd.py
class DiskTempPlugin(RRDBase):
vertical_label = "Celcius"
def get_title(self):
title = self.identifier.replace("disk-", "")
return 'Disk Temperature (%s)' % title
def get_identifiers(self):
ids = []
@Raboo
Raboo / collectd_temp.sh
Last active July 19, 2020 07:34
FreeBSD collectd hdd temperature script
#!/bin/sh
# URL https://gist.github.com/Raboo/eda65914c4bcb2af2b32
# add following to sudo
# Cmnd_Alias SMARTCTL = /usr/local/sbin/smartctl
# daemon ALL=(ALL) NOPASSWD: SMARTCTL
# add following to /usr/local/etc/collectd.conf
# LoadPlugin exec