Skip to content

Instantly share code, notes, and snippets.

View submachine's full-sized avatar

Arjun Shankar submachine

  • Brno, Czech Republic
View GitHub Profile
@submachine
submachine / csv2muttalias.pl
Created July 3, 2015 11:27
Reads STDIN as an 'Outlook CSV' (e.g. contacts exported from GMail webUI); writes to STDOUT as mutt aliases
#!/usr/bin/perl
# Reads STDIN as 'Outlook CSV' (e.g. contacts exported from GMail webUI).
# Writes to STDOUT as mutt aliases
#
# Example usage:
#
# perl csv2muttalias.pl < contacts.csv >> ~/.muttrc
use strict;
@submachine
submachine / hdi-vs-irreligion.data
Created March 7, 2017 15:27
HDI vs Irreligion Data
# HDI vs Irreligion;
# Source:
# https://en.wikipedia.org/wiki/List_of_countries_by_irreligion
# https://en.wikipedia.org/wiki/List_of_countries_by_Human_Development_Index
# gnuplot command line:
# echo "set xlabel 'Irreligion (% of population)'; set xrange [0:100]; \
# set ylabel 'HDI'; set term png size 1024,768; \
# set output 'hdi-vs-irreligion.png'; \
# f(x) = a*x + b; a=0.003;b=0.7; \
# fit f(x) 'hdi-vs-irreligion.data' using 2:3 via a,b; \
@submachine
submachine / iconv-2byte-fuzzer.sh
Created May 17, 2019 12:57
Test iconv with every possible input combination of two bytes for every supported character set
#!/bin/sh -f
# Run iconv(1) tests with every possible input combination of two bytes.
# Copyright (C) 2019 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Arjun Shankar <[email protected]>, 2019.
# The GNU C Library 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.1 of the License, or (at your option) any later version.
@submachine
submachine / iconv-2byte-fuzzer.out
Created May 20, 2019 11:54
Output; iconv-2byte-fuzzer.sh (https://git.io/fj8xa) run on Fedora 29 with glibc-2.28-30.fc29.x86_64
HANG: ANSI_X3.110; echo -en "\x00\x23" | iconv -c -f ANSI_X3.110 -t "UTF-8//TRANSLIT//IGNORE"
HANG: ARMSCII-8; echo -en "\x00\xa1" | iconv -c -f ARMSCII-8 -t "UTF-8//TRANSLIT//IGNORE"
HANG: ASMO_449; echo -en "\x00\xa1" | iconv -c -f ASMO_449 -t "UTF-8//TRANSLIT//IGNORE"
HANG: BIG5; echo -en "\x00\x81" | iconv -c -f BIG5 -t "UTF-8//TRANSLIT//IGNORE"
HANG: BIG5HKSCS; echo -en "\x00\xff" | iconv -c -f BIG5HKSCS -t "UTF-8//TRANSLIT//IGNORE"
HANG: BRF; echo -en "\x00\xff" | iconv -c -f BRF -t "UTF-8//TRANSLIT//IGNORE"
HANG: BS_4730; echo -en "\x00\xff" | iconv -c -f BS_4730 -t "UTF-8//TRANSLIT//IGNORE"
OK: CP10007
OK: CP1125
HANG: CP1250; echo -en "\x00\x81" | iconv -c -f CP1250 -t "UTF-8//TRANSLIT//IGNORE"