Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
echo "This script prints the filenames of any dylibs in your /usr/local/ that depend on the System Python"
for f in `find /usr/local -iname "*.dylib"`; do
otool -L "$f" | grep Python | grep System &> /dev/null
status=$?
if [ $status -eq 0 ]; then
echo "$status: $f"
fi
done
@lokkju
lokkju / find_system_python_dylibs.sh
Last active December 31, 2023 23:08
This script prints the filenames of any libs in your /usr/local/lib that depend on the System Python. It is especially useful if you use a non-system Python, but have previously compiled extensions against the System Python - it will tell you which need to be recompiled.
#!/bin/bash
echo "This script prints the filenames of any dylibs in your /usr/local/ that depend on the System Python"
for f in `find /usr/local/lib`; do
otool -L "$f" 2> /dev/null| grep Python | grep System &> /dev/null
status=$?
if [ $status -eq 0 ]; then
echo "$status: $f"
fi
done
@lokkju
lokkju / vaulty-decode.py
Created November 6, 2014 09:46
Decode Vaulty protected .vdata files
#!/usr/bin/python
# This program will copy, rename and decode Vaulty .vdata files back to images and videos for viewing in normal applications.
# Usage: python vaulty-decode.py <directory with .vdata files>
import sys
import os
import glob
import io
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.2.3'
id 'java'
id 'maven'
}
scmVersion {
tag {
prefix = ''
serialize = {config, version -> "$version-RELEASE"}
@lokkju
lokkju / crosstool-NG.patch
Created October 13, 2015 10:11
Patch to allow building Expressif on case insensitive filesystems
diff --git crosstool-NG/scripts/crosstool-NG.sh.in crosstool-NG/scripts/crosstool-NG.sh.in
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -84,14 +84,14 @@
# Where will we work?
-CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/.build}"
-CT_DoExecLog ALL mkdir -p "${CT_WORK_DIR}"
-CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/backtrace"
+# CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/.build}"
def time[R](block: => R): R = {
val t0 = System.nanoTime()
val result = block // call-by-name
val t1 = System.nanoTime()
println("Elapsed time: " + (t1 - t0) + "ns")
result
}
package org.apache.spark.sql.catalyst.expressions
import org.apache.spark.sql._
import org.apache.spark.sql.catalyst._
import org.apache.spark.sql.catalyst.analysis._
import org.apache.spark.sql.catalyst.expressions.aggregate._
import org.apache.spark.sql.types._
import scala.collection.mutable
curl "https://www.ethernodes.org/network/1/data?draw=1&columns%5B0%5D%5Bdata%5D=id&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=host&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=port&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=country&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=clientId&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=tr
@lokkju
lokkju / rotating_vigenere_decoder.py
Last active October 7, 2018 20:47
rotating vigenere decoder for adversary group
from itertools import count
from string import ascii_letters
_cidx = dict(zip(ascii_letters, count(1)))
def decipher(key,enc,rot):
"""
Deciphers Vigenere cipher with the given key and rotated alphabet
Parameters:
@lokkju
lokkju / fare_rules.yaml
Created November 11, 2019 16:35
Examples of querying kiwi.com's flight API (and returning results based on earned elite qualifying mileage for American Airlines)
AA:
codes:
F: {award_mod: 1.0, bonus_mod: 1.0, qm_mod: 3.0, eqd_mod: .40, eqs_mod: 1.0, name: First}
A: {award_mod: 1.0, bonus_mod: 1.0, qm_mod: 2.0, eqd_mod: .40, eqs_mod: 1.0, name: First}
J: {award_mod: 1.0, bonus_mod: 1.0, qm_mod: 3.0, eqd_mod: .40, eqs_mod: 1.0, name: Business}
R: {award_mod: 1.0, bonus_mod: .75, qm_mod: 2.0, eqd_mod: .35, eqs_mod: 1.0, name: Business}
D: {award_mod: 1.0, bonus_mod: .50, qm_mod: 2.0, eqd_mod: .30, eqs_mod: 1.0, name: Business}
I: {award_mod: 1.0, bonus_mod: 0.0, qm_mod: 2.0, eqd_mod: .20, eqs_mod: 1.0, name: Business}
W: {award_mod: 1.0, bonus_mod: 0.0, qm_mod: 1.5, eqd_mod: .20, eqs_mod: 1.0, name: Premium Economy}
P: {award_mod: 1.0, bonus_mod: 0.0, qm_mod: 1.5, eqd_mod: .20, eqs_mod: 1.0, name: Premium Economy}