Skip to content

Instantly share code, notes, and snippets.

@gnthibault
gnthibault / fstab
Last active December 1, 2020 17:25
Example fstab for cifs/sshfs/nfs
# CIFS with password in clear, or in a file
# content of /home/user/.smbcredentials looks like this:
# username=user.name
# password=password
# domain=WORKSPACE
//smbservername/foldername /home/user/foldername cifs uid=username,rw,user=smbuser,password=smbpassword,vers=3.0 0 0
//smbservername/foldername /home/user/foldername cifs uid=username,rw,credentials=/home/user/.smbcredentials,vers=3.0 0 0
# SSHFS
@gnthibault
gnthibault / get_ubuntu_window_back.txt
Created April 11, 2018 06:23
When ubuntu window is outside of the screen
Be sure to have the off-screen window selected (use Alt-Tab or Super-W for example). Then hold Alt+F7 and move the window with the cursor keys until it appears in the viewport.
@gnthibault
gnthibault / create_python_project.sh
Last active March 25, 2020 08:51
Create python project from start
#!/bin/bash
# Go one level up your git repo directory called project_name
pip install pyscaffold pyscaffoldext-markdown pyscaffoldext-dsproject python-sphinx
putup project_name --markdown --dsproject --force
cd project_name
wget "https://www.gitignore.io/api/vim,python,pycharm,jupyternotebooks" -O .gitignore
# Put you requirements inside requirements.txt, example: matplotlib==3.1.0
@gnthibault
gnthibault / README.md
Created March 16, 2020 23:04 — forked from Sklavit/README.md
Tornado HTTP web page with embedded Bokeh widget which communicates with other page of the same application

Tornado HTTP web page with embedded Bokeh widget which communicates with other page of the same application

Tornado HTTP web page with embedded Bokeh widget which communicates with other page of the same application.

Features

  • Full Tornado server
  • Bokeh server is started from Tornado server and is executed in the same ioloop
  • Embedded Bohek widget by autoload_server
  • 2 web page communication:
@gnthibault
gnthibault / README.md
Created March 16, 2020 23:04 — forked from Sklavit/README.md
Tornado HTTP web page with embedded Bokeh widget which communicates with other page of the same application

Tornado HTTP web page with embedded Bokeh widget which communicates with other page of the same application

Tornado HTTP web page with embedded Bokeh widget which communicates with other page of the same application.

Features

  • Full Tornado server
  • Bokeh server is started from Tornado server and is executed in the same ioloop
  • Embedded Bohek widget by autoload_server
  • 2 web page communication:
@gnthibault
gnthibault / installGDAL.sh
Created March 27, 2018 11:52
Installing GDAL (c++ anf python) on ubuntu 16.04
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt upgrade
sudo apt-get install libgdal-dev libgdal1i
pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL
@gnthibault
gnthibault / tmux.sh
Created April 29, 2019 06:09
Tmux cheatsheet
# create sessionL
tmux new -s thibault1
# list session
tmux ls
#Attach to session
tmux attach -t thibault1
# Quit session
@gnthibault
gnthibault / CondaPipTips.txt
Last active August 28, 2018 14:15
Run pip install inside anaconda environments
conda create --name my_name pip
source activate my_name
pip install -r ./requirements.txt
source deactivate my_name
conda env remove --name dash-app
@gnthibault
gnthibault / copy.txt
Created August 24, 2018 15:26
Rename a whole bunch of files
find ./dirA -name "*c" -print0 | xargs -0 -I {} mv {} {}_appended
@gnthibault
gnthibault / deletedocker.sh
Created May 31, 2018 07:30
delete docker images
#In order to delete all containers, use the given command
docker rm $(docker ps -a -q)
# In order to delete all images, use the given command
docker rmi $(docker images -q)