Skip to content

Instantly share code, notes, and snippets.

View bernd's full-sized avatar

Bernd Ahlers bernd

  • Graylog, Inc.
  • Hamburg/Germany
View GitHub Profile
@abraithwaite
abraithwaite / chill-zoom.sh
Last active December 12, 2024 09:16
Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/bash -xe
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice"
[Slice]
AllowedCPUs=0-4
MemoryHigh=6G
EOF
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop"
#!/bin/sh
GITHUB_USER=dennisoelkers
if [ "$1" != "" ]; then
GITHUB_USER=$1
fi
echo "PRs asking me for review:\n"
for i in `hub pr list -s open -o update -f '%i;%sH;%H;%U;%ut;%rs%n'|sed 's/ //g'|grep ${GITHUB_USER}`; do
#!/bin/sh
# Returning the status of all open PRs of $1, execute it in the directory of the git repository
# Perfect in combination with `watch -n 30 -c pr-check`
GITHUB_USER=dennisoelkers
if [ "$1" != "" ]; then
GITHUB_USER=$1
fi
@coolaj86
coolaj86 / Bootable Mac ISO with Linux.md
Last active April 20, 2025 01:25
Create Bootable MacOS ISO from Apple's Free PKG
@spinscale
spinscale / Webserver.java
Created June 10, 2015 07:01
Undertow + jgroups-raft example
package de.spinscale.cluster;
import io.undertow.Undertow;
import io.undertow.server.handlers.PathTemplateHandler;
import io.undertow.util.HttpString;
import io.undertow.util.PathTemplateMatch;
import org.jgroups.JChannel;
import org.jgroups.raft.RaftHandle;
import org.jgroups.raft.blocks.ReplicatedStateMachine;
@bernd
bernd / gist:b291794b6d2f6a8b8eba
Created August 1, 2014 13:30
Compare deb and rpm versions
@mlafeldt
mlafeldt / Usage.md
Last active November 24, 2015 21:25
Vagrant + fpm-cookery

Boot up the Vagrant virtual machine:

$ vagrant up

Build a specific recipe with fpm-cookery:

$ RECIPE=<recipe-name> vagrant provision

The final packages will be located here:

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 10, 2025 09:21
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@rnewson
rnewson / haproxy.cfg
Last active November 18, 2021 22:12
haproxy.cfg stanzas to enable Perfect Forward Secrecy and HTTP Strict Transport Security. Requires OpenSSL 1.0.1g or so.
# Bind SSL port with PFS-enabling cipher suite
bind :443 ssl crt path_to_certificate no-tls-tickets ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-GCM-SHA384:AES128-SHA256:AES128-SHA:AES256-SHA256:AES256-SHA:!MD5:!aNULL:!DH:!RC4
# Distinguish between secure and insecure requests
acl secure dst_port eq 443
# Mark all cookies as secure if sent over SSL
rsprep ^Set-Cookie:\ (.*) Set-Cookie:\ \1;\ Secure if secure
# Add the HSTS header with a 1 year max-age