Skip to content

Instantly share code, notes, and snippets.

View manchoz's full-sized avatar

Giampaolo Mancini manchoz

View GitHub Profile
# pkcs11-tool --module /usr/lib/libckteec.so.0 --init-token --label arduino --so-pin 12345678
# pkcs11-tool --module /usr/lib/libckteec.so.0 --init-pin --label arduino --so-pin 12345678 --pin 87654321
# pkcs11-tool --module /usr/lib/libckteec.so.0 --keypairgen --key-type EC:prime256v1 --label testkey --token-label arduino --pin 87654321
Key pair generated:
Private Key Object; EC
label: testkey
Usage: sign, derive
Access: sensitive, always sensitive, never extractable, local
@robonxt
robonxt / Installing the Pebble app on iOS with Sideloadly.md
Last active May 21, 2024 22:09
Installing the Pebble app on iOS with Sideloadly - Rebble (Now)Official Installation Guide by robonxt

NOTICE:

This guide is now in maintenance mode. Rebble made their own official guide based on this, so please follow the updated guide on their website at help.rebble.io/sideload-ios-app. If you have any suggestions, ping me (@robonxt) or one of the helpful people in the official Rebble Discord Server and hopefully there will be a guide update soon!

Thank you for all the support, and long live Pebble and Rebble!

Fun Fact: I've never daily driven Pebble on iOS before, only to test out sideloading and to ensure the guide works with the iOS devices I have 🤣

Installing the Pebble app on iOS with Sideloadly

template<typename E>
constexpr typename std::underlying_type<E>::type toBase(E e) noexcept
{
return static_cast<typename std::underlying_type<E>::type>(e);
}
@swlaschin
swlaschin / effective-fsharp.md
Last active July 23, 2024 10:39
Effective F#, tips and tricks

Architecture

  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
  • Keep IO at edges

FreeTypeCache cleanUp.
Clipboard startUp: true.
RubEditingState allInstances do: [ :each | each instVarNamed: #undoManager put:nil].
GTPlayBook reset.
EditorFindReplaceDialogWindow cleanUp.
ActiveHand resetClickState; releaseAllFocus.
UITheme current focusIndicator: nil.
40 timesRepeat: [
1 second wait.
World doOneCycle.
@vladbabii
vladbabii / build_emqtt.sh
Created October 23, 2016 17:21
Compile EMQTT on Raspberry Pi 3
apt-get update
apt-get install git erlang-base erlang-crypto erlang-eunit erlang-mnesia erlang-runtime-tools erlang-syntax-tools erlang-asn1 erlang-public-key erlang-ssl erlang-inets erlang-snmp erlang-os-mon erlang-webtool erlang-tools erlang-xmerl erlang-dev erlang-edoc erlang-eldap erlang-gs erlang-appmon erlang-wx erlang-et erlang-observer
# then follow instructions from http://emqtt.io/docs/v2/install.html#installing-from-source
git clone https://github.com/emqtt/emqttd-relx.git
cd emqttd-relx
make
# to start cd to bin then run emqttd console
# cd _rel/emqttd/bin/
# ./emqttd console
@alexeygrigorev
alexeygrigorev / vimeo-download.py
Created September 17, 2016 09:09
Downloading segmented video from vimeo
import requests
import base64
from tqdm import tqdm
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1'
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1]
resp = requests.get(master_json_url)
content = resp.json()
anonymous
anonymous / .bash_aliases
Created September 12, 2014 14:37
## Modified commands
alias diff='colordiff' # requires colordiff package
alias grep='grep --color=auto'
alias more='less'
alias df='df -h'
alias du='du -c -h'
alias mkdir='mkdir -p -v'
alias nano='nano -w'
alias ping='ping -c 5'
@willurd
willurd / web-servers.md
Last active July 26, 2024 13:45
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jboner
jboner / latency.txt
Last active July 26, 2024 04:31
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD