Skip to content

Instantly share code, notes, and snippets.

View nerun's full-sized avatar
💾
Fight on!

Daniel Dias Rodrigues nerun

💾
Fight on!
View GitHub Profile
@nerun
nerun / blowfishhelper.py
Created July 18, 2024 14:47
Blowfish with Python, symmetric encryption
#!/usr/bin/python3
# You must install package "python3-pycryptodome"
import base64
from struct import pack
from Cryptodome.Cipher import Blowfish
from Cryptodome.Random import get_random_bytes
class BlowfishHelper():
def __init__(self, key=None):
if key == None:
@nerun
nerun / indices.sh
Last active July 22, 2024 14:09
Imprime índices econômicos direto no terminal.
#!/bin/bash
#
# indices.sh - version 1.1 - 22/07/2024
# Copyright (c) 2024 Daniel Dias Rodrigues <danieldiasr@gmail.com>. No rights
# reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the Creative Commons Zero 1.0 Universal (CC0 1.0) Public
# Domain Dedication (https://creativecommons.org/publicdomain/zero/1.0/).
#
@nerun
nerun / gerador-aventuras.py
Last active January 24, 2024 19:51
Geradores Diversos de RPG baseados em artigos de Diogo Nogueira para o blog "Pontos de Experiência" <http://www.pontosdeexperiencia.com.br>.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys, random
# VARIÁVEIS
# Gerador de Aventuras de Espada e Feitiçaria
# ===========================================
objetivo = { 'Atacar / Matar / Destruir' : [ 'Uma pessoa importante',
@nerun
nerun / cuneicrypt.py
Last active January 16, 2024 13:16
CUNEICRYPT encrypts or decrypts a text file to stdout. It's a keyless cipher that replaces each printable character in a text file with a character in the cuneiform unicode block. It is written in Python for study and entertainment purposes only. This is a very weak encryption, do not use it to protect your data.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
args = sys.argv
def color(code, txt):
# 1 Red 3 Yellow 5 Purple 7 Light Gray
# 2 Green 4 Blue 6 Cyan (Light Blue) 8 Black
return '\033[3' + str(code) + 'm' + str(txt) + '\033[00m'
@nerun
nerun / paragrapher.sh
Last active June 20, 2024 02:28
The purpose of this script is to analyze plain text files (with or without the ".txt" extension) looking for broken paragraphs, i.e., paragraphs splited in more than one line, and join them in a single very long line. It's markdown friendly.
#!/usr/bin/env zsh
################################################################################
# PARAGRAPHER revision 19
# By Daniel "Nerun" Rodrigues
# June 19, 2024
# https://gist.github.com/nerun/8318924aa35f3f27231f86468804cc8c
#
# The purpose of this script is to analyze plain text files (with or without the
# ".txt" extension) looking for broken paragraphs, i.e., paragraphs splited in
# more than one line, and join them in a single very long line.
@nerun
nerun / Oblivion.json
Last active December 20, 2023 20:19
Ghostwriter theme based upon Oblivion for Gedit / Pluma / Xed. Copy to yours ~/.config/ghostwriter/themes.
{
"dark": {
"accent": "#ac7e9a",
"background": "#2e3436",
"block": "#bdc3c7",
"cursor": "#3daee9",
"emphasis": "#8ae234",
"error": "#da4453",
"foreground": "#d3d3a9",
"heading": "#ca6b0d",
@nerun
nerun / diario
Last active January 10, 2024 19:52
A daily log of experiences (daybook, journal), a personal organizer or an appointment diary to be run in a linux terminal. Totally written in shell script. Support AES-256 symmetric encryption through 7-Zip.
#!/usr/bin/env zsh
##############################################################################
# DIÁRIO NUM TERMINAL
#
# Copyright (C) 2023, 2024 Daniel Dias Rodrigues
#
# Source code is available at:
# https://gist.github.com/nerun/25bad2359b873351a65c40b1d425766f
#
# This program is free software; you can redistribute it and/or modify it
@nerun
nerun / groff.lang
Last active February 17, 2023 21:36 — forked from Sciancisco/groff.lang
Gedit groff syntax highlight
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2020 - Sciancisco
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@nerun
nerun / PyDice.py
Last active July 9, 2024 14:56
A dice roller with a gaussian distribution calculator. Written in Python 3.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# PyDice.py - version 2.0 - 08 july 2024
# Copyright (c) 2024 Daniel Dias Rodrigues <danieldiasr@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the Creative Commons Zero 1.0 Universal (CC0 1.0) Public
# Domain Dedication (https://creativecommons.org/publicdomain/zero/1.0/).
#
@nerun
nerun / bitwarden-to-chrome-csv
Created March 14, 2022 18:24
Convert a CSV created by Bitwarden Password Manager to Chrome CSV format.
#!/bin/bash
# First, make a copy of the original CSV file. We gonna work with the copy.
cp $1 $2
# If no name is given for the output file, use a default.
if [ -z $2 ]; then
output='passwords_output.csv'
else
output=$2
fi