Skip to content

Instantly share code, notes, and snippets.

@danny8376
danny8376 / read.amazon.co.jp-darkmode.user.css
Last active October 6, 2024 08:33
Dark Mode for read.amazon.co.jp
/* ==UserStyle==
@name read.amazon.co.jp Dark Mode
@namespace saru.moe/userstyles/read.amazon.co.jp
@version 0.1.0
@description Dark Mode for read.amazon.co.jp
@author DannyAAM
==/UserStyle== */
@-moz-document url-prefix("https://read.amazon.co.jp") {
body,
._21ykqjol8NRHrgKPwlCGFu,
@danny8376
danny8376 / path-try-additional-ext.inc.sh
Created September 29, 2024 18:12
Try additional file extensions in msys2 shell (bash/zsh currently)
path_try_additional_ext_find_names() {
local fn="$1" result=()
shift
result+=("(" "-name" "$fn.$1")
shift
while (( $# )); do
result+=("-o" "-name" "$fn.$1")
shift
done
result+=(")")
@danny8376
danny8376 / rbenv-wrapper.inc.sh
Last active September 2, 2024 16:37
rbenv for Windows helper stuff
if [[ -z "$RBENV_INIT" ]]; then
export RBENV_SYSTEM_RUBY=$( powershell -Command '& {& "$env:RBENV_ROOT\rbenv\bin\rbenv.ps1" init *> $null ; echo $env:RBENV_SYSTEM_RUBY}' )
export PATH="$RBENV_ROOT/rbenv/bin":"$RBENV_ROOT/shims":$PATH
if [[ -n "$RUBYLIB" ]]; then
export RUBYLIB="$RUBYLIB":"$RBENV_ROOT/rbenv/share"
else
export RUBYLIB="$RBENV_ROOT/rbenv/share"
fi
@danny8376
danny8376 / encrypt-swaps
Created August 30, 2024 13:01
Mainly for enabling swap encryption in WSL2?
#!/usr/bin/bash
mapfile -t swaps < <(cat /proc/swaps | awk '/^\/dev\// && /partition/ { print $1 }')
for swap in "${swaps[@]}"; do
swapoff "$swap"
name="swap-$(echo "$swap" | cut -c 6- | tr '/ ' '_-')"
cryptsetup plainOpen --batch-mode --cipher aes-xts-plain64 --key-size 512 --sector-size 4096 --key-file=/dev/urandom "$swap" "$name"
mkswap "/dev/mapper/$name" > /dev/null
swapon "/dev/mapper/$name"
done
@danny8376
danny8376 / MessageLoggerV2-HeavyDutySaving.js
Last active October 4, 2024 18:53
My modified MessageLoggerV2
/**
* @name MessageLoggerV2
* @version 1.8.31
* @invite NYvWdN5
* @donate https://paypal.me/lighty13
* @website https://1lighty.github.io/BetterDiscordStuff/?plugin=MessageLoggerV2
* @source https://github.com/1Lighty/BetterDiscordPlugins/blob/master/Plugins/MessageLoggerV2/MessageLoggerV2.plugin.js
* @updateUrl https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/MessageLoggerV2/MessageLoggerV2.plugin.js
*/
/*@cc_on
#!/usr/bin/env bash
l="/ip4/127.0.0.1/tcp/5001"
c="/ip4/127.0.0.1/tcp/9095"
ipfs="/usr/bin/ipfs"
if [[ "$@" =~ "--api" ]]; then
$ipfs "$@"
elif [[ "$1" = "--local" || "$1" = "-L" ]]; then
shift
$ipfs --api "$l" "$@"
from pyctr.crypto import CryptoEngine
from Cryptodome.Cipher import AES
from hashlib import sha256
a = CryptoEngine()
def print_diff(ori, enc, dec, postxt, *suffix):
if postxt == None:
return
if type(postxt) is tuple:
#!/bin/sh
DELAY=1
PID=0
trap_int() {
if [ "$PID" = "0" ]; then
exit
else
#!/usr/bin/env bash
BOOT9=~/.3ds/boot9.bin
if [[ ! "$1" =~ ^- ]]; then
ESSENTIAL="$1"
shift
ARGC=$#
else
ESSENTIAL="${@:$#}"
@danny8376
danny8376 / sha256_12.c
Last active September 26, 2023 08:34
sha256_12 for mii lfcs hash
/* sha256_16/12
* again specialized to only take 16/12 bytes input and spit out the first 16/last 8 bytes
* again code dug out from mbed TLS
* https://github.com/ARMmbed/mbedtls/blob/development/library/sha256.c
*/
// adopted from: https://github.com/Jimmy-Z/bfCL/blob/master/cl/sha256_16.cl
#include <stdint.h>
const uint32_t K[] =