Skip to content

Instantly share code, notes, and snippets.

View bkonetzny's full-sized avatar

Bastian Konetzny bkonetzny

View GitHub Profile
@bkonetzny
bkonetzny / git-diff-check-files.sh
Last active February 21, 2020 09:44
Check a list of changed files, e.g. run through php-cs-fixer
#!/bin/bash
BRANCH=master
git diff --name-status ${BRANCH} | \
while read -r status srcfile destfile
do
if [ -z "$destfile" ]
then
# Use source file (e.g. modified)

Windows 10 (20H1 / 2004 / Mai 2020 Update) with WSL2 is out, this guide should be obsolete now.

Upgrading an existing WSL1 setup to WSL2

Docker in WSL1

Note, this is only needed on Windows 10 Home and WSL1. If you have Windows 10 Pro, you can run Docker for Windows (https://docs.docker.com/docker-for-windows).

After completing this guide, you will have a Windows 10 Home running the docker deamon via Docker Toolbox / VirtualBox. The WSL guest OS will connect to this docker deamon, and will have the Windows OS filesystem mapped as C:\ -> /c/ instead of C:\ -> /mnt/c/, which will fix path translation between docker deamon on Windows and docker client in WSL guest OS.

@bkonetzny
bkonetzny / tunnel-request-through-remote-server.sh
Last active February 21, 2020 09:28
Tunnel a TCP request through a remote server
#!/bin/bash
SSH_HOST=YOUR-REMOTE-SSH-SERVER-HOST
SSH_PORT=YOUR-REMOTE-SSH-SERVER-PORT
LOCAL_HOST=127.0.0.1
LOCAL_PORT=8888
read -p 'Target Host/IP: ' TARGET_HOST
read -p 'Target Port: ' TARGET_PORT
@bkonetzny
bkonetzny / microsoft-edge-local-domains.md
Last active February 4, 2020 09:29
Microsoft Edge and local domains
@bkonetzny
bkonetzny / Vagrantfile
Last active December 20, 2017 12:44
Vagrant synced folders with symlinks
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
if !Vagrant::Util::Platform.windows?
# On Mac, use NFS
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'vers=3', 'tcp', 'fsc', 'actimeo=1']
else
# On Windows, use SMB
# Needs to run CMD as admin for SMB share to work.