Skip to content

Instantly share code, notes, and snippets.

View tautomer's full-sized avatar

Xinyang Li tautomer

View GitHub Profile
@tautomer
tautomer / Launch VcXsrv from WSL at Startup.md
Last active November 3, 2019 02:43
Launch VcXsrv from WSL at Startup

Add the following line of Python code to you dot files, like .profile, .bashrc, .bash_profile, .zshrc, etc.

python -c 'import subprocess as sp; p=sp.Popen(["/mnt/c/Program Files/VcXsrv/vcxsrv.exe", ":0", "-ac", "-terminate", "-lesspointer", "-multiwindow", "-clipboard", "-wgl", "-silent-dup-error"])' 2>/dev/null
  • VcXsrv.exe is assumed to be installed in C:\Porgam Files. Change it if it is not the case.
  • For safety, I am using Python 2 here. Feel free to change it to Python 3.
@tautomer
tautomer / install-ubuntu-wsl-debian.sh
Created October 31, 2019 01:20
manually install ubuntu-wsl on debian
wget http://mirrors.kernel.org/ubuntu/pool/main/w/wslu/wslu_2.0.0-0ubuntu2_all.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/u/ubuntu-meta/ubuntu-wsl_1.431_amd64.deb
sudo dpkg -i wslu_2.0.0-0ubuntu2_all.deb
sudo dpkg -i ubuntu-wsl_1.431_amd64.deb
sudo apt --fix-broken install -y
@tautomer
tautomer / karabiner.json
Created October 30, 2019 01:43
Karabiner config file for CoolerMaster QuickFire Rapid
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@tautomer
tautomer / install_latest_pandoc.sh
Last active October 27, 2019 02:40
Install latest pandoc with the official deb on debain family distros. The one installed via apt is very old.
json="https://api.github.com/repos/jgm/pandoc/releases/latest"
dl_url=$(curl -s $json | grep deb latest | tail -n 1 | cut -d'"' -f4)
wget $dl_url
deb=$(basename $dl_url)
sudo dpkg -i $deb
rm -f $deb
@tautomer
tautomer / compile_gnuplot_m1_mac.sh
Last active August 3, 2022 19:33
Compile gnuplot on Mac with x11 and wxt. Qt is dropped.
# Homebrew removed the support of adding options while compiling, so there isn't x11 or wx term availble anymore
# Here I'm going to remove the gnuplot installation from homebrew and compile it myslef and then relink
# remove the one from homebrew or this script
if [[ ! -z $(brew list | grep gnuplot) ]]; then
if [[ ! -z $(brew list --pinned | grep gnuplot) ]]; then
brew unpin gnuplot
brew unlink gnuplot
fi
brew uninstall gnuplot
@tautomer
tautomer / startTerminator.vbs
Last active October 30, 2019 11:08 — forked from ropnop/startTerminator.vbs
VBS Script to Check if vcxsrv.exe Is Running and Launch Terminator through WSL 2
Function IsProcessRunning(strProcess)
Dim Process, strObject
IsProcessRunning = False
strObject = "winmgmts://."
For Each Process in GetObject(strObject).InstancesOf("win32_process")
If UCase(Process.name) = UCase(strProcess) Then
IsProcessRunning = True
Exit Function
End If
Next