Skip to content

Instantly share code, notes, and snippets.

View niderhoff's full-sized avatar
:octocat:
All it takes to become a data scientist: 5 PhD's & 87 years of job experience.

Nicolas Iderhoff niderhoff

:octocat:
All it takes to become a data scientist: 5 PhD's & 87 years of job experience.
View GitHub Profile
@niderhoff
niderhoff / tmux.sh
Created April 9, 2018 13:45
create multiple tmux panes from bash script
#!/bin/bash
SESSIONNAME="niid"
STARTDIR="/home/niid/Documents/Projects"
tmux has-session -t apr &> /dev/null
if [ $? != 0 ]
then
tmux new-session -s $SESSIONNAME -c $STARTDIR/TCM -n "jptr" -d
tmux send-keys -t $SESSIONNAME:0 "source activate TCM" C-m
@niderhoff
niderhoff / git-cmds.md
Last active January 25, 2021 14:24
Handy git commands

Handy git cmds

checkout earlier commit for a specific file only

this will delete your local version!!

go back to commit x (=c5f567)

git checkout c5f567 -- file/1/to/restore file/2/to/restore
@niderhoff
niderhoff / gist:519441d6e8fe1b88ab47118275a348d3
Last active June 29, 2021 08:16
Fix WSL2 nameserver for VPN
  1. find out your nameserver in the vpn/intranet by opening powershell and writing nslookup
PS C:\Users\niderhof> nslookup
Standardserver:  S4DE4ZSYDIEE123.abc-sa.xxxxx.xyz
Address:  66.66.666.66 <--------

that is the nameserver you want WSL to use also.

@niderhoff
niderhoff / README.md
Last active June 30, 2021 10:23
VS Code Attach to running container fromCLI

Attach to VS Code Running Container from CLI

Usage:

chmod +x code_attach
code_attach <container_name> <path> <docker_context>
  • container_name: name of the running container
@niderhoff
niderhoff / autoenv.sh
Created July 29, 2021 08:26
auto venv bash
# venv
function deactivate_venv() {
parentdir=$(dirname "${VIRTUAL_ENV}")
if [[ "$PWD"/ != "$parentdir"/* && -n "$(command -v deactivate)" ]] ; then
echo "Deactivating ${VIRTUAL_ENV}"
deactivate
activate_venv
fi
}
function activate_venv() {