Skip to content

Instantly share code, notes, and snippets.

View andresilva's full-sized avatar
🌴
Off

André Silva andresilva

🌴
Off
  • Porto, Portugal
View GitHub Profile
@andresilva
andresilva / test-webcam.sh
Last active December 7, 2023 15:06
Test ipu6 webcam on NixOS
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p linuxPackages_latest.v4l2loopback gst_all_1.gstreamer
function usage() {
echo "Usage: $0 <platform name> [--webcam]"
echo "Supported platforms are: ipu6, ipu6ep, ipu6epmtl"
exit
}
PLATFORM="$1"
@andresilva
andresilva / Cargo.toml
Last active February 25, 2020 18:03
Motivational USB foot pedal
[package]
name = "motivation-pedal"
version = "0.1.0"
authors = ["André Silva <andre.beat@gmail.com>"]
edition = "2018"
[dependencies]
env_logger = "0.7.1"
hidapi = "1.1.1"
log = "0.4.8"
@andresilva
andresilva / MusicoinBlockReward.sol
Last active September 21, 2018 00:31
MusicoinBlockReward
// Copyright 2018 Parity Technologies (UK) Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
/*
* 'Origami Programming' by Hugo Sereno Ferreira
*
* IEEE Talk @ FEUP (2018)
*
* Exercise sheet (http://goo.gl/Dd4p7b)
*
* Note: Make sure you have node.js, and then install the dependencies using:
*
* npm install -g lodash
@andresilva
andresilva / nodes.json
Last active January 30, 2018 15:50
filtered nodes.json
{
"nodes": [
{
"url": "enode://4c77ab57b6c464f58daaadfda79fcb28a42ae1b8e0c85028ace7ebf691f47b18b0f40151d0348744cf194c2bb653847ef5203675513b6f3be10a1c515d9529f2@XXX.XXX.XXX.XXX:YYYYY",
"attempts": 8512,
"failures": 0
},
{
"url": "enode://ede814ea322852e826c95fbaff2a019e3af12f7998fdd1d529f54ca1e011b98cd532f909491aaefc59a059b616fddafd4dc0b068b50d3fce43561b3f62c1f888@XXX.XXX.XXX.XXX:YYYYY",
"attempts": 3352,
@andresilva
andresilva / Dockerfile
Last active June 28, 2018 16:06
parity-alpine
FROM alpine:3.7
WORKDIR /build
# install tools and dependencies
RUN apk add --no-cache gcc musl-dev openssl-dev pkgconfig g++ make curl \
eudev-dev rust cargo git file binutils libusb-dev \
linux-headers
# show backtraces

Keybase proof

I hereby claim:

  • I am andresilva on github.
  • I am andrebeat (https://keybase.io/andrebeat) on keybase.
  • I have a public key ASCSJHirkFqkUPDPCD9S9UVwUfokXrq01XipxZUEFjplBQo

To claim this, I am signing this object:

@andresilva
andresilva / proxy.scala
Created December 7, 2016 12:17
spray dynamic route
def receive = {
case EnableMaster(f) => enableMaster(f)
case EnableProxy(h, p, f) => enableProxy(Some((h, p, f)))
case ForecasterClusterSingleton.Started(h, p, f) if h != selfHost || p != selfHttpPort =>
self ! EnableProxy(h, p, f)
case m => currentService.foreach(_.forward(m))
}

Keybase proof

I hereby claim:

  • I am andrebeat on github.
  • I am andrebeat (https://keybase.io/andrebeat) on keybase.
  • I have a public key ASCSJHirkFqkUPDPCD9S9UVwUfokXrq01XipxZUEFjplBQo

To claim this, I am signing this object:

[CRT] s3fs.cpp:set_s3fs_log_level(253): change debug level from [CRT] to [DBG]
[INF] s3fs.cpp:set_moutpoint_attribute(4151): PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40755)
[CRT] s3fs.cpp:s3fs_init(3334): init v1.80(commit:unknown) with OpenSSL
[INF] s3fs.cpp:s3fs_check_service(3708): check services.
[INF] curl.cpp:CheckBucket(2860): check a bucket.
[DBG] curl.cpp:GetHandler(272): Get handler from pool: 31
[INF] curl.cpp:prepare_url(4175): URL is http://s3.amazonaws.com/******************/
[INF] curl.cpp:prepare_url(4207): URL changed is http://******************.s3.amazonaws.com/
[INF] curl.cpp:insertV4Headers(2237): computing signature [GET] [/] [] []
[INF] curl.cpp:url_to_host(100): url is http://s3.amazonaws.com