Skip to content

Instantly share code, notes, and snippets.

@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
@sblendorio
sblendorio / Palette C16 vs C64.bas
Last active August 28, 2019 08:42
Palette C16 vs C64.bas
10 ifpeek(1)>199thenpoke65305,0:poke65301,0
20 ifpeek(1)<200thenpoke53280,0:poke53281,0
30 r$=chr$(18):printchr$(147);
110 printr$chr$(144)" ctrl + 1 "
120 printr$chr$(005)" ctrl + 2 "
130 printr$chr$(028)" ctrl + 3 "
140 printr$chr$(159)" ctrl + 4 "
150 printr$chr$(156)" ctrl + 5 "
160 printr$chr$(030)" ctrl + 6 "
170 printr$chr$(031)" ctrl + 7 "
@sblendorio
sblendorio / Hardware cursor on TED: Commodore 16, Plus 4
Created August 20, 2019 15:06
Hardware cursor on TED: Commodore 16, Plus 4
D 3000 3011
. 3000 A5 CA LDA $CA
. 3002 18 CLC
. 3003 65 C8 ADC $C8
. 3005 8D 0D FF STA $FF0D
. 3008 A5 C9 LDA $C9
. 300A 69 00 ADC #$00
. 300C E9 0B SBC #$0B
. 300E 8D 0C FF STA $FF0C
. 3011 60 RTS