Skip to content

Instantly share code, notes, and snippets.

View Leask's full-sized avatar
🏠
Working from home

Sixia "Leask" Huang Leask

🏠
Working from home
View GitHub Profile
@Leask
Leask / dbxclear.sh
Created January 10, 2020 22:35
Clean Dropbox conflicted files.
#!/bin/sh
# Flora Dropbox clear by LeaskH.com
dbcMatcher="*(*'s conflicted copy 20*-*-*)*"
num=`find ~ -name "$dbcMatcher" | wc -l`
if [ $num -gt 0 ]; then
echo "Dropbox conflicted file(s):\n"
find ~ -name "$dbcMatcher"
echo "\nTotal: $num item(s), do you want to clear now? (y/n)"
read answer
@Leask
Leask / brew-up.sh
Last active January 10, 2020 22:34
Updating brew packages.
# Flora Up by LeaskH.com
up() {
echo 'Updating brew packages...'
brew update
brew upgrade --all
brew cleanup
echo ':) Done'
}
@Leask
Leask / black-box.sh
Last active January 10, 2020 22:34
BlackBox is a simple toolkit to backup my GoPro videos and my Blackberry phone records.
#!/bin/sh
# Flora BlackBox Utilities by LeaskH.com
# BlackBox is a simple toolkit to backup my GoPro videos and my Blackberry phone records.
initBlackBox() {
if [ -e "$basePath" ]; then
logFile="$basePath$logFile"
echoWithLog "<<<<<<< Flora BlackBox >>>>>>>\n"
else
logFile="/var/log$logFile"
{"lastUpload":"2020-01-10T14:41:13.416Z","extensionVersion":"v3.4.3"}
const { randomBytes } = require('crypto')
const secp256k1 = require('secp256k1')
// or require('secp256k1/elliptic')
// if you want to use pure js implementation in node
// generate message to sign
const msg = randomBytes(32)
// generate privKey
let privKey
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>InAppPurchaseReceipt_com.fiftythree.paper.mixer</key>
<data>MTMzMzA1Njc5OC45MTQ0NjI=</data>
<key>WebKitDiskImageCacheSavedCacheDirectory</key>
<string></string>
<key>FacebookSharingEnabled</key>
<false/>
@Leask
Leask / linuxium-z3735f-patch.sh
Created September 24, 2015 05:10
Linuxium's installation script for upgrading Ubuntu with Canonical's Z3735F customizations
#!/bin/sh
# Linuxium's installation script for upgrading Ubuntu with Canonical's Z3735F customizations
if [ -d /target ]; then
echo "$0: Do not run this script from a LiveCD ... exiting."
exit
fi
DEFAULT_GATEWAY=`ip r | grep default | cut -d ' ' -f 3`
const { randomBytes } = require('crypto')
const secp256k1 = require('secp256k1')
const createKeccakHash = require('keccak')
const signToPubAddress = (msghash, sig) => {
// TODO: verify msghash and sig
const v = Number(sig.slice(128));
const sigObj = {r: sig.slice(0, 64), s: sig.slice(64, 128)};
const point = secp256k1.recoverPubKey(msghash, sigObj, v);
const pub = point.encode('hex');
@Leask
Leask / listening.sh
Created May 15, 2018 09:32
Get current listening on iTunes.
#!/bin/sh
# Flora Listening by LeaskH.com
initFlora() {
export PATH=~/Documents/.flora:$PATH
}
getLastListening() {
echo `cat /tmp/flora_listening 2> /dev/null`
}