Skip to content

Instantly share code, notes, and snippets.

@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)
{
@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)
#!/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
#!/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
@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
@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 / 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 / sshuttle.sh
Last active May 24, 2023 13:09 — forked from rchrd2/sshuttle.sh
xbar + sshuttle
#!/usr/bin/env bash
#
# Easily start/stop sshuttle
#
# <xbar.title>sshuttle</xbar.title>
# <xbar.version>v1.3</xbar.version>
# <xbar.author>Elias Abacioglu</xbar.author>
# <xbar.author.github>Raboo</xbar.author.github>
# <xbar.desc>Easily start/stop a background sshuttle.</xbar.desc>
# <xbar.dependencies>sshuttle</xbar.dependencies>
@Raboo
Raboo / netcat-tar-pipe.sh
Last active October 18, 2022 13:41
Command line snippets
# should be faster than rsync
# 1. receiver
nc -l 6001 | tar xvpP
# 2. sender
tar cfP - /etc/profile.d | nc ${HOST} 6001
@Raboo
Raboo / aptly_ubuntu.rb
Last active March 4, 2019 17:22
chef aptly cookbook mirroring ubuntu repos
# ubuntu
excluded_sections = '!Section (comm), !Section (debug), !Section (fonts), !Section (games), !Section (gnome), !Section (graphics), !Section (kde), !Section (localization), !Section (math), !Section (restricted/x11), !Section (science), !Section (sound), !Section (translations), !Section (universe/comm), !Section (universe/debug), !Section (universe/electronics), !Section (universe/embedded), !Section (universe/fonts), !Section (universe/games), !Section (universe/gnome), !Section (universe/gnustep), !Section (universe/graphics), !Section (universe/hamradio), !Section (universe/kde), !Section (universe/localization), !Section (universe/math), !Section (universe/news), !Section (universe/science), !Section (universe/sound), !Section (universe/translations), !Section (universe/video), !Section (universe/x11), !Section (universe/xfce), !Section (universe/zope), !Section (video), !Section (x11), !Section (zope)'
# packages that we want to include from excluded sections
included_packages = '| fonts-dejavu|