Main

October 30, 2010

Some gsed magic to insert a line below the regex matched text

So I'm working on finishing automating as much of my install fresh installations of Crowd, Confluence and JIRA. One of the things I was looking for is how to use gsed to insert some thing after a specific line has been matched with regex. For example if I insert a line before something I used something.

Before I started testing I created a test text file:

[jacques@auriga ~]$ cat far
hello
ABOVE
BELOW
ayoba

Then I wanted to insert the word testing above the word ABOVE:

[jacques@auriga ~]$ gsed -i"" -e "/ABOVE/i\
testing" far
[jacques@auriga ~]$ cat far
hello
testing
ABOVE
BELOW
ayoba

So that works well - after quite a bit of fiddling it was discovered to insert a line after something I needed to change the i script modifier to an a:

[jacques@auriga ~]$ gsed -i"" -e "/BELOW/a\
testing" far
[jacques@auriga ~]$ cat far
hello
testing
ABOVE
BELOW
testing
ayoba

January 1, 2009

Happy New Year!

Just a quick blog post to say Happy New Year! 2008 seems to have flow by quite quickly and at the start of 2009 I've made a resolution to not make any resolutions as I never tend to be able to keep any of my new years resolutions. Hopefully this year I can get round to blogging more often which is something which I've not been following through on.

August 9, 2005

Reflecting on the tools one uses

Benjamin Trott, from Six Apart, wrote about Open Data which started getting me to think about how certain companies write software to lock you into using their software only!

For me, it's always been easier to trust a tool that allows me to get my data out if I watch to switch tools.

And so, since day one, Movable Type and TypePad have had the ability to Export your posts--not because we wanted people to leave, but because we wanted people to stay.

Many tools do not allow you to easily transfer your data out of them. For example Clickatell's Messenger-PRO stores the SMS messages which you have sent using the programme in a database which one cannot easily extract contacts when you can export elements of the sent SMS data. How difficult would it be to have added CSV export of your contacts to the software? Not much more I'm sure, seeing that you're half way there with the exporting of certain elements of your outbox. Having to manually export your contacts for example requires one to manually write down the contacts details to another file rather than being able to click on a 'export contacts' button and Bob's your uncle.

In Movable Type's case one can easily run queries against the various tables and import the data and reformat the content of entries on one's weblog till the cows come home, as you have the raw data and can do what you please with it.

Continue reading "Reflecting on the tools one uses" »

January 25, 2005

Blog style changing

I am busy changing the look and feel of the blog. It's going to be another work in progress over the next couple of weeks while I spend more time tweaking CSS.

January 1, 2005

Happy New Year!

Happy New Year all. I hope that everyone has a prosperous year. All the best for 2005!

December 30, 2004

Deep Linking

I have to admit what I'm finding quite funny is that sites claim to have website usage agreements inplace which is supposed to be a disclaimer. What happens when a user does not read the said disclaimer and the site you are reading starts to complain about deep linking into their website.

I'd like to know if I decide to make a website usage policy and state in it that the users who view my website have to pay R 50.00 per page view to view my website is that legally binding?

Evil Desktop(tm)

For those unix beasties (as certain work staff would say) that need to use windows, Wez Furlong one of the PHP Project's hackers has released his Evil Desktop(tm), which he is planning to take over as many desktops in the world as part of his evil plan for world domination, or something to that effect.

December 29, 2004

Buys Inc. gets a late christmas present

I was looking for a copy of a PDF which is available for download from the Buys Inc. website and would have guessed it? Yes the site is unreachable again!

jacques@maquis:~$ dig buys.co.za soa \@dynamic2.cybersmart.co.za.

; <<>> DiG 8.3 <<>> buys.co.za soa @dynamic2.cybersmart.co.za.
; (1 server found)
;; res options: init recurs defnam dnsrch
;; res_nsend: Operation timed out
jacques@maquis:~$ dig buys.co.za soa \@dynamic1.cybersmart.co.za.

; <<>> DiG 8.3 <<>> buys.co.za soa @dynamic1.cybersmart.co.za.
; (1 server found)
;; res options: init recurs defnam dnsrch
;; res_nsend: Operation timed out

Reinhardt let me know when your website and blog is back up! ;)

December 25, 2004

Merry Christmas

Merry Christmas :)

December 24, 2004

Movable Type Comment And Trackback Closing Script (PHP)

I've hacked together a script which closes commenting and allowing trackback pings to blog entries that are older than 15 days. You can view it over here.

This is a early christmas present. It was written using PHP and PEAR DB (which should be in your include_path).

I was trying to get Kasia's perl based comment closing script to work but it did not and I was not in the mood for perl a few days ago and I hacked up the following php script.

It's been done by others before (Jeremy has it on his blog, mine is better cause it's longer!) but in the spirit of "not invented here" I wrote my own script which closes MT entries to comments and pings.

The idea is to cron it and forget about it and it has worked in that capacity well enough for the last few weeks.. so if anyone wants to use it (or they just like to amuse themselves by reading perl written by a Java programmer) the code is available here.

Remember you need to change the database connection details and you are good to do.

December 19, 2004

Why do food delivery services stink?

Okay so I'm working late at the office and now I want to arrange some food but I don't feel like walking around town to order and fetch some food. So I phone the idiots at Mr Delivery to see if they accept payments done online (ala internet banking) or if they accept payment using debit cards (i.e. they have the machines which they can take with themselves on the road). They don't seem to understand that they are loosing out on revenue from this untapped market.

Just imagine that they can arrange that they take a FNB speed point machine on the road which gets plugged in and reads the debit card information and then you enter your pin and it dials out to finalise your payment. Also their online website is an disgrace as you cannot order online from their site either.

So I'm busy weighing up now how far I want to walk to collect food.

Contingency Design

37Signals have an interesting whitepaper regarding Contingency Design: Maximizing Online Profitability By Helping People When Things Go Wrong which is a 17 page pdf which is available for download.

I think that it's important to utilise certain tricks when viewing sites and you happen to mistype a URL and cause a 404 error. For example IS's and UUnet's websites both return 404 errors while my website displays a page saying there was a 404 error with navigation. The PHP website redirects you to a search page.

Contingency design is design for when things go wrong. It's the error messaging, graphic design, instructive text, information architecture, backend system, and customer service that helps visitors get back on track after a problem occurs.

November 21, 2004

Starting my Christmas Wishlist

I've decided on which toy I want for christmas this year! It has to be a Wacom Cintiq 15" interactive pen display. It's quite wicked for drawing on which the graphics department at work utilise and I'm hoping for sometime to utilise one of the work ones more often to get back into drawing again. Quite fun really! And you have to remember to use lots of layers else it looks not so great. I also plan on finding what resolution Caroline and Luan utilise when drawing at work so that I can attempt to create images like they do.

October 16, 2004

Change of scenery

Busy looking at changing joblets atm. Had a job interview in town on Friday which seems to have gone well. The company seems to be quite cool considering that they are into open source and all the good things like that. :) Added bonus is that they will be moving closer to home as well as providing a challenging working environment to work in, which is kind of what I'm busy looking for, provided I get the job.

I've started uploading some pictures to my gallery.

I'm planning on getting round to using learning python again seeing that I've used it in 2001 which is quite a while ago.

October 8, 2004

Motherboard issues resolved

Turns out the issue with my workstation/development box (raider) was a screw which had somehow got under the motherboard was causing it to short hence it would not switch on. *sigh*

Anyway after a bit of taking the motherboard out and cleaning out the dust which for some odd reason makes it's way into the inside of the case the box is back alive and kicking.

It's good to hear this loud machine's fans spinning away. :)

September 23, 2004

Bookmarks

Finally started sorting through my bookmarks, seeing that I normally just "bookmark" something and forget to put them into some sort of categories for later retrieval. At least it is easier to find bookmarks depending on subject matter. Silly I know, but when you have 10000+ bookmarks and you need a specific one and nothing is really sorted it's difficult to look up what you need.

Also I need to migrate more of the bookmarks over to del.icio.us.

September 11, 2004

Recommended Blogs

On the subject of nice looking sites, Jim Winstead jr.'s blo.gs has a recommended blogs feature which recommends blogs to you to read.

It runs an SQL query to generate the list of recommended blogs while not including any blogs on your favourites list. It's kind of interesting what you can do to get different views of information out of a MySQL database.

August 23, 2004

#cape_town website redesign

The new layout of the #cape_town is coming along nicely now especially after some help from Damien. Kudu's to him ;)

Tshukudu anyone?

I hate naming pieces of software which I'm developing. It is time consuming to come up with names, and finding names which no one else seems to be using. Tshukudu means rhino in Sotho, which is one of South Africa's 11 official languages.

Tshukudu is an Application Framework which contains reusable components which I've been over the past couple of years utilising over and over again for projects, which also means I now only maintain one copy of the class rather than a couple of copies.

August 13, 2004

Changing layout slightly

Vaughan helped out earlier with fixing up my image on the mainsight which I'm planning on incorporating somehow on my blog, not sure in which shape, form or fashion. Thanks mylo :) He's the one with the skills which made the header image look way better than I could.

August 2, 2004

Started tweaking the layout of the site slightly

I've started tweaking the layout of my personal site. I will add more content here over the next couple of days.

My PHP and MySQL optimisation tricks on the Firstier website seems to be paying off.

July 24, 2004

Nice job a little too late

IOL's advertising a position in their Cape Town office, which I would have been extremely interested in a few months ago while working in "hell". Seeing that I'm no longer associated with "hell" or the people there, and am happily doing my own thing currently the particular job still looks interesting enough.

The position is for a Senior/Lead Developer within their Cape Town offices.

The successful candidate will form part of a small team reporting to the Technical Manager. This team develops and maintain the technical solutions for IOL, including the IOL website, and the Independent Newspaper websites.

The ideal candidate will have:

  • Superb Internet development skills using PHP, or a similar language such as Perl or C, in a high-volume environment.
  • Strong knowledge of SQL (IOL uses MySQL)
  • A passion for Open Source Software.
  • Strong systems administration skills (IOL uses Apache and FreeBSD).
  • Ability to lead a development team
  • Strong HTML, CSS, XML and JavaScript skills
  • Ability to work responsibly on their own, without close supervision, in a relaxed atmosphere with occasional bursts of pressure.
  • Work in Newspaper House, central Cape Town, in an open-plan office of about 25 people, technical and editorial staff

Email your CV to techjobs AT iol DOT co DOT za. No telephone enquiries will be accepted.

Yes thanks to the various people who've been pointing to me that I should look into this job.

June 22, 2004

I'm alive and stuff

I'm alive for those who have heard rumours about me not being alive and stuff. If you want to contact me please drop me a mail to jacques [at] powertrip [dot] co [dot] za.

June 16, 2004

Post Office dives for cover amid privacy row

Following up on my previous post about personal information which the Post Office is wanting to sell, it seems as if the South African Post Office are vigorously dening that it's planning to sell our personal details, but the facts and the legal jargon in use seems to.

IOL has more on this.

June 15, 2004

Post Office plans on selling personal data

It seems that the evil people over @ Intimate Data (chad I hope that you are not one of the evil ones although you work there) in conjuction with the post office, SABC (South African Broadcasting Corporation), etc.

The Post Office is to make millions by selling your personal information to private companies - and consumers are furious.

If you voted, have an ID book, a TV licence, a landline or even completed the census, the state parastatal will hawk your confidential information when it launches the National Address Database (NAD) - in conjunction with Intimate Data - later this month.

IOL : Your personal info will soon be up for grabs.

I can see that the Post Office and Telkom are going to be boycotted by consumers. I wonder if anyone would be volunteering to get a high court ruling againt the Telkom / Post Office / Intimate Data to prevent them going ahead with releasing millions of consumers private information.

April 19, 2004

Backstage

Been inspired to fix some issues that cropped up with implementing backstage on another website for work considering the following:

- FreeBSD 5.2-RELEASE workstation HDD still needs to be recovered so that I can actually access the latest version of backstage, but fortunately I have a old CVS repository backup lying around.
- Dreamweaver buggers up my hand coded XHTML and I prefer nice clean XHTML especially with my inability to use tools like the windows html staff at work, I think I need to get them to not break / tamper with my nice XHTML and put weird HTML code and what not into the Smarty template files which requires that I reformat the files prior to editing to make big changes.

April 15, 2004

Zend Studio 3.5 Beta

zend-studio-bug1.jpg

Busy testing Zend Studio 3.5.0 Beta on my work workstation, and let me tell you that I'm quiet impressed from what pieces I've utilised so far. Only one thing currently irritating me is whenever I open a file I get the a new 'alert' type window with that error message.

Zend Studio 3.5 Beta is now availableI'm starting to like the "Dark" theme for viewing/editing php files, which slightly looks similar to the view I have when using vim on my FreeBSD boxes.

One can download a copy of the Zend Studio 3.5 Beta which one can test to see if you like it.

Kudus goes to Andi and Zeev for another great product.

February 22, 2004

FNB's getting Digitags

First National Bank is getting the digitag devices. Looks like I'm getting another toy to use.

February 2, 2004

Smarty + PHP + MySQL

Busy reworking some old code I wrote ages ago basically another one of my old 'blogging' software prior to when these things were called 'blogs'.

Now to just get a nice layout with css and stuff.

January 1, 2004

Happy New Year

Happy New Year!

Better late than never ;)

December 25, 2003

Merry Christmas :)

Merry Christmas!

November 15, 2003

The blog has moved

My blog has finally finished the data migration process that has taken a few months as I've been busy with 101 bits and pieces. A lot of things have happened over the past few months, and hopefully I'll have time to dedicate a few minutes a day capturing a few entries for this blog.

Continue reading "The blog has moved" »

March 16, 2003

My server's great uptime history gone

I took a look at the uptimes project website where I monitor various servers that I maintain's uptime figures, which comes in very useful for various things having a graphical representation of server uptime.

Continue reading "My server's great uptime history gone" »

Afrigator