Posts

Showing posts with the label script

Virgin Media : Poor Internet Speed Misery

Image
You know that moment in Misery where Annie (played by the excellent Kathy Bates) raises the lump hammer to Paul (James Caan's) ankles?  That hopeless moment, where you know what's coming, and she's determined this is the best, and he's helpless to change things.... Yeah, his feeling at that moment is the same feeling I get whenever I try to solve my service problems with Virgin Media.  I've tried in the phone centre, they either won't talk to me, or deny I'm an account holder - the account being in my wifes name, but I'm a registered up user of the account etc etc.... Or they simply deny there's an issue.... "I can ping you now sir".... Really, a few ICMP packets get through and you think it's a-okay do you? Or I get told, reboot your superhub... Or variously asked "are you on wifi or wired"... It makes no difference when the speed recorded by either is less than 2mbits!!! And I've just been told in a reply on twitter ...

Bash : Power of Pipes

Subtitle: "Get IP Address Easily" When I say easily, I mean not so easily, but with the proper tools... Let me explain, it's been one of those days... I've a remote server running some flavour of Linux, and no-one knows it's remote IP Address, they all SSH into the box run " ifconfig " and note down the value, they then plug this into a config (or worse still were baking it directly into some code) and running their services.... The trouble of course being, years later, they're no-longer the programmers nor maintainers of this machine, I am... And to be frank whenever the IP address changes I don't want to recompile their java code, nor use vi to edit the various configuration files, I want a script to at least update the settings automatically. I therefore changed their code to load the IP address, not hard code it, and used some other scripts to put the IP address into the config file at boot... The first line of that script is what I'm goi...

Development : Python, MySQL and Protocol Buffers Build

Today I've come to a totally virgin installation upon a server, this was for a work group I've got to head up whom are looking at pushing MySQL with Python.  And things initially went wrong... I stipulated they had to use Python3 and thought everything else would be fine for them to install with Pip3, so... sudo apt-get update sudo apt-get upgrade sudo apt-get install python3 sudo apt-get install python3-pip sudo apt-get install mysql-server Everything looked fine, their user could install packages through Pip3 and they had Flask and a few other things and were flying.  I used the mysql client on the command like to test I could add a few items and also ran... sudo mysql_secure_installation To do the basic hardening of the database, so everything was fine... Right?....RIGHT?!?! No, not exactly....  "I can't get mysql.connector" .... Came the cry. And they were right, it reported a myriad of build issues and could not install.  I took a look... NIGHTMARE! It appear...

Server Admin : Ubuntu 17.04 thinks it's Ubuntu 12.04???

Image
Yeah, I'm serious, I've taken time tonight to look at the release of Ubuntu Server 17.04, specifically to set up a new mini-server which is to be Core 2 Duo powered and on 24/7 as boot strapper & service strapping server itself. But, before I run I like to walk, so I set up a 2 core, 1GB RAM VMware machine from the 17.04 ISO... Take a look at the first thing it has presented to me.... Yes, just read that again... I booted the server... and the only action I took was to log in... Welcome to 17.04... All good... What wait?.. Why am I being warned to upgrade my 12.04?  This is 17.04? Before I ran around like my last vestiges of hair were on fire, I decided to do a simple test, I've previously found that Ubuntu often goes wondering off on the internet for message of the day (motd) information, so I pulled the network card (virtual) out of the machine. This results in a long boot time, but you at least know no remote files or services are going to be listing things on your s...

Development : Anti-Hungarian Notation

Whilst cutting code I employ a coding style, which I enforce, whereby I output the scope of the variable being used with a prefix. "l_" for Local "m_" for Member "c_" for constant "e_" for enum And so forth, for static, parameter and a couple of others.  I also allow compounds of these, so a static constant would be: "sc_" This is useful in many languages, and imperative in those which are not type strict, such as Python. Some confuse this with "Hungarian Notation", it's not.  Hungarian notation is the practice of prefixing a type notification to the variable name, for example "an integer called count" might be "iCount". I have several problems with anyone using Hungarian Notation, and argue against it thus. With modern code completion and IDE lookup tools this is really not needed, with useful and meaningful naming of your variables the type is not needed and finally there are multiple types with the s...