Skip to content

Instantly share code, notes, and snippets.

View chrisnew's full-sized avatar
👾
wat

Christian R. chrisnew

👾
wat
  • InterWebs Ltd.
  • Sofia
View GitHub Profile
@gandro
gandro / dockerd-on-qemu-arm64.md
Last active February 7, 2023 03:32
Running dockerd on linux/arm64 with QEMU

Running dockerd on linux/arm64 with QEMU

Why

  • You need to pull, build, or push linux/arm64 Docker images with tooling which does not support Docker's experimental --platform argument.
  • You are otherwise blocked by moby/moby#36552.
  • You are unable to configure your local dockerd and/or cannot use user-space emulation with qemu-user-static (see below).

Why not

@slavafomin
slavafomin / nodejs-custom-es6-errors.md
Last active March 9, 2024 12:03
Custom ES6 errors in Node.js

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js

@dust321
dust321 / arch-linux-install-encryption
Last active April 2, 2021 23:43 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing Arch Linux on an DOS/BIOS system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system, for BIOS. Dustin dut n ex 5 a t g ma il
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@Pathoschild
Pathoschild / google-sheets-color-preview.js
Last active July 4, 2023 12:07
A Google Sheets script which adds color preview to cells. When you edit a cell containing a valid CSS hexadecimal color code (like #000 or #000000), the background color is changed to that color and the font color is changed to the inverse color for readability.
/*
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a
valid CSS hexadecimal color code (like #000 or #000000), the background color will change to that
color and the font color will be changed to the inverse color for readability.
To use this script in a Google Sheets spreadsheet:
1. go to Tools » Script Editor;
2. replace everyting in the text editor with this code;
3. click File » Save;
@mathiasbynens
mathiasbynens / README.md
Last active August 5, 2023 03:20
Superfish certificate
@ryancdotorg
ryancdotorg / rsabd.py
Last active March 13, 2023 15:57
backdoored rsa key generation
#!/usr/bin/env python
import sys
import gmpy
import curve25519
from struct import pack
from hashlib import sha256
from binascii import hexlify, unhexlify
@pawelkl-zz
pawelkl-zz / config
Last active August 17, 2023 18:32
my i3 config
# http://i3wm.org/docs/userguide.html
# font pango: share tech mono, comfortaa, FontAwesome, octicons, Ionicons 10
# Lekton, NotCourierSans, SaxMono
font pango: Ubuntu Mono for Powerline, KlarTextMono, comfortaa, FontAwesome, octicons, Ionicons 11
# ubuntu 10
# ubuntu mono 11
smart_borders on
# on / no_gaps
# gaps inner 5
@mlynch
mlynch / autofocus.js
Last active August 24, 2022 15:03
AngularJS Autofocus directive
/**
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded
* templates and such with AngularJS. Use this simple directive to
* tame this beast once and for all.
*
* Usage:
* <input type="text" autofocus>
*
* License: MIT
*/
@mnshankar
mnshankar / post-receive.sh
Last active July 24, 2016 22:20
post-receive hook for git deploy (Laravel 4)
#!/bin/sh
WEBROOT=/var/www/domain.com/project
GIT_WORK_TREE=$WEBROOT git checkout -f
#change directory to the project dir
cd $WEBROOT
rm -f storage/cache/*
echo 'cache cleared'
rm -f storage/views/*
echo 'views cleared'
# Check if a composer.json file is present