Skip to content

Instantly share code, notes, and snippets.

View adv0r's full-sized avatar

Nicolò Paternoster adv0r

View GitHub Profile
@adv0r
adv0r / updateLighthouse.sh
Created August 3, 2022 09:35
A script to update lighthouse to a given version
#!/bin/bash
# Assumption 1: you have lighthouse running on ubuntu with systemctl
# Assumption 2: lighthouse binary is in /home/lighthouse/.cargo/bin/lighthouse
# If otherwise, change the script accordingly
latestVersion="2.5.0" ##Change this before running, see https://github.com/sigp/lighthouse/releases
logFile="/home/lighthouse/lighthouseUpdate.log"
filename="lighthouse-v"$latestVersion"-aarch64-unknown-linux-gnu.tar.gz"
@adv0r
adv0r / S3Client.js
Created July 27, 2017 17:02
AWS s3 : Generate a pre-signed URL - step-by-step. {Node.js}
//A quick way to generate valid URL to GET files hosted on private AWS S3 bucket
//I didn't want to use an SKD so I followed the documentation to make my own and learn
//The code is dirty, but since I couln't find anything online,
//I figured this could be handy to someone
//Requirements : Node and Crypto-js (install with npm install crypto-js)
//Remote settings-----------------------------------------------------------
@adv0r
adv0r / bewout
Created July 30, 2015 18:43
brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/opt/local/bin/ncurses5-config
@adv0r
adv0r / Tweets.js
Created December 13, 2011 15:06 — forked from JohnGreenaway/Tweets.js
var sys=require('sys'), http = require('http');
var query = "Winter Olympics";
var twitter = http.createClient(80, "search.twitter.com");
var since = 0;
function scanTweet() {
// the httpclient "twitter" we created above - here we build a
// query to Twitter, requesting a JSON response. It's not
// fired off until we call the "finish" method on it.