Skip to content

Instantly share code, notes, and snippets.

Aarón Rosas a2ron

Block or report user

Report or block a2ron

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@a2ron
a2ron / compile-nginx.sh
Last active Aug 7, 2017 — forked from tollmanz/compile-nginx.sh
Install NGINX (compiling and adding extra modules)
View compile-nginx.sh
################################################################################################
# VARS
SOURCES_FOLDER="/opt/"
################################################################################################
# move to folder where we will download the sources
cd $SOURCES_FOLDER
# dependency
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
tar -zxf pcre-8.40.tar.gz
@a2ron
a2ron / analytics.nginx
Last active Aug 7, 2017 — forked from jirutka/analytics.conf
Add Google Analytics tracking code to HTML via nginx
View analytics.nginx
# Add Google Analytics tracking code to HTML response
#
# Usage:
# set $tracking_id 'UA-********-*';
# include incl/analytics.conf;
#
# It needs nginx compiled with option --with-http_sub_module.
# Uses optimized GA code from: http://mathiasbynens.be/notes/async-analytics-snippet
#
@a2ron
a2ron / ImperialMarch.ino
Last active Jan 3, 2018 — forked from StevenNunez/ImperialMarch.ino
Imperial march played on an Arduino with a Piezo Element
View ImperialMarch.ino
int speakerPin = 5;
String notes[] = {"G4","G4", "G4", "D#4/Eb4", "A#4/Bb4", "G4", "D#4/Eb4","A#4/Bb4", "G4", "D5", "D5", "D5", "D#5/Eb5", "A#4/Bb4", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4", "G5","G4","G4","G5","F#5/Gb5", "F5","E5","D#5/Eb5","E5", "rest", "G4", "rest","C#5/Db5","C5","B4","A#4/Bb4","A4","A#4/Bb4", "rest", "D#4/Eb4", "rest", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4" ,"D#4/Eb4","A#4/Bb4", "G4"};
int beats[] = { 8, 8, 8, 6, 2, 8, 6 , 2 ,16 , 8, 8, 8, 6, 2, 8, 6, 2, 16,8,6,2,8,6,2,2, 2, 2,6,2,2,8,6,2,2,2,2,6,2,2,9,6,2,8,6,2,16 };
int tempo = 50;
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(tone);
digitalWrite(speakerPin, LOW);
@a2ron
a2ron / cec-keypresses.sh
Created Oct 21, 2018 — forked from bahamas10/cec-keypresses.sh
use `cec-client` to fire events when keys are pressed
View cec-keypresses.sh
#!/usr/bin/env bash
#
# binding remote control commands
#
# Author: Aaron Rosas
# Date: 21/10/2018
# Licens: MIT
# Tested on: Raspberry pi 3 with cec-client installed
cec-client -t a | perl -nle 'BEGIN{$|=1} /key (pressed|released): (.*) (.*) (.*)/ && print $2' | \
You can’t perform that action at this time.