Skip to content

Instantly share code, notes, and snippets.

sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
deb http://repo.pritunl.com/stable/apt jammy main
EOF
# Import signing key from keyserver
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
# Alternative import from download if keyserver offline
curl https://raw.githubusercontent.com/pritunl/pgp/master/pritunl_repo_pub.asc | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list << EOF
@DarthJahus
DarthJahus / instructions.md
Created February 26, 2022 19:00 — forked from douglasmiranda/instructions.md
Add email to Keybase.io PGP Key (Public Key)

Export your public key:

keybase pgp export > keybase-public.key

Export your private key:

keybase pgp export --secret &gt; keybase-private.key
@DarthJahus
DarthJahus / silly_addition.py
Created September 21, 2020 11:41
Solution to 16+18=214 at Codewars (Python)
# Jahus
# 2020-09-19
# Passes tests at Codewars / 16+18=214
# https://www.codewars.com/kata/5effa412233ac3002a9e471d/train/python
def decompose(num):
if num != 0:
_vec = []
while num > 0:
@DarthJahus
DarthJahus / weighted_jabberwocky.py
Created September 11, 2020 13:30
Script to generate giberish words given letters, weights and lenght. Created and used for typing practice.
# Jahus
# 2020-09-11
# Weighted Jabberwocky
import random
_letters = "aerlndvtxyhbpsoigzmfqkcwuj"
_speeds = [45, 41, 32, 31, 30, 26, 26, 25, 25, 24, 23, 23, 22, 22, 21, 20, 20, 20, 20, 16, 15, 15, 15, 12, 12, 8]
_letters = [i for i in _letters]
@DarthJahus
DarthJahus / ExifFolders.py
Created September 8, 2019 22:21
Read EXIF data from image and video files and sort theses files in a custom structure (folders and subfolders representing years, months and days…).
from PIL import ExifTags, Image
from os import listdir, mkdir
from os.path import isfile, join, isdir, getmtime
from datetime import datetime
import shutil
files = [f for f in listdir('.') if isfile(join('.', f))]
__folder_structure = ["%Y", "%Y-%m (%Y-%B)", "%Y-%m-%d"]
@DarthJahus
DarthJahus / slack_delete_messages.js
Created March 5, 2019 22:06
NodeJS script to delete messages in a Slack channel.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = ''; // You can learn it from: https://api.slack.com/custom-integrations/legacy-tokens
// GLOBALS #############################################################################################################
@echo off
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min %~dpnx0 %* && exit
echo Switching to extended mode
displayswitch.exe /extend
echo openning %* in VLC
timeout 5
"C:\Program Files\VideoLAN\VLC\vlc.exe" --started-from-file %*
echo Switching to external mode
displayswitch.exe /external
exit
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Applications\cvlc.bat]
"FriendlyAppName"="VLC (Custom)"
[HKEY_CLASSES_ROOT\Applications\cvlc.bat\DefaultIcon]
@="\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\",0"
[HKEY_CLASSES_ROOT\Applications\cvlc.bat\shell]
@DarthJahus
DarthJahus / HexToRGB.py
Created November 22, 2018 10:35
Simple Python script to convert hexadecimal color codes to RGB
"""
Simple Python script to convert hexadecimal color codes to RGB
Jahus, 2018-11-21
"""
while True:
try:
print("Hex?")
@DarthJahus
DarthJahus / discord_delete_messages.js
Created October 13, 2018 22:50
Delete personal messages, direct messages, private chat in Discord.
// by @ordubis
var authToken = 'AUTHORISATION_TOKEN_HERE'
if (typeof(blockedAuthors) === 'undefined') {
var blockedAuthors = []
}
clearMessages = function() {
const channel = window.location.href.split('/').pop()