Skip to content

Instantly share code, notes, and snippets.

@sgtoj
sgtoj / persistent_c_mount_wsl.sh
Last active January 29, 2024 06:11
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# allow `mount` cmd without password
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo')
# add the mount directive to `fstab`
sudo mkdir -p /c
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# update to `.bashrc` to auto mount at login
echo "sudo mount -a" >> ~/.bashrc
# now reload it
source ~/.bashrc
@raphw
raphw / WeakeningAgent.java
Last active January 23, 2021 11:40
A Java agent for fixing exports for an app that is not yet Java 9 aware.
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Layer;
import java.lang.reflect.Module;
import java.util.*;
public class WeakeningAgent {
public static void premain(String argument, Instrumentation instrumentation) {
boolean full = argument != null && argument.equals("full");
Set<Module> importing = new HashSet<>(), exporting = new HashSet<>();
/**
* {@link Kalman} is an one dimensional implementation of KALMAN filter used to
* predict a noisy signal containing fluctuations due to measurement errors, noise etc.
*
* @author AchuthaRanga.Chenna
*
*/
public class SimpleKalman {
/** process noise COVARIANCE */
private double q = 1.48d;
@mmdemirbas
mmdemirbas / LogFile.udl.xml
Created September 13, 2012 11:34
Custom log file syntax highlighting for Notepad++
<NotepadPlus>
<UserLang name="LogFile" ext="log">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">[(0])0</Keywords>
<Keywords name="Folder+"></Keywords>