Skip to content

Instantly share code, notes, and snippets.

View paganotoni's full-sized avatar
💭
⚡️⚡️

Antonio Pagano paganotoni

💭
⚡️⚡️
View GitHub Profile
@paganotoni
paganotoni / install.sh
Last active August 29, 2015 14:21 — forked from wdullaer/install.sh
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Add Docker PPA and install latest version
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker -y
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
Ref http://devcenter.heroku.com/articles/custom-domains
Heroku Setup
1. Install Custom Domain Plugin for your app
heroku addons:add custom_domains
2. Add domain names
heroku domains:add www.example.com
GoDaddy Setup
1. Go to your domain under your account
Groovy also has a Time Category class which gives you DSL style syntax for manipulating dates. Here is an example:
import org.codehaus.groovy.runtime.TimeCategory
now = new Date()
println now
use(TimeCategory) {
footballPractice = now + 1.week - 4.days + 2.hours - 3.seconds
}
println footballPractice
which will produce output like this:
@paganotoni
paganotoni / tomcat.sh
Created December 3, 2012 18:13 — forked from valotas/tomcat.sh
Tomcat init.d script
#!/bin/bash
#
# tomcat7 This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
@paganotoni
paganotoni / ssh-known-hosts-mgmt.sh
Created October 25, 2012 04:07 — forked from bradland/ssh-known-hosts-mgmt.sh
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -H -F github.com
@paganotoni
paganotoni / hack.sh
Created June 20, 2012 13:34 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@paganotoni
paganotoni / get_location_1.js
Created May 12, 2011 21:32 — forked from wadey/get_location_1.js
SimpleGeo JavaScript getLocation examples
client.getLocation({enableHighAccuracy: true}, function(err, position) {
if (err) {
// Could not retrieve location information. Check err for more information
} else {
// Latitude and longitude available in position.coords
}
});