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 / 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 {
#!/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
#!/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
@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.
@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;
}
smtpd_banner = Welcome! I'm an ESMTP capable SMTP server.
biff = no
setgid_group = postdrop
append_dot_mydomain = no
myhostname = mail.mittudomain.hu
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases.db
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<!-- $Id: ssh.service 1391 2007-02-07 11:54:54Z lennart $ -->
<!--
This file is part of avahi.
avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2 of the
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<!-- $Id: vmware.service 995 2005-11-17 15:26:53Z yale $ -->
<!--
This file is part of avahi.
avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
@hron84
hron84 / gist:275390
Created January 12, 2010 17:36
Twitter1.awk
#!/usr/bin/awk -f
BEGIN {
twuser="user"
twpass="secret"
status = "";
if(twuser == "" || twpass == "") {
print "No twitter username or password defined";
exit 1;
@hron84
hron84 / gist:275392
Created January 12, 2010 17:37
Twitter2.awk
#!/usr/bin/awk -f
BEGIN {
twuser="user"
twpass="secret"
status = "";
}
{
status = status " " $0;