This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef USE_ECDH | |
#include "mbedtls/include/mbedtls/ecdh.h" | |
static NO_INLINE JsVar *jswrap_crypto_ecdh(JsVar *message, JsVar *key, JsVar *options, bool genSecret ) { | |
int ret; | |
JSV_GET_AS_CHAR_ARRAY(msgPtr, msgLen, message); | |
if (!msgPtr) return 0; | |
mbedtls_ecdh_context ecdh_ctx; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var fs = require('fs'); | |
var SSH_AUTH_SOCK_PATH_PREFIX = "/tmp/ssh-agent." | |
var SSH_AUTH_SOCK_PATH_POSTFIX = ".sock" | |
function createServer(socketName, callback, onConnect) { | |
var SSH_AUTH_SOCK_PATH = SSH_AUTH_SOCK_PATH_PREFIX + socketName + SSH_AUTH_SOCK_PATH_POSTFIX; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t baud; | |
uint32_t old_baud; | |
void loop() { | |
// put your main code here, to run repeatedly: | |
baud = Serial.baud(); | |
if (baud != old_baud) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************* | |
* Dual Channel DC Motor Driver Board* | |
* Code Written by Idayu - MYBOTIC * | |
*************************************/ | |
int IN1 = 12; | |
int IN2 = 11; | |
int IN3 = 7; | |
int IN4 = 6; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// N0 M106*36 | |
// N1 G28*18 | |
// N2 M107*39 | |
getCS("N0 M106"); | |
getCS("N1 G28"); | |
getCS("N2 M107"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
#PS1="\h:\W \u\$" # Default | |
PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var key1Name = "test13"; | |
var key2Name = "test22"; | |
// "hex" or "base64", default is raw(Uint8Array) | |
var encoding = "hex"; | |
////----------------------- | |
var atob = require("atob"); | |
var btoa = require("btoa"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
modprobe libcomposite | |
command="$1" # "up" or "down" | |
gadgetDevice="/sys/kernel/config/usb_gadget/my_gadget" | |
usb_up() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cloud9 nvm node runner | |
{ | |
"script": [ | |
"source $HOME/.nvm/nvm.sh", | |
"set -e", | |
"if ! [ \"$debug\" == true ]; then ", | |
" node \"$file\" $args", | |
"elif \"$(node -p 'parseInt(process.version.slice(1)) < 7')\" == true; then", | |
" FLAGS=\"--nocrankshaft --nolazy --debug-brk=$debugport\"", | |
" if node --nodead_code_elimination -e '' &> /dev/null; then", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
To have abstract application keys into a keychain, so you can keep | |
your keys (aka one login, but many apps) without having to constantly | |
shift your logins between applications or shared documents | |
We do this by: | |
- Initiate 2 instances of gun. | |
- The main user instance will act as you, using a key chain to keep key pairs | |
that apps may generate. | |
- All keys will be encrypted to yourself, which means only you will be able to access |