Skip to content

Instantly share code, notes, and snippets.

View kostajh's full-sized avatar

Kosta Harlan kostajh

View GitHub Profile
// Test Access to the online help section.
// The online help handbook should only be accessible to administrators.
casper.test.begin('Restrict access to online help to Administrators only', function suite(test) {
// Check that online help is not accessible to anonymous user.
casper.start();
casper.setHttpAuth('USERNAME', 'PASSWORD');
casper.thenOpen(link + '/handbook').waitForSelector('.error',
@kostajh
kostajh / composer.json
Created December 16, 2013 15:04
Install Drush 7 with the drush-server patch.
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/kostajh/drush"
}
],
"require": {
"drush/drush": "dev-web-service-drush-server"
}
@kostajh
kostajh / setup.py
Last active December 31, 2015 12:59
Call with something like `python3 setup.py --username ACQUIA_CLOUD_USERNAME --password ACQUIA_CLOUD_PASSWORD --branch GIT_BRANCH`
#!/usr/bin/env python3
import subprocess
import json
import time
import sys
import argparse
baseurl = 'https://cloudapi.acquia.com/v1/sites/devcloud:MYSITE'
parser = argparse.ArgumentParser(description='Get username and password.')
@kostajh
kostajh / core-status.json
Created December 18, 2013 13:22
core-status --format=json
{
"php-bin": "/usr/bin/php",
"php-os": "Linux",
"php-conf": [
"/etc/php5/cli/php.ini",
"/home/kosta/.drush/drush.ini"
],
"drush-version": "7.0-dev",
"drush-conf": [
"/home/kosta/.drush/drushrc.php"
{
"DRUSH_COMMAND_NOT_FOUND": [
"The drush command 'made-up-command' could not be found. Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions."
],
"DRUSH_NO_DRUPAL_ROOT": [
"A Drupal installation directory could not be found"
]
}
</span><span style="color: #E5E5E5;"><span style="background-color: #00FFFF;"><b>Test file: /var/lib/jenkins/workspace/CLIENT/tests/casperjs/tests/online-help.js</b></span></span>
<span style="display: none;">Test file: /var/lib/jenkins/workspace/CLIENT/tests/casperjs/tests/online-help.js
</span><span style="color: #CDCD00;"># Restrict access to online help to Administrators only</span>
<span style="display: none;"># Restrict access to online help to Administrators only
</span><span style="color: #00CD00;"><b>PASS</b></span> Anonymous user denied access to restricted node.
<span style="display: none;">PASS Anonymous user denied access to restricted node.
</span><span style="color: #00CD00;"><b>PASS</b></span> Login form present on Access Denied page
<span style="display: none;">PASS Login form present on Access Denied page
</span><span style="color: #00CD00;"><b>PASS</b></span> School Administrator user denied access to restricted node.
<span style="display: none;"
@kostajh
kostajh / taskwarrior-recognize.php
Created February 24, 2014 20:59
Ugly script to find malformed entries in taskwarrior data.
<?php
$dir = '/home/kosta/.task';
$files = array('pending.data', 'completed.data', 'undo.data', 'undo_remote.data');
foreach ($files as $file) {
$handle = fopen("/home/kosta/.task/" . $file, "r");
print 'Looking at file ' . $file . "\n";
$line_number = 0;
@kostajh
kostajh / migrate-bitbucket.sh
Created February 27, 2014 13:27
Migrate repositories from gitolite (or somewhere else) to Bitbucket
#!/bin/bash
# Usage: ./bitbucket-migrate.sh repos.txt
#
# repos.txt should have one repository per line.
echo "Reading $1"
while read line
do
$ ~/.eclipse/org.eclipse.platform_793567567_linux_gtk_x86_64/eclimd
java -Xms128m -Xmx512m -Dorg.eclipse.swt.browser.UseWebKitGTK=true -Dhelp.lucene.tokenizer=standard -XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith -XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,<init> -XX:CompileCommand=exclude,org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates,instantiateTemplate -XX:CompileCommand=exclude,org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage,addBinding -XX:CompileCommand=exclude,org/python/pydev/editor/codecompletion/revisited/PythonPathHelper,isValidSourceFile -XX:CompileCommand=exclude,org/eclipse/tycho/core/osgitools/EquinoxResolver,newState -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins -Declipse.p2.skipMovedInstallDetection=true -XX:MaxPermSize=256m -jar /usr/lib64/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20131104-1241.jar -debug -clean -refresh -ap
@kostajh
kostajh / gist:9380365
Created March 6, 2014 01:21
Eclim install
$ java -jar eclim_2.3.2.jar
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
Buildfile: installer.xml
2014-03-05 20:14:40,814 INFO [org.formic.Installer] Running Installer...
2014-03-05 20:15:24,190 INFO [org.formic.util.CommandExecutor] which gvim
2014-03-05 20:15:24,197 INFO [org.eclim.installer.step.VimStep] which gvim: /usr/bin/gvim
2014-03-05 20:15:24,198 INFO [org.formic.util.CommandExecutor] vim -f -X -u NONE -U NONE --cmd redir! > /tmp/eclim_installer389425476468186494.tmp | silent! echo &rtp | quit
2014-03-05 20:15:40,279 INFO [org.formic.util.CommandExecutor] vim --version
2014-03-05 20:15:41,839 INFO [org.formic.util.CommandExecutor] java -Xmx256m -XX:MaxPermSize=128m -jar /usr/lib64/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20131104-1241.jar -clean -application org.eclipse.equinox.p2.director -repository file:///tmp/formic_939679033/update -installIU org.eclim.installer.feature.group
2014-03-05 20:15:51,501 INFO [org.formic.util.CommandExecutor] java -Xmx256m -XX:MaxPer