Skip to content

Instantly share code, notes, and snippets.

View michael-o's full-sized avatar

Michael Osipov michael-o

View GitHub Profile
@michael-o
michael-o / autounattend.xml
Last active October 19, 2025 17:12
Minimal Windows 11 Setup
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<!--https://schneegans.de/windows/unattend-generator/?LanguageMode=Interactive&ProcessorArchitecture=amd64&BypassRequirementsCheck=true&BypassNetworkCheck=true&ComputerNameMode=Random&CompactOsMode=Default&TimeZoneMode=Implicit&PartitionMode=Interactive&DiskAssertionMode=Skip&WindowsEditionMode=Interactive&InstallFromMode=Automatic&PEMode=Default&UserAccountMode=Unattended&AccountName0=User&AccountDisplayName0=&AccountPassword0=&AccountGroup0=Administrators&AutoLogonMode=Own&PasswordExpirationMode=Default&LockoutMode=Default&HideFiles=Hidden&TaskbarSearch=Box&TaskbarIconsMode=Default&StartTilesMode=Default&StartPinsMode=Default&EffectsMode=Default&DesktopIconsMode=Default&StartFoldersMode=Default&WifiMode=Interactive&ExpressSettings=DisableAll&LockKeysMode=Skip&StickyKeysMode=Default&ColorMode=Default&WallpaperMode=Default&LockScreenMode=Default&Remove3DVi
@michael-o
michael-o / mapping.md
Last active October 2, 2025 18:04
Mapping Flags/Tags between Open-Xchange (OX) App Suite (Webmail) UI and Thunderbird

Mapping Flags (Tags, Labels) Between Open-Xchange (OX) App Suite (Webmail) UI and Mozilla Thunderbird

Both Thunderbird (TB) and OX App Suite (OX AS) provide message flagging features. While OX AS has only ten predefined flags named by colors, Thunderbird allows an arbitrary number of flags. The flags in OX AS cannot be customized by the user and are localized for display, but their underlying values are well defined and language agnostic.

Through reverse engineering via IMAP, I discovered that these flags are named from $cl_0 through $cl_10. IMAP allows querying the FLAGS set in addition to the standard IMAP flags. All additional flags are custom and not standardized.

Here’s an example of probing via IMAP (C: denotes client, S: denotes server):

@michael-o
michael-o / DirTest.java
Created June 12, 2025 16:14
NPE with GSS-API + TLS with Active Directory
public static void main(String[] args) throws NamingException {
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldaps://<fqdn>");
env.put(Context.SECURITY_AUTHENTICATION, "GSSAPI");
env.put(Sasl.SERVER_AUTH, "true");
env.put(Sasl.QOP, "auth-int");
env.put("com.sun.jndi.ldap.trace.ber", System.err);
env.put("java.naming.ldap.version", "3");
@michael-o
michael-o / PrincipalTransformingRealm.java
Created May 30, 2025 12:40
PrincipalTransformingRealm
import java.io.IOException;
import java.security.Principal;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
$ gmake clean-native OS_NAME=FreeBSD OS_ARCH=x86_64 native CC=cc CCFLAGS="-I/usr/local/openjdk8/include -I/usr/local/openjdk8/include/freebsd -Os -fPIC -fvisibility=hidden"
rm -rf target/native-FreeBSD-x86_64
running: cc -I/usr/local/openjdk8/include -I/usr/local/openjdk8/include/freebsd -Os -fPIC -fvisibility=hidden -c src/main/native/jansi.c -o target/native-FreeBSD-x86_64/jansi.o
cc -I/usr/local/openjdk8/include -I/usr/local/openjdk8/include/freebsd -Os -fPIC -fvisibility=hidden -c src/main/native/jansi.c -o target/native-FreeBSD-x86_64/jansi.o
running: cc -I/usr/local/openjdk8/include -I/usr/local/openjdk8/include/freebsd -Os -fPIC -fvisibility=hidden -c src/main/native/jansi_isatty.c -o target/native-FreeBSD-x86_64/jansi_isatty.o
cc -I/usr/local/openjdk8/include -I/usr/local/openjdk8/include/freebsd -Os -fPIC -fvisibility=hidden -c src/main/native/jansi_isatty.c -o target/native-FreeBSD-x86_64/jansi_isatty.o
running: cc -I/usr/local/openjdk8/include -I/usr/local/openjdk8/include/freebsd -Os -fPIC -fvisib
@michael-o
michael-o / AprTest.java
Created May 25, 2021 12:42
Spin up APR server socket in Java
import org.apache.tomcat.jni.Address;
import org.apache.tomcat.jni.Pool;
import org.apache.tomcat.jni.Socket;
import org.apache.tomcat.jni.Library;
import org.apache.tomcat.jni.OS;
public class AprTest {
public static void main(String... args) throws Exception {
String hostname = null;