Skip to content

Instantly share code, notes, and snippets.

View jschpp's full-sized avatar

Johannes Schöpp jschpp

View GitHub Profile
@jschpp
jschpp / genVHDLtest.py
Last active August 29, 2015 14:08
Generates VHDL Signal inputs to test components
class meh():
value = True
name = ""
def __init__(self, name):
self.name = name
def __repr__(self):
if self.value:
return "1"
else:
return "0"
@jschpp
jschpp / cloudflare-ip.sh
Last active April 25, 2020 03:29
script to add all cloudflare IPs to iptables
#!/bin/sh
exec > /var/log/cloudflare.log 2>&1
set -x
for ip in $(curl -s https://www.cloudflare.com/ips-v4); do /usr/sbin/iptables -I INPUT -p tcp -m multiport --dports http,https -s "$ip" -j ACCEPT; done
for ip in $(curl -s https://www.cloudflare.com/ips-v6); do /usr/sbin/ip6tables -I INPUT -p tcp -m multiport --dports http,https -s "$ip" -j ACCEPT; done
@jschpp
jschpp / gatling.service
Last active December 10, 2015 17:20
systemd script for gatling: https://www.fefe.de/gatling/
#!/bin/sh
[Unit]
Description=Control gatling webserver
After=network.target
Requires=revprox.service
[Service]
Type=simple
ExecStart=/usr/bin/gatling -p 81 -L -F -S -D -c /var/www/
@jschpp
jschpp / revprox.go
Last active December 10, 2015 17:13 — forked from JalfResi/revprox.go
Simple reverse proxy in Go - Prints forwarded addresses
package main
import (
"bytes"
"log"
"net/http"
"net/http/httputil"
"net/url"
"time"
)
#!/bin/sh
[Unit]
Description=Control go reverse Proxy
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/revprox
ExecReload=/bin/kill $MAINPID && /usr/bin/revprox
@jschpp
jschpp / tlsgatling.service
Created January 18, 2016 16:32
systemd script for tlsgatling: https://www.fefe.de/gatling/
#!/bin/sh
[Unit]
Description=Control gatling ssl webserver
After=network.target
[Service]
Type=simple
WorkingDirectory=/var/www
ExecStart=/opt/diet/bin/tlsgatling -F -S -D
@jschpp
jschpp / change.diff
Last active February 14, 2016 13:04
Understanding test_binary
diff --git a/src/util.c b/src/util.c
index 3045bdf..bf0dad6 100644
--- a/src/util.c
+++ b/src/util.c
@@ -324,6 +324,7 @@ int is_binary(const void *buf, const size_t buf_len) {
}
}
suspicious_bytes++;
+ log_debug("found suspicious byte %#x at pos %i", buf_c[i], i);
/* Disk IO is so slow that it's worthwhile to do this calculation after every suspicious byte. */
@jschpp
jschpp / oab.ps1
Last active November 16, 2022 09:21
Deletes OAB locally and deactivates automatic OAB download for prompted user
# This script remove the local Offline Address Book files and sets the
# registry key to disable automatic download of the OAB
$OFS = "`r`n`r`n"
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
try {
$username = [Microsoft.VisualBasic.Interaction]::InputBox("Input username", "User", "")
$User = New-Object System.Security.Principal.NTAccount($username)
$sid = $User.Translate([System.Security.Principal.SecurityIdentifier]).value
} catch {
@jschpp
jschpp / Dockerfile
Last active February 26, 2016 11:46
silver searcher test
FROM ubuntu:precise
# essentials
RUN apt-get update -q
RUN apt-get install -y python-software-properties curl build-essential
# ag specific
RUN add-apt-repository -y 'ppa:ubuntu-toolchain-r/test'
RUN add-apt-repository -y 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main'
RUN curl http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
@jschpp
jschpp / post.html.diff
Created February 29, 2016 16:28
adding disqus
diff --git a/_layouts/post.html b/_layouts/post.html
index e75c724..9f70c29 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -23,5 +23,22 @@ layout: default
<div class="post-content" itemprop="articleBody">
{{ content }}
</div>
+{% if page.comments %}
+ <div id="disqus_thread"></div>