Skip to content

Instantly share code, notes, and snippets.

@laurentbel
laurentbel / !Nginx Basic Auth.md
Last active April 10, 2024 21:05
Nginx reverse proxy with basic authentication

Nginx Basic Auth

A simple demo of using Nginx as a reverse proxy to add basic authentication.

@palewire
palewire / run.py
Last active January 19, 2023 21:48
A command-line interface for running Jupyter Notebooks.
# -*- coding: utf-8 -*-
"""
A command-line interface for running Jupyter Notebooks.
Usage: run.py [OPTIONS] [NOTEBOOK_PATHS]...
Executes Jupyter Notebooks from the command line.
Expects one or more file paths input as arguments.
@aelk00
aelk00 / remove-likes.md
Last active March 1, 2024 00:58
Remove all your facebook likes
@eeejay
eeejay / install_addon.js
Created November 16, 2020 17:31
Sideload addon in Firefox for Android
// In main process JS console:
const { AddonManager } = ChromeUtils.import("resource://gre/modules/AddonManager.jsm")
AddonManager.getInstallForURL(XPI_URL).then(r => r.install())
@oofnikj
oofnikj / answerfile
Last active June 8, 2024 21:46
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
const fetch = require('node-fetch');
async function run() {
let username = "YOUR USERNAME HERE";
let password = "YOUR APP PASSWORD";
let authBasic = new Buffer(username + ':' + password).toString('base64');
let session = await (await fetch('https://jmap.fastmail.com/.well-known/jmap', {
headers: {
"Authorization": "Basic " + authBasic
}
})).json();
@joeycastillo
joeycastillo / code.py
Created August 14, 2020 18:33
the big board of death
import adafruit_ht16k33.segments
import board
from digitalio import DigitalInOut, Direction
import time
from busio import I2C, SPI
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
from adafruit_esp32spi import adafruit_esp32spi
import adafruit_requests as requests
try:
@Vic3198
Vic3198 / InstallSignalEN.py
Last active January 26, 2024 04:08
Simple Python script for automating the installation of signal-cli, the DBus service, and registering a new user. It worked well for me and saved me a lot of time for each time I had to reinstall signal-cli on a new machine, but I cannot 100% guarantee that it will work for you.
#!/usr/bin/env python
#coding: utf-8
#
# Run this file with superuser rights ('sudo') to install the Signal client
raw_input("Welcome to the signal-cli install wizard.\nPress ENTER when you are ready.")
import os
@veltman
veltman / README.md
Last active April 19, 2023 16:32
Generating an SVG from a set of shapefiles

Generating an SVG from a set of shapefiles

The USGS provides detailed downloads of fire perimeters, with timestamped files that can be used to show the spread of a major fire over time.

Using the 2017 Thomas fire as an example, we'll process this data into a single SVG file with all the different perimeter measurements.

This index page contains links to a series of shapefiles of the fire boundary, each one with a timestamp:

https://rmgsc.cr.usgs.gov/outgoing/GeoMAC/2017_fire_data/California/Thomas/

@necojackarc
necojackarc / Set up Vim with clipboard on Ubuntu on WSL2.md
Last active December 28, 2023 02:45
Set up Vim on Ubuntu on Windows Subsystem for Linux 2 (WSL2) to share clipboard

This explains how to set up Vim on Ubuntu 18.04 on Windows Subsystem for Linux 2 (WSL2) in order to share the clipboard between Windows and Ubuntu.

Environments

  • Windows 10 Home
  • Ubuntu 18.04 on Windows Subsystem for Linux 2 (WSL2)

Steps

  1. Build Vim with the clipboard option enabled
  2. Set up VcXsrv Windows X Server