Skip to content

Instantly share code, notes, and snippets.

@intijk
intijk / pp-iptables.py
Created October 22, 2022 16:27 — forked from djoreilly/pp-iptables.py
Pretty print iptables output. Align columns and strip out comments.
#!/usr/bin/python3
import re
import sys
from tabulate import tabulate
comments_re = re.compile(r'/\*.*\/')
in_chain, eof = False, False
headers, table = [], []
@the-spyke
the-spyke / pipewire.md
Last active July 14, 2024 13:08
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@2E0PGS
2E0PGS / xbox-one-controller-bluetooth-ubuntu-fix.md
Last active July 14, 2024 20:04
Fix to pair Xbox One S Bluetooth controller on Ubuntu

First things first you need to have a new ish bluetooth adapter I have found in my testing.

It may need to be bluetooth 4 compatible I am not sure but my laptop and phone worked whereas my desktop using a £1 dongle did not.

Once you get a successful pair you may notice the controller still has a blinking light. If this is the case see below.

Install sysfsutils

sudo apt-get install sysfsutils

@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active July 18, 2024 10:09
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active February 27, 2024 14:08
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
anonymous
anonymous / untrusted-lvl21-solution.js
Created April 19, 2014 00:44
Solution to level 21 in Untrusted: http://alex.nisnevich.com/untrusted/
/*
Objects can have the following parameters:
color: '#fff' by default
impassable: true if it blocks the player from movement (false by default)
onCollision: function (player, game) called when player moves over the object
onPickUp: function (player, game) called when player picks up the item
symbol: Unicode character representing the object
type: 'item' or null
*/
anonymous
anonymous / untrusted-lvl20-solution.js
Created April 19, 2014 00:36
Solution to level 20 in Untrusted: http://alex.nisnevich.com/untrusted/
/*****************
* bossFight.js *
*****************
*
* NO FARTHER, DR. EVAL!!!!
* YOU WILL NOT GET OUT OF HERE ALIVE!!!!
* IT'S TIME YOU SEE MY TRUE FORM!!!!
* FACE MY ROBOT WRATH!!!!!
*/
anonymous
anonymous / untrusted-lvl18-solution.js
Created April 18, 2014 23:44
Solution to level 18 in Untrusted: http://alex.nisnevich.com/untrusted/
/**********************
* superDrEvalBros.js *
**********************
*
* You're still here?! Well, Dr. Eval, let's see
* how well you can operate with one less dimension.
*
* Give up now. Unless you have a magic mushroom
* up your sleeve, it's all over.
*/
anonymous
anonymous / untrusted-lvl17-solution.js
Created April 18, 2014 23:34
Solution to level 17 in Untrusted: http://alex.nisnevich.com/untrusted/
/***************
* pointers.js *
***************
*
* You! How are you still alive?
*
* Well, no matter. Good luck getting through this
* maze of rooms - you'll never see me or the Algorithm again!
*/
anonymous
anonymous / untrusted-lvl16-solution.js
Created April 18, 2014 22:57
Solution to level 16 in Untrusted: http://alex.nisnevich.com/untrusted/
/*************
* lasers.js *
*************
*
* Time to unleash the killer lasers! Each laser will kill you
* unless you have the appropriate color. Too bad you can't
* see which color corresponds to which laser!
*/
function getRandomInt(min, max) {