Skip to content

Instantly share code, notes, and snippets.

@lpar
lpar / makerepo
Created Feb 4, 2014
Shell script to make a shared Git repository
View makerepo
#!/bin/sh
CMDNAME=`basename $0`
GROUP=$1
REPODIR=$2
if [ -z $REPODIR ]; then
echo "usage: $CMDNAME <group> <dir>"
echo "creates a shared Git repository for group <group> in the specified directory"
exit 0
@lpar
lpar / corba.js
Created Mar 31, 2014
How to access an IBM Domino server from JDK 8 command-line JavaScript, using CORBA and DIIOP.
View corba.js
/*jshint indent:2 */
/*global Packages */
// Sample JavaScript CORBA/IIOP code for JDK 8 and Domino 9.0.2
// Run with jrunscript -cp DOMINO_JARS corbatest.js
// where DOMINO_JARS contains Domino.jar and NCSO.jar from your Domino server
// install.
/**
* Opens a connection to a Domino server via CORBA/DIIOP, and returns a Domino
@lpar
lpar / mbox2maildir.pl
Created May 15, 2015
Simple Perl script for mbox to Maildir conversion - I used this and it worked for me, YMMV
View mbox2maildir.pl
#! /usr/bin/perl
# put into the public domain by Bruce Guenter <bruceg@em.ca>
# based heavily on code by Russell Nelson <nelson@qmail.org>, also in
# the public domain
# NO GUARANTEE AT ALL
#
# Creates a maildir from a mbox file
# Assumes that nothing is trying to modify the mailboxe
# version 0.00 - first release to the public.
@lpar
lpar / 10-mail.conf
Created May 15, 2015
Main Dovecot configuration file /etc/dovecot/conf.d/10-mail.conf
View 10-mail.conf
##
## Mailbox locations and namespaces
##
# Location for users' mailboxes. The default is empty, which means that Dovecot
# tries to find the mailboxes automatically. This won't work if the user
# doesn't yet have any mail, so you should explicitly tell Dovecot the full
# location.
#
# If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
@lpar
lpar / ExamplePage.xsp
Last active Aug 29, 2015
Bootstrap + XPages custom control for easier form fields, with validation via SSJS controller
View ExamplePage.xsp
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.data>
<xp:dominoDocument var="document1">
<xp:this.querySaveDocument><![CDATA[#{javascript:
var name = getComponent('birdName').getValue(),
species = getComponent('birdSpecies').getValue(), result = true;
if (name === "") {
@lpar
lpar / Test.xsp
Created Jul 2, 2015
XPages Extension Library HTML generation bug
View Test.xsp
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">
<xe:applicationLayout id="applicationLayout1">
<xe:this.configuration>
<xe:bootstrapResponsiveConfiguration productLogoHeight="15px"
productLogoWidth="" productLogoAlt="IBM"
titleBarName="Application title" placeBarName="Home"
legalText="Copyright © 2015 IBM Corporation.">
<xe:this.productLogo>ibmlogo.svg</xe:this.productLogo>
@lpar
lpar / md5daemon
Created Jun 17, 2011
Automatic MD5 checksum generating daemon for use with vsftpd
View md5daemon
#!/usr/bin/env ruby
# encoding: UTF-8
'di '
'ig00 '
# VSFTPD auto-MD5 program
#
# Run man -l <this file> for documentation
require 'rb-inotify'
@lpar
lpar / jay
Created Jun 20, 2011
jay - a utility for removing excess kernel files from Ubuntu systems
View jay
#!/usr/bin/env ruby
# encoding: UTF-8
'di '
'ig00 '
# This is both a Ruby script and a man page; you can symlink it into your
# man directory as /usr/local/man/man8/jay.1 or run man -l on this file.
# The package which contains the kernel image itself
KERNEL_PACKAGE = 'linux-image'
@lpar
lpar / gist:1092764
Created Jul 19, 2011
IBM Lotus Domino rc_domino startup script diffs for syslog support
View gist:1092764
Diff for Daniel Nashed's rc_domino startup script, to enable domino2syslog and
pipe your Domino console logs to regular Unix syslog.
See http://www.nashcom.de/nshweb/pages/startscript.htm for obtaining rc_domino.
See elsewhere in my gists for domino2syslog itself.
*** rc_domino_script 2009-09-24 15:42:47.000000000 -0500
--- /home/meta/rc_domino_script 2011-02-04 17:03:20.000000000 -0600
***************
@lpar
lpar / Stopwatch.java
Created Jul 26, 2011
Stopwatch: Record real time taken for an operation, across multiple runs
View Stopwatch.java
import java.text.DecimalFormat;
/**
* The Stopwatch class provides a simple way to record the real-world time taken by an operation,
* averaged over multiple runs, and report the result easily in logs.
*
* An example use case would be timing JDBC calls to a relational database.
*
* This code does not measure CPU time or pay any attention to whether a thread or process is
* active or not. For that, you need to use a profiler.