Skip to content

Instantly share code, notes, and snippets.


Jon Austen djangofan

View GitHub Profile
djangofan / get_home.bat
Created Dec 8, 2011
DOS batch file to find JAVA_HOME
View get_home.bat
:: ------------------------------------------------------------------
:: JavaHome.bat - search for and set JAVA_HOME
:: 1. If JAVA_HOME is set in system environment, do nothing else.
:: 2. If javahome.txt already exists, use that value
:: 3. If those fail, search parent directories for java.exe
:: 4. Finally, try looking in the registry for other Java installations
:: Note- Script does not add trailing slash to JAVA_HOME variable
:: Note- JBINARY var can be set to JRE or JDK detection
:: ------------------------------------------------------------------
djangofan / trust_cacerts.bat
Created Dec 8, 2011
A batch file to import Java JRE cacerts into a jssecacerts file
View trust_cacerts.bat
@ECHO off
:: Script to import and trust CACERTS entries into the JSSECACERTS file
:: run this file from a Java servers home directory with no arguments
:: J_HOME is the parent directory of the directory you run your server out of.
:: assumes J_HOME/Javasoft might be your JRE home
SETLOCAL EnableDelayedExpansion
SET fileobject=jars\myServer.jar
if defined J_HOME (
djangofan / ubuntu_commands.txt
Created Dec 8, 2011
Commands to install Oracle Java on Ubuntu
View ubuntu_commands.txt
sudo apt-get install galternatives
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin
(then use Gnome galternatives GUI to set the default)
OR on the pure command line:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
djangofan / start_Openfire.bat
Created Dec 11, 2011
Advanced script to start Openfire Chat server on Windows
View start_Openfire.bat
@echo off
:: openfire_START.bat
:: The directory usually called "Openfire" is referred to as _SERVER_HOME
:: Script assumes these directories exist:
:: \Openfire , \Openfire\Javasoft, \Openfire\Databases, \Openfire\lib, \Openfire\plugins
ECHO SERVER_HOME is already set to %SERVER_HOME% from system environment
View gist:1511742
@ECHO off
SET XMLFILE=plugins.xml
SET XMLBASE=//Config/Plugin
xmlstarlet.exe sel -t^
-c ^"%XMLBASE%/Instance/Project[@name='myapp']/DEBUG^" --nl^
-c ^"%XMLBASE%/Instance/Project[@name='myapp']/Company^" --nl^
-c ^"%XMLBASE%/Instance/Project[@name='myapp']/SaveOffline^" --nl^
-c ^"%XMLBASE%/Instance/Project[@name='myapp']/Client^" --nl^
-c ^"%XMLBASE%/Instance/Project[@name='myapp']/GPSDiscoverPort^" --nl^
djangofan / PropertyFileHandler.bat
Created Jan 9, 2012
DOS batch functions to handle editing property files.
View PropertyFileHandler.bat
:: Functions for updating property files
ECHO Args to script: %1 %2 %3
:: Create test file if it doesn't exist
ECHO Key1=Value1>
ECHO #Key2=Value2>>
djangofan /
Last active Jan 20, 2018
Using Java Selenium Webdriver and LoadableComponent to handle page changes
package qa.test;
* Call this class with :
* ExpectedPage ep = new ExpectedPage().get();
* ep.method();
* /
public class ExpectedPage extends LoadableComponent<ExpectedPage> {
djangofan /
Created Mar 13, 2012 — forked from jarib/wd.rb
selenium-webdriver wait
public WebElement waitFindElement(WebDriver drv, By by, long timeout, long interval)
long start = System.currentTimeMillis();
return drv.findElement(by);
} catch(NoSuchElementException nse) {
throw new Error("Timeout reached and element["+by+"]not found");
djangofan / smb.conf
Created Mar 29, 2012
Samba config for allowing Windows users full public access to a share
View smb.conf
security = share
guest account = publicuser
passdb backend = tdbsam
comment = publicuser Home Dir
path = /home/publicuser
public = yes
writable = yes
write list = +publicuser
djangofan / smbusers
Created Mar 29, 2012
smbusers file sample
View smbusers
# Unix_name = SMB_name1 SMB_name2 ...
# root =
publicuser = Administrator smbguest pcguest guest
# nobody = guest pcguest smbguest