Skip to content

Instantly share code, notes, and snippets.

felipou /
Last active Dec 5, 2022
DBeaver password decryption script - for newer versions of DBeaver
# requires pycryptodome lib (pip install pycryptodome)
import sys
import base64
import os
import json
from Crypto.Cipher import AES
adrianlzt / sharescreen
Last active Jan 7, 2022
Scripts to share only a portion of the screen
View sharescreen
# Modified version of
# Script to share a portion of the screen in VLC to be used by Chrome/Firefox to share the screen
# By default, when run, it asks to click in some window. The area of that window is what is going to be shared.
# If executed with "sharescreen area", it asks for a portion of the screen to be shared.
unset x y w h
# Old code to choose a monitor
kylebrandt /
Last active Jul 10, 2020
i3 Hangout / Meet VLC screensharing workaround mutli-monitor

Share an area of your screen by using vlc screen capture, and then sharing the vlc capture window

Make sure the VLC window floats

In i3 config:

for_window [window_role="vlc-video"] floating enable move down 100px;

We float it so the tiling window manager doesn't resize the window and mess up the scale. We also move the window placement down at launch so it easy to drag somewhere mostly offscreen.

# Split the logs in separate files
echo Splitting...
csplit r-ryantm '/2018-..-..T..:..:.. .* [^ ]* -> [^ ]*/' '{*}' 1>/dev/null
# rename xx* to xx*-package-name
echo Renaming...
parallel -j30 "mv {} {}-\$(head -n1 {} | cut -d' ' -f2)" ::: xx*
echo Separating...
cheater / sleep-countdown
Created Nov 18, 2018
sleep with countdown in bash
View sleep-countdown
sleep_time="$(( $1 - 1 ))" # subtract 1, since we wait on the 0th second.
start_s="$(date +%s)"
start_ns="$(date +%N)"
div_whole() {
# whole-number division of integers.
tazjin /
Last active Nov 15, 2022
Nix builder for Kubernetes
edolstra /
Last active Sep 24, 2022
Nix language changes

This document contains some ideas for additions to the Nix language.


The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
balsoft / crd.nix
Last active Oct 3, 2021
chrome-remote-desktop on nixos/nix
View crd.nix
{ config, lib, pkgs, ...}:
with lib;
cfg =;
in {
options = {
services.crd = {
enable = mkEnableOption ''
chrome remote desktop, a service which allows for remote control of your desktop from anywhere.
brettscott / aes-256-cbc-test.js
Last active Nov 7, 2022
AES 256 CBC encryption between Golang and Node JS
View aes-256-cbc-test.js
// Node v6.9.0
// TEST FILE (cut down for simplicity)
// To ensure Golang encrypted string can be decrypted in NodeJS.
let crypto;
try {
crypto = require('crypto');

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru