Quick Random Password Generator for Perl

Mostly writing this for my own future benefit, but if this can help someone else in the process, perfect.

Basically, create random strings of random sizes using random characters until the size of the resulting string is greater than 16. Pretty simple.

#!/usr/bin/perl

my @alphanumeric = ('a'..'z', 'A'..'Z', 0..9,'!','_','-');
my @numeric = (0..9);
my $randpassword = '';

until ( length($randpassword) > 16 ) {
        $randpassword = $randpassword . join '', map $alphanumeric[rand @alphanumeric], 0..(rand @numeric);
}

print "$randpassword\n"

Save the resulting file as "randpasswd.pl" on a Linux system (I used Ubuntu), set as executable, and run it in a command line to generate a random password.

How to disable TLSv1 on Sophos UTM9 WAF for PCI

As freaking annoying as it is that the Sophos UTM, a security appliance, doesn't pass a PCI compliance scan, what's worse is that the process for disabling TLSv1 for sites running behind the Sophos WAF is not documented anywhere currently that I can find.

So, in an effort to help the community at large, I decided to docuemnet how I fixed it.

First, I was able to find excellent docuemnetation by a community member on how to disable TLSv1 for the Sophos Admin interface:

https://juicytool.wordpress.com/2015/12/15/how-to-disable-tls-1-0-on-sophos-utm-for-pci-compliance/

This is helpful, but I also needed to know how to disable TLSv1 for sites that run behind the Sophos WAF.

After (a lot) of digging, I found that the sites running behind the Sophos WAF do so through the Sophos Service "reverseproxy". This is the service we need to edit to remove TLSv1 support.

The above documentation talks about hwo to go about logging into the command line on a Sophos UTM9, so I won't repeat it. Once you're logged in, you'll need to run the following commands:

sudo vim /var/storage/chroot-reverseproxy/usr/apache/conf/httpd.conf

Update these to lines:

SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:ECDH+3DES:DH+3DES:RSA+3DES:!aNULL:!MD5:!DSS
#SSLProtocol all -SSLv2 -SSLv3

to this

SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AES:!ADH:!AECDH:!MD5:!DSS:!3DES
SSLProtocol +TLSv1.1 +TLSv1.2

The restart the 'reverseproxy" service with the following command:

sudo /var/mdw/scripts/reverseproxy restart

Check that you can no longer acccess your site using TLSv1 with the following command (updating it with your own domain name):

openssl s_client -connect utdream.org:443 -tls1

You'll get a handshake failed error if TLSv1 has been properly disabled:

SSL handshake has read 0 bytes and written 0 bytes

How to create an elliptical shadow in GIMP

For a new project, I wanted to create a shadow on an icon I was creating in order to give it some depth. I couldn't find any good visual tutorials on how to do this in GIMP, which usually means I'm not using the right keywords, but I was able to find a forum post: Creating an Elliptical Vignette in GIMP.

Following the posters steps exactly didn't get me what I wanted, but modifying his steps slightly, I was able to do what I wanted, so I figured I'm write down what I deduced from his process and include some screen shots in an effort to help anyone else who wanted to do something like this.

Step 1: Prep Your Image

I prepared my icon for a shadow by increasing the cancas space a bit so that there was room for the shadow below the icon itself. The result was as follows:

Step 2: Ellipse Select

Next I selected an area beneith the image where my shadow was going to go.

Step 3: Feather the Selection

Next we're going to feather our selection. This is what will give us the gradiant. To feather your selection, you have to use your menu, and go to Select -> Feather. Gimp will prompt you for how many pixels you want to feather, I went with 25. Your visual for your elliptical selection will go away when you feather it, but don't worry, it's still there.

Step 4: Fill with FG Color

Last, you'll want to fill with the color you want to use as your shadow. I just went with black, and set black as my foreground color. From there, we go again to the menu, and go to Edit -> Fill with FG Color. You can repeat the fill if you want your shadow to grow darker. I had to do a fill 3 times before I got the following result:

Hope this helps!

Steam won't start on Ubuntu 16.04 LTS 64-bit with AMD GPU

Steam on Ubuntu 16.04

I run two PC's with AMD GPU's and with the release of Ubuntu 16.04 LTS, I have been unable to run steam using the default grpahics drivers that come with steam. Clicking the steam icon, just made it flash for a little bit, but steam never started. To get more detail, I tried running steam from the command-line, and I got the following error message:

jordan@jordan-H8DI3:~$ steam
Running Steam on ubuntu 16.04 64-bit
STEAM_RUNTIME is enabled automatically
grep: symbol lookup error: grep: undefined symbol: pcre_jit_stack_alloc
/bin/bash: /home/jordan/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /bin/bash)
grep: symbol lookup error: grep: undefined symbol: pcre_jit_stack_alloc
grep: symbol lookup error: grep: undefined symbol: pcre_jit_stack_alloc
awk: /home/jordan/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /lib/x86_64-linux-gnu/libreadline.so.6)
Installing breakpad exception handler for appid(steam)/version(1468023329)
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
^C
jordan@jordan-H8DI3:~$ 

I had to hit CTRL+C in order to get out of it. After some research, I was able to get steam running with the following command:

LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 steam

I haven't tried a lot of games through steam after starting this way, but the ones that I did try have run just fine... so far.

How to fix Lucee 'Handler "BonCode-Tomcat-CFM-Handler" has a bad module "ManagedPipelineHandler" in its module list' Error.

Handler "BonCode-Tomcat-CFM-Handler" has a bad module "ManagedPipelineHandler" in its module listFor whatever reason IIS likes to set the default version of .NET on some versions of IIS to 2.0. This is generally rediculous since 4.0 has been around for some time and even when 4.0 is installed and working, MS will default to 2.0.

If you install Lucee server on to your windows server and get this error, there are several possible causes:

1) You need to use a more recent version of .NET for your application pool. The fix is to adjust your .NET application pool version to 4.0 (or above) for that site, then restart the pool. Once you do that, your Lucee install should work perfectly.

IIS Application Pool Switch from 2.0 to 4.0

2) You need to ensure that you have .NET Extensibility turned on in your IIS Install. In windows 7, this is what the window looks like:

Enable .NET Extensibility

3) You have a .NET version cconflict. You'll need to remove all versions of .NET from your machine and re-install Lucee to let the installer handle installing .NET.

Hope this helps!