Get RackTables working with php-cgi or fastcgi

Leave a reply

If you’ve tried to google “racktables authentication not working after install” you won’t find much, but there is a couple of articles about fastcgi and the PHP_AUTH_PW and PHP_AUTH_USER not being passed correctly. But no real solution to the problem.

I was able to get RackTables working using the following work around posted on www.rosmir.org/Index/Docs/archive/LabsFolder/FastCGI which has nothing to do with RackTables.

  1. You will need to add the following to your .htaccess file.
    1
    2
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
  2. Next you will need to modify the inc/auth.php file and add the following before the function authenticate.
    1
    2
    3
    if(preg_match('/Basic+(.*)$/i', $_SERVER['REDIRECT_HTTP_AUTHORIZATION'], $matches)) {
    list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':' , base64_decode(substr($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 6)));
    }
  3. It should look like following below when completed.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    function authenticate ()
    {
    if(preg_match('/Basic+(.*)$/i', $_SERVER['REDIRECT_HTTP_AUTHORIZATION'], $matches)) {
    list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':' , base64_decode(substr($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 6)));
    }

    global
    $remote_username,
    $remote_displayname,
    $auto_tags,
    $user_given_tags,
    $user_auth_src,
    $script_mode,
    $require_local_account;
    if (!isset ($user_auth_src) or !isset ($require_local_account))
    throw new RackTablesError ('secret.php: either user_auth_src or require_local_account are missing', RackTablesError::MISCONFIGURED);
    if (isset ($_REQUEST['logout']))
This entry was posted in Linux, PHP and tagged authentication, cgi, fastcgi, php, racktables on by Jordan.
spacer

Upgrading Memory on a Macbook Pro OSX with the GeIL 16GB Memory Kit (GS316GB1333C9DC)

Leave a reply

I recently purchased the “GeIL 16GB (2 x 8G) 204-Pin DDR3 SO-DIMM DDR3 1333 (PC3 10660) Laptop Memory (GS316GB1333C9DC)” from NewEgg on boxing day in hopes that it would work in my Macbook Pro (Early 2011 15″ – MC721LL/A – MacBookPro8,2 – A1286 – 2353-1*)

And to my surprise after installing the memory my Macbook Pro booted and actually posted to OSX 10.8.2, here is a screenshot of the “About This Mac” and “System Report” sections showing that 16GB of memory is installed.

Even thought I could boot into OSX, I still needed to confirm that everything was stable. There is a program called memtest by Command-Tab that will allow you to test the memory extensively. The best way to test is through Single User Mode to ensure that you test all memory and with minimal running in the background. If you run memtest via terminal when OSX is booted, then you will only be able to test available memory. I’ve provided a screenshot of memtest running from OSX via terminal, and you can see that it only detects 12GB of memory. This is because the rest has been used and can’t be tested.

 

spacer

This entry was posted in 1 on by Jordan.

Microsoft IIS 7.5 Best Practices

Leave a reply

I thought everyone should take a look at this quick Micrsoft IIS 7.5 Best Practices article, it talks a little bit about security but mostly just what not to leave on was default. If you have any other sites or information you want to share, please comment!

adminspeak.wordpress.com/tag/iis-7-5-best-practices/

This entry was posted in IIS and tagged best practices, configuration, iis, iis7.5, mcirosoft, security on by Jordan.

IIS Site Slow to Load on First Visit/Load (SiteFinity)

1 Reply

I had to deploy a new website that was done by a web design company, it was created in Sitefinity. I didn’t have the option to install it, I simply was given the site files and the database. I think had to figure out a way to update the database configuration file, of which Sitefinity doesn’t really have much documentation on. I will post if I find anything related on how to update the Sitefinity database connection strings in the Sitefinity configuration file.

I was able to get Sitefinity working, and the content was displaying properly. However after a little while the site would begin to load slowly, but only on the first page load. I could tell it had something to do with the idle timeout for the application pool in IIS 7.5

Digging further I found the following article that talks about auto start for ASP.NET applications.

weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx

I also find this article about Sitefinity and auto start but not much information on how to implement it properly.

patrickdunn.me/blog/posts/2012/10/18/auto-start-sitefinity-iis

I then found the following two articles.

scottrozman.net/blog/12-07-27/Sitefinity_5_x_Performance.aspx
www.techbubbles.com/aspnet/auto-start-web-applications-in-aspnet-40/

The last article from techbubbles.com talks about the preloadEnabled=”true” and preloadProvider=”PrewarmMyCache” of which just cause IIS 7.5 not to start. Because its not valid XML. The error was 

1
2
3
</p>
<p>The worker process for application pool 'site' encountered an error 'Configuration file is not well-formed XML ' trying to read global module configuration data from file '\\?\C:\inetpub\temp\apppools\site\site.config', line number '3'. Worker process startup aborted.</p>
<p>

I later found out this is because preloadEnabled is actually is a property for the “Application Initalization” module.

www.iis.net/downloads/microsoft/application-initialization

This property is available by default in IIS 8.0, hence why you might see some documentation talking about it but no the ”Application Initalization” module.

So, if you want to be able to use the preloadEnabled property you will need to install the “Application Initalization” module. Just a note on the installation, you will need the x64 binary which is available under “Additional Downloads” at the bottom of the page. You will also be asked to reboot, so if this is a production server, schedule a maintenance.

The following page will go over how to use the Application Initialization Module.

blogs.iis.net/wadeh/archive/2012/05/01/application-initialization-part-2.aspx

That’s it!

This entry was posted in 1, IIS and tagged iis7.5, microsoft iis application .net asp.net on by Jordan.

Changing the Thumbnail on a YouTube Video to a Custom Image

Leave a reply

The following code will allow you to use a custom image for the thumbnail on a YouTube video.

1
2
3
4
5
6
7
8
9
10
11
<div style="float: right; padding: 20px;">
<img style="cursor: pointer;" src="/img/spacer.gif">
</div>
<div id="thevideo" style="display: none; float: right; padding: 20px;">
<object width="460" "259" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="src" value="www.youtube.com/v/tX4l7aPoYLU?version=3&amp;hl=en_US&amp;rel=0&amp;autoplay=1&amp;autohide=1" />
<param name="allowfullscreen" value="true" />
<embed width="460" "259" type="application/x-shockwave-flash" src="/img/spacer.gif">
</object>
</div>

Here is an example of what the video would look like.

spacer
This entry was posted in 1 on by Jordan.

WordPress SEO plugin by Yoast

Leave a reply

I recently installed the plugin Wordpres SEO by Yoast on my this blog, and others. It was recommended by one of those top 10-20-50 WordPress Plugin posts you find all over the place.

You can read more about Yoast and their plugin on their website yoast.com/articles/wordpress-seo/

One of the features that comes in handy quite often when writing a new post or page, is the Snippet Preview as seen below:

spacer

It hangs out just below the content box when you’re writing up your page or post, and it provides a preview of what your article will look like when its posted on Facebook or other sites that take a preview of your article.

This entry was posted in Plugins, Wordpress and tagged facebook, plugins, preview, seo, social media, wordpress, yoast on by Jordan.

How to fix the Asus Zenbook trackpad

3 Replies

I have an Asus Zenbook for work, and its awesome. Small. light and fast!

Since day 1, the trackpad has been a huge issue. It didn’t perform like some previous laptops I had, nor like my Macbook. For instance when you single tap on the left or right buttons on the track pad, they register as single clicks. This messes things up from time to time. There are some other issue as well, my palm getting in the way and causing issues.

Anyways, I found somewhat of a solution to some of the issues. A personal blog provides some registry changes you can make to reveal more settings from the Elan trackpad program.

alonsrants.blogspot.ca/2012/01/asus-zenbook-touchpad-hack.html

The only problem is that when you save your settings after enabling the registry keys and re-open the Elan application, the extra options are removed. So I’ve provided a registry file that you simply run each time.

Zenbook/Elan Extra Features Registry Key Enabler (1031)
This entry was posted in 1 and tagged asus, crap, trackpad, zenbook on by Jordan.

Cheat Sheet for Administrating a PostgreSQL Database/Server

Leave a reply

PostgreSQL Interactive Terminal

 

Postgresql is similar to MySQL in that it uses an interactive terminal. To gain access type the following as root

1
su - postgres -c psql

You’re now logged into the Postgresql interactive terminal and interacting with the local server.

Common Shell Commands

 

Dump a database.

When dumping and restoring a database, you have to work within the postgres user, this is the default setup. The home directory for the postgres user is /var/lib/postgresql

1
pg_dump -U username database -f file.sql

 

Restore a database.

In order to restore the database you will need to ensure that the database name exist, for instance if it was dropped.

1
psql -U username -d database -f file.sql

 

Common Interactive Terminal Commands

 

Connect to a database, like “use database” in MySQL.