Skip to content

Instantly share code, notes, and snippets.

View joao-pinheiro's full-sized avatar

Joao Pinheiro joao-pinheiro

View GitHub Profile
@notnotrobby
notnotrobby / cgp.md
Last active March 12, 2026 09:45
List of free resources to study computer graphics programming.
@mudge
mudge / blocklist.sh
Last active November 7, 2025 17:08
A Bash script to generate an Unbound configuration to block all domains on The Firebog's "The Big Blocklist Collection" and allow all domains on Anudeep's list
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Download all ticked blocklists from The Firebog's "The Big Blocklist
# Collection" [0] and block access to them with Unbound by redirecting traffic
# to 0.0.0.0.
#
# [0]: https://firebog.net
(
@dragon788
dragon788 / .crypt-fix.md
Last active June 16, 2024 21:51
Repair "ubuntu--vg-root" not found with LUKS and LVM encryption

Crypt-fix

Use this script via curl -L -O https://gist.github.com/dragon788/e777ba64d373210e4f6306ad40ee0e80/raw/a86f3d05fb56feb6ef01fc2d61a4feb2fd82b281/crypt-fix.sh and sudo bash ./crypt-fix.sh. You may need to edit the DEVICE variable to reflect your disk and partition layout (this was created on an EFI system using LUKS and LVM). It will prompt you for your disk password once to mount and discover the correct name for the encrypted volume mount and then prompt again to mount with the correct name so that the update-initramfs command succeeds with the appropriate mapping, if this wasn't done you would get a warning and your next boot would still fail.

@m-x-k
m-x-k / active_directory_users.py
Created July 18, 2017 12:12
Python ldap3 active directory add and search for users
import ssl
from flask import json
from ldap3 import Server, \
Connection, \
SUBTREE, \
ALL_ATTRIBUTES, \
Tls, MODIFY_REPLACE
OBJECT_CLASS = ['top', 'person', 'organizationalPerson', 'user']
@yajra
yajra / install-wkhtmltopdf.sh
Last active April 15, 2025 09:34
Install wkhtmltopdf 0.12.4 (with patched qt)
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin/
ln -nfs /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
@mosquito
mosquito / README.md
Last active February 19, 2026 04:21
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@augustoroman
augustoroman / example.c
Last active July 5, 2024 13:33
Example use of nacl secretbox in C, C++, Go
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "crypto_secretbox.h"
#include "randombytes.h"
// install nacl: https://nacl.cr.yp.to/install.html
// export NACL_DIR=path/to/nacl/build/<machinename>/
@oneyoung
oneyoung / falcon_urlreverse.py
Last active January 18, 2021 17:16
A customize Falcon Router that support Django like url reverse
from falcon.routing import DefaultRouter
class ReverseRouter(DefaultRouter):
url_map = {}
# override add_route to add our map
def add_route(self, uri_template, method_map, resource, name=None):
if name:
self.url_map[name] = uri_template
@nbremer
nbremer / .block
Last active December 16, 2025 12:59
Radar Chart Redesign
height: 600
license: mit
acknowledgement: Please add "Nadieh Bremer | Visual Cinnamon" to your credit when re-using this code, thank you!