Skip to content

Instantly share code, notes, and snippets.

View lifeofguenter's full-sized avatar
💭
I'm just a thin layer on top of AWS

Günter Grodotzki lifeofguenter

💭
I'm just a thin layer on top of AWS
View GitHub Profile
@defila-aws
defila-aws / patch-ubuntu_14.04.1-ixgbevf-2.16.1-kcompat.h.patch
Last active April 27, 2016 13:11
patch-ubuntu_14.04.1-ixgbevf-2.16.1-kcompat.h.patch
--- /usr/src/ixgbevf-2.16.1/src/kcompat.h.orig 2015-02-03 18:34:22.901474028 +0000
+++ /usr/src/ixgbevf-2.16.1/src/kcompat.h 2015-02-03 18:35:32.577440102 +0000
@@ -3219,8 +3219,6 @@
#define u64_stats_update_begin(a) do { } while(0)
#define u64_stats_update_end(a) do { } while(0)
#define u64_stats_fetch_begin(a) do { } while(0)
-#define u64_stats_fetch_retry_bh(a) (0)
-#define u64_stats_fetch_begin_bh(a) (0)
#if (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,1))
@lifeofguenter
lifeofguenter / Z
Last active November 11, 2018 21:14
NZBGet Transcoders
#!/bin/bash
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Move files if all daisy-chained PP prior succeeded.
# Version: 0.1.0
#
#
# NOTE: For support visit the forum thread: http://nzbget.net/forum/viewtopic.php?f=8&t=1265
# supervisor
#
# Author: Günter Grodotzki <gunter@grodotzki.co.za>
# Version: 2015-04-25
#
# - set param "SUPERVISE=enable" to activate
# - chmod +x supervise.sh
#
packages:
yum:
@mikeifomin
mikeifomin / wait_for_http.yml
Created October 8, 2016 10:20
Ansible wait_for http
- name: wait_for http
command: "curl --silent {{ url }}"
register: result
until: result.stdout.find("200 OK") != -1
retries: 60
delay: 1
changed_when: false
@parsa
parsa / ssh-key-to-fingerprint.md
Last active July 18, 2023 05:26
Generate MD5 and SHA256 fingerprint of an OpenSSH host

Generate MD5 and SHA256 fingerprint of an OpenSSH host

MD5

# ssh-keyscan -p 8000 -t rsa rostam.cct.lsu.edu 2>/dev/null | awk '{ print $3 }' | base64 -d | md5sum | awk '{ print $1 }' | fold -w2 | paste -sd':' -
71:5a:1d:bb:1f:1e:fa:e6:34:98:3d:48:f5:ce:9d:68
# ssh-keygen -l -E md5 -f <(ssh-keyscan -p 8000 -t rsa rostam.cct.lsu.edu 2>/dev/null)
2048 MD5:71:5a:1d:bb:1f:1e:fa:e6:34:98:3d:48:f5:ce:9d:68 [rostam.cct.lsu.edu]:8000 (RSA)
@procrastinatio
procrastinatio / haproxy_rate_limiting.md
Created October 25, 2017 06:04
Rate limiting with HAproxy

Introduction

So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])

@vxnick
vxnick / gist:380904
Created April 27, 2010 15:52
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@stonar96
stonar96 / Anti-Xray.md
Last active March 4, 2024 15:16
Recommended Paper Anti-Xray settings by stonar96

❗ This has been moved to the official PaperMC docs ❗

Link: https://docs.papermc.io/paper/anti-xray

Help: https://discord.gg/papermc






Recommended Paper Anti-Xray settings by stonar96

General

Anti-Xray can be configured per world in the paper.yml configuration file. To understand how per world configuration works please read this first. Note that after changing any settings for Anti-Xray you have to restart your server. Executing the /reload command (you should never do this) won't apply the settings to worlds that are already loaded.

@vjt
vjt / copy-from-time-machine.sh
Last active March 8, 2024 17:05
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active March 15, 2024 11:26
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost