Skip to content

Instantly share code, notes, and snippets.

View aonic's full-sized avatar

Raja Kapur aonic

  • AWS
  • Seattle, WA
View GitHub Profile

MAIL TO PRINTER GATEWAY

sudo adduser autoprint
sudo apt-get install fetchmail postfix

/etc/default/fetchmail

START_DAEMON=yes
import org.codehaus.groovy.grails.plugins.codecs.MD5Codec
import org.grails.plugin.resource.mapper.MapperPhase
class HashVersionResourceMapper {
static phase = MapperPhase.RENAMING
def cacheHeadersService
def resourceService
@aonic
aonic / gist:8429390
Last active January 3, 2016 07:29 — forked from anonymous/gist:8414867
(function($) {
var validate_rules = {
user: function(value) {
var reg = /^[a-z0-9\_\-\@\.]{1,32}$/;
if (reg.test(value) === false) {
return "Invalid";
}
},
<?php
/**
* OAuth 2.0 Password grant
*
* @package php-loep/oauth2-server
* @author Alex Bilbie <hello@alexbilbie.com>
* @copyright Copyright (c) 2013 PHP League of Extraordinary Packages
* @license http://mit-license.org/
* @link http://github.com/php-loep/oauth2-server
*/
[9] boris> $hits;
→ array(
0 => array(
'hit' => array(
'name' => 'Alice'
)
),
1 => array(
'hit' => array(
'name' => 'John'
<?php
/* connect to gmail */
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = 'dispatch@gbfd.net';
$password = '';
/* try to connect */
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
/* grab emails */
@aonic
aonic / gist:831945
Created February 17, 2011 15:46
trying out scala
package scalaapplication1
import java.io._
import java.util.Scanner
import javax.swing.JFileChooser
import javax.swing.JOptionPane
object Main {
def main(args: Array[String]): Unit = {
@aonic
aonic / gist:828284
Created February 15, 2011 21:26 — forked from anonymous/gist:828273
<?php
//ICE //William Mantly //willaim@aonic.net //5-2-07
//session_start();
if("4"=="4"){
include("mysql.php"); //conects to D
array_map('addslashes', $_GET);
/**
*
*/
package example05;
import java.util.Scanner;
/**
* @author pajensen
<?php
//$url['url'] is the URL as saved in urls table, it has * in it
$temp = preg_quote($url['url'], '/');
$temp = str_replace('\\*','(.*?)',$temp); //Replacing * with (.*?)
$urlToMatch = "/^{$temp}$/"; //Adding /^ and $/ to make preg_match work, ^ and $ are important
//Part taken from old code
$page_requesting = remove_last_slash(remove_index_etc(strip_www($page_requesting)));