Skip to content

Instantly share code, notes, and snippets.

@naus3a
naus3a / cyboRNG.sh
Created December 23, 2022 18:18
use my implanted smartcard as a TRNG
#!/bin/bash
SZ=128
if [ -n "$1" ]; then
SZ=$1
fi
echo "scd random $SZ" | gpg-connect-agent --hex
@naus3a
naus3a / index.html
Created March 17, 2021 18:19
socket.io client test unit
<!DOCTYPE html>
<head>
<script src="https://cdn.socket.io/3.1.3/socket.io.min.js" integrity="sha384-cPwlPLvBTa3sKAgddT6krw0cJat7egBga3DJepJyrLl4Q9/5WLra3rrnMcyTyOnh" crossorigin="anonymous"></script>
</head>
<body>
<script>
function sha256(message) {
// encode as UTF-8
const msgBuffer = new TextEncoder().encode(message);
@naus3a
naus3a / stapleApp.sh
Created March 8, 2021 12:46
staple an OSX app after notarization
#!/bin/bash
xcrun stapler staple "$1"
#!/bin/bash
APPLE_ID="someone@somewhere.com"
PW="aaaa-bbbb-cccc-dddd"
PROVIDER="XXXXXXXX"
xcrun altool --notarization-info $1 --username $APPLE_ID --password $PW --asc-provider "$PROVIDER"
@naus3a
naus3a / notarize.sh
Created March 8, 2021 11:49
OSX notarize Unity+Oculus app
#!/bin/bash
## we assume both the app and the entitlements file are in ./
APP="something.app"
ENT="something.entitlements"
ZIP="somthing.zip"
BUNDLE="com.something"
APPLE_ID="someone@somewhere.com"
PW="aaaa-bbbb-cccc-dddd"
@naus3a
naus3a / questDeploy.sh
Created February 24, 2021 13:31
microscript to upload builds quest builds to the oculus store
#!/bin/bash
#path to the ovr platform util
OVR=~/ovr-platform-util
ID="1234"
SECRET="1234"
APK=~/app.apk
OBB=~/app.obb
CHAN="chan"
@naus3a
naus3a / dylib_wrangling.md
Created February 11, 2021 11:49
dylib checking and embedding

How to check where you library wants to live: $ otool /pathToLib/lib.dylib

How to tell your app to get the lib from another path: $ install_name_tool -change /pathLibWantsToBe/lib.dylib /pathYouNeed/lib.dylib /pathToApp/AppName.app/Contents/MacOS/AppName

Let's say you want the lib to be embedded in your app (supposing you're using XCode):

  • add the library to your project (drag it in Frameworks / BuildPhases -> Link Binary With Libraries)
  • Go to BuildPhases -> CopyFiles, set Destination to Frameworks and add the library to the list. This will copy it to the Frameworks folder in your bundle.
  • In BuildPhases -&gt; RunScript add:
@naus3a
naus3a / gist:b69a9ee8b327bddc90fe5af5ef89d02e
Created November 6, 2020 11:02
git push when peeps messed up your LFS too bad to care anymore
git push --no-verify [remote] [local_branch]:[remote_branch]
@naus3a
naus3a / conwaySpinner.sh
Created November 5, 2020 18:05
bash Conway glider spinner
#!/bin/bash
frames=("⠢⠇" "⠨⠖" "⠬⠆" "⠐⡴" "⠢⠇" "⠨⠖" "⠬⠆" ".." "⣤ ")
nFrames=${#frames[@]}
curFrame=0
frameTime=0.2
printf " "
while true; do
printf "\033[2D${frames[$curFrame]}"
curFrame=$[$curFrame+1]
if [ $curFrame -ge $nFrames ]; then
@naus3a
naus3a / cleanupDevStuff.sh
Created July 31, 2020 11:18
osx dev cleanup
#!/bin/bash
brew update && brew upgrade && brew cleanup
rm -rf "${HOME}/Library/Caches/CocoaPods"
#old simulators
xcrun simctl delete unavailable
#xcode archives
rm -rf ~/Library/Developer/Xcode/Archives
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~~/Library/Developer/Xcode/iOS Device Logs/