Skip to content

Instantly share code, notes, and snippets.

View flazz's full-sized avatar

Franco Lazzarino flazz

View GitHub Profile
[package]
name = "digidist"
version = "0.1.0"
authors = ["flazz"]
edition = "2018"
[dependencies]
vst = { git = "https://github.com/rust-dsp/rust-vst.git" }
rustfft = "3.0.0"
# credentials
# SSO=your.sso
# PASS=your.pass
# choose between prod or staging
HOST=https://staging.identity-internal.api.rackspacecloud.com
#HOST=https://identity-internal.api.rackspacecloud.com
# payload
DATA="{\"auth\":{\"RAX-AUTH:domain\":{\"name\":\"Rackspace\"},\"passwordCredentials\":{\"username\":\"${SSO}\", \"password\":\"${PASS}\"}}}"
@flazz
flazz / auth.lua
Created August 23, 2016 23:08 — forked from kyleondata/auth.lua
local count = 0
core.register_service("auth", "http", function (applet)
count = count + 1
-- Get X-Auth-Token --
local token = applet.headers['x-auth-token'][0]
local cmd = 'curl -H "X-Auth-Token:'..token..'"'
cmd = cmd..' -sL -w "%{http_code}\\n"'
cmd = cmd..' "https://staging.identity-internal.api.rackspacecloud.com/v2.0/tokens/'..token..'"'
cmd = cmd..' -o /dev/null'
@flazz
flazz / conc.c
Last active August 20, 2016 02:45
python callbacks not making new thread on every cb invocation
/* cc -shared conc.c -o conc.dynlib */
#include <pthread.h>
#include <stdio.h>
typedef void (*cb_t)(int);
pthread_t t;
cb_t cb;
void set_notify(cb_t cb0) {
#! /usr/bin/osascript -l JavaScript
Mail = Application('Mail');
release = Mail.accounts.byName("Exchange").mailboxes.byName("release");
messages = release.messages();
histo = messages.reduce(function(acc, msg, ix, arr) {
from = msg.sender();
if (!acc[from]) {
@flazz
flazz / -
Created April 24, 2015 21:26
foo
@flazz
flazz / -
Created April 24, 2015 21:26
foo
package main
import (
"fmt"
)
func main() {
c := make(chan int, 10)
go task1(c)
# server
listen1 -v 'tcp!localhost!7777' wc -l
# dial client - doesn't work
dial 'tcp!localhost!7777' < some-file
# nc client – does work
nc localhost 7777 < some-file
10
% GOOS=linux GOARCH=amd64 ./make.bash
# Building C bootstrap tool.
cmd/dist
ld: can't open output file for writing 'cmd/dist/dist.ld_PtcpHb', errno=13 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)