Skip to content

Instantly share code, notes, and snippets.

@adtac
adtac / Dockerfile
Last active May 8, 2025 00:47
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@yookoala
yookoala / 90-mac-superdrive.rules
Last active March 1, 2025 22:03
udev rules to use Apple SuperDrive on Linux
#
# Apple SuperDrive initialization rule
#
# See: https://gist.github.com/yookoala/818c1ff057e3d965980b7fd3bf8f77a6
ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw --cmdset=1 %r/sr%n EA 00 00 00 00 00 01"
%YAML 1.2
# Reference: https://www.sublimetext.com/docs/3/syntax.html
# A systemd syntax highlight file for Sublime Text 3
# Fix comment support, fix heading, add boolean, add string, switch source type -- thendrix
---
name: Systemd
file_extensions: [service]
scope: source.service
contexts:
@dentechy
dentechy / WSL-ssh-server.md
Last active May 9, 2025 02:32
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@0xjac
0xjac / private_fork.md
Last active May 14, 2025 10:32
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

import numpy as np
from scipy.stats import t, zscore
def grubbs(X, test='two-tailed', alpha=0.05):
'''
Performs Grubbs' test for outliers recursively until the null hypothesis is
true.
@rvagg
rvagg / v8-changelog-4.3+4.4.md
Created June 29, 2015 06:38
v8-changelog --trim --range '>=4.3 <4.5'

4.4.65 (2015-05-13)

  • Deprecate Isolate::New.
  • Factor out core of Array.forEach and .every, for use in TypedArrays (issue 3578).

4.4.63 (2015-05-11)

  • Let Runtime_GrowArrayElements accept non-Smi numbers as |key| (Chromium issue 485410).
@bwbaugh
bwbaugh / dnsmasq.conf
Last active September 5, 2024 09:41
Changing the DNS server on a RT-AC66U / RT-N66U
# Add these, though they didn't seem to take effect for me.
server=8.8.8.8
server=8.8.4.4
@mxwell
mxwell / convert_from_bt656.py
Created February 18, 2015 16:07
Script to extract a picture from a BT.656 frame
#! /usr/bin/python
###############################################################################
# Script converts a single frame, compliant with ITU-R BT.656-5,
# into a picture of given format (like PNG, JPEG, BMP, etc)
#
# Tested with Python 2.7.5, Pillow 2.7
###############################################################################
from PIL import Image
template<typename T>
class PersistentHandleWrapper {
public:
inline PersistentHandleWrapper()
: _isolate(nullptr) { }
inline PersistentHandleWrapper(v8::Isolate* isolate, v8::Local<T> value)
: _isolate(isolate),
_value(isolate, value) { }