Skip to content

Instantly share code, notes, and snippets.

View pedrocarrico's full-sized avatar

Pedro Carriço pedrocarrico

View GitHub Profile
@pedrocarrico
pedrocarrico / install.sh
Created October 30, 2019 16:12
Install nano on heroku dyno
mkdir /app/nano
curl https://github.com/Ehryk/heroku-nano/raw/master/heroku-nano-2.5.1/nano.tar.gz --location --silent | tar xz -C /app/nano
export PATH=$PATH:/app/nano
ARG FUNCTION_RUNTIME
FROM mikesir87/aws-cli as code
ARG FUNCTION_NAME
ARG AWS_DEFAULT_REGION
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
RUN wget -O function.zip `aws lambda get-function --function-name $FUNCTION_NAME --query 'Code.Location' --output text`
@pedrocarrico
pedrocarrico / README.md
Last active August 5, 2016 11:55
pg-copy-streams readable stream not finishing and multiple end events error example
@pedrocarrico
pedrocarrico / install_ruby_rpi.sh
Last active March 22, 2017 18:39 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.2 on the Raspberry Pi (Raspbian).
#!/bin/bash
# -----------------------------------------------------------------------
# Installs Ruby 2.2 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s raw_script_url_here)
# -----------------------------------------------------------------------
# Set up variables
@pedrocarrico
pedrocarrico / install.sh
Created June 30, 2014 21:16
Install latest node.js on the raspberry pi
!#/bin/bash
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
@pedrocarrico
pedrocarrico / interfaces
Created June 30, 2014 20:44
Raspbian network interfaces configuration ("/etc/network/interfaces")
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "SSID"
@pedrocarrico
pedrocarrico / remove_packages.sh
Last active February 1, 2022 20:40
Remove unneeded packages from raspbian
#!/bin/bash
# Stephen's Raspberry Pi Mimimalist install from standard Raspdian Image
# as seen in http://www.raspberrypi.org/phpBB3/viewtopic.php?f=24&t=45437
sudo apt-get update
sudo apt-get purge xserver* -y
sudo apt-get purge ^x11 -y
sudo apt-get purge ^libx -y
sudo apt-get purge ^lx -y
sudo apt-get purge samba* -y
sudo apt-get autoremove -y
@pedrocarrico
pedrocarrico / wpa_supplicant.conf
Created November 17, 2012 17:58
Wpa supplicant configuration
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
network={
ssid="YOUR SSID here"
scan_ssid=1
mode=0
proto=WPA2
auth_alg=OPEN
module HashExtensions
def symbolize_keys
inject({}) do |acc, (k,v)|
key = String === k ? k.to_sym : k
value = Hash === v ? v.symbolize_keys : v
acc[key] = value
acc
end
end
end
@pedrocarrico
pedrocarrico / haproxy.cfg
Created June 16, 2012 10:26
Sample HAProxy configuration for testing in your local development environment
global
maxconn 4096
pidfile /tmp/haproxy-queue.pid
defaults
log global
mode http
timeout connect 300000
timeout client 300000
timeout server 300000