Skip to content

Instantly share code, notes, and snippets.

View XenGi's full-sized avatar
☠️
🪄✨ hax hax

Ricardo Band XenGi

☠️
🪄✨ hax hax
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 5, 2024 14:09
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; // ¯\\_(ツ)_/¯
@zajdee
zajdee / debian-initramfs-ipv6-hook-script
Last active February 20, 2024 13:51
Scripts to support IPv6 networking in Debian pre-boot (initramfs) environment
#!/bin/sh
# Script to be placed in /etc/initramfs-tools/hooks/ipv6
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
@XenGi
XenGi / messengers.md
Last active December 24, 2017 22:55
messengers and chat systems matrix

messengers/chat systems

messenger native android client native ios client native desktop client cli client web client e2e encrypted chat e2e encrypted group chat open source client open source server supports gifs support polls supports audio supports video supports location transmit files/photos multi device multi device encryption with pfs phone number required decentralized servers
jabber/xmpp y y y y y y (y) y y [n][1] - y y y y y y n y
signal y y (y) n n y y y y y - y y - - n n y n
whatsapp y y n n (y) y - n n - - y - - - - - y n
threema y y n - (y) y - n n y y y - - - n n n n
@marcan
marcan / linux.sh
Last active December 1, 2023 15:18
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@XenGi
XenGi / meckbd_v1.kbd.json
Last active March 11, 2017 22:23
meckbd_v1
[
{
"backcolor": "#ebebeb",
"name": "meckbd_v1",
"author": "XenGi",
"background": {
"name": "Steel brushed horizontal",
"style": "background-image: url('/bg/metal/iron_texture66.jpg');"
},
"switchMount": "cherry",
@jimbol
jimbol / assign-doest-do-deep.js
Created March 25, 2016 18:13
Object.assign doesn't deep copy
a = {b: 1, c:{ d:3 }}
z = Object.assign({}, a)
z.c.d = 4
console.log(a.c.d) // 4
@MichaelKreil
MichaelKreil / ffmpeg4matelight.sh
Last active April 7, 2024 23:22
using ffmpeg to stream videos, gifs, the webcam or the screen to matelight
# Stream a video
ffmpeg -re -i video.avi -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
# Loop a gif
ffmpeg -re -ignore_loop 0 -i image.gif -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
# Stream webcam
# Mac
ffmpeg -re -f avfoundation -r 30 -s 1280x720 -i "0" -vf "scale=40:ih*40/iw, crop=40:16, pp=autolevels:f, eq=1.5" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
@marcusandre
marcusandre / ipv6_freebsd.md
Created November 1, 2015 17:34
Configure IPv6 on netcup.de FreeBSD Servers

IPv6 on FreeBSD

ifconfig_em0_ipv6="<IP>"
ifconfig_vtnet0_aliases="inet6 <IP> prefixlen 64"
ifconfig_vtnet0_ipv6="inet6 accept_rtadv"
ipv6_default_interface="em0"
ipv6_defaultrouter="fe80::1%em0"
rtsold_enable="YES"
@mtak
mtak / firstboot.sh.erb
Created July 8, 2014 17:31
Generator for Debian preseed files
#!/bin/sh
# set hostname
echo <%= hostname %> > /etc/hostname
/etc/init.d/hostname.sh
# Set up networking
cat > /etc/network/interfaces << EOF
# The loopback network interface
auto lo
@uwekamper
uwekamper / gist:9c8bdeff7f2fc999398e
Created July 5, 2014 22:39
c-base-Plasmaleitung / Space-Shlong
/**
* Plasma-Leitungs-Code für die c-base
*/
// most launchpads have a red LED
#define LED1 P1_7
#define LED2 P1_6
#define LED3 P2_5
#define LED4 P2_4
#define LED5 P2_3