Skip to content

Instantly share code, notes, and snippets.

@AlbertVeli
AlbertVeli / gist:5994777
Created July 14, 2013 16:13
Solver for puzzle found in showcase at Tekniska Museet.
/* https://twitter.com/albertveli/status/356432567106408449/photo/1 */
#include <stdio.h>
void print_rot(char *str, int rot)
{
char c;
while (*str) {
c = *str;
### Keybase proof
I hereby claim:
* I am AlbertVeli on github.
* I am trebla (https://keybase.io/trebla) on keybase.
* I have a public key whose fingerprint is 41C3 870C D0C9 D022 5272 EA65 C6C6 E433 11E8 A597
To claim this, I am signing this object:
@AlbertVeli
AlbertVeli / emulate_hd44780.py
Created January 15, 2016 17:53
32c3 hd44780
#!/usr/bin/python
import sys
pin_s = 'RSPI_GPIO_7.txt'
pin_e = 'RSPI_GPIO_8.txt'
pin_db7 = 'RSPI_GPIO_18.txt'
pin_db6 = 'RSPI_GPIO_23.txt'
pin_db5 = 'RSPI_GPIO_24.txt'
pin_db4 = 'RSPI_GPIO_25.txt'
@AlbertVeli
AlbertVeli / parse_traces.py
Created January 16, 2016 13:04
Python script to solve traces from 32c3
#!/usr/bin/env python
valid = False
fw = None
x = 0
y = 0
# Guess that width is 752 pixels, try some different widths
width = 752
xline = []
Verifying that "trebla.id" is my Blockstack ID. https://onename.com/trebla
@AlbertVeli
AlbertVeli / gist:8727d0924a594a1ff50a2d4e1e56c1eb
Created March 4, 2020 16:11
JtR sprintf compile warnings when configuring with --enable-ztex
last commit: 2020-03-04 17:20 +0200 Maxim Ivanov
0674b6994 - Error out when not SYSTEMWIDE and john_home_path detected empty (#4218)
./configure --enable-ztex
...
Configured for building John the Ripper jumbo:
Target CPU ................................. x86_64 AVX2, 64-bit LE
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 97a2200f..ac734bae 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -347,7 +347,7 @@ static GQuark tabs_menu_action_quark = 0;
static const GtkActionEntry action_entries[] =
{
{ "file-menu", NULL, N_ ("_File"), NULL, NULL, NULL, },
- { "new-tab", "tab-new", N_ ("Open _Tab"), "<control><shift>t", N_ ("Open a new terminal tab"), G_CALLBACK (terminal_window_action_new_tab), },
+ { "new-tab", "tab-new", N_ ("Open _Tab"), "<control>t", N_ ("Open a new terminal tab"), G_CALLBACK (terminal_window_action_new_tab), },
@AlbertVeli
AlbertVeli / abp.py
Created April 6, 2020 08:47
Apple Banana Pineapple puzzle
#!/usr/bin/env python3
from z3 import *
a, b, p = Reals('a b p')
s = Solver()
s.add((a / (b + p)) + (b / (a + p)) + (p / (a + b)) == 4)
s.add(b != -p)
s.add(a != -p)
s.add(a != -b)
@AlbertVeli
AlbertVeli / correcthorsebatterystaple.txt
Created July 7, 2020 13:34
CorrectHorseBatteryStaple
# Create xkcd hash
echo -n "CorrectHorseBatteryStaple" | md5sum | awk '{ print $1 }' > md5.hash
cat md5.hash
f6f9b174745fa4651f750c36957d674c
# Get 20k wordlist (containing all 4 words)
wget https://raw.githubusercontent.com/first20hours/google-10000-english/master/20k.txt
# Pick 2k top words to speed up attack:
head -2000 20k.txt > 2k.txt
@AlbertVeli
AlbertVeli / d2.py
Created December 2, 2020 22:10
aoc day2
#!/usr/bin/env python3
import sys
# Return list of [(min, max), char, password]
def read_input(fname):
r = []
for line in open(fname).read().splitlines():
a = line.split()
a[0] = tuple(map(int, a[0].split('-')))