This file contains 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
require 'rubygems' | |
require 'erb' | |
require 'sinatra' | |
require 'dropbox' | |
configure do | |
enable :sessions | |
end | |
def authed? |
This file contains 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
//metadoc Redis Alice Kaerast 2011 | |
/*metadoc Redis description | |
redis is an open source, advanced key-value store | |
<br />An example: | |
<pre> | |
myredis := Redis clone connect("127.0.0.1:6379") | |
myredis send("rpush", "foo", "bar") | |
</pre> | |
*/ |
This file contains 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
Feature: Offline system cleaning | |
We often come across Windows machines which have unknown malware installed. | |
There are relatively few entry points for such malware to run. | |
It should be possible to build an open source tool which scans these, even if the system is offline. | |
Background: Mount the offline system | |
Given I've mounted the hard disk | |
Scenario: The disk is scanned |
This file contains 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
sgversion=`awk '/Version/ {print $2;}' squidguard.spec` | |
wget -c `awk '/Source/ {print $2;}' squidguard.spec | sed s/%{version}/$sgversion/g` | |
cp squidGuard-$sgversion.tar.gz ~/rpmbuild/SOURCES/squidGuard-$sgversion.tar.gz | |
rpmbuild -ba squidguard.spec | |
sgrelease=`awk '/Release/ {print $2;}' squidguard.spec | cut -c 1` | |
cp ~/rpmbuild/RPMS/*/squidguard-$sgversion-$sgrelease.*.rpm . |
This file contains 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
# $Id: ldap-account-manager.spec 7981 2009-11-03 03:05:34Z dag $ | |
# Authority: dag | |
# Tag: test | |
Summary: LDAP Account Manager | |
Name: ldap-account-manager | |
Version: 3.4.0 | |
Release: 2%{?dist} | |
License: GPL |
This file contains 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
service = "QSNKDT E91F220080427300001010000010 696 0 I" | |
service_exception = "QE20100920201009240" | |
service_origin = "QO450024175 1725 T1F0" | |
service_destination = "QT25001940 1649 T1F0" | |
service_regex = /^QS([NDR])(.{4})(.{6})(\d{8})(\d{8})([01]{7})([SH ])([ ABX])(.{4})(.{6})(.{8})(.{8})(.)$/ | |
service_exception_regex = /^QE(\d{8})(\d{8})([01])$/ | |
service_note_regex = /^QN(.{5})(.{72})$/ | |
service_origin_regex = /^QO(.{12})(\d{4})(.{3})(T[01])(F[01])$/ | |
service_intermediary_stop_regex = /^QI(.{12})(\d{4})(\d{4})([BPSN])(.{3})(T[01])(F[01])/ |
This file contains 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
require 'redis' | |
@redis = Redis.new | |
# width & height of the map | |
@x = @y = 0 | |
grassdatafile = open('../resources/maps/land3g.txt') | |
grassdatafile.readlines.each { |line| |
This file contains 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
<pre> | |
<?php | |
require_once('config.php'); | |
$sql = 'SELECT time/(15*60), COUNT(DISTINCT userid) FROM mdl_log | |
GROUP BY time/(15*60)'; | |
print_r(recordset_to_array(get_recordset_sql($sql))); | |
?> | |
</pre> |
This file contains 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
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
php_value session.cookie_secure 1 | |
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteCond %{HTTPS}s ^on(s)| | |
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
This file contains 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
function valid_email_address($mail) { | |
return (bool)filter_var($mail,FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>"/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/"))); | |
} |