Skip to content

Instantly share code, notes, and snippets.

View mz0's full-sized avatar
🥎
Թակել յոթ դուռ, մինչեվ մեկը կբացվի

Mark Zhitomirski mz0

🥎
Թակել յոթ դուռ, մինչեվ մեկը կբացվի
View GitHub Profile
@mz0
mz0 / fscrypt-enable.sh
Last active November 5, 2025 06:33
Ubuntu *fscrypt* (Ext4 / F2FS only. See `gocryptfs` for XFS/Btrfs) https://github.com/google/fscrypt
sudo apt install fscrypt libpam-fscrypt
# encrypt only filesytem with /home (it may be in '/' filesystem)
FileSystem=$(grep -E ' (/home|/) ' /proc/mounts | grep -o '^[^ ]*')
getconf PAGE_SIZE # 4096
# TODO check Ext2/Ext3 (FSFS, UBIFS ??)
sudo tune2fs -l $FileSystem | grep 'Block size'
sudo tune2fs -O encrypt $FileSystem
sudo fscrypt setup
sudo pam-auth-update
@mz0
mz0 / create-homed-user.sh
Last active December 15, 2024 19:37
Ubuntu 24.04 setting up user with systemd-homed
apt-cache policy systemd-homed
# systemd-homed: Candidate: 255.4-1ubuntu8.4
sudo apt install systemd-homed
# The following NEW packages installed: systemd-homed systemd-userdbd
sudo homectl --real-name=ZM \
--uid=60131 \
--kill-processes=false \
--member-of=docker,dip,lpadmin,plugdev,ops,sudo,users,wireshark \
@mz0
mz0 / homoiconic-python-post.md
Created May 13, 2024 12:47 — forked from aburjg/homoiconic-python-post.md
Homoiconic Python Post
@mz0
mz0 / Readme-Windows.md
Last active February 23, 2023 21:16
Shsha Windows development

Install Java

We are turning off PATH, JAVA_HOME modifications so we can install multiple versions of Java, and set PATH as needed per-project. However

  • we do not provide instructions for this scenario (TODO jps)
  • if this is the only Java on your workstation, you can let setup do these changes for you
winget install --interactive BellSoft.LibericaJDK.11

Interactively set this location C:\JDK\11, and turn off PATH, JAVA_HOME, and Jar assotiation

Setup JDK11

@mz0
mz0 / tomcat-shsha
Created January 31, 2022 12:49
Tomcat/Shsha(w/Hazelcast 3.12) Unit file for EL7/JDK11
# this is /etc/default/tomcat-shsha
TOMCAT=/srv/tomcat
JAVA_OPTS=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
-Djdk.tls.ephemeralDHKeySize=2048 \
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources \
-Dorg.apache.catalina.security.SecurityListener.UMASK=0027 \
-Dhazelcast.logging.type=log4j2 \
--add-modules java.se \
--add-exports java.base/jdk.internal.ref=ALL-UNNAMED \
@mz0
mz0 / log4j2.properties
Last active April 15, 2021 12:26
Shsha Log4j2 selective debug configuration
property.level = info
property.path = logs
property.filename = shsha
property.layout_pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{-10}:%L - %m%n
property.console_pattern = %d{HH:mm:ss} %-5p %c{-10}:%L - %m%n
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = ${console_pattern}
@mz0
mz0 / docker-compose.yml
Created March 2, 2021 14:27
MS SQL container
# docker-compose.yml, v3.5 allows defining networks right here
version: "3.5"
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
container_name: mssql
volumes:
- mssql-data:/var/opt/mssql
networks:
@mz0
mz0 / netbeans.desktop
Created January 30, 2021 20:43
No-nonsense Apache NetBeans 12.2 .desktop file
[Desktop Entry]
Version=1.0
Type=Application
Name=NetBeans
Icon=/home/mz0/t/nb12.2/netbeans/nb/netbeans.png
Exec=/home/mz0/t/nb12.2/netbeans/bin/netbeans
Comment=Apache NetBeans IDE 12.2
Categories=Development;IDE;
Terminal=false
StartupWMClass=Apache NetBeans IDE 12.2
CREATE TABLE upMsg (
id int,
msg varchar(31)
);
insert into upMsg values (1, "Foo");
insert into upMsg values (2, "Bar");
CREATE TABLE dnMsg (
ni int not null auto_increment primary key,
id int not null,