Tim Groeneveld
Random musings from the world of an Open Source geek
More snippets
/ | Leave a CommentYesterday 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.
Have ssh-agent load on all new shells
/ | Leave a CommentI 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 🙂
Strict Notice: Only variables should be passed by reference in ..lib/Zend/Db/Select.php on line 216
/ | Leave a CommentHaving 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);
RHEL, Scientific Linux & CentOS: A sad story indeed
/ | 1 Comment on RHEL, Scientific Linux & CentOS: A sad story indeedI love RedHat Linux. I think it is a beautiful piece of engineering. Hundreds of thousands of man hours spent ensuring systems that have packages installed keep running. Continuously.
One thing however that I have found is that my favorite RHEL clone for years, CentOS has been slacking. Bad.
For example, RedHat Enterprise Linux 6 was released 10/11/2010, not bad, seeing as it’s previous version, RHEL5 was released 15/3/2007 – Three and a half years earlier. CentOS? Well, Version 6 of CentOS was released July 10. In the time that it took for CentOS to release their new fresh build of CentOS 6, RedHat had already released their first service pack/major update to RedHat, RedHat Enterprise Linux 6.1.
I must point out here, the fact that CentOS does not have 6.1 is not a security issue. Any security patches for RHEL have made their way to CentOS.
Scientific Linux on the other hand have been tracking the updates and new releases very well. They had their remix of RHEL released for public consumption on March 3 – not too much of a short wait. The fact that it is not a very faithful clone has scared me from moving to it, but with the long wait of CentOS 6.1, I am starting to think that it might just be time to change my mind and grow up!
Sydney Bank 2.0 Meetup
/ | Leave a CommentAs the cost of living increases and the dream of home ownership seems like an unachievable goal, how can we ensure we have the right tools in place to encourage GenY to build a financially sustainable future and make the most of their personal finances?
On Tuesday, August 23, a group of us will be meeting at Forresters Hotel at the Cnr. Riley & Foveaux St. in Surry Hills to brainstorm some ideas. I will be there, along with at least 11 others. Feel free to bump into me and say “Hi!”.
Duff Beer, IRL!
/ | Leave a CommentWhile in Brisbane, a good friend of mine (Hadi Nematollah) introduced me to Duff Beer (of The Simpson’s fame). Although I am not really a beer drinker, I can say that I was not put off the taste. Not a bad deal, $25 for a six-pack of novelty beer. Bonus points for being drinkable!
I love Brisbane
/ | Leave a Comment
Brisbane, one of the few cities that I really love. It quite possibly might even be my favorite capital city in Australia. Should you look down similar streets in Sydney, everyone is too busy to have even the smallest of smiles.
Sure, Sydney has some nice beaches – as it is a capital just kilometers away from the coastline of the Pacific Ocean – such as Manly Beach and Bondi Beach (which has made many a lifegaurd state celebrities with the TV show Bondi Rescue), but Brisbane has Streets Beach, a man-made beach with just about 4,000 cubic meters of sand. It allows you to have a perfect view of the city lights while kicking back eating a Bubble O’ Bill ice cream.
It almost seems like that on every corner there is a park. Not just a tiny 50m2 block, but a decent sized area. Enough to fit a school class room worth of kids in. The parks in Brisbane show the fashion, style and flare that defines Brisbane, especially South Bank. South Bank is Queensland’s cultural precinct and includes Australia’s largest Gallery of Modern Art, the Queensland Theatre Company, Queensland Museum, Queensland Performing Arts Centre and State Library of Queensland.
Sydney IT Meetup Calendar
/ | 1 Comment on Sydney IT Meetup CalendarWondering 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
- MobileMondy – “MoMo”. First Monday of Every Month. Get your tickets from EventBrite.
- SyPy – First and Last Thursday of Every Month. 6pm-9pm
- Product Mavens – Every Third Wednesday. 6:30pm+
- Sydney PCUG– Forth Tuesday of Every Month.
- Sydney Business & Technology User Group – The Last Wednesday of Every Month.
Sparatic
- IgniteSydney is always lots of fun, but not sure if they actually have a set schedule.
- Sydney MySQL Users Group
- Agile Sydney – at the City Hotel. 9th Feb.
Please let me know (in the comments section “below”) if there is anything that I have missed out on!
Google’s Android Fonts
/ | Leave a CommentI love Android, and I love that Google is offering such a good mobile operating system, for free. Many people might just remember that Microsoft grew to prominence in the IT industry in much a similar way. They provided DOS for free (or at least at a low cost) to OEMs, which provided them with much of the market share that they have now.
It can be seen as actually quite smart that Google are offering their OS for such a low price.
Google commissioned Ascender, a digital typeface foundry and software development company located in the Chicago suburb of Elk Grove Village, Illinois in the United States to create the fonts that are used by the Android user interface.
Ascender engineered the new set of system User Interface (UI) fonts named “Droid” for the Android platform built by the Open Handset Alliance. The fonts provided by Ascender allow highly legible text resulting in easy to use interfaces.
The fonts are open source, licensed under the Apache Software License.
Finding a download link to the fonts can be a bit tricky, but one of the easiest ways to get the fonts is to download them from Google’s Web Fonts project.
Here is Droid Sans, Droid Sans Mono and Droid Serif.
Failing that there is this link here to a Mercurial repository, but I didn’t tell you that, now did I?
Holiday mode started early?
/ | Leave a CommentLooking at my emails, I just realised that I forgot to pay for Drupal Downunder. -.-“