Skip to content

Instantly share code, notes, and snippets.

@mistificator
mistificator / smb.reg
Last active October 25, 2023 14:20
.reg file that registers URL protocol "smb://" for SMB shared folders
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\smb]
"URL Protocol"=""
[HKEY_CLASSES_ROOT\smb\shell]
[HKEY_CLASSES_ROOT\smb\shell\open]
[HKEY_CLASSES_ROOT\smb\shell\open\command]
@="powershell -WindowStyle Hidden -Command \"& { Invoke-Expression $(-join('cmd /c', [URI]::UnescapeDataString('start %1').Replace('smb://', '//').Replace('/', '\\'))) }\""
@mistificator
mistificator / readme.md
Last active August 13, 2023 10:44
How to run ESXDOS in Fuse emulator of ZX Spectrum

How to run ESXDOS in Fuse emulator of ZX Spectrum

1. Preparing disk image

1.1 Getting HdfMonkey, building and installing it

git clone https://github.com/gasman/hdfmonkey.git

dpkg-source -b hdfmonkey

dpkg-buildpackage

@mistificator
mistificator / async_start_gui_remote.sh
Last active December 7, 2022 10:05
command to asynchronously start GUI app on remote host inside XRDP session
#!/bin/sh
# command to asynchronously start GUI app on remote host inside XRDP session (batch command is part of "at" package)
ssh user@host "echo 'DISPLAY=:10 app_name' | at now"
@mistificator
mistificator / torrc
Created March 23, 2022 08:31
Sample torrc configuration file for using with Tor
#
# torrc configuration file that allows to setup Tor-proxy on port 8080 through another proxy in LAN on port 3128 with obfs4 transport
#
# 1. On Windows install Tor as service
# tor -service install --options -f "c:\Users\user\AppData\Roaming\tor\torrc" | more
#
# 2. Check Tor is working (SOCKS port checking)
# netstat -aon | findstr ":9050"
#
# 3. Set proxy in browser to 127.0.0.1:8080 for both HTTP and HTTPS
@mistificator
mistificator / extended_view.sql
Created March 15, 2022 07:35
PL/pgSQL procedure that makes view of data with rows transponded to columns. In this code %1 is placeholder for table suffix and %2 is placeholder for object number.
DO $$
DECLARE
objs INTEGER[];
r RECORD;
i INTEGER;
subquery_str TEXT;
with_str TEXT;
from_str TEXT;
query_str TEXT;
where_str TEXT;
@mistificator
mistificator / postgresql_foreign_select.sql
Created November 3, 2021 15:19
PostgreSQL select table from foreign server
DROP FOREIGN TABLE IF EXISTS server2_cdg_types;
DROP USER MAPPING IF EXISTS FOR postgres SERVER server2;
DROP SERVER IF EXISTS server2;
DROP EXTENSION IF EXISTS postgres_fdw;
CREATE EXTENSION IF NOT EXISTS postgres_fdw;
CREATE SERVER server2
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host '127.0.0.1', port '5432', dbname 'postgres');
@mistificator
mistificator / KEYZX.ASM
Last active July 28, 2022 20:40
KEYZX - keyboard driver for CP/M on ZX Spectrum
; KEYZX.ASM is keyboard driver for CP/M on ZX Spectrum
; (c) 2021, 2022 ZXLDR
;
; zxldr@yandex.ru
; get char routine (wait for key)
Get_Char: ; out: a - char code
ld hl, (0x39)
ld bc, rst_38_routine
@mistificator
mistificator / tape_port.asm
Last active August 16, 2021 13:41
ZX Spectrum tape pulses measure
;
; Tape bit lengths
;
org 0x8000
di
ld sp, stack
@mistificator
mistificator / tape_parse.asm
Last active August 18, 2021 18:31
ZX Spectrum demo tape loader
;
; Demo tape loader by Mist Poryvaev.
;
; Loads two-section tape: e.g. BASIC loader and one code block.
; Look the .TAP file image at location 0x9000.
;
; start in non-contended memory, or tape input latency will be unpredictable
org 0x8000
@mistificator
mistificator / zx_4color.asm
Last active November 23, 2020 18:57
ZX Spectrum - 4 colors at one char position demo
basic48_cls equ 0x0D6B
org 25000
ld a, 00000111b ; PAPER 0, INK 7
ld (iy + 83), a ; ATTR-P
xor a ; BORDER 0
out (0xFE), a
ld (iy + 14), a ; BORDCR
call basic48_cls