Skip to content

Instantly share code, notes, and snippets.

@moxus
moxus / gist:7789b93119df777465ea
Created July 5, 2015 09:34
Decrypt KeePass files
/* global Buffer */
/**
* Decrypt KeePass files
*
* There are some sources where you can find description about the keepass file format
* https://gist.githubusercontent.com/msmuenchen/9318327/raw/f6cbc07c01297f129700b7e14e1013253ab8b44f/gistfile1.txt
* http://blog.sharedmemory.fr/en/2014/04/30/keepass-file-format-explained/
*/
@CalebFenton
CalebFenton / DexFileFingerprinter.java
Created September 28, 2017 17:27
Fingerprinting / Hashing Dalvik Executables
import gnu.trove.map.TObjectLongMap;
import gnu.trove.map.hash.TObjectLongHashMap;
import org.jf.dexlib2.Opcode;
import org.jf.dexlib2.iface.ClassDef;
import org.jf.dexlib2.iface.DexFile;
import org.jf.dexlib2.iface.Field;
import org.jf.dexlib2.iface.Method;
import org.jf.dexlib2.iface.MethodImplementation;
import org.jf.dexlib2.iface.instruction.Instruction;
@arkon
arkon / patch_boot.sh
Last active March 13, 2019 08:45
Bash scripts for patching boot.img/build.prop for Fate/Grand Order on LineageOS (https://goo.gl/YkHgjZ)
#!/usr/bin/env bash
#
# This script replaces "ro.debuggable=1" with "ro.debuggable=0" in the
# default.prop file in a ROM's boot.img and gives you the patched boot.img.
#
# Prerequisites:
# - A UNIX system (with `unzip`)
# - These tools added to your PATH:
# - Android dev tools (adb/fastboot)
# - Various tools in "bootimg_tools_7.8.13.zip" from https://goo.gl/48Sszu
@charveey
charveey / 51-noto-color-emoji.conf
Created October 1, 2017 01:14
Enabling Color Emoji in Chrome (Linux)
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
You need Noto Color Emoji installed in your machine.
Save this file in ~/.config/fontconfig/conf.d/ or /etc/fonts/conf.d/ (system-wide)
-->
<fontconfig>
<match target="scan">
<test name="family">
@douglasrizzo
douglasrizzo / inconsistent-authors-bib.ipynb
Last active June 27, 2022 00:19
Merging inconsistent author names in a bib file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@msmuenchen
msmuenchen / gist:9318327
Last active September 18, 2022 21:53
KeePass v2.x (KDBX v3.x) file format
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)
@imAliAzhar
imAliAzhar / emoji-list
Last active January 15, 2023 17:59
Create an Emoji selector menu with Rofi
<span lang="face with tears of joy"> 😂 </span>
<span lang="grinning face with smiling eyes"> 😄 </span>
<span lang="grinning face with sweat"> 😅 </span>
<span lang="face with rolling eyes"> 🙄 </span>
<span lang="smirking face"> 😏 </span>
<span lang="smiling face with halo"> 😇 </span>
<span lang="grinning face"> 😀 </span>
<span lang="squinting face with tongue"> 😝 </span>
<span lang="grinning face with big eyes"> 😃 </span>
<span lang="unamused face"> 😒 </span>
@dokato
dokato / orthogonalization.py
Created February 15, 2018 14:13
Find closest orthogonal matrix
import numpy as np
def find_closest_orthogonal_matrix(A):
'''
Find closest orthogonal matrix to *A* using iterative method.
Bases on the code from REMOVE_SOURCE_LEAKAGE function from OSL Matlab package.
Args:
A (numpy.array): array shaped k, n, where k is number of channels, n - data points
@graymouser
graymouser / hb_all_books_dl.js
Created February 28, 2016 14:09
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
$('a').each(function(i){
if ($.trim($(this).text()) == 'MOBI') {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
});
@15leesan
15leesan / original.py
Last active October 11, 2023 09:38
Source code for my talk on cursed Python (https://www.youtube.com/watch?v=t863QfAOmlY).
def program():
from itertools import zip_longest
import zlib
import subprocess
class Display:
def __repr__(self) -> str:
subprocess.run([
"feh",
"-xYFqZ",