Skip to content

Instantly share code, notes, and snippets.

View endreszabo's full-sized avatar
💭
I may be slow to respond. Btw I use Arch.

Endre Szabo endreszabo

💭
I may be slow to respond. Btw I use Arch.
View GitHub Profile
@endreszabo
endreszabo / targyeset.pl
Created April 22, 2022 07:55
Automatikus targyeset mutato script
weechat::register(
"targyeset",
"Automatikus targyeset",
"1.0",
"GPL2",
"Script ami segit latszatni az automatikus targyeset",
"", ""
);
sub sendtext_data {
@endreszabo
endreszabo / asciicast-timestamp-converter.pl
Created June 28, 2018 08:41
asciinema asciicast recording absolute/relative time converter for fine adjustments of output delays in post-production
#!/usr/bin/env perl
#===============================================================================
#
# FILE: asciicast-timestamp-converter.pl
#
# USAGE: ./asciicast-timestamp-converter.pl [filename]
# USAGE: cat filename | ./asciicast-timestamp-converter.pl
#
# DESCRIPTION: asciinema asciicast recording absolute/relative time converter
# for fine adjustments of output delays in post-production
@endreszabo
endreszabo / archzfs-kernels-make.sh
Created May 8, 2018 11:08
Make your very own archzfs-tied kernels Arch Linux repository.
#!/usr/bin/env bash -x
set -o nounset
set -o errexit
curl http://archzfs.com/archzfs/x86_64/archzfs.db | tar xJvf -
cat */desc | perl -e'while(<>) {
if (m/^%DEPENDS/) {
while(<>) {
@endreszabo
endreszabo / xor.pl
Last active March 17, 2016 15:53
Perl that XORs.. for science!
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use List::Util qw( shuffle );
my $o='`^._-=>;:/()|[]{}#@%+$&?*~,"';
my $s=join(" ",@ARGV)||"egyenisegek vagytok mind!";
sub xorsplit($){my$oa;my$ob;out:foreach my$c(split//,shift){foreach my$a(shuffle split//,$o){foreach my$b(shuffle split//,$o){if((ord($a)^(ord($b)))==ord($c)){$oa.=$a; $ob.=$b;next out;}}}printf"Failed looking up '%s'\n",$c;}return($oa,$ob);}
#!/bin/bash
# Tmux based TeX editor helper
EDITOR="${EDITOR:-vim}"
DOCUMENT="${1:-deriv}"
SESSIONID="tmuxtexex_${DOCUMENT}_$$"
tmux new-session -d -s "${SESSIONID}" && tmux new-window -t "${SESSIONID}:1" -n 'TmuxTeXEx' "$EDITOR ${DOCUMENT}.tex" && tmux split-window -v -l 6 -t "${SESSIONID}:1" "while :; do inotifywait -e modify \"${DOCUMENT}.tex\" && { make || pdflatex \"${DOCUMENT}.tex\" } && jobs %% || { evince \"${DOCUMENT}.pdf\" & }; done" && tmux select-pane -U -t "${SESSIONID}:1" && tmux -2 attach-session -t "${SESSIONID}"
@endreszabo
endreszabo / aessss.sh
Created January 20, 2014 22:46
aessss. q&d combination of aes and ssss.
#!/bin/bash
for i in $*; do
HASH=$(openssl dgst -sha256 -binary < "$i" | perl -ne'map{printf("%02x",ord($_))} split//')
KEY=$(dd if=/dev/random bs=1 count=32 | perl -ne'map{printf("%02x",ord($_))} split//')
echo -n "$KEY" | openssl aes256 -aes-256-xts -e -pass stdin -in "$i" -out "${HASH}.bin"
echo -n "$KEY" | ssss-split -x -t 3 -n 4 -w "$HASH" -q | split --lines=1 --numeric-suffixes=1 --suffix-length=1 - "$HASH-"
done
@endreszabo
endreszabo / koponyeg_rss.py
Created November 21, 2013 18:12
koponyeg.hu RSS feedparser hinting
import feedparser
def start_koponyeg_elorejelzes(self, attrsD):
context = self._getContext()
context['koponyeg_elorejelzes_%s' % attrsD['nap']] = attrsD
feedparser._FeedParserMixin._start_koponyeg_elorejelzes = start_koponyeg_elorejelzes
feed = feedparser.parse('http://koponyeg.hu/idojaras_rss.php?regios=1')
@endreszabo
endreszabo / unshorten_bookmarklet.js
Created August 27, 2013 11:02
unshortr url submit bookmarklet
#!/usr/bin/perl
local$/;$_='javascript:'.<DATA>;$_=~s/\) \{\n/){\n/g;$_=~s/\n\s*//g;print;
__DATA__
USSw=open('','unshorten_url_submit','width=400,height=200,scrollbars,resizable,menubar');
OSUl=document.links;
with(USSw.document) {
write('<base target=_self><p>Ushorten Bookmarklet has ');
if(OSUl.length>0) {
write('found the following URLs. Click on any of these to submit to Unshorten delvelopers.</p>');
for(USi=0;USi<OSUl.length;USi++) {
@endreszabo
endreszabo / Xdefaults
Created January 19, 2013 13:10
c64 theme for (u)rxvt
urxvt-c64*font: xft:Adore 64:pixelsize=16
urxvt-c64*boldFont: xft:Adore 64:pixelsize=16
urxvt-c64*internalBorder: 64
urxvt-c64*color0: rgba:0000/0000/CC00/ffff
urxvt-c64*color15: rgba:FF00/FF00/FF00/ffff
urxvt-c64*color1: rgba:CC00/0000/0000/ffff
urxvt-c64*color14: rgba:0000/FF00/CC00/ffff
urxvt-c64*color5: rgba:FF00/0000/FF00/ffff
urxvt-c64*color2: rgba:0000/CC00/0000/ffff
urxvt-c64*color4: rgba:0000/0000/CC00/ffff
@endreszabo
endreszabo / foobar.c
Created December 4, 2012 22:02
usin intel's ivy-bridge rdrand hrng
#include <stdio.h>
#include <string.h>
#include "rdrand.h"
#define BUFFSIZE 65536
int main()
{
int r;