News aggregator

Dick Turpin: One of them days!

Planet WolvesLUG - Wed, 19/03/2014 - 11:15
I run an opt-in mailing list and send out something like 70+ PC's and laptops. As you'd expect there's a brief run down of CPU, Memory etc. So some bright spark sent me and email asking "Can you supply the generations of the CPU's and the CLOCK speeds of all the memory on every unit please."

Fook Off

I quoted (Actually I under-priced it tbh) to replace a screen on a laptop, inadvertently I was not making any money on the actual screen but at least was making money on the installation. Had an email. "Do you have a courier service? If I send it to you it will cost money and I would expect a discount on the price you quoted."

Fook Off
Categories: LUG Community Blogs

Convert OpenVPN ovpn files for use in network-manager

Planet SurreyLUG - Tue, 18/03/2014 - 19:41

Anyone who has enjoyed the dubious benefits of working with IPSEC will find OpenVPN a delight, but what do you do with your client.ovpn file once you have it?

If you spend most of your time in a terminal anyway, then I would suggest just putting all your client.ovpn files into ~/.openvpn, renaming them in some appropriate way, and then using them simply by typing:

$ sudo openvpn client.ovpn

If, on the other hand, you live in a more graphically orientated world, then you might like to integrate them into Network Manager. Sadly, the Import feature in Ubuntu does not work, at least in the versions of Ubuntu that I have used, and you have to make a few changes first.

Firstly, I would always create a hidden directory into which to store your client files:

$ mkdir ~/.openvpn $ cd ~/.openvpn $ mv ~/Downloads/client.ovpn ./

Secondly, you need to ensure that you have installed openvpn for network-manager:

$ sudo apt-get install network-manager-openvpn-gnome

Thirdly, we need to extract some data out of the client.ovpn, and for this I followed these instructions, which I include below in case of link breakage:

  1. Open client.ovpn in your favour text editor and copy the lines between the <ca> tags into a new file named client.ca.
  2. Remove <ca> section including tags.
  3. Now copy the lines between the <cert> tags into a new file named client.crt.
  4. Remove <cert> section including tags.
  5. Now copy the lines between <key> tags into a new file named client.key.
  6. Remove <key> section including tags.
  7. Now copy the lines between <tls-auth> tags into a new file named client.tls.
  8. Remove <tls-auth> section including tags.
  9. Remove the line “key-direction 1″.
  10. Insert the following text above the line # —–BEGIN RSA SIGNATURE—– :
ca client.ca cert client.crt key client.key tls-auth client.tls 1

Finally, save and close all the files and check that you now have all the above files sitting happily in your ~/.openvpn directory.

Go to Network Manager -> Edit Connections ->VPN and click Import, browse to the modified client.ovpn import that file.

Enter vpn username and password if prompted.

On the VPN page, select Advanced and on the General Tab, uncheck the first option, “Use custom gateway.


Categories: LUG Community Blogs

Steve Kemp: Sending commands to your running mail-client

Planet HantsLUG - Mon, 17/03/2014 - 12:10

So I wrote a mail client, and this morning I added the ability for it to receive input from a Unix domain socket.

In one terminal I have my email client open. In another I run:

lumailctl /tmp/foo.sock "open('/home/skx/Maildir/.livejournal.2014/');"

That opens the unix domain socket, and pipes the following command to it:

open('/home/skx/Maildir/.livejournal.2014/');

The mail client has already got the socket open, and the end result is that my mail client suddenly opens the specified mail folder, and redraws itself.

Neat.

The "open" function is obviously a lua function, which builds upon the lua primitives the client understands:

function open( folder ) clear_selected_folders() set_selected_folder(folder) index() end

Obviously this would be woefully insecure if it were released like this. Later I'll wire up some lua function to establish the socket, such that the user specifies where the socket is created (their home directory, ideally), and it doesn't run by default.

Categories: LUG Community Blogs

Meeting at "The Moon Under Water"

Wolverhampton LUG News - Mon, 17/03/2014 - 08:56


53-55 Lichfield St
Wolverhampton
West Midlands
WV1 1EQ

Eat, Drink and talk Linux

Event Date and Time:  Wed, 19/03/2014 - 19:30 - 23:00
Categories: LUG Community Blogs

Debian Bits: Video streams for the MiniDebConf 2014 Barcelona

Planet HantsLUG - Sat, 15/03/2014 - 12:10

This is just a quick note to tell you that the video stream of the Barcelona MiniDebConf will be available at the following URL:

http://bcn2014.video.debconf.org/

If you were not able to make it to Barcelona, now you can still follow from home!

May you have a productive and joyful MiniDebConf - and thanks for volunteering and talking if you do so! The MiniDebConf is what you make it.

Categories: LUG Community Blogs

Steve Kemp: So load-balancers are awesome

Planet HantsLUG - Fri, 14/03/2014 - 14:49

When I was recently talking about load-balancers, and automatically adding back-ends, not just removing bad ones that go offline, I obviously spent a while looking over some.

There are several dedicated load-balancers packaged for Debian GNU/Linux, including:

In addition to actual dedicated load-balancers there are things that can be coerced into running in that way: apache2, varnish, squid, nginx, & etc.

Of the load-balancers I was immediately drawn to both pen and pound, because they have command line tools ("penctl" and "poundctl" respectively) for adding/removing/updating the running configuration.

Pen I've been using for a couple of days now, and although it suffers from some security issues I'm confident they will be resolved in the near future. (#741370)

My only outstanding task is to juggle some hosts around and stress-test the pair of them a little more before deciding on a winner.

In other news I kinda regret the whole blogspam.net API. I'd have had a far simpler life if I'd just ran the damn thing as a DNSBL in the first place. (That's essentially how it operates on the whole anyway. Submit spammy comments for long enough and you're just blacklisted, thereafter.)

Categories: LUG Community Blogs

Dick Turpin: Here we go again ZenCart.

Planet WolvesLUG - Thu, 13/03/2014 - 12:09
So I'm doing yet another ZenCart site for a customer. The latest version 1.5.1 requires PHP 5.5 which meant we had to set up a dedicated LAMP server, which actually is about time.

I did all the usual PITA stuff of changing permissions on folders so it installs and that [supposedly] was fine. Now the default template is pretty nasty to say the least so I had a quick punt around and found a suitable one and installed that. But wait, what's this?

WARNING: An Error occurred, please refresh the page and try again.

Really? What kind of error? A hint would be nice? Now your first thought is "This must be a template related error as the default one works?" so after some searching (And time wasting I hasten to add.) I find that supposedly ZenCart does not turn on Layout Boxes by default. You have to go in there and turn them on, but wait!

WARNING: An Error occurred, please refresh the page and try again.

WTF now? Oh yes, clicking on Tools--Layout boxes controller bombs out with that very same, ever so helpful message! So off we go again in search of an answer. After losing even more time (And time is money you know.) I find a kinda helpful answer "Check your logs." so off I go to my logs and it says;

PHP Fatal error: 1146:table 'my.TABLE_EZPAGES_TEXT' doesn't exist

WTF? Surely that's a core element of ZenCart? After all, there is a button for Layout boxes controller why would there not be a table for it? But no! According to DrByte on this thread http://www.zen-cart.com/showthread.php?200200-Error-on-ez-pages

"There is no "ezpages_text" table in original Zen Cart code."

I also had to laugh at Kobra who apparently is a at the Black Belt level for support who asked

"Table 'XXXX.TABLE_EZPAGES_TEXT'Are the XX's actual or just what you added?" Bwahahahaha

Tears flowed down my face when I read that, talk about not understanding what your reading? As if they're going to put myxyz.TABLE_EZPAGES_TEXT? You'd still ask "What's myxyz?" I suspect?

Anyway the thread is about as helpful as a one legged man in an arse kicking competition. Suffice to say supposedly you now have to install Multi-Language EZ-Pages which comes with a database script to add the table[s]. Who's bright idea was that to make an integral function of ZenCart a plugin? Oh and just look at these hoops you have to jump through!

Step 2.  replace the following two CUSTOM folder with your own folder(template) name
  includes\modules\CUSTOM
  includes\modules\sideboxes\CUSTOM

Step 3.  Make a copy of the included file
  admin/includes/languages/english/extra_definitions/ezpages_multilanguage_defines.php
and save it as
  admin/includes/languages/YOUR_LANGUAGE/extra_definitions/ezpages_multilanguage_defines.php
then edit the two define statements in the file to suit your language.

And then @tigg wonders why I hate it with a vengeance. :-)
Categories: LUG Community Blogs

Tony Whitmore: Have you processed the pictures?

Planet HantsLUG - Tue, 11/03/2014 - 22:25

In 1991 I had some photos published in Doctor Who Magazine. Fast forward 23 years and 293 editions and it’s happened again.

I was asked to photograph Nicholas Briggs (voice of the Daleks, Cybermen, Judoon and more, executive producer at Big Finish and all round good egg) interviewing David Graham. David was one of the voice artistes who created the Daleks’ grating staccato delivery back in the 1960s. He has had an amazing career, appearing on screen in Doctor Who, The Avengers, The Saint and plenty more. He was also the voice of Parker and Brains in Thunderbirds, and is Grandpa in Peppa Pig.

So on a Monday morning back in January I found myself stood outside David’s flat in a rather nice area of London. Nick and David were already mid-interview (I was bang on time of course! They must have started early) so after David had made me a cup of tea I sat quietly a took some candid photos of them chatting. Then we carefully re-arranged David’s furniture to create an impromptu space for photographs and I broke out the speed lights and softbox. Figuring out how to make the available space work is something that I have learnt from my wedding photography. I think the photos capture the gentle good humour that was bouncing between Nick and David. Nick’s write-up of the interview is a funny take on the morning. It’s fascinating to read his take on the conversation.

You can read the interview and admire the photos in the latest issue of Doctor Who Magazine, which is a Dalek special. It’s at newsagents now, or available online: Doctor Who Official Magazine issue 471 (April 2014) – Dalek Special

Thanks to Tom Spilsbury and Nick Briggs for asking me to take the photos, and the DWM team who made them look fantastic. It was a very enjoyable way to spend a morning!

Pin It
Categories: LUG Community Blogs

Steve Kemp: Discovering back-end servers automatically?

Planet HantsLUG - Tue, 11/03/2014 - 14:28

Recently I've been pondering how to do service discovery.

Pretend you have a load balancer which accepts traffic and routes incoming requests to different back-ends. The loadbalancer might be pound, varnish, haproxy, nginx, or similar. The back-ends might be node applications, apache, or similar.

The typical configuration of the load-balancer will read:

# forward # backends backend web1 { .host = "10.0.0.4"; } backend web2 { .host = "10.0.0.6"; } backend web3 { .host = "10.0.0.5"; } # afterword

I've seen this same setup in many situations, and while it can easily be imagined that there might be "random HTTP servers" on your (V)LAN which shouldn't receive connections it seems like a pain to keep updating the backends.

Using UDP/multicast broadcasts it is trivial to announce "Hey I'm a HTTP-server with the name 'foo'", and it seems to me that this should allow seamless HTTP load-balancing.

To be more explicit - this is normal:

  • The load-balancer listens for HTTP requests, and forwards them to back-ends.
  • When back-ends go away they stop receiving traffic.

What I'd like to propose is another step:

  • When a new back-end advertises itself with the tag "foo" it should be automatically added and start to receive traffic.

i.e. This allows backends to be removed from service when they go offline but also to be added when they come online. Without the load-balancer needing its configuration to be updated.

This means you'd not give a static list of back-ends to your load-balancer, instead you'd say "Route traffic to any service that adfvertises itself with the tag 'foo'.".

VLANS, firewalls, multicast, udp, all come into play, but in theory this strikes me as being useful, obvious, and simple.

(Failure cases? Well if the "announcer" dies then the backend won't get traffic routed to it. Just like if the backend were offline. And clearly if a backend is announced, but not receiving HTTP-requests it would be dropped as normal.)

If I get the time this evening I'll sit down and look at some load-balancer source code to see if any are written in such a way that I could add this "broadcast discovery" as a plugin/minor change.

Categories: LUG Community Blogs

Chris Lamb: Two aesthetically pleasing Python snippets

Planet ALUG - Tue, 11/03/2014 - 10:25

The following Python tree structure recently resurfaced. I find it rare to see functional or recursive techniques expressed so succinctly in Python:

def tree(): return collections.defaultdict(tree)

Another construction I am quite fond of is:

for _, dirnames, filenames in os.walk(path): break

...which leaves dirnames and filenames in the current scope, containing the immediate subdirectories and files of the specified path.

Perhaps a little too cute, but appealing in its own way.

Categories: LUG Community Blogs
Syndicate content