Skip to content

Instantly share code, notes, and snippets.

@fedme
fedme / Run Visual Studio Code for Linux from WSL.md
Last active November 8, 2023 09:33
Run Visual Studio Code for Linux from WSL on Windows 10

Run Visual Studio Code for Linux from WSL

Thanks a lot to mredbishop and others for their insturctions posted here. This is just a recap of what they figured out.

This process was tested on WSL Ubuntu 18.04.

Install VcXsrv on Windows

  1. Dowload the VcXsrv installer from https://sourceforge.net/projects/vcxsrv/
  2. Install the software on Windows

Add VS Code repositories

@noelbundick
noelbundick / LICENSE
Last active June 20, 2025 18:44
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@flozz
flozz / gnome_shell_wayland_meta_window_hack.py
Created May 14, 2018 18:06
A small hack that allows to manipulate windows on GNOME Shell / Wayland
#!/usr/bin/env python
import json
import pydbus
GNOME_SHELL = "org.gnome.Shell"
META_WINDOW_JS = """
(function(params) {
@christian-eriksson
christian-eriksson / window_finder_bash.sh
Last active February 18, 2025 13:34
Script using xprop and grep to look for a provided (as cmd-line argument) WM_CLASS. The script identifies a window which has a grandparent with 2 children somewhere in it's tree.
#!/bin/bash
# The script is looking for a window with a given WM_CLASS property. The window
# will be attached to the root node (R in the graph below), the root note is
# what you get from 'xprop -root'. There are two different types of windows with
# the same WM_CLASS (Q and W) but their tree structures are different. However,
# the tree structure of the two windows are different as seen in the graph
# below.
#
# R
@niclasnilsson
niclasnilsson / config
Last active June 17, 2021 13:30
Example ~/.ssh/config for dealing with JSch and public key authentication with encrypted (password protected) keys.
# Example ~/.ssh/config for dealing with JSch problems regarding
# ssh public key authentication with encrypted (password protected) keys.
#
# First, a problem description and a couple of solutions that worked for me,
# (in March 2018 on MacOS High Sierra) and in the bottom youäll find an example
# config that doesn't interfere with JSch's use of the ssh-agent.
#
#
# Problem description:
# --------------------
@t184256
t184256 / example_remap.py
Created January 19, 2018 03:26
A thoroughly annotated example on keyboard remapping with evdev/uinput.
#!/usr/bin/python3
# CC0, originally written by t184256.
# This is an example Python program for Linux that remaps a keyboard.
# The events (key presses releases and repeats), are captured with evdev,
# and then injected back with uinput.
# This approach should work in X, Wayland, anywhere!
@sparksbat
sparksbat / ProcessUtils.cs
Created October 24, 2017 21:23
C# Get Foreground Process
using System;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace FGWindow
{
class ProcessUtils
{
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
@nitrag
nitrag / convert_m4b.sh
Last active July 9, 2025 01:54
Audibook convert m4b to mp3. This will split into chaptered mp3 files and automatically reconfigure proper ID3v2 tags.
#!/bin/bash
#
# sudo apt-get install id3v2 ffmpeg
#
# USAGE:
# cd /book title/
# bash ~/this_script_path.sh
# rm *.m4b (you need to manually remove the original in case something goes wrong)
#
#
@szarroug3
szarroug3 / split_audiobook_chapters.py
Last active August 15, 2018 22:50
Split audiobook into chapters
#!/usr/bin/env python
"""
Script to split audiobook chapters into separate files using metadata
"""
from __future__ import print_function
import os
import re
@dmn001
dmn001 / apple tv screensavers download command.txt
Last active December 9, 2023 00:50
apple tv screensavers
cat urls.csv | sed 's/\([^,]*\),\(.*mov\)\r/wget "\1" -O "\2"/' | sh
the location and time of day are prepended to the filename.