Skip to content

Instantly share code, notes, and snippets.

View gabrielrubens's full-sized avatar

Gabriel Rubens gabrielrubens

View GitHub Profile
@danieldbower
danieldbower / javaSwitch.sh
Created August 16, 2012 17:43
Switch Java Versions on Debian/Ubuntu
#!/bin/sh
clear
f_o6 () {
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64;
sudo update-alternatives --set java /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java;
}
f_s6 () {
@usamadar
usamadar / HttpDigestAuthServlet.java
Created June 11, 2012 19:17
HTTP Servlet Sample Implmentation of HTTP Digest Authentication RFC 2617
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.example.http.authenticate;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
@yincrash
yincrash / Google2APi.java
Created April 22, 2012 17:22
Google OAuth2.0 for scribe-java
package org.scribe.builder.api;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.scribe.exceptions.OAuthException;
import org.scribe.extractors.AccessTokenExtractor;
import org.scribe.model.OAuthConfig;
import org.scribe.model.OAuthConstants;
import org.scribe.model.OAuthRequest;
@slok
slok / jboss_apache.md
Created December 31, 2011 09:06
Setup for jboss 7 with apache and mod_cluster in ubuntu 11.10

Preparing Jboss environment

Create Jboss user and group

Create a group for a system user (daemnos and program users like www-data, mysql...)

# addgroup --system jboss

Create a user (system user, without home -> See below the command, to the jboss group and no login shell)

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')