Skip to content

Instantly share code, notes, and snippets.

$ cat jdbctest.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class jdbctest {
public static void main(String[] args) {
// JDBC URL, username, and password of MySQL server
String url = "jdbc:mysql://1.1.1.1:3306/DATABASE_NAME"; // Change to your database URL
String user = "USER"; // Change to your username
@SirYaro
SirYaro / gist:319d2b1a5e31d584885015bf69b90094
Created November 6, 2022 12:48
poprawienie oznaczenia dysków jako SSD
root@yaro-desktop2:~# cat /etc/udev/rules.d/60-ssd-scheduler.rules
# set a larger readahead size
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/read_ahead_kb}="1024"
# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}="0"
# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"
# LC_ALL=C strace -f -o /tmp/LO-strace2.txt libreoffice --version
# ----------------------------------
564007 execve("/usr/bin/libreoffice", ["libreoffice", "--version"], 0x7ffd29a5c280 /* 74 vars */) = 0
564007 brk(NULL) = 0x55b520a93000
564007 arch_prctl(0x3001 /* ARCH_??? */, 0x7ffda7989770) = -1 EINVAL (Invalid argument)
564007 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
564007 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
564007 fstat(3, {st_mode=S_IFREG|0644, st_size=185233, ...}) = 0
@SirYaro
SirYaro / gist:4f80d2e880fb72cb31fabc9bdb76bf50
Created November 4, 2022 23:39
libreoffice + mergerfs strace dump
yaro@yaro-desktop2:~$ LC_ALL=C strace libreoffice --version
execve("/usr/bin/libreoffice", ["libreoffice", "--version"], 0x7ffcd298b6d8 /* 74 vars */) = 0
brk(NULL) = 0x558f847ec000
arch_prctl(0x3001 /* ARCH_??? */, 0x7fff10610980) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=185233, ...}) = 0
mmap(NULL, 185233, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5aa3486000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3