Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Rodrigo Ayala RodrigoAyala

🏠
Working from home
View GitHub Profile
@RodrigoAyala
RodrigoAyala / servel.sh
Last active Oct 20, 2016
Descarga automática de los PDF pertenecientes al Padrón Electoral del Servel
View servel.sh
curl -s http://web.servel.cl/archivos.xml | grep -ohE 'A\d{7}.pdf' | while read x; do curl -o $x http://web.servel.cl/padron/$x; done
@RodrigoAyala
RodrigoAyala / iptables.sh
Created Jun 9, 2014
Iptables script which blocks all connections, except incoming SSH, HTTP and HTTPS, and outgoing DNS, HTTP and HTTPS
View iptables.sh
#!/bin/sh
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
@RodrigoAyala
RodrigoAyala / AppDelegate.cpp
Created Oct 28, 2013
Boilerplate code AppDelegate.cpp for Cocos2d-x games
View AppDelegate.cpp
bool AppDelegate::applicationDidFinishLaunching() {
CCSize designSize = CCSizeMake( 480,320);
CCSize resourceSize = CCSizeMake(480,320);
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize();
std::vector<std::string> searchPaths;
std::vector<std::string> resDirOrders;
TargetPlatform platform = CCApplication::sharedApplication()->getTargetPlatform();
if (platform == kTargetIphone || platform == kTargetIpad)
@RodrigoAyala
RodrigoAyala / tree.txt
Created Jul 11, 2013
Debug info for tv.js issue
View tree.txt
**Tree diagram of files and folders:**
```
.
├── LICENSE
├── Makefile
├── README.md
├── bin
│   └── run.js
├── config.js
@RodrigoAyala
RodrigoAyala / nodejs_installer.sh
Created Mar 24, 2013
Bash script to install NodeJS on the Raspberry Pi
View nodejs_installer.sh
#!/bin/bash
echo -e "nodejs_installer.sh - \033[37mNode\033[32m\033[32mJS \033[0minstaller for \033[35mRaspberry Pi\033[0m"
echo -e "========================================================\n"
if [ "$(uname -m)" != "armv6l" ]; then
echo -e "\033[31mError: \033[0marmv6l architecture not found. (Are you sure that you are running the script on a Raspberry Pi?)\033[0m";
exit 1;
else
echo -e "\033[35mRaspberry Pi \033[32mfound! Proceeding...\033[0m"
You can’t perform that action at this time.