Skip to content

Instantly share code, notes, and snippets.

View bogdanr's full-sized avatar
💭
:(){ :|:& };:

Bogdan Rădulescu bogdanr

💭
:(){ :|:& };:
View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 23, 2024 11:47
set -e, -u, -o, -x pipefail explanation
@SyncChannel
SyncChannel / Arduino_Speed_Tests.ino
Created January 30, 2016 03:15
Arduino Speed Test Benchmarking Program
// Arduino Speed Test Benchmarking Program
// Original Program Credit: Arduino.cc
// Modified By: Dan Watson
// synchannel.blogspot.com
// 1-29-2015
// This sketch is the speed test portion of the Arduino Show Info program
// http://playground.arduino.cc/Main/ShowInfo
// Certain tests may not compile/run for all boards. Comment them out as necessary:
/*
ffmpeg -i "$file" -f s32be -acodec pcm_s32be -ar 44100 -af "volume=0.5" tcp://espip:5522
*/
#include "i2s.h"
#include <ESP8266WiFi.h>
const char* ssid = "***********";
const char* password = "**********";
WiFiServer pcmServer(5522);
static WiFiClient pcmClient;
@florianbeer
florianbeer / set-tmux-title
Created April 21, 2015 10:47
Set tmux pane title to short hostname on ssh connections
ssh() {
if [ "$(ps -p $(ps -p $$ -o ppid=) -o comm=)" = "tmux" ]; then
tmux rename-window "$(echo $* | cut -d . -f 1)"
command ssh "$@"
tmux set-window-option automatic-rename "on" 1>/dev/null
else
command ssh "$@"
fi
}
input {
s3 {
bucket => "your_bucket_name"
credentials => ["acces_key","secret_key"]
codec => cloudtrail
region_endpoint => "your_region"
type => "cloudtrail"
prefix => "your/logs/path"
sincedb_path => "/path/.sincedb"
}
@projectgus
projectgus / linpack_bench.ino
Last active March 31, 2021 19:49
Linpack Floating Point benchmark that runs as an Arduino sketch. (Yes, I know...) I wanted to generically measure Arduino Floating Point performance, this seemed like a reasonable(ish) way to do it. Runs with N=10, single precision, but produces sane looking results & residual. (89 Linpack kFLOPS on a Freetronics Eleven, ie Arduino Uno compatibl…
# include <stdlib.h>
# include <stdio.h>
# include <math.h>
int do_benchmark ( void );
double cpu_time ( void );
void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
double ddot ( int n, double dx[], int incx, double dy[], int incy );
int dgefa ( double a[], int lda, int n, int ipvt[] );
void dgesl ( double a[], int lda, int n, int ipvt[], double b[], int job );
@joeyAghion
joeyAghion / mongodb_collection_sizes.js
Last active February 9, 2024 22:37
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
var collectionNames = db.getCollectionNames(), stats = [];
collectionNames.forEach(function (n) { stats.push(db[n].stats()); });
stats = stats.sort(function(a, b) { return b['size'] - a['size']; });
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); }
@deltheil
deltheil / nginx.conf
Created June 4, 2012 07:57
Hide sensitive GET parameters within nginx access logs thanks to the Lua module
http {
log_format filt '$remote_addr - $remote_user [$time_local] "$_request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
location /login {
# `set` is provided by the Rewrite module
set $filter "password|secret";