1 0 Archive | Documentation RSS feed for this section
post icon

More snippets

06. Sep, 2011

Yesterday I posted about having an existing ssh-agent load on all new shells. Here are two more handy snippets of code from my .bash_profile

The first code snippet is a follow on from yesterday, were I can type ‘lock’ or ‘unlock’ into my shell and the ssh-agent will follow on accordingly. When your ssh-agent is locked, users that have access to the ssh-agent will be required to type in your SSH agent password.

function lock () { ssh-add -x }
function unlock () { ssh-add -X }

The next snippet of code adds a ‘ns’ command. I have issues trying to remember IPs – especially when they are not used too often. This command lets me easily remember :)

alias ns='for x in ns1 ns2 ns3 ns4 ; do host $x.google.com; done'

When run:

[tim@2-xlc-controller ~]$ ns
ns1.google.com has address 216.239.32.10
ns2.google.com has address 216.239.34.10
ns3.google.com has address 216.239.36.10
ns4.google.com has address 216.239.38.10

The last dirty one liner that I love is another simple time saver. Many people use the ‘whois‘ command to find out what nameservers are used by a domain name. It’s not too long before you work out that it is not really the best way to be finding out what the domain name’s nameservers are.

function nameservers() { echo $1\'s nameservers are:; dig +trace $1 | grep NS  | grep "^$1.";  }

This handy one liner allows me to do awesome things like:

[tim@3-xlc-controller ~]$ nameservers google.com
google.com's nameservers are:
google.com.             172800  IN      NS      ns2.google.com.
google.com.             172800  IN      NS      ns1.google.com.
google.com.             172800  IN      NS      ns3.google.com.
google.com.             172800  IN      NS      ns4.google.com.
Read full story »


Written By Tim Groeneveld.
post icon

Have ssh-agent load on all new shells

05. Sep, 2011

I love ssh-agent, but always found that running source ~/.ssh.agent annoyed me!

That was before I wrote this code, which I absolutely love:

source ~/.ssh.agent

PID=$SSH_AGENT_PID
if [ -f /proc/$SSH_AGENT_PID/cmdline ]; then
        CMD=`cat /proc/$SSH_AGENT_PID/cmdline`;
        if [ "$CMD" != "ssh-agent" ] ; then
                PID=0
        fi
else
        PID=0
fi;

if [ "$PID" -eq 0 ]; then
        ssh-agent > ~/.ssh.agent
        source ~/.ssh.agent
        ssh-add
fi;

Put simply, when added to your .bash_profile this code will ensure that your current ssh-agent is loaded. You may now ssh freely into servers without always typing that 100 character SSH Key password :)

Read full story »


Written By Tim Groeneveld.
post icon

Strict Notice: Only variables should be passed by reference in ..lib/Zend/Db/Select.php on line 216

01. Sep, 2011

Having problems with your (older) Magento install on your (newer) PHP?

Some versions of Magento have been using the ‘current‘ function incorrectly.

If you experience the following error:

Strict Notice: Only variables should be passed by reference in ..lib/Zend/Db/Select.php on line 216

A simpler fix may just be to change two files:

File One: lib/Zend/Db/Select.php
Find:
$correlationName = current(array_keys($this->_parts[self::FROM]));

Replace With:
$arrayKeys = array_keys($this->_parts[self::FROM]);
$correlationName = current($arrayKeys);

File Two: Toolbar.php
Find:
return current(array_keys($this->_availableMode));

Replace With:
$arrayKeys = array_keys($this->_availableMode);
return current($arrayKeys);

Read full story »


Written By Tim Groeneveld.
post icon

Sydney IT Meetup Calendar

05. Feb, 2011

Wondering where all the interesting Sydney IT meetups are? I have listed here a rough calendar for 2011. There may be some updates further on in the year as more events are announced.

Big Meetups

  • PHPConfAu – Late October. You didn’t hear that form me though because the exact date is yet to be confirmed. First national PHP meetup, this one is going to be big! Some of Australia’s most respected PHP developers are already slated to be there, so if you want to learn anything new, definitely drag yourself across!
  • WordCamp – OK, technically it is in Melbourne, but this is the WordPress meetup of the year, and something everyone who has a blog should go to – tickets are $50, there is no reason not to go!
  • PyCon AU – 20th – 21st August. Again, Python’s National Conference.
  • Ad:Tech Sydney – 9-10 March. ad:tech is the leading event for the digital marketing and advertising community in Australia and New Zealand.
  • CeBIT Australia – 31st May – 2nd June. Australia’s biggest IT get-together.

Weekly / Fortnightly Meetups

  • Sydney Tech Startup Meetup – Every Thursday Morning. 8am-10am.
  • Silicon Beach Sydney – Every Friday at the Grace Hotel 6pm+. Silicon Valley has a supporting ecosystem that makes Internet innovation thrive, so what can Australia do? How can that big island with the best beaches in the world, harness the passionate, intelligent individuals who care to do more?
  • Coffee Mornings – Every Friday Morning @ 8am. A get together of social media personel.

Monthly Meetups

Sparatic

Please let me know (in the comments section “below”) if there is anything that I have missed out on!

Read full story »


Written By Tim Groeneveld.
post icon

Getting OpenSUSE’s Xen ‘Kernel of The Day’ on other Distro’s

08. Aug, 2010

Getting the latest (mainline) Linux kernel is easy, you just head over to kernel.org and click the first ‘Full Source’ link that you see. When it comes to Xen, it’s so hard that even the official Xen Wiki can’t really find a simple download and configuration link.

After running Andrew Lyon’s Gentoo patches for Xen kernel for quite a while on my Archlinux install, it’s unstability instability on my work machine (which can mainly be tracked down to Kernel Mode Setting issues inside the kernel code).

I have faced two ways to fix the issues I have been having on this particular machine: either fix the kernel code with the KMS patches (linked to above) or try a newer version of the OpenSUSE patches.

I have tried on and off the KMS patches, but either the build always fails somewhere or the machine simply will reboot just before Dom0 loads. To fix the issue, I have simply gone to rebuild a new kernel from OpenSUSE’s KoTD source.

Recorded here is the quick hacky steps taken to get the kernel building on my machine:

  1. Download the kernel-source rpm from ftp://ftp.suse.com/pub/projects/kernel/kotd/master/src/
  2. Extract the RPM.
    [tim@myhost ~]$ pacman -Qo `which rpmextract.sh`
    /usr/bin/rpmextract.sh is owned by rpmextract 1.0-4
    
  3. for x in `find | grep \.bz2 `; do tar -xvf $x; done
  4. for p in $(./guards $(./arch-symbols) < series.conf | grep -v ia64); do
        echo "--> $p"
        patch -d linux-2.6.35 -p1 < $p || break
    done
  5. cp config/x86_64/xen linux-2.6.35/.config
  6. cd linux-2.6.35
  7. make oldconfig
  8. make

Will it fix all my complaints that I have about my current kernel? Who knows, but I hope it does!

Read full story »


Written By Tim Groeneveld.
post icon

Building a PCI DSS compliant network [1/12]

11. Jul, 2010

PCI, or the Payment Card Industry Security Standards Council was created in September 2006 by the major card issuers, such as Visa, MasterCard and AMEX.

The standards, PCI-DSS (Data Security Standard) were developed to ensure that card holder’s data security was always kept to the highest possible standards.

To reduce the scope of assessment for any network that involves credit card data, it is extremely important that as little credit card data as possible is stored – and if that credit card data is actually stored on a network, that as few machines as possible have direct access to that credit card data.

This could be done in many particular ways. For example, any remote machines cannot access credit card information once encrypted. Storing the data on a separate network then that of the public network (read: internet) will ensure that your scope of assessment area.

If possible, never transmit credit card data over a wireless network. Seriously. The second that you add a wireless network into the credit card mix, your PCI assessments become much more complex – and much more expensive. When possible, keep the credit card data over wires. Wires are easy to see and difficult to listen in on.

There are 12 requirements inside the PCI DSS document. (more…)

Read full story »


Written By Tim Groeneveld.
post icon

MyBanco: FAQ

13. Apr, 2009

Every time I go to my Inbox every morning; I seem to have three or four questions waiting for me regarding MyBanco. Starting from the most asked question, and going down to questions I seem to get less often, I thought I might answer a few of those questions so that I will never have to type out the same repetitive answer again.

How can i download MyBanco 2009.1?
MyBanco 2009.1 is not yet released, I know that the site is a bit out of date, and that the release is way over due, all I can say is hold your horses and go download the latest release, which you will see on the very same download page that talks about MyBanco 2009.1, http://mybanco.org/download.html

Is this for real? Is MyBanco really meant in production environment of real banks?
Well, yes. This is the aim of the game. The application is not yet fully feature rich, so don’t expect Citi Bank to start using it just yet, but with enough programmers hands, it will become an application that can be used in production environments, not just for small community banks but also larger national banks.

I can’t install MyBanko. I do not use XAMPP. I use real web server. I can’t found where to write the MySQL server address on page 3 ?!?
Firstly, do your research. XAMPP is just a nice and easy way to get a webserver with Apache, PHP and MySQL installed on Windows without little work at all. It is a real server, just as much as a LAMP server is. I don’t know what you mean about MySQL, all you need to do is create a database with acceptable permissions (say with phpMyAdmin — which XAMPP also comes with…) and enter those login details into the installation script for MyBanco. The install application for MyBanco will come up when you go to the domain for MyBanco for the first time.

Is it possible to install with the following url: http://localhost/mybanco? Because, with the original installation method I have to sacrifice other websites.
No, it is not possible. The internet banking module is built to run off it’s own domain/subdomain. The easiest way to do it is to just create a virtual hosts configuration in Apache, where you have something like http://mybanco.localhost :) The reason this is here is to make MyBanco comply with PCI DSS (https://www.pcisecuritystandards.org/), which are rules created by the major credit card issuers on the subject of how machines must handle credit card information. https://www.pcisecuritystandards.org/security_standards/pci_dss_download.html

PCI DSS Requirement 2.2.1 specifies ‘Implement only one primary function per server.’, which basically means that the internet banking interface must be on a separate server then say the backend server or the MySQL server. Of course, for testing it is OK for this to not be the case, but for the reason that there are rules to worry about, making it run the way you want in a testing environment has not really been a big concern.

PCI DSS Requirement 6.3.2 requires that test/production environments must be seperate, and it is recommended to have the same config. between both environments, yet another reason not to implement what you are saying.

MyBanco throws some errors even at installation. Step 4, i.e. stop after sql writing and gave no clue for me. And, also some undefined variables message after that.
If you encounter errors, please copy and paste them so I can fix them.

I manage a banking program at a community college. We are setting up a model branch for students to practice retail banking operations in a simulated environment and would like to use your retail banking solution. Does an extensive amount of programming need to be done before we can use the software. We only need the basics -nothing fancy. How exactly do I download it and get it to run? What hardware/operating system/database platform etc. do we need to run it? We will have about 5 – 25 work stations running it.
At the moment, MyBanco does not perform any lending functions, this is it’s only downfall. To get it running is very easy, if you look around the MyBanco website at this link http://www.mybanco.org/about-us.html you will see that there is a link to this blog post: http://timg.ws/2009/01/26/installing-mybanco-with-xampp-on-windows/ It describes all that needs to be done to install MyBanco on a Windows system.

You can download MyBanco from here: http://timg.ws/downloads/mybanco/ No fancy hardware is required, a basic Core2Duo machine, which costs less then $2,000 will be able to handle not 25 work stations, but 250!

MyBanco is very fast. No programming will need to be done, unless you want to offer loan support.

Read full story »


Written By Tim Groeneveld. \\ tags: , , , , , ,
post icon

So, I just installed MyBanco

26. Jan, 2009

Right, so you have a new installation of MyBanco, what should you do now? Well, here are a few ideas just to get the ball rolling:

  • Create a new skin of MyBanco. Skins are very easy to make, you do it by just copying an existing skin to a new directory (skins are in C:\xampp\htdocs\Skins). For example, to make a skin called ‘wicked’, here are the steps.
    1. Copy the folder ‘Simple’ and paste it in the same directory.
    2. Rename ‘Copy of Simple’ to ‘wicked’
    3. Enter the folder ‘wicked’ and rename ‘Simple.php’ to ‘wicked.php’
    4. Goto ‘C:\xampp\htdocs’ and edit ‘config.php’.
    5. Change the line starting with “$CONFIG['skin']” changing it to this:
      $CONFIG['skin'] = 'wicked';
    6. Start editing the new skin, making it look how you want :)
  • Install xbank. Do this by going to the admin, and specifying ‘Enable xbank’ in the config. If you have made the config file read only (not a bad idea!) you will have to edit config.php manually.
    When XBank is enabled, a new config item will appear, where you can add banks that allow communication with. To do this, you will have to know what the partner bank’s XBank I.D. is, and create a new Communication Key with them. You must share then with the manager of the partner bank’s system your communication key, and they will give you their communication key. If both keys are not traded, communication between the banks will be impossible, as the communication key builds up the security between the two banks.
  • Enable Currency XChange. (CXC).
    CXC is a system that allows different currencies to be traded in a fair way. The way that CXC works is that a new currency is created by a ‘Host Bank’. This host bank then specifies the four character CXID, or ‘Currency Xchange ID’, which other banks will use to specify the currency.

    For example, the “Test Bank of Testland” floats their new curreny, who’s CXID is “TEST”. “Test Bank of Testland” tells the CXC server that they are willing to put t10,000 into a CXC account. This new currency can now be floated at a rate specified by the “Test Bank of Testland” against *ONE* other currency already in the CXC.

    When another bank, for example the “First bank of Demonasia” has a customer that wants to put t2,000 into the account, the money will then be traded with the specified amount.

    This requires both banks to have communication set up not only between the CXC, but also with each other.

    The First Bank of Demonasia can then tell the Test bank of Testland that it has 2,000 to put into the foreign bank, and the money will appear in the account.

    Unlike other systems availible at the moment, this system does not magically ‘create’ currency, rather, it is only traded, so always the exact amount that was put in the system is actually there.

    Really cool things can then be done, for example, the Test bank of Testland can remove all the money that it has from circulation (which are not held in other banks)

  • Offer Phone Banking
    If you have an install of Asterisk laying around, you can actually create online banking for customers of your bank. For example, with voip.ms, a new number in America only costs around $3 a month, and you can accept two incoming calls at a time (and pay nothing to accept those calls). All you need to do to make this work well is have a good TTS (text To Speech engine installed, like Cepstral) and a Linux install of Asterisk, which is allowed to access the MyInfo location (the backend of MyBanco).
  • Allow SMS Banking
    If you have credits with Clickatell, you can actually do SMS banking. This costs a bit of money to actually set up, but getting it working once you pay the $30 a month is very simple. Customers can then see from anywhere how much money is available in their account.

Well, that should at least get the ball rolling.

Read full story »


Written By Tim Groeneveld. \\ tags: ,