Skip to content

Instantly share code, notes, and snippets.

View hron84's full-sized avatar
🔫
Hunting bugs

Gabor Garami hron84

🔫
Hunting bugs
View GitHub Profile
@hron84
hron84 / 03_openssl_md5_support.patch
Created May 24, 2016 15:14
pam_auth_mysql OpenSSL MD5 Support patch
#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_libpam.patch by Lars Bahner <bahner@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: This patch makes sure Makefile references -lpam
## to insure correct linking
@DPATCH@
--- pam-mysql-0.7~RC1.orig/pam_mysql.c 2006-01-09 11:35:59.000000000 +0100
+++ pam-mysql-0.7~RC1/pam_mysql.c 2016-05-24 16:48:59.664125029 +0200
@hron84
hron84 / postfix-nulldelivery.c
Created May 27, 2015 12:06
Postfix blackhole (null) delivery
#include <stdio.h>
int main(int argc, char **argv, char **environ) {
printf("0\n");
return 0;
}
@hron84
hron84 / README.md
Created December 3, 2014 14:59
Duke server

DukeServer

This script is just provides a basic builder for the com.sun.net.httpserver.HttpServer and does some magic to make Groovy closures to work easily.

Pros:

  • This stuff has no dependency other than JRE >= 1.6 and Groovy runtime
  • Building a server is quick and painless.
#!/bin/bash
PKGFILE=/tmp/kernelpurge.$$
true > $PKGFILE
dpkg --get-selections | awk '$2 !~ /^install/ { next } $1 ~ /^linux-image-[0-9]/ { print $1 }' | head -n -1 | fgrep -v "$(uname -r)" >> $PKGFILE
dpkg --get-selections | awk '$2 !~ /^install/ { next } $1 ~ /^linux-image-extra-[0-9]/ { print $1 }' | head -n -1 | fgrep -v "$(uname -r)" | tac >> $PKGFILE
dpkg --get-selections | awk '$2 !~ /^install/ { next } $1 ~ /^linux-headers-[0-9]/ { print $1 }' | head -n -1 | fgrep -v "$(uname -r)" | tac >> $PKGFILE
lines=$(cat $PKGFILE | wc -l)
#!/usr/bin/env groovy
import groovy.util.XmlParser
def dasher = { Integer n, String c -> def ret = ""; for(i = 0; i < n; i++) ret += c ; return ret }
BufferedReader STDIN = new BufferedReader(new InputStreamReader(System.in))
def clear = {
if(System.getProperty("os.name").substring(0,3).toLowerCase().equals("win")) {
// Ugly solution, windows is fucked up
#!/usr/bin/env ruby
require 'rubygems' unless defined?(Gem)
require 'nokogiri'
xml = ARGV.first
if xml.nil? or xml == '--help' then
puts "Usage: #{$0} TEST-junit.xml"
exit 1
end
@hron84
hron84 / toggle.js
Created June 11, 2014 20:38
Toggler
jQuery(
function() {
$('a#info-button').on('click', function(e) {
var infodiv = 'div#info-content'
$(infodiv).toggle();
if($(infodiv).is(':visible')) {
$(this).html('Hide')
} else {
#!/bin/bash
PAPEROPTS="-x 210mm -y 297mm"
SCANOPTS="${PAPEROPTS} --resolution 300 --format=tiff --mode Gray"
function die() {
echo " !!!! $@ !!!!"
exit 1
}
@hron84
hron84 / .gitignore
Last active December 18, 2015 17:29
Plop
*.pyo
*.pyc
@hron84
hron84 / notepad.js
Last active December 17, 2015 13:39
Notepad bookmarklet
javascript:title=window.prompt("Title:", "Untitled");window.open("data:text/html, <html contenteditable><title>"+title+" &mdash; Notepad</title></html>","Notepad","modal=yes,alwayRaised=yes,fullscreen=no,width=640,height=480");