Skip to content

Instantly share code, notes, and snippets.

View szkrd's full-sized avatar

szabolcs kurdi szkrd

  • tralfamadore
View GitHub Profile

creating a pixelated font from a tilemap

software needed

  1. imagemagick
  2. potrace

1. download the fontmap

@szkrd
szkrd / npr-100-scifi-fantasy.md
Created April 7, 2023 18:05
NPR Top 100 Science-Fiction, Fantasy Books

SF Masterworks

Details: https://en.wikipedia.org/wiki/SF_Masterworks

  • 334 - Thomas Disch
  • A Canticle for Leibowitz - Walter M. Miller Jr.
  • A Case of Conscience - James Blish
  • A Deepness in the Sky - Vernor Vinge
  • A Fall of Moondust - Arthur C. Clarke
  • A Fire Upon the Deep - Vernor Vinge
@szkrd
szkrd / news.js
Created March 18, 2023 10:58
the proper amount of daily news
#!/usr/bin/env -S node --no-warnings
const { JSDOM } = require("jsdom");
const ua = 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0';
function listHeadlines(url, title, selector) {
return fetch(url, { headers: { "User-Agent": ua}}).then((res) => res.text()).then((text) => {
const doc = (new JSDOM(text)).window.document;
const titles = Array.from(doc.querySelectorAll(selector)).map(el => el.textContent.trim());
console.log(`====== [${title}] ======`);
titles.forEach((text) => console.log(`* ${text}`));
});
@szkrd
szkrd / ice.md
Last active January 29, 2023 10:36
From roller skates to ice skates

From roller skates to ice skates

If you're reading this because we talked at the course held by Aya & Angela, Glide Roller Skating (GRS), then you can find me on facebook, but I comment from time to time at the (mostly Hungarian) group Dunaguri.

Angela is active in the Artistic Roller Skating group as well, but I'll miss their lessons greatly and it saddens my heart to loose such wonderful teachers. I'm a novice, I started roller skating early 2022 and while I practice a lot, please take what I say with a grain salt, there are hundred times better and better informed skaters out there.

@szkrd
szkrd / monswap-top-bottom.ahk
Created September 9, 2022 21:45
Swap all windows between two vertical monitors (2nd top, primary 1st bottom)
; MonSwap - Swaps all the application windows from one monitor to another.
; see: https://www.autohotkey.com/boards/viewtopic.php?t=68311
; v1.0.0 Author: Alan Henager
; v1.0.1 Xenrik - Updated to use relative screen size when swapping
; v1.0.2 Boiler, Masgo - exclude Windows 10 secondary monitor taskbar from being swapped
; v1.0.3 Szkrd - dumbing it down for two vertical monitors, 1 below, 2 above
; +-------+
; | 2 |
; +-------+
; +-------+
@szkrd
szkrd / forward-rot.js
Last active March 2, 2022 13:18
bi-directional port forwarding with a dumb rot13 cypher
// this is a very simple implementation of rot13 cypher over sockets, to avoid primitive
// deep packet inspection (https://gist.github.com/gmurdocca/88857b58dc4668d88b0d0fae6ebf8b64);
// a more robust solution would be to use obs4 (https://github.com/Yawning/obfs4), which
// implements the ScrambleSuit protocol as a tor transport plugin with a standalone
// runner/wrapper (for example https://github.com/twisteroidambassador/ptadapter in python)
const net = require('net');
const parseIpPort = (s = '') => ({ ip: s.split(':')[0], port: parseInt(s.split(':')[1], 10) });
const addrs = { from: parseIpPort(process.argv[2]), to: parseIpPort(process.argv[3]) };
const ports = { from: addrs.from.port, to: addrs.to.port }
const hosts = { from: addrs.from.ip, to: addrs.to.ip }
@szkrd
szkrd / forward.js
Created February 22, 2022 19:50
Wait for interface to come up then start forwarder to local server (windows).
const net = require('net');
const spawn = require('child_process').spawn;
const ports = [80, 5000];
const sleepSecs = 30;
const interfaceMatcher = /(169\.254\.[\d\.]+)/;
function doForward(listenInterface = '0.0.0.0') {
const server = net.createServer(function (from) {
const to = net.createConnection({ host: '127.0.0.1', port: ports[1] });
from.pipe(to).on('error', (err) => console.log('from error', err.code));
@szkrd
szkrd / md2pdf.js
Last active November 4, 2022 03:35
convert markdown to pdf using puppeteer
// first: `npm init -- yes && npm i -S showdown@1.9.1 github-markdown-css@5.1.0 serve@13.0.2 puppeteer-core`
// then: `node . --help`
const fs = require('fs');
const http = require('http');
const puppeteer = require('puppeteer-core');
const showdown = require('showdown');
const githubMarkdownCss = fs.readFileSync(require.resolve('github-markdown-css'), 'utf8');
const handler = require('serve-handler'); // without serve loading local files, like images, would not be possible
const die = (text = '', code = 1) => process.exit(~~console.error(text) + code);
@szkrd
szkrd / xiaomi-redmi-4x-unlock.md
Created August 10, 2021 16:32
Xiaomi Redmi 4x unlock, lineage install and root

Unlock Xiaomi Redmi 4X (santoni) and install Lineage OS via sideloading

So far the most useful documentation was at Lineage's Redmi section, random "mobile enthusiast" sites were "not very good" and youtube videos are to be avoided like the plague.

Files needed

  • SDK platform tools from android.com
  • mi flash unlock gui tool (miflash_unlock-en-5.5.224.24.zip)
  • newest twrp for device (twrp-3.5.2_9-0-santoni.img), from twrp site