Windows Command Line Ping Replacement
So the windows version of ping is really stupid.
I was writing a batch script to mount up a network share that involved checking to ensure my NAS unit was turned on. The script is scheduled to run after the computer resumes.
What I found out is that the built in version of Ping.exe is terrible at telling you whether the ping has returned successfully or not. I was checking the ERRORLEVEL – %ERRORLEVEL% variable to find out what ping was returning. It should be 0 for success and 1 or higher for a failure.
What I found was, i was getting replies from the local pc (dunno why, leave me a comment if you know) and ping was reporting a success even though the correct pc failed to reply. The solution?
Replace the Windows ping.exe with Fping. It has a lot more options and appears – from some initial quick tests – to correctly report the errorlevel.
Kudos to Wouter Dhondt for developing it. I’ll update this post with any more news!
Fping vs Ping errorlevel return values
PC Gamer Rips off Rock Paper Shotgun
Back in June of this year, PC Gamer launched a new website. This website design appears to be a rip-off of that used by Rock Paper Shotgun. With all the images that follow, click through for a larger version.
But, let’s roll back shall we? Rock Paper Shotgun launched September 2007, though their first post goes back to July 2007. They were a novel pc gaming blog site, trying to do something different in the gaming scene. They concentrated on PC games and only PC games, with running jokes. They have a small enough set of writers, that you can pick up the personality of each. (Kieron takes the weird ones, VERY NSFW: example.)
Back in 2007, pcgamer.co.uk redirected to a sub-site of www.computerandvideogames.com. Since then, they haven’t altered the design at all. Now, it redirects to pcgamer.com. Looking at the two reveals this:
As an ex-web-developer, it looks to me like someone decided that they quite liked the RPS type website and went ‘make me a website like that, but in this style’. And tweaked the mock ups (and site designs) a few times, till what they had looks remarkably like what we see now.
Saying that, of course, this is quite a standard design style. It comes quite often easily when you use WordPress as your back-end engine, as this blog does, and as RPS does. However, they’ve not just used the site layout of wordpress as a base, they’ve decided to publish all of their posts in the same sort of format as RPS, with the same aim at getting discussions around their posts via the commenting.
A little birdie 1 tells me that someone at future (the company behind PC gamer) really might hate Rock Paper Shotgun. Would rather they disappear. It’s almost like, they’ve finally decided to fight this sphere of influence, with money, and lots of people, finally decided that maybe their website is worth working on and taking care of.
What annoys me, is that the big guy is trying to kill the little guy
Here are a whole load of screenshots, save you finding them. Some are from Wayback machine, some are from the website directly.
The old website, up till June. This image was recovered with a lot of hard work from webpigeon, of unitycoders.co.uk, (thanks!) since PC gamer used some really horrible website coding, which broke the waybackmachine copy. This has to be one of the ugliest websites I’ve seen, though not the worst. You could switch the big image, and below it was a list of recent stories.
And, if you scroll down a bit..:
They seem to be trying to throw links at you, lots and lots and lots of them, in a really small space. Check it out for yourself.
Rock Paper Shotgun’s footer:
PC Gamer’s footer:
OOo… don’t they look similar? Apart from the ‘we must keep up with the cool kids’ twitter panels and lots and lots of post links (which RPS doesn’t force on you, or puts in the right hand panel). This mess could also be due to Search Engine Optimization, that dark art in which you try to trick search engines into putting you higher up on their listings than your arch rivals.
Now, I work for the company that keeps RPS online. I like the guys that work there, I think they do a good job, especially considering they’re not getting paid much from it.
Also interesting, is the fact that PC Gamer seem to have thrown money at this venture. I work with some high-load wordpress-powered sites, and there is some very obvious things you do to make them work fast. Very fast. PC Gamer isn’t doing at least one of the most obvious, which suggests that instead they’ve thrown cash at keeping it online, with a cluster of computers working on it. Don’t know how a website works? Find out here 2
The fallacy of bandwidth limits
Currently, according to mainstream media, bandwidth is defined as the quantity of data you download or upload to the internet over a month. So, for example, your ISP will tell you the maximum bandwidth limit is 100GB. Or whatever.
That, however, is not it’s true definition. It’s true definition is:
a data transmission rate; the maximum amount of information (bits/second) that can be transmitted along a channel 1
This is the secret thing about bandwidth. ISPs don’t care about how much you upload to the web over a given period. We care about how fast you upload it.
When you pay for a high-level connection to the internet, that you use to connect houses to, or web-serving computers, you do not pay in quantity over time. You pay in speed. So, for example, 1 gigabit per second. If you go over that speed, longer than a allowed ‘burst’ period, you pay an overage charge, always assuming that your network is even capable of going over that speed.
Think of bandwidth like gas going through a pipe. (Terrible, terrible analogy, I know. But it’s the easiest way to explain.) That gas can only flow so fast, and only so much can be fit in the pipe at any one time. We don’t particularly care if you use 100GB by taking a trickle out of the system at any one time. We do care if you take a torrent.
Realistically though, customers never notice bandwidth. They’re too busy playing with computer-resource hungry things, like wordpress, to even be able to consume all of their allocated bandwidth. Only very, very rarely do we actually start thinking about bandwidth rather than computing resources. Normally, it’s podcasts. Static file. Almost no server-resources required to send it out onto the internet. But it eats bandwidth. Most are ~50-80Megabytes per episode. You get enough people downloading that simultaneously, and we’re going to start noticing…
As long as the current trend continues, i.e. the more computing power we have available to provide you with your shiny websites, the more the people creating the shiny websites waste computing power, the mainstream will never notice this secret.
More often than not, the reason we ask people to upgrade off our shared servers, is not because they’ve reached any arbitrary bandwidth limit, although we may use this as a guide to identify them. It’s because they’re using too much CPU time.
- http://wordnetweb.princeton.edu/perl/webwn?s=bandwidth ↩
Easy on the eyes
Just a quick post here…
Recently my eyes have been a little strained using the computer. I think it probably has something to do with the misplacement of my reading glasses somewhere at University. Hopefully I’ll find them before my Mum finds out and goes nuts lol.
Anyways to reduce browser related eye strain, I found a handy script for Greasemonkey (in Firefox) that kinda inverts the webpage/makes it less white and a bit easier to read (higher contrast). Its not perfect but it’s a handy hack until I can do some more hunting for my glasses!
Anyway enough text, here’s the links:
Invert web page colours (lifehacker)
Direct link to Greasemonkey script
Options are customisable, so you can restrict the websites it works on…
Oh, and here’s a screenshot:
Prevent Adobe Acrobat Crashing Firefox
I’m using Adobe Acrobat (for compatibilities sake only, please post your favourite PDF program in the comments below!), but I’ve been rather annoyed recently at it having a tendency to hang Firefox if I tried to open more than one PDF file from the internet.
Simple fix/hack – make Firefox save PDF files rather than open them.
- Open Options (Tools \ Options in Windows and Edit \ Preferences in Linux)
- Open the Applications tab
- under ‘Adobe Acrobat Document’ change the value of the dropdown to ‘Save file’
- OK the change
- All done. Hopefully that’s one less annoying crash to worry about!
Ps get Session manager to save yourself loosing a window full of tabs or having to do a horribly manual procedure like recovering tabs from a accidentally closed Firefox window.
Denial of Service attacks.
I don’t like them. But, at least some of them I can work around using bash, logfiles, awk, grep, tail, cut and netstat are handy tools
That’s all for today, I’m afraid. Not much else to talk about
Hopefully I’ll be able to produce some proper posts next week!
Help firefox wget and ssh shell script
I’m trying to create a script to allow me to command a remote server to download a file from firefox.
There are various reasons for this, mainly todo with connection speed.
What I have at the moment is:
#/bin/sh
terminator -x ssh user@site.com wget -qc -t 3 -o ~/wget_testlog ftp://anothersite.com/file.ext \\& \& &
I want it to kick off, ask for a password to login via ssh and then go away…
I would like to be able to set the location for the download to ~/www/files/
I was planning to place this script in /usr/bin and install it in firefox using the code/link provided on this blog: Wget from firefox
Can anyone complete my solution with the correct syntax, or provide a better solution (preferably KISS)?
I’m more of hacker than an expert IMO and I know when I’m out of my depth!
Cheers,
Garreth
How a website Works
This is just a quick guide on how a website stays online. It’ll probably be common knowledge to most reading this blog, but good to put up anyway.
You may think when you visit, for example, bbc.co.uk that it’s just “there”, and not worry about how, but my job is dependent on the how. The error messages you see when a website isn’t working are also very descriptive, but quite cryptic if you’re not in the know.
All websites are hosted on servers. A server is just a computer which we use to serve others, so in this case, serve a website, or provide email services. Normally, a server is a rackserver, designed to fit in a small space with a lot of other computers in a datacentre, far, far removed from that big beige box that allows you to browse the internet.
When you visit a website, a lot of different things are happening in the background. Firstly, your computer looks up the computer address with the domain name you just visited. Say you just hit my site, “kirrus.co.uk”. Well, the internet addressing system, that tells your computer where to look for the website is based in numbers. So, your computer asks special servers on the internet, we call “Domain Name Servers”, what the address is for that website. In this case, they’ll reply “80.87.131.49″. Your web-browser, firefox, will then ask for “kirrus.co.uk” from my server “80.87…”). Everyone has one of these IP addresses, even you. Go to http://itempeter.com to see yours
Once my server has the request, it then sends the web-page back to your computer.
What is a webpage?
A webpage, as your computer sees it, is a collection of a couple of languages. The most basic is “HTML”, or “HyperText Markup Language”. This was designed to allow you to quickly put together a webpage – all you do is wrap (or mark up) the text you want with the flags you want. For example <b>word</b> tells your computer to make word bold, so, you see: word
You can see the HTML that makes up this page by clicking on “View” and then “View Source” in your web-browser.
That’s the most basic level. It gets a lot more complex than that under the skin, with extra languages running on your computer (JavaScript, CSS [Cascading Style Sheet]), and on the server (PHP – PreHypertextProcessor, ASP, perl, python, MySQL) but they’re all too complex to go into unless you want to create dynamic websites. A good place to go if you want to create webpages is w3schools.com, where they have lots of tutorials on all the major web languages.
UK Surveillance Plan to go ahead
http://news.bbc.co.uk/1/hi/uk_politics/8350660.stm
Can I just say.. bad bad bad bad bad bad bad?
That and they have no idea how much this will cost to implement. £2bn is too little imho. Technically, implementing this will not be easy, and will cost a lot
Eve Online
I had trouble trying to think of something to blog about. So I’ll blog about this. Recently, I’ve taken to playing Eve Online, an interesting enough online MMORPG. It’s quite fun, in parts, although there are bits that get on my nerves. Firstly, the interface. It’s rubbish. The text font is too small, and you have to boost it by default.
On my machine, it and my graphics card drivers just don’t seem to get along. It crashes when anything interesting (or too busy) happens on my screen. A lot. The other week, it crashed whilst I was doing the utterly uninteresting task of mining (I set it go, and then go about doing something more interesting, like studying, whilst keeping half an eye on it to make sure I don’t get blown up), but more often it crashes whilst I’m trying to do something more interesting, like helping blow other people’s space ships up.
This game is interesting, in that you are effectively immortal, dying isn’t a problem. The only rule is, only fly what you can afford to loose.
Still fun game
I can give out 21-day free trials, if anyone wants one, let me know. (Disclaimer: If you sign up, I get 30 days free play
)








I'm a 23 year old Christian, Geek, Bookworm,
Socially Inept guy living in Cambridgeshire.