Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / git-credential-netrc
Created December 1, 2020 17:31
git-credential-netrc to be used to allow for multiple git user to safely log to machine with password (most idiots will never use the clean method and just override whatever you have done though)
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use File::Basename;
my $VERSION = "0.1";
@gnthibault
gnthibault / npm-using-https-for-git.sh
Created December 1, 2020 18:28 — forked from taoyuan/npm-using-https-for-git.sh
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@gnthibault
gnthibault / gist:970d0d30644a5162cd4e9068f49151ef
Last active December 1, 2020 20:26
Safe access for multiple user on the same account on a linux machine
First task is to create your own token (generate new token):
https://github.com/settings/tokens
you can test it with
curl -u <token>:x-oauth-basic https://api.github.com/user
Then write it down to a specific file in home/user/subuser/.netrc , where you just created your directory
content of the file:
machine github.com
@gnthibault
gnthibault / search_modified_after_date.sh
Created November 14, 2021 23:19
Find all files recursively that have been modified after a certain date
# From https://stackoverflow.com/questions/848293/shell-script-get-all-files-modified-after-date
find . -newermt '2021-11-14T23:00:00'
@gnthibault
gnthibault / astrobox_configuration_guidelines.sh
Last active January 9, 2022 21:52
Configuration of linux box for remote observatory with indi/indiwebmanager/vnc/webvnc, ...
# Instalation guide
### solve locale problem on computer
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
### Setup automatic time update toward UTC
sudo apt-get install ntp
# From https://stackoverflow.com/a/64716636/2697831
#A stash entry is a special ref that points to a commit. So you can simply tag the commit.
git stash push -m "debug"
# after "git stash", tag the last entry
git tag debug stash@{0}
# later use the tag name
git stash apply debug