Skip to content

Instantly share code, notes, and snippets.

@kanzure
kanzure / git-commit-cleaner.py
Last active May 17, 2022 17:25
git-filter-branch examples and notes
"""
Creates pretty-looking commit messages for git. This was created to pretty
print the old-commit-id values for filter-branched-rewritten commits in
pyphantomjs from the phantomjs repository.
"""
import os
import sys
@shauns
shauns / slack.py
Created August 10, 2016 14:44
Deleting and listing slack files, sorting by size
from slacker import Slacker
import itertools
slack = Slacker('<API TOKEN>')
pages = slack.files.list(page=1).body['paging']['pages']
all_the_files = list(itertools.chain(*[slack.files.list(page=i).body['files'] for i in range(1,pages + 1)]))
biggest_first = sorted(all_the_files, key=lambda f: f['size'], reverse=True)
@marceloalmeida
marceloalmeida / .gitattributes
Last active December 7, 2023 14:26
How to show diffs for gpg-encrypted files?
*.gpg filter=gpg diff=gpg
*.asc filter=gpg diff=gpg
@turboBasic
turboBasic / Use-symmetric-key-to-encrypt-repository.md
Last active April 10, 2024 05:36
Use git-crypt & symmetric key kept inside a repo to encrypt some files in the repository

Use git-crypt & symmetric key kept inside a repo to encrypt some files in the repository

Requirements

  1. GnuPG aka "gpg"
  2. git-crypt

you may totally ignore complicated gpg manuals, but you must understand how git-crypt operates.

@Prakasaka
Prakasaka / bash-colors.md
Created July 25, 2020 09:14 — forked from JBlond/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@SomajitDey
SomajitDey / gpg_ecc-25519_keygen
Last active November 22, 2023 08:37
Create ECC (elliptic curve crypto) keys using curve 25519 with/for GPG
#!/usr/bin/env -S gpg --batch --expert --gen-key
# Brief: Generate ECC PGP keys for signing (primary key) & encryption (subkey)
# Run as: chmod +x gpg_ecc-25519_keygen; ./gpg_ecc-25519_keygen
# Ref: https://www.gnupg.org/documentation/manuals/gnupg/Unattended-GPG-key-generation.html
%echo "Generating ECC keys (sign & encr) with no-expiry"
%no-protection
Key-Type: EDDSA
Key-Curve: ed25519
Subkey-Type: ECDH
@opastorello
opastorello / sublime text 4143 license key
Last active June 14, 2024 10:55
sublime text 4143 license key
> * Go to [hexed.it](https://hexed.it/)
> * Click "Open File" and choose your sublime_text.exe **(DON'T FORGET TO BACKUP YOUR EXE FILE)**
> * Go to Search and in "Search for" put: 80 78 05 00 0F 94 C1
> * In Search Type select "Enable replace" and put: 80 78 05 00 0F 94 C1
> * Click "Find next" then "Replace"
> * Do the same thing with: C6 40 05 01 48 85 C9 => C6 40 05 01 48 85 C9
> * Click "Save as" then name it: sublime_text
> * Copy your modified sublime_text.exe to directory Sublime Text
import os
sublime_binary_path = "/tmp/sublime_text" # FIXME: this is the absolute path to writable sublime_text binary.
version_magic_string = "4126"
sz_magic_string = 4
version_magic_string_offset = 0x0002d78a # (Real offset from xxd)
is_file_read = os.access(sublime_binary_path, os.R_OK)
if not is_file_read: