Category Archives: Technology

It is done

I mentioned last month that I was in the process of consolidating the mess of repositories that I have created over the past few years. This is now done and, hopefully, will be a bit more manageable going forward.

I now have three consolidated repositories: silliness, utilities and utils-on-power. The Configurate repository is already logically enough organised and Squirt is large enough to justify its own repo.

I have also removed the static pages referring to these repos on this site. They were creating overhead without adding any value.

And I now know a lot more about Git that I knew this time last month.

flattr this!

Squirt 0.2: Now with SMTP

As you may or may not be aware I have been tinkering with a command-line FTP client over the past year or so. And now seems as good a time as any to release version 0.2. The main change here is that the FTP client now supports sending data via SMTP.

In order for this to work, you need to be able to specify an SMTP server and port but, if you have a spare gmail account knocking around, server smtp.gmail.com and port 587 will work quite nicely.

As ever, you can find all of the source on GitHub. Feel free to tinker around with it.

flattr this!

Fun with Git: Moving a file from one repository to another

This has taken a while for me to come up with an approach, and the approach I took probably isn’t the most efficient. In fact I am sure it isn’t.

But it worked and I thought it would be worth documenting it for the next time I want to do something like this.

So the issue was that I had two files (dicetastic.py and dicelib.py) that needed to be moved. These files has started out in their own (now deleted) Dicetastic repository and then merged into my utilities repository. Now I wanted to move them to silliness, while retaining the git history.

The approach I eventually took was to format a set of patches from the original repositor(y|ies) and then merge them into the new.

So first I created a folder called rollout:

mkdir rollout

Then I formatted the patches I needed from the utilities folder:

cd utilities
git format-patch -o ../rollout --root dice*

This created three patches in the rollout folder. Unfortunately this wasn’t quite what I wanted as none of the history from before I started mucking about with this.

So I went back and formatted the patches from the Dicetastic folder:

cd ../Dicetastic
git format-patch -o ../rollout --root dice*

And I will note here that I should have done this for everything, not the dice* files, in order to include the changes to the README. Oh well.

So now I have a collection of patches in the rollout folder, which I could use to rebuild the history in the silliness folder.

If I had done this properly, I should have been able to use:

git am ~/Code/patches/*.patch

Unfortunately, because I had created two sets of patches in the same folder I had a slightly scary numbering issue. And because there were only seven patches I decided to apply them individually so that I could see what I was doing.

But it worked and all that was left was for me to commit the changes and push them and both the files are in the right place, along with their full history.

I hope.

flattr this!

Towel was a silly name for a repository

I mentioned about a week ago that I was starting to consolidate some of the short scripts that I have knocked together and pushed to GitHub over the years. This is still in progress but I have decided to consolidate these into two repositories: utilities and silliness. Because A lot of what I do is quite silly.

Going forward, anything short I throw together will end up in one or the other of these repositories. Now I just need to tidy up my current mess of folders.

flattr this!

An administrative note

I don’t think anyone actually looks at these but, in the site menu here are a bunch of links to IBM i and Linux utilities that I have knocked together over the years. They are useful to me and may be useful to someone else at some point.

However, my habit of throwing each script into a seperate folder, and a seperate repository on GitHub has let to a bit of a mess of tiny repositories. So I have started thinking about consolidating these in the Towel repository (because it’s a tough universe out there).

So far Photog (a photo renaming utility) and killchar (a utility to strip annoying characters from file names) are in there. Others will follow as and when I find the time.

And then I will need to look at repairing or removing the links and static pages on this site.

flattr this!

Adding variables to ad-hoc SQL queries with REXX

It’s incredible how easily I can be distracted. All I needed was a quick and dirty way of capturing the input into an interface and now I’m writing a blog post.

Everything starts with an issue and, in this case, the issue is with an interface not behaving as expected in production even though everything works as expected in the test environment. My suspicion is that the incoming data is not correctly formatted, causing transactions to not meet the selection criteria. But to confirm this, I need to see exactly what is waiting to be processed when the interface runs.

Since this interface runs after the end of business I want to be able to submit an SQL query to capture the input data into a separate table so that I can see what was processed when I come in tomorrow morning. And, because much of this data is not destined to pass through the interface in question (this is why we have selection criteria) I want to be able to select today’s transactions for whatever the current value of today happens to be.

In a sane world, this would be a simple case of using the current date but in the real world there are still people using eight digit numbers to represent the date. This leads to some unwieldy date calculations in SQL which led me to wondering whether I could capture this in a variable to make things a bit more readable. It turns out I can, but not on the version of the IBM i operating system that I am currently using.

What really caught my eye at the above link however, was this:

but if “ad hoc sql + variables” is the thing you need, you should really try Rexx.

And I thought: “Rexx. That’s something I haven’t used since last century.”

Any excuse to download a couple of manuals is reasonable as far as I’m concerned, so off I went.

And here’s the script (library and table names have been changed):

datenow = DATE('S')
statement = 'insert into MYLIB/INPUTDATA' ,
            'select * from PRODLIB/INPUTDATA where dhdate =' datenow
address 'EXECSQL'
EXECSQL 'SET OPTION COMMIT = *NONE, NAMING = *SYS'
EXECSQL 'delete from MYLIB/INPUTDATA'
EXECSQL statement

The DATE function returns the current date and the 'S' option handily reformats it into an eight digit number (yyyymmdd). The address 'EXECSQL' statement handily points the subsequent commands to the SQL command environment and then it’s just a case of executing the statements I need to execute.

It all works very nicely indeed.

On a tangential note, I noticed that Rexx is also available in Arch. I may well install this sometime soon just to have a play around with the language.

flattr this!

The world’s heaviest metal

compressorhead logo

No-one is more metal than Compressorhead

Stickboy (drums) was created to exacting specifications. 4 arms, 2 legs, 1 head, no brain. he plays a Pearl 14 piece kit with double kick. stickboy junior, the bastard child of an unknown mother takes control of the hihat shuffle. inception date 2007

Fingers (guitar) joined stickboy in 2009 and brings 78 purpose built fingers, enough to play the entire fret board and pluck.
Bones (bass) is the highest precision bass player in known existence, and the youngest member of the band. inception date 2012.

Stand aside meatbags. Oil is thicker than blood.

Via io9, who have found a whole lot more.

flattr this!

If People Were Like Social Networking Sites

Tangential to yesterday’s post

From The Joy of Tech via Re/Code.

flattr this!

Ello, it’s another silo

Another week, another proprietary social network. This time it’s Ello which is trying to position itself as an ad-free answer to Facebook. The Register took it for a spin and made the following point in conclusion:

But is Ello quite as pure as it makes out? And will its lofty goals stand up against the test of time? I have my doubts.

Ello already has venture capital funding and VCs aren’t charities – they expect a return on investment. The site promises that its pay-for-features model will involve “very small” amounts of money but it’s going to take a serious amount of cash to run the servers needed to power the site properly if it gets a serious amount of users.

And this is why I won’t be signing up to Ello. For all its talk, Ello is yet another proprietary silo of a social network. The people behind Ello will, inevitably, come under pressure to provide a return to the venture capitalists that are funding it. It will either collapse or have to start breaking promises – quite possibly both.

And when Ello fails, all of its users will find themselves stuck in a silo again. Either they leave and lose contact with their connections, or they stay and put up with corporate behaviour with which they are increasingly uncomfortable (Hello, Facebook).

It’s for this reason that I think federated services are a much better proposition for all.

My preference is for GNU Social (also referred to as StatusNet) although other federated networks do exist (Friendica, Pump.io and Diaspora all spring to mind). The advantage that all of these offer is that you are not tied to a single provider. If I decide that I am not happy with my current instance, I can easily move to an alternative (or even install my own instance) and continue talking to exactly the same people over exactly the same interface.

We don’t accept proprietary limitations on which websites we visit. We don’t accept proprietary limitations on who we can exchange emails with. Why should we treat social networks any differently?

flattr this!