This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Selenium::Remote::Driver; | |
use Test::More tests=>4; | |
my $driver = Selenium::Remote::Driver->new; | |
$driver->get("http://www.google.com"); | |
$driver->find_element('q','name')->send_keys("Hello WebDriver!"); | |
ok($driver->get_title =~ /Google/,"title matches google"); | |
is($driver->get_title,'Google',"Title is google"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Selenium::Remote::Driver; | |
use Test::More; | |
my $driver = Selenium::Remote::Driver->new; | |
my $driver2 = Selenium::Remote::Driver->new(remote_server_addr=>'10.4.20.1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
system(); | |
if ($? == -1) { | |
print "failed to execute: $!\n"; | |
} elsif ($? & 127) { | |
printf "child died - signal %d, %s coredump\n", | |
($? & 127), ($? & 128) ? 'with' : 'without'; | |
} else { | |
printf "child exited with value %d\n", $? >> 8; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROGNAME=`basename $0` | |
CRIT=15 | |
WARN=30 | |
usage() { | |
echo "$PROGNAME -H <FQDN> [-c <15>] [-w <30>]" | |
echo "-H Mandatory, please put the fully qualified domain name for the SSL Certificate you want to monitor" | |
echo "-c Default 15, the number of days left before it alerts for Critical state" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install sysbench | |
$ apt-get install sysbench | |
# CPU benchmark, 1 thread | |
$ sysbench --test=cpu --cpu-max-prime=20000 run | |
# CPU benchmark, 64 threads | |
$ sysbench --test=cpu --cpu-max-prime=20000 --num-threads=64 run | |
# Disk benchmark, random read. See .fio files in this gist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => [ "/var/log/messages", "/var/log/kern.log" ] | |
type => "linux-syslog" | |
} | |
file { | |
path => "/var/log/apache2/access.log" | |
type => "apache-access" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Disable-UAC | |
if (Test-PendingReboot) { Invoke-Reboot } | |
Update-ExecutionPolicy Unrestricted | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
Enable-RemoteDesktop | |
Disable-InternetExplorerESC | |
$seleniumGridPath = "c:\SeleniumGrid" | |
$seleniumGridExtraDownloadUrl = "https://github.com/groupon/Selenium-Grid-Extras/releases/download/1.10.0/SeleniumGridExtras-1.10.0-SNAPSHOT-jar-with-dependencies.jar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nginx proxy for Elasticsearch + Kibana | |
# If you use this, you'll want to point config.js at http://FQDN:80/ instead of | |
# http://FQDN:9200 | |
server { | |
listen *:80 ; | |
server_name kibana.myhost.org; | |
access_log /var/log/nginx/kibana.myhost.org.access.log; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |