Skip to content

Instantly share code, notes, and snippets.

View KavenTheriault's full-sized avatar

Kaven Thériault KavenTheriault

View GitHub Profile
@KavenTheriault
KavenTheriault / python_notes.md
Last active November 29, 2018 16:15
Python notes

Named tuples

from collections import namedtuple
Point = namedtuple('Point', ['x', 'y'])

point1 = Point(24, 67)
print(point1.x)
print(point1.y)
@KavenTheriault
KavenTheriault / angular_notes.md
Last active November 24, 2018 16:54
Angular `Observables` notes

Angular Observables notes

https://angular.io/guide/rx-library

  • A promise can be subcribed.
  • It will give an observable.
const secondsCounter = interval(1000);
secondsCounter.subscribe(n =>
  console.log(`It's been ${n} seconds since subscribing!`));
@KavenTheriault
KavenTheriault / serveo.md
Created December 20, 2018 14:01
Expose local servers to the internet

Expose localhost port 8000 to the internet

ssh -R 80:localhost:8000 serveo.net

https://serveo.net/

@KavenTheriault
KavenTheriault / create_gitlab_deploy_key.md
Created March 20, 2019 19:03
Create GitLab project deploy key

Create GitLab project deploy key

Generate key

cd ~/.ssh/
ssh-keygen -t ed25519 -C "project_name_deployment"
  • Input a file path to save your SSH key pair to. Example project_name_deployment_rsa
  • Enter a passphrase if you want. You can skip creating it by pressing Enter twice.
  • Backup the key somewhere safe and secure

mongodump command example

mongodump --host localhost:27017 --username=user --password=password --db=db_name --authenticationDatabase=admin
@KavenTheriault
KavenTheriault / problem.md
Created November 14, 2019 16:12
Problem disk usage docker

Before execution

docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              8                   4                   6.375GB             5.05GB (79%)
Containers          4                   4                   437.8kB             0B (0%)
Local Volumes       7                   2                   10.12kB             2.58kB (25%)
Build Cache         0                   0                   0B                  0B
@KavenTheriault
KavenTheriault / profiling.md
Created December 23, 2019 15:23
Python memory profiling

Use de "track_memory" decorator on your functions.

@KavenTheriault
KavenTheriault / copy_iso_usb.md
Last active July 28, 2020 14:43
Copy iso file on usb

Use “fdisk -l” to find the USB device

fdisk -l

Make sure the USB device is unmounted

umount /dev/sd**
@KavenTheriault
KavenTheriault / build_glpk_java.sh
Last active June 3, 2020 19:29
Build glpk_java 1.0.22 with java 8
#Reset
rm -rf /home/$USER/src
rm -rf /home/$USER/glpk
#Set JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/default-runtime
#Download source code
mkdir -p /home/$USER/src
cd /home/$USER/src
@KavenTheriault
KavenTheriault / french_canadian_keymap.md
Last active August 4, 2020 16:55
French Canadian keymap
setxkbmap -model pc104 -layout ca -variant fr