Skip to content

Instantly share code, notes, and snippets.

View punkeel's full-sized avatar

Maxime punkeel

  • Munich, Germany
View GitHub Profile

Keybase proof

I hereby claim:

  • I am PunKeel on github.
  • I am punkeel (https://keybase.io/punkeel) on keybase.
  • I have a public key whose fingerprint is 0216 8B4D 30F6 BD17 4A19 85EC FF57 EC5B 089B B801

To claim this, I am signing this object:

<?php
$a = $_SERVER;
echo '<script type="text/javascript" src="/c.js"></script>
';
echo "------------- Alarming detections -------------</br>";
if (array_key_exists("HTTP_X_TOR2WEB",$a)) {
echo "The 'HTTP_X_TOR2WEB' key exist, so you are using Tor2Web!</br>";
@pdeschen
pdeschen / initd
Created May 12, 2013 18:10
CentOS service initd erb template. Ready to use in Opscode Chef or replace template variables with your own hard-coded value. Takes into account priority/nice, sudo user, and /etc/sysconfig/ Support start, stop, restart, console.
#!/bin/sh
#
# <%=@service%> This shell script takes care of starting and stopping
# the <%=@service%> service.
#
# chkconfig: 2345 65 35
# description: <%=@description%>
#
SERVICE=<%=@service%>
@Plazmaz
Plazmaz / netcat-webserver.sh
Last active May 7, 2021 02:08
A one-liner for a netcat webserver w/ sane logging
#! /bin/bash
sudo bash -c 'while true; do echo "HTTP/1.1 200 OK\n\n" |nc -l -p 80 |egrep -v "Accept" |egrep -v "Content-Length" |egrep -v "Host" |egrep -vi "cache"; done'
# Original (no sudo):
# while true; do echo "HTTP/1.1 200 OK\n\n" |nc -l -p 80 |egrep -v "Accept" |egrep -v "Content-Length" |egrep -v "Host" |egrep -vi "cache"; done
# Raw (Skip filtering header lines):
# sudo bash -c 'while true; do echo "HTTP/1.1 200 OK\n\n" |nc -l -p 80; done'
@tuxfight3r
tuxfight3r / jenkins-decrypt.groovy
Created September 23, 2015 11:36
Decrypting Jenkins Password
#To Decrypt Jenkins Password from credentials.xml
#<username>jenkins</username>
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase>
#go to the jenkins url
http://jenkins-host/script
#In the console paste the script
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J'
@swenson
swenson / gist:cf74cd8e282443b43b8a
Created May 21, 2014 15:51
Google Interview Study Guide
Author unknown.
1.) Algorithm Complexity: You need to know Big-O. If you struggle with
basic big-O complexity analysis, then you are almost guaranteed not to
get hired.
For more information on Algorithms you can visit:
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=alg_index
2.) Coding: You should know at least one programming language really
well, and it should preferably be C++ or Java. C# is OK too, since
@KodrAus
KodrAus / Profile Rust on Linux.md
Last active November 14, 2023 17:19
Profiling Rust Applications

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.

# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
@jult
jult / blockpeers.sh
Last active March 5, 2024 07:33
blocking p2p peer snoopers and evil corp (for Tixati IP filter and such)
#!/bin/sh
# This script runs every other night at 04:56 CET on a webserver I maintain
# Results are always at: https://jult.net/block.txt ( or https://jult.net/block.txt.gz )
# And much smaller, stripped of BS; https://jult.net/bloc.txt
# For use in Tixati IP filter: https://jult.net/bloc.txt.gz !!!
# And finally a txt file with just the bold IP-ranges: https://jult.net/bl.txt (or https://jult.net/bl.txt.gz )
# Download open block-lists, unpack, filter:
curl -s https://www.iblocklist.com/lists.php | grep -A 2 Bluetack | xargs wget -qO - --limit-rate=500k | gunzip -f | egrep -v '^#' > /tmp/xbp
@jdarpinian
jdarpinian / executable.c
Last active March 20, 2024 15:28
Add one line to your C/C++ source to make it executable.
///bin/true;COMPILER_OPTIONS="-g -Wall -Wextra --std=c99 -O1 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@"
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}