Skip to content

Instantly share code, notes, and snippets.

@cravecode
cravecode / selenium-hub-daemon
Last active March 15, 2016 02:56 — forked from bcap/start-stop-daemon-template
File for starting Seleniun Standalone Server Hub as a linux services using the start-stop-daemon.
#!/bin/bash
### BEGIN INIT INFO
# Provides: selenium-hub
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The Selenium Standaline Server ran as a hub.
### END INIT INFO
@cravecode
cravecode / start-stop-example.sh
Created March 14, 2016 20:56 — forked from alobato/start-stop-example.sh
start-stop-example
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=foo
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/usr/local/bin/bar
#!/bin/bash
path=${1%/}
user=${2}
group="www-data"
help="nHelp: This script is used to fix permissions of a drupal installationnyou need to provide the following arguments:nt 1) Path to your drupal installationnt 2) Username of the user that you want to give files/directories ownershipnNote: "www-data" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this scriptnnUsage: (sudo) bash ${0##*/} drupal_path user_namen"
if [ -z "${path}" ] || [ ! -d "${path}/sites" ] || [ ! -f "${path}/modules/system/system.module" ]; then
echo "Please provide a valid drupal path"
echo -e $help
$content = array(
'member_id_row' => array(
'#type' => 'container',
'#attributes' => arra(),
'label' => array(
'#markup' => '<label>' . t('Member ID') . '</label>',
),
'value' => array(
'#markup' => '<span>' . $GLOBALS['user']->name . '</span>',
)