Skip to content

Instantly share code, notes, and snippets.

View spetersson's full-sized avatar

Sander Petersson spetersson

View GitHub Profile
@spetersson
spetersson / gist:c693eab5e36e65c1e219c7e1650c5379
Created February 16, 2023 07:25
BGP / ECMP HAProxy loadbalancer
root@lb-101:/ # netstat -I bnxt0
Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oerrs Coll
bnxt0 1500 <Link#1> -------------6:dc 458420009 0 0 264906 0 0
bnxt0 - ------------- ------------- 219314 - - 264834 - -
root@lb-101:/ # netstat -I bnxt1
Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oerrs Coll
bnxt1 1500 <Link#2> -------------6:dd 464941518 0 0 1115146950 0 0
bnxt1 - ------------- ------------- 219330 - - 1115146880 - -
root@lb-102:/ # netstat -I bnxt0
[sanderp@linux ~]$ iperf3 -c 10.1.10.253
Connecting to host 10.1.10.253, port 5201
[ 4] local 10.1.10.13 port 57639 connected to 10.1.10.253 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 158 MBytes 1.32 Gbits/sec 149 42.4 KBytes
[ 4] 1.00-2.00 sec 250 MBytes 2.10 Gbits/sec 168 4.24 KBytes
[ 4] 2.00-3.00 sec 166 MBytes 1.39 Gbits/sec 232 59.4 KBytes
[ 4] 3.00-4.00 sec 177 MBytes 1.49 Gbits/sec 364 55.1 KBytes
[ 4] 4.00-5.00 sec 222 MBytes 1.86 Gbits/sec 440 72.1 KBytes
[ 4] 5.00-6.00 sec 160 MBytes 1.34 Gbits/sec 404 55.1 KBytes
# ifstated.conf
haproxy = '"rcctl check haproxy >/dev/null 2>&1" every 1'
state initial {
if $haproxy {
run "ifconfig vio1 up"
run "ifconfig vio2 up"
}
if ! $haproxy {
run "logger -st ifstated 'haproxy is down'"
@spetersson
spetersson / gist:30439b955660d27e6edb1365ea46182c
Created February 1, 2021 21:19
When you leave unattended upgrades in Ubuntu to it's own fate of upgrading without cleaning
root@ts:/usr/local/teamspeak# apt dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
grub-pc-bin linux-headers-4.4.0-121 linux-headers-4.4.0-121-generic linux-headers-4.4.0-124 linux-headers-4.4.0-124-generic
linux-headers-4.4.0-127 linux-headers-4.4.0-127-generic linux-headers-4.4.0-128 linux-headers-4.4.0-128-generic linux-headers-4.4.0-130
linux-headers-4.4.0-130-generic linux-headers-4.4.0-133 linux-headers-4.4.0-133-generic linux-headers-4.4.0-134
linux-headers-4.4.0-134-generic linux-headers-4.4.0-137 linux-headers-4.4.0-137-generic linux-headers-4.4.0-138
ansible_ssh_user: centos
ceph_origin: repository
ceph_repository: community
ceph_stable_release: octopus
public_network: "10.0.1.0/24"
cluster_network: "10.0.1.0/24"
monitor_interface: eth0
dashboard_enabled: True
dashboard_port: 8443
dashboard_protocol: http
@spetersson
spetersson / gist:8e40f42cd38996cc7cd05631924e25cc
Created December 17, 2020 10:29
openssl speed -evp aes-256-gcm -multi 24
✘ spetersson@trash  ~ 
-> openssl speed -evp aes-256-gcm -multi 24
Forked child 0
Forked child 1
Forked child 2
+DT:aes-256-gcm:3:16
Forked child 3
+DT:aes-256-gcm:3:16
Forked child 4
+DT:aes-256-gcm:3:16
{
"__inputs": [
{
"name": "DS_ICINGA2-IDO",
"label": "icinga2-ido",
"description": "",
"type": "datasource",
"pluginId": "mysql",
"pluginName": "MySQL"
}
@spetersson
spetersson / Output from r10k run
Created January 2, 2018 09:26
Issue is that we are trying to use deploy keys in Github with r10k, and each github repo needs it's own private key
root@foreman:/etc/puppetlabs/code/environments/test# /opt/puppetlabs/puppet/bin/r10k -c /etc/puppetlabs/r10k/r10k.yaml puppetfile install -v debug2
...
[2018-01-02 10:21:33 - DEBUG] /etc/puppetlabs/code/environments/test/modules/foreman is already at Git ref master
[2018-01-02 10:21:33 - INFO] Updating module /etc/puppetlabs/code/environments/test/modules/nnse_icinga
[2018-01-02 10:21:33 - DEBUG1] Creating new git cache for "git@github.com:org/puppet-nnse-icinga.git"
[2018-01-02 10:21:33 - DEBUG2] Starting process: ["git", "clone", "--mirror", "git@github.com:org/puppet-nnse-icinga.git", "/var/cache/r10k/git@github.com-org-puppet-nnse-icinga.git"]
[2018-01-02 10:21:35 - DEBUG2] Finished process:
Command: git clone --mirror git@github.com:org/puppet-nnse-icinga.git /var/cache/r10k/git@github.com-org-puppet-nnse-icinga.git
Stderr:
Cloning into bare repository '/var/cache/r10k/git@github.com-org-puppet-nnse-icinga.git'...