Category Archives: Programming

Check email address format with JavaScript

function checkEmailAddress(emailAddress){ var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&’\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&’\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i); return pattern.test(emailAddress); }

Test OpenSSL ciphers

#!/usr/bin/env bash # OpenSSL requires the port number. SERVER=192.168.1.11:443 DELAY=1 ciphers=$(openssl ciphers ‘ALL:eNULL’ | sed -e ‘s/:/ /g’) echo Obtaining cipher list from $(openssl version). for cipher in ${ciphers[@]} do echo -n Testing $cipher… result=$(echo -n | openssl s_client -cipher “$cipher” -connect $SERVER 2>&1) if [[ “$result” =~ “Cipher is ” ]] ; then echo… Read More »

Enable remote access of MySql on Ubuntu

By default MySQL only listens to localhost, if we want to enable the remote access to it, then we need to made some changes in my.cnf file: We need to comment out the bind-address and skip-external-locking lines.   Restart mysql   Check the process: lsof -i -P | grep :3306 Create user: CREATE USER ‘myuser’@’localhost’… Read More »

Installing Perl modules using CPAN

Installing Perl modules required by various open source software is a routine tasks for sysadmins. Installing Perl modules manually by resolving all the dependencies is  tedious and annoying process. Installing Perl modules using CPAN is a better solution, as it resolves all the dependencies automatically. In this article, let us review how to install Perl… Read More »

Create a Persistent Bootable Ubuntu USB Flash Drive

Don’t feel like reinstalling an antivirus program every time you boot up your Ubuntu flash drive? We’ll show you how to create a bootable Ubuntu flash drive that will remember your settings, installed programs, and more! Previously, we showed you how to create a bootable Ubuntu flash drivethat would reset to its initial state every… Read More »

ModSecurity Advanced Topic of the Week: (Updated) Exception Handling

UPDATE – since this original post, we added new exception handling capabilities to v2.6.0 which are a tremendous help for adding in custom exceptions. See the section below on Updating the Target Lists. This post is long overdue. I will cover the current state of exception handling options within both ModSecurity and the OWASP Core… Read More »

Integrating Apache with Active Directory

Here are my requirements:   Must use Active Directory for the user/pass database Must use Active Directory groups to determine membership in “departmentA” Must be able to implement group based restrictions, eg. “repositoryA” must only be accessible by “departmentA” So being a Debian sorta fellow I did a search for all the Apache and LDAP… Read More »

How to use Google free SVN repository with Eclipse

If you already have a gmail account, make sure you’re logged in (that way, your repository and your account will be linked). Start here: http://code.google.com/hosting/ Go to the ‘Create a new Project’ link and create your project… Install eclipse if you haven’t already (current recent version is 3.5): http://www.eclipse.org/downloads/ Now you need to install the… Read More »