Skip to content

Instantly share code, notes, and snippets.

View gionn's full-sized avatar
⚔️

Giovanni Toraldo gionn

⚔️
View GitHub Profile
# My new git commit shortcut, thanks to http://whatthecommit.com/ :-)
alias commit='git commit -m "$(curl -s http://whatthecommit.com/ |grep '<p>' |cut -c 4-)"'
@domdorn
domdorn / playframework
Created October 15, 2011 15:57
Upstart Script for the PlayFramework 1.x
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/playframework
# you can then start/stop it using either initctl or start/stop/restart
# e.g.
# start playframework
# http://dominikdorn.com
description "Description of your app"
author "Dominik Dorn <dominik@studyguru.eu>"
version "1.0"
@malteo
malteo / LocalStorageProvider.js
Created December 12, 2011 17:04
localStorage state provider for ExtJS 3
Ext.ns('Ext.ux.state');
/**
* @class Ext.ux.state.LocalStorageProvider
* @extends Ext.state.Provider
* A Provider implementation which saves and retrieves state via the HTML5 localStorage object.
* If the browser does not support local storage, an exception will be thrown upon instantiating
* this class.
* <br />Usage:
<pre><code>
@iamFIREcracker
iamFIREcracker / googleit.sh
Created January 31, 2012 13:12
Let me google clipboard for you!
#!/usr/bin/env bash
# Utility script which googles for the data contained inside positional
# arguments or for everything stored inside the WM clipboard.
#
# If the content of either positional argumets or clipboard starts with
# http,ftp,ecc (which means it is already a valid url), then skip the
# url-stuffing bit.
#
# Depends on xclip and xdg-open
@fujin
fujin / foo.rb
Created January 31, 2012 21:49
template override between cookbooks
template "/tmp/foo.rb"
source "foo.rb.erb"
cookbook "banana"
end
@hoverlover
hoverlover / savon_client.rb
Created March 19, 2012 14:45
Using my forks of Akami and Savon to sign a request with a X.509 certificate. See https://github.com/genuitytech/akami and https://github.com/genuitytech/savon.
client = Savon::Client.new do
# This can be a URL also
wsdl.document = "/Path/to/your.wsdl"
# These are optional, only if your WSDL sucks :)
wsdl.endpoint = "https://your_endpoint"
wsdl.namespace = "http://your_namespace"
certs = Akami::WSSE::Certs.new :cert_file => "/path/to/cert.crt", :private_key_file => "/path/to/private/key.pem", :private_key_password => "password"
wsse.sign_with = Akami::WSSE::Signature.new certs
@lusis
lusis / keytool.rb
Created March 26, 2012 04:51
recipe for adding certs to keytool
keystore = "/etc/java-6-sun/security/cacerts"
keystore_pass = "foobar"
# you'll need foo.cert et. al. in files/default
certs = %w{foo bar bang}
certs.each do |cert|
cookbook_file "#{Chef::Config[:file_cache_path]}/#{cert}.cert" do
source "#{cert}.cert"
end
from fabric.api import cd, env, local, prefix, run, sudo
env.hosts = ['cs01.actalis.vpn']
env.project_root = '/home/libersoft/visalaid'
env.user = 'libersoft'
def push():
local('git push')
@arangamani
arangamani / chef_attribute_converge.rb
Last active February 20, 2023 02:44
Dynamically update attribute of a Chef resource during converge phase (Node variable assignment in Compile vs Converge)
# In Chef, when a resource is defined all its variables are evaluated during
# compile time and the execution of the resource takes place in converge phase.
# So if the value of a particular attribute is changed in converge
# (and not in compile) the resource will be executed with the old value.
# Example problem:
# Let's consider this situation where there are two steps involved in a recipe
# Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed
# in converge phase
# Step 2 is a Chef resource that makes use of the node attribute that was
@leifg
leifg / Vagrantfile
Last active November 12, 2023 08:31
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end