Skip to content

Instantly share code, notes, and snippets.

@sblendorio
sblendorio / Quine Commodore 64 BASIC 2.bas
Created October 31, 2025 08:48
Quine Commodore 64 BASIC 2.0
10 dim s$(75):t=0
20 s=41118
30 s$(t)="":i=0
40 if peek(s+i)>128 then 70
50 s$(t)=s$(t)+chr$(peek(s+i))
60 i=i+1:goto 40
70 s$(t)=s$(t)+chr$(peek(s+i)-128)
80 if t<75 then s=s+i+1:t=t+1:goto 30
90 s=peek(43)+peek(44)*256
100 s=s+2
@sblendorio
sblendorio / gist:efd7251c40399dc3dca7207501c5a740
Created October 30, 2025 16:02
Falling stars C64 text mode
10 print chr$(147);
20 print chr$(19)" "chr$(19);
30 print tab(rnd(0)*39)"*"
40 fori=23to0step-1
50 x1=i:x2=i+1
60 poke781,x2:sys59888
70 poke172,peek(60656+x1)
80 poke780,peek(217+x1):sys59848
90 next
100 goto 20
@sblendorio
sblendorio / Mysql dump queries log.sql
Created March 28, 2023 14:22
Mysql dump queries log
mysql> SHOW VARIABLES LIKE "general_log%";
+------------------+----------------------------+
| Variable_name | Value |
+------------------+----------------------------+
| general_log | OFF |
| general_log_file | /var/run/mysqld/mysqld.log |
+------------------+----------------------------+
mysql> SET GLOBAL general_log = 'ON';
@sblendorio
sblendorio / gist:3dc6444b6708997d73d173f904a59d52
Created October 6, 2021 07:16
Block PETSCII Graphics for BBS
package eu.sblendorio.bbs.demo;
import eu.sblendorio.bbs.core.AsciiThread;
import eu.sblendorio.bbs.core.Hidden;
import eu.sblendorio.bbs.core.PetsciiThread;
@Hidden // THIS CLASS IS ONLY FOR EXPERIMENTS
public class GardaconBlockExperiment extends AsciiThread {
10 graphic1,1:dr=0:x=72:y=24
20 reada$,b$:a=dec(a$):b=dec(b$)
30 ifa=255andb=255then80
40 ifa=255andb<>255thendr=0:reada$,b$:a=dec(a$):b=dec(b$):goto60
50 ifa=254thendr=0:readc$,d$:c=dec(c$):d=dec(d$):paint-(b=1),c+x,d+y:goto20
60 ifdr=0thendr=1:draw,a+x,b+y:elsedrawtoa+x,b+y
70 goto20
80 char,10+(x/8),10+(y/8),"basic":char,13+(x/8),13+(y/8),"v3.5"
90 getkeya$:graphicclr
100 data ff,01,23,0b,3a,0b,3a,21,71,21,71,0b,7d,0b,88,16,88,5e,7f,5e,7f,38,40,38
@sblendorio
sblendorio / gist:aeca2feaa3224a02d2d7f81a5b71550d
Created October 27, 2020 11:11
TCPSER for emulating serial modem
sudo tcpser -d /dev/ttyUSB0 -s 1200 -l 5 -i "&k0"
1200 is the baud rate
@sblendorio
sblendorio / Lag test Commodore 64 Joystick and Keyboard.bas
Created December 26, 2019 12:46
Lag test Commodore 64 Joystick and Keyboard.bas
10 poke54272,0
20 poke54273,15
30 poke54277,0
40 poke54278,7
50 poke54296,15
60 i=0
70 reada:ifa=-1then100
80 poke4096+i,a:i=i+1:goto70
100 i=0
110 reada:ifa=-1then130
@sblendorio
sblendorio / Client proxy for use TcpSer with WinUae.java
Last active November 17, 2019 12:49
Client proxy for use TcpSer with WinUae.java
package eu.sblendorio.clienttelnetproxy;
import java.io.*;
import java.net.*;
public class MainClass {
public static void main(String argv[]) throws Exception {
Socket clientWinUae = new Socket("localhost", 1234);
Socket clientTcpSer = new Socket("localhost", 2100);
@sblendorio
sblendorio / get files list from directory.java
Created November 12, 2019 13:50
get files list from directory.java
public static void main(String[] s) {
File file = Paths.get("c:/temp").toFile();
Arrays.stream(file.listFiles()).forEach(System.out::println);
}
@sblendorio
sblendorio / Elasticsearch: GET configuration
Created September 26, 2019 10:05
Elasticsearch: GET configuration
GET /_nodes/_master