Skip to content

Instantly share code, notes, and snippets.

import Foundation
import PromisedFuture
class APIClient {
var http:HttpProtocol = HttpAlamofire()
func getNews() -> Future<[ListNewsUseCase.ListNews.SuccessResponse.NewModel]> {
return self.http.getArray(endpoint: "news")
}
@carlosjac
carlosjac / etchosts
Created May 10, 2011 13:48
etchosts
127.0.0.1 mailer.mislistasdecorreo.com
127.0.0.1 localhost localhost.localdomain
@carlosjac
carlosjac / etcnetiface
Created May 10, 2011 13:44
etcnetiface
auto lo
iface lo inet loopback
pre-up iptables-restore < /etc/iptables.up.rules
auto eth0
iface eth0 inet dhcp
@carlosjac
carlosjac / IPTablesRulesForMailer
Created May 10, 2011 13:35
IPTables rules for mailer
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
@carlosjac
carlosjac / backup_transfer.sh
Created April 6, 2011 12:42
backup transfer script
#!/bin/sh
# source directory containing files to transfer
LBDIR=/backups/daily.0
# destination directory
[email protected]:remotedirectory
#########################################################################
#!/bin/bash
#
# Install PHP Client with mysql and imap support
#
# Author : Carlos Jacobs
# Date : 09 dic 2010
#
sudo aptitude install php5-cli mysql-client php5-mysql php5-imap
@carlosjac
carlosjac / InstallPostgresql9FromSourceOnUbuntu1004
Created September 27, 2010 16:50
InstallPostgresql9FromSourceOnUbuntu1004
#!/bin/bash
#
# Install Postgresql9 From Source On Ubuntu 10.04 (Slicehost)
# Execute as root
#
# Author : Carlos Jacobs
# Date : 27 Sep 2010
sudo aptitude install libreadline6 libreadline6-dev
sudo aptitude install zlib1g zlib1g-dev
@carlosjac
carlosjac / CreateDigitalCertificate.sh
Created August 11, 2010 12:49
Create digital certificate.sh
#!/bin/bash
#
# Create digital certificates for a virtual domain on Ubuntu 10.04 (Slicehost)
# Execute as root
#
# Author : Carlos Jacobs
# Date : 11 Aug 2010
echo Please, enter domain
read DOMAIN
@carlosjac
carlosjac / nginxcreatevdomain.sh
Created July 16, 2010 19:05
NginxCreateVirtualDomain
#!/bin/bash
#
# Create a virtual domain on Nginx Ubuntu 10.04 (Slicehost)
# Execute as root
#
# Author : Carlos Jacobs
# Date : 16 Jul 2010
echo Please, enter domain
read DOMAIN
#!/bin/bash
#
# Install Nginx, PHP and fcgi on Ubuntu 10.04 (Slicehost).
# Execute as root
#
# Author : Carlos Jacobs
# Date : 16 Jul 2010
#
# install nginx, php5 , fastcgi