Skip to content

Instantly share code, notes, and snippets.

@0xssff
0xssff / eco-friendly-tiny-server-patterns.md
Created September 2, 2024 13:29 — forked from coderofsalvation/eco-friendly-tiny-server-patterns.md
My favorite (awesome) eco-friendly server patterns

tiny servers: the serverpark killers

auto-suspend-wakeup webservices

stop wasting cpu/mem-resources on idling services:

#!/bin/sh
while sleep 1s; do
 set +e
@0xssff
0xssff / vanilla-js-cheatsheet.md
Created September 2, 2024 13:10 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@0xssff
0xssff / gist:76c3467657137937e3332853280035c1
Created June 1, 2024 11:21 — forked from vms20591/gist:b8b17b3c44fc9b62ff734c0b588014db
Virtualbox - Arch Linux installation - Full Disk Encryption with detached LUKS header & unecrypted boot

Pre-Requisites

  1. Arch Linux iso
  2. Virtualbox
  3. Two virtual HDDs - 8G (main) & 1G (detached header & boot) respectively

Preparing the disks

Step 1

@0xssff
0xssff / mpvctl
Created October 20, 2020 19:22 — forked from dwgill/mpvctl
A small script for controlling mpv via the JSON IPC. Intended to resemble playerctl.
#!/usr/bin/env bash
# This script requires:
# - that the directory $HOME/.mpv exist
# - that the program socat be installed
# - that you start mpv with the unix socket feature pointing at that directory
# I recommend an alias in your .bashrc or equivalent file:
# alias mpv="mpv --input-unix-socket=$HOME/.mpv/socket"
socket="$HOME/.mpv/socket"
sudo stop shill ; sleep 3 ; sudo start shill BLACKLISTED_DEVICES=tun0 ; sleep 3 ; sudo openvpn --mktun --dev tun0 && openvpn --config /home/root/vpnconfig --auth-user-pass /home/root/vpnauth --dev tun0 --dev-type tun
@0xssff
0xssff / aliases.sh
Created April 1, 2020 15:55
aliases
# Easier navigation: .., ..., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# List all files colorized in long format, including dot files
alias la="ls -Gla"
# List only directories
@0xssff
0xssff / corsproxy.php
Created March 30, 2020 16:18 — forked from dropmeaword/corsproxy.php
simple CORS proxy in php
<?php
error_reporting( error_reporting() & ~E_NOTICE ); // evil
// config
$enable_jsonp = false;
$enable_native = false;
$valid_url_regex = '/.*/';
// ############################################################################