Skip to content

Instantly share code, notes, and snippets.

@ceving
ceving / Web Component for Copyright Years.md
Last active March 28, 2024 23:41
Web Component for Copyright Years
@2ndshadow
2ndshadow / Delegate.md
Last active March 28, 2024 23:40
How to delegate to a worker node

How to delegate to a worker node

  1. Go to 'Workers' page

  2. Select a Worker node with high APR image

  3. Click 'Delegate', select amount to delegate and confirm. image image

  4. Sign the transaction

@James-Ansley
James-Ansley / pi5_fan_controller.py
Last active March 28, 2024 23:37
Raspberry Pi 5 Auto Fan Controller
from enum import Enum
import time
TEMP_PATH = "/sys/devices/virtual/thermal/thermal_zone0/temp"
FAN_PATH = "/sys/class/thermal/cooling_device0/cur_state"
class FanSpeed(Enum):
OFF = 0
LOW = 1
@bruvv
bruvv / pwnagotchi change wlan card.md
Last active March 28, 2024 23:34
pwnagotchi change wlan card

I want to disable monitor mode for the interal wlan0 card of the pi. If you want to do that too and use wlan1 as mon0 do:

sed -i 's/phy0/phy1/g' /usr/bin/pwnlib

If you want wlan0 and wlan1 in monitor mode and want to use wlan1 as pwnagotchi device, use this ps did didn't work for me but above example

sudo su
rm /etc/network/interfaces.d/wlan1-cfg
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active March 28, 2024 23:34
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@alexishida
alexishida / nginx-config-auth-cert-ssl.md
Last active March 28, 2024 23:34
Tutorial to configure Nginx client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Original: https://gist.github.com/mtigas/952344

Convert SSL certificate from CRT format to PEM

openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 23:32
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@dmitriyvolk
dmitriyvolk / animals.Animal.java
Created March 26, 2024 23:16
Generics: RedRover 2024 Spring Lecture 16
package animals;
public class Animal {
private final String name;
private final double weight;
private final double canLiftWeight;
public Animal(String name, double weight, double canLiftWeight) {
this.name = name;
this.weight = weight;
@ANRCorleone
ANRCorleone / readme.txt
Last active March 28, 2024 23:31 — forked from CraigCottingham/readme.txt
Ubuntu 22.04 + Hyper V + Enhanced Session mode + XRDP PulseAudio
Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# https://gist.github.com/rkttu/35ecab5604c9ddc356b0af4644d5a226
# Installation and Enhanced session
# follow steps on the post below, I installed Ubuntu 22.04 on a Windows 11 machine
@drewkerr
drewkerr / get-focus-mode.js
Last active March 28, 2024 23:28
Read the current Focus mode on macOS Monterey (12.0+) using JavaScript for Automation (JXA)
const app = Application.currentApplication()
app.includeStandardAdditions = true
function getJSON(path) {
const fullPath = path.replace(/^~/, app.pathTo('home folder'))
const contents = app.read(fullPath)
return JSON.parse(contents)
}
function run() {