Skip to content

Instantly share code, notes, and snippets.

@triffid
triffid / openrc-init-pia
Last active Jul 16, 2022
shell script for accessing PIA wireguard
View openrc-init-pia
#!/sbin/openrc-run
command="/root/bin/pia-wg.sh"
CONFIGDIR="${CONFIGDIR:-/var/cache/pia-wg}"
CONFIG="${CONFIG:-/etc/pia-wg/pia-wg.conf}"
extra_started_commands="reload"
depend() {
View ESP32-CAM Python stream
import cv2 as cv
import numpy as np
from urllib.request import urlopen
import os
import datetime
import time
import sys
#change to your ESP32-CAM ip
url="http://192.168.1.149:9601/stream"
@DaneGardner
DaneGardner / ubuntu_18.04_cuda.md
Last active Jul 6, 2022
Installing CUDA 9.1 on Ubuntu 18.04 (circ. 5/18)
View ubuntu_18.04_cuda.md

Install CUDA 9.1 on Ubuntu 18.04

Prep system

sudo apt install build-essential gcc-6 g++-6

sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 20
sudo update-alternatives --set gcc /usr/bin/gcc-6
@khanhnamle1994
khanhnamle1994 / main.py
Last active May 14, 2022
FCN - Full Code
View main.py
#--------------------------
# USER-SPECIFIED DATA
#--------------------------
# Tune these parameters
num_classes = 2
image_shape = (160, 576)
EPOCHS = 40
BATCH_SIZE = 16
@whophil
whophil / jupyter.service
Last active Jun 6, 2022 — forked from doowon/jupyter_systemd
A systemd script for running a Jupyter notebook server.
View jupyter.service
# After Ubuntu 16.04, Systemd becomes the default.
# It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/jupyter_notebook_config.py