Skip to content

Instantly share code, notes, and snippets.

@axxapy
axxapy / wsl_docker_ssh.md
Last active January 4, 2024 05:39
ssh into WSL2 ubuntu

Summary

The problem addressed here is the challenge of accessing a WSL (Windows Subsystem for Linux) instance from an external network. By default, WSL instances are not directly accessible from outside the host machine. This guide presents a solution using Docker and SSH proxying to allow SSH access to the WSL instance from an external machine via the host machine's Windows IP address.

Prerequisites

  • Windows 10/11
  • WSL2
  • Docker Desktop with WSL support enabled
  • Ubuntu (or another Linux distribution)

Concept

@axxapy
axxapy / exportIndexedDB.js
Last active February 10, 2022 04:07
export indexedDB as a json
((storeName) => {
let _result = {}
const _req = indexedDB.open(storeName)
_req.onsuccess = async () => {
const db = _req.result
let semaphore = 0
for (num in [...db.objectStoreNames]) {
semaphore++
const tableName = db.objectStoreNames[num]
db.transaction(tableName, 'readonly').objectStore(tableName).getAll().onsuccess = (e) => {
@axxapy
axxapy / steam_autoupdate_disable.sh
Last active January 7, 2022 23:42
Disables steam auto update for all installed games (linux)
#!/bin/bash
# https://www.cyberciti.biz/faq/how-to-use-sed-to-find-and-replace-text-in-files-in-linux-unix-shell/
STEAM_PATH="$HOME/.local/share/Steam"
LIBS=($(cat "$STEAM_PATH/config/libraryfolders.vdf" | grep '"path"' | sed s/\"path\"//g | sed s/\"//g))
for LIB_DIR in ${LIBS[@]}; do
GAMES=($(ls -1 "$LIB_DIR"/steamapps/appmanifest_*.acf))
@axxapy
axxapy / runkit.patch
Created April 25, 2015 07:34
runkit php 5.6 fix
diff --git a/runkit_import.c b/runkit_import.c
index e3bc1f7..d7ab65f 100644
--- a/runkit_import.c
+++ b/runkit_import.c
@@ -217,13 +217,13 @@ static int php_runkit_import_class_consts(zend_class_entry *dce, zend_class_entr
}
}
if (
- Z_TYPE_PP(c) == IS_CONSTANT_ARRAY
+ Z_TYPE_PP(c) == IS_CONSTANT_AST
@axxapy
axxapy / install ntfs-3g on mac
Last active January 1, 2016 00:27
ntfs on mac
original: https://github.com/bfleischer/fuse_wait
oosxfuse: http://sourceforge.net/projects/osxfuse/files/osxfuse-2.7.5/osxfuse-2.7.5.dmg/download
ntfs-3g: http://sourceforge.net/projects/catacombae/files/NTFS-3G%20for%20Mac%20OS%20X/
fuse_wait fix: https://github.com/downloads/bfleischer/fuse_wait/fuse_wait-1.1.pkg
# NTFS-3G for Mac OS X
@axxapy
axxapy / prepare-commit-msg
Last active August 29, 2015 14:05
Git hook which adds ticket number extracted from branch name (like TICKET-123_comment) to every commit message.
#!/bin/bash
#
# This hook adds ticket number from branch name to every commit message
#
BRANCH_NAME=$(git symbolic-ref --short HEAD)
MSG=$(head -n 1 $1)
[[ -z "$BRANCH_NAME" ]] && exit 0
if [ "$BRANCH_NAME" = "master" ]; then