Python – Decorators

A decorator provides a simplified way to pass one callable object to another (i.e a class or function). The main benefit of decorators is that it allows you to clearly state where and what objects are being passed to each other. Typically this can be achieved by the following. Without Decorators As you can see, … Read more

Incapsula: Protect & Secure Your Website in 10 Minutes

What is Incapsula ? Incapsula is a cloud based service that provides the ability to add further security and also improve the performance of any website in a matter of minutes via a few simple DNS changes.   How does it work ? Incapsula works by routing traffic via its global CDN network prior to … Read more

Window doesn’t show when using Cisco VPN Client 5.x/Windows 7

Recently I started having some issues with the Cisco VPN client window not coming to the foreground. After some digging I found the solution. Windows 7 Hold the Alt key, press Tab key until the VPN Client window is highlighted. Release Alt. Hold the Windows key and press the right arrow key once. This should … Read more

How to Fix Unreadable Directory Listings within Shell

You may find that when listing directories within the shell and when using a black background that the directory names aren’t clearly readable. To resolve this issue the following command and then log back in.  This command will issue a find and replace against the color setting (for directory listings) within the necessary configuration file. … Read more

Python – List Comprehensions

List comprehensions provide an more Pythonic and alternative way (i.e instead of using map and filter) in which to express a list. There are 3 components to a list comprehension. The expression, the for loop and the optional condition. As you can see below, by changing the expressions and enclosing brackets to your expression you … Read more

Python – What does ‘if __name__ == “__main__”‘ mean ?

Within a Python program you may see the following syntax, if __name__ == “__main__”:    …(your code)… What does this mean ? When a Python program is run directly it runs within the __main__ namespace. However when a python script is imported as a module it runs within its own namespace. This statement checks the namespace … Read more

BIGIP F5 LTM – Action on Service Down

Background “Action on Service Down” defines the action that should be taken once the pool member has been marked as “down” by the associated healthcheck, after it has been selected as the load balancing target for a connection. Configuration To configure “Action on Service Down” goto the GUI and then to ‘Local Traffic / Pools’. … Read more

MySQL – How to reset a forgotten Root password

I’m sure that we have all done it. Yep, that’s right you’ve forgotten the MySQL root password. Fear not my fellow conrade, with a few simple simple commands you will be back in control. Stop MySQL First of all stop MySQL. /etc/init.d/mysqld stop Connect to MySQL Next instruct MySQL to ignore the GRANT Tables. Then … Read more