Skip to content

Instantly share code, notes, and snippets.

View jgwill's full-sized avatar

Guillaume Descoteaux-Isabelle jgwill

View GitHub Profile
@jgwill
jgwill / jgwill-docker-node-210131-install.sh
Last active January 31, 2021 16:57
jgwill/node - Docker package installer running in the build script of the container
npm i node-gip --y
npm i ginol --g
npm i gixb --g
npm i miur --g
@jgwill
jgwill / gfs-git-dup.sh
Created January 24, 2021 04:54
Duplicate GIT branching - branch a file to a new one and keep the original using the same data in the repo so they wont be stored twice
#!/bin/bash
dupsrc=$1
newname=$2
branchname="dup-$dupsrc-$newname"
git checkout -b $branchname
git mv "$dupsrc" "$newname"
git commit . -m "dup:mv $dupsrc $newname"
@jgwill
jgwill / 00-git-dup-file-2101082331.md
Last active January 9, 2021 04:55
Branch copy-merge strategy for GIT to duplicate file that uses the same source in the repo

Branch copy-merge strategy for GIT to duplicate file that uses the same source in the repo

# I RAN BRANCHING twice with theses two dir with few operation at the end
export targetdir=gia-young-picasso-v05-2101082232
export srcdir1=gia-young-picasso-v05-add
export srcdir2=gia-young-picasso-v03-201216

## BRANCHING
for srcdir in $srcdir1 $srcdir2; do
@jgwill
jgwill / bash_aliases__hawk.sh
Created January 7, 2021 11:47
@stcgoal Enhance existing linux output commands (History)
#@STCGoal Enhance existing linux output commands
alias hawk="history | awk '// { print \$2\" \"\$3\" \"\$4\" \"\$5\" \"\$6\" \"\$7\" \"\$8\" \"\$9\" \"\$10\" \"\$11\" \"\$12\" \"\$13\" \"\$14\" \" }
## INSTALL
### ADD to .bash_aliases in $HOME
vi $HOME/.bash_aliases
@jgwill
jgwill / Can we tar achive via SSH? 201223171246.md
Last active December 23, 2020 23:41
Can we tar achive via SSH? 201223171246

#Can we tar achive via SSH?

YES

This script does :

  • connect to the host
  • change dir to the desired
  • extract into local dir desired
@jgwill
jgwill / gia-replicate-ref2012231720.pl
Created December 23, 2020 22:38
@stcissue How do you manage machine learning learning states adequately ?
import torch
import replicate
def train():
# Save training code and hyperparameters
experiment = replicate.init(path=".", params={...})
model = Model()
for epoch in range(num_epochs):
# ...
@jgwill
jgwill / bash-for-f-append-suffix.sh
Last active December 16, 2020 11:09
BASH Script appending suffix to each file in current dir to a target dir 2012160339 & related
td=/a/lib/results/_comparer_it-135k-300k-model_gia-young-picasso-201210_new
ext=jpg
suffix="-300k"
for f in x*1k* ; do ft=${f%.*} ;echo "cp $f $td/$ft$suffix.$ext" ; done
@jgwill
jgwill / remote-x11-bashrc-autoset-display.md
Created December 6, 2020 01:44
Remote X11 Forwarding - An auto setting of the SSH (remote) IP as a target for the display

Remote X11 Forwarding - An auto setting of the SSH (remote) IP as a target for the display

Add to .bashrc

export myip=$(export myipis=$(last | grep "still logged" | awk '/still/ { print $3 }') ; echo $myipis | awk '// { print $1 }')
export DISPLAY=$myip:0.0
@jgwill
jgwill / x__github_api__nodejs__2012030818.dissimination-method-.md
Last active December 3, 2020 13:56
@stcgoal Create Gist really quickly when experimenting

#--@STCGoal Create Gist really quickly when experimenting

##--@STCIssue Why creating Gist when Experimenting ?


Well, what else ??

Here is what created that content anyway

@jgwill
jgwill / 00-status-WSL-Ubuntu-setup-20112611.md
Last active May 9, 2022 19:26
WSL Ubuntu setup 2011261142

Docker Desktop WSL 2 backend is not supported yet with GPUs. You will have to install Docker as you would traditionally in Linux for WSL 2 and then install NVIDIA Container Toolkit (or nvidia-docker2) for now. nvidia-container-toolkit and nvidia-docker2 in the end are just wrappers. There is a slight variation depending on which version of Docker you use (19.03 vs. 18.09), but if you chose to install nvidia-docker2, then that works across both releases of Docker. I’ll look into making that more clear in the documentation. nvidia-smi does not work because we don’t support NVML in WSL 2 yet - this is part of the Known Limitations in the user-guide. We will be adding support for it in the near future. >https://forums.developer.nvidia.com/t/hiccups-setting-up-wsl2-cuda/128641