I have been testing out Solarwinds MSP backup, and one of the features this has is that you can restore the backup to a virtual disk, which is in VMware vmdk format.
I use this locally on Oracle VirtualBox, which I for my virtual machines.
While the vmdk file does work with VirtualBox natively, I discovered that it does require some work to get it to boot and you cannot do much else with it, which includes shrinking it. This is one thing I needed to do in order to reduce the amount of space used by my restored virtual disk image.
Firstly in order to get the vmdk to boot I had to enable EFI mode in virtualbox settings.
I then had to run bootrec/rebuildbcd
To compact the disk, I discovered I have to convert the vmdk to a VDI file. thankfully this turned out to be quite simple.
If you will not be using a dynamic disk, and do not need to shrink it, then you can skip these first 3 steps obviously.
1. Delete Unnecessary Files from the VM
- The best way to do this is to run the Windows disk cleanup tool, including the option to “clean up system files”
2. Defragment the Disk
- If you want to also shrink the disk, then Using the Windows defrag tool will help with the shrink process.
3. Clean any free disk space
After the disk has been defragmented, the virtual Windows drive will still have unused space containing garbage bits and bytes. These garbage bits and bytes are from the contents of files that used to occupy that space but that are no longer there.
The most effective way to clean free disk space on a Windows drive is to overwrite the unused space with a bitstream of zeros or to zero-fill any free space.
Windows does not come with a native utility to zero-fill unused space but you can find the excellent SDelete tool at Microsoft’s TechNet: http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx
4. Convert the disk
If your vmdk image file is already connected to a guest VM, then you need to remove it, otherwise, the process will not work.
- shutdown the VM
- go into the virtual media manager and remove the vmdk file from the guest VM
Open CMD prompt, and navigate to your VirtualBox folder, from here you will execute VBoxManage, using the coneMEdium command to clone the VHD and convert to VDI.
c:\Program Files\Oracle\VirtualBox> VBoxManage clonemedium disk --format VDI [drive]:[\path_to_file\sourceFile.vmdk] [drive]:[\path-to\destinationFile.vdi]
Obviously, replace the [drive]:[\path_to_file\myserver.vmdk] with your source and destination paths.
This conversion process will actually shrink down the VHD by default if you are using a dynamic disk, and should get it down the minimum required. If it hasn’t sufficiently reduced it, then you can try to run this command.
VBoxManage modifyhd --compact "[drive]:\[path_to_image_file]\[name_of_image_file].vdi"
I have been having some WIFI problems the last couple of months where devices would randomly lose access to the internet, some devices couldn’t even connect to the WIFI access point, others could connect but were just slow as hell. Even wired devices seemed to be having problems. After trying everything possible, I finally thought that maybe something on the network was sucking all the bandwidth, as some devices did still have a connection.
So I logged into my router and checked the connected devices bandwidth usage and saw that PC which was showing high usage. Lo and behold windows update was running, which was sucking all the bandwidth and killing the network for everyone else.
After further investigation, I discovered that one of the new features introduced in windows 10 is the ability to get updates through P2P (like how torrents work) to improve download speed. This can be a major network bottleneck due to the number of p2p connections that get opened up. So disabling this was the first step.
go to Windows Update -> Advanced Options -> Choose how updates are delivered
PCs on my local network, this will still allow you to get updates from other computers in your local network only, and not external computers, which will save your available bandwidth.
Although making this change while updates are already downloading doesn’t seem to have any effect, so you would have to stop the downloads for the setting to take effect. This also did not solve the issue by itself, it improved things, but everything was still slow.
My next step was to go into my router admin and set some throttling so that individual computers had a limit on how much bandwidth they could consume. Although if you have a basic/cheap router from your ISP then you may not have such an option available. In which case you can try setting thr throttle on the individual pc’s using BITS.
The updates happen through 2 main windows components: WUDO and BITS.
WUDO is the Windows Update Delivery Optimization is part of the Windows Update for Business and is used for the P2P installation that I disabled already.
The Background Intelligent Transfer Service (BITS) is commonly used by Windows to download updates, so this can also be tweaked using group policy.
To open the Local Group Policy Editor from the command line:
- Click Start , type
gpedit.msc in the Start Search box, and then press ENTER.
To set a bandwidth rule on the BITS:
- Navigate to
Administrative Templates ->
Background Intelligent Transfer Service (BITS)
Limit the maximum network bandwidth for BITS background transfers
- Set it to
- Set the time range and maximum transfer rate
I have recently been setting up MSP Control (formerly WebsitePanel) on my new CFML Developer server. Unfortunately, it doesn’t support MariaDB out of the box and so won’t detect if you have it installed. Fortunately, this is an easy hack.
- Open up your MSPControl database in SSMS, and open the providers table.
- Now find the MySQL providerID that matches your MariaDB install
i.e. MySQL 5.7 for MariaDB 10.1
- Now add a new entry into the SERVICES table, using the providerID you got from the last step and the appropriate serverID for the server you want to add it to. You get he ServerID from the servers table, or just edit the server in the control panel and get it from the URL.
- Now just edit this server in MSP Control, and you should see MySQL listed, just edit and setup as you would MySQL.
- Now you just enable MySQL on your hosting plans.
Windows Phone has received a lot of bad publicity, and the main complaint you see from ignorant reviewers is that there is a lack of apps for windows Phones (WP). While there may be many legitimate reasons to not like WP, lack of apps is not one of them, there are currently over 500,000 apps in the WP store, and there were 300k even when I got my phone, so I would hardly call this a lack of apps. Sure there are some apps you may want that do not exist because most vendors do not bother with WP due to the small user base, but in most cases someone else has created a good alternative and I have found the quality of most WP apps to be high. I have only found a very small handful of apps I wanted which were not available at all or were so bad I could not use them, LastPass and Kayako are 2, both of which I needed and both of which are dire on Windows as the developers have put barely any effort into them and they lack the functionality of their Android counterparts.
The biggest cock up that Microsoft did make was not releasing Windows Phone 10 at the same time as Windows 10, and I think this killed it for them, aside from being too late to the phone party in general. And then they have taken forever to roll out the upgrade to Windows phone 8 users, and many phones will not even keep the upgrade as promised as their phones do not meet minimum memory requirements.
I have a Nokia Lumia 930, running WP 8.1, which I purchased after getting fed up with Android updates making my Galaxy note unusable, killing my battery life etc. It turns out I much preferred Windows Phone, it was faster, more responsive, more reliable, and I simply preferred the more grown up and business like UI. The requirements for WP are also a lot lower and thus the phones are lower spec and cheaper as a result. Certainly there were some areas of functionality lacking, and I got fed up waiting for WP10 to be released for my phone, and so I installed the insider preview instead. Sadly it has been riddled with bugs, with each update seeming to break something new, and then it seems the last update I did must have resulted in the battery being drained super fast, as it was only lasting half a day with no use whatsoever and suddenly became unusable.
At the time I thought it was a problem with the phone/battery itself, so decided to bite the bullet and get an upgrade from O2, and decided to try the much applauded Samsung Galaxy S7 edge (which I will be reviewing). While I like the look of the new Lumia 950 XL, my experience with WP10 insider preview has given me a bad impression that if I bought a new WP10 phone, I would have same issues, and as much as I like Windows Phone, unless Microsoft pulls a rabbit out of the hat, its days are certainly numbers, unless the rumored surface phone saves the day.
Now annoyingly after I got my new Galaxy S7, my son asked if he could have my Lumia 930, so I did a factory reset on it, and installed latest updates, and guess what, the battery is now fine GRRR!!
So I then decided to find out if WP10 was officially available yet, and it was, although this information was not made easily available by Microsoft, you have to install the upgrade adviser first to find out if your phone supports WP10, and then you have to enable the upgrade. So I would imagine that most WP8 users are never going to find this out. You can find upgrade instructions HERE.
So I now have an upgrade that I didn’t really need and I am tempted to just send it back and carry on using my Lumia. But I first decided to see if there was a way to make Android UI more like Windows Phone, so then maybe I could have UI I wanted, but keep the other advantages this phone offered, and it turns out there is a way.
A number of developers have created Windows Phone style launchers for Android that emulate the WP8 or WP10 UI and layout. The best one I have found so far is “Launcher 8 WP style” which has managed to emulate the WP tiles interface so perfectly that you think you have a Windows Phone. The only thing that seems to be lacking is live tiles, as I so far have not seen any of the tiles updating. Most of the others I have tried have not got it right, and just look like cheap knockoffs as they have no got the tiles right. This app also includes themes so you can change the look further.
So if you are a fan of the Windows Phone UI and tiles, but find the Windows Phones lacking and cannot give up your Android phone, give this a try instead.
This is a topic I have found myself explaining a lot over the years, not just to customers but to developers as well, and one thing I can say with absolutely certainly from dealing with hundreds of developers of all levels over the years, from newbs to gurus, is that most devs in general do not really understand how things work on the server (they know how to write code and upload it to the server) and most CF devs additionally don’t understand how ColdFusion really works and how/why it differs from other scripting languages like PHP or Perl or ASP.net, so I decided it was time to write a complete blog post on the subject and hopefully to try and enlighten some of those developers a bit more. I have copied this article across from my old blog as it was a popular article with a lot of views. I have removed all references to Railo (since it is now dead) and replaced with Lucee.
Now I have heard many say “I am just a developer, it is my job to write code, not to understand the server stuff”, but i’m afraid I disagree with this and consider it a bit of a cop out, because If you don’t understand how things work on the server to at least some degree, how can you be sure you are writing code that is going to be scalable, reliable and is not going to cause problems? Sure no-one should expect you to know EVERYTHING to the same level as a sysadmin, but you certainly should know the basics that are relevant to your job, especially if you are going to be making any hosting recommendations to your clients, which most devs do.
The first thing to understand, is that ColdFusion and Lucee are not technically application servers (which most people believe them to be), they are simply Java applications (that convert CFML into Java bytecode) that run inside a java servlet container (e.g. Apache tomcat, Jetty, Jboss) which runs as a service/daemon, and all requests for all pages coming into the server go through that same service/daemon. This means that any problems with that service affect ALL CFML (or JSP) websites on the server.
This is also a bad thing for security because it means that all sites on the server run within the security context of the service and so cannot have their own permissions. So any java code in any site can access files in site2, site3 or any other site on the server or in fact any part of the system that the service itself has access to. The only way round this is to use security sandboxes, which is a feature of ColdFusion enterprise and Lucee.
But BEWARE, CF sandboxes can give a false sense of security, they are only applied to CFML code and do not sandbox Java, so if you drop any Java code in your CFML pages (using CreateOnject(java), then you bypass the sandbox completely, so they not stop any vaguely competent coder/hacker. There is no way round this on a shared server, you simply have to take the risk. On a dedicated VPS you can mitigate this by using multiple instances of CF/Tomcat and isolating each site using server side permissions.
Before you say “so hosts shouldn’t allow Java”, this also is not even an option for any host as all moden frameworks and apps need createObject(java), so disabling this function would break almost every modern application, ergo it is a risk that has to be taken, because at the end of the day 99% of clients simply don’t care about the security risks, all they see is that their app doesn’t work and will just go elsewhere.
When we look at other common languages such as PHP, Perl, asp.net etc, these run as an ISAPI or CGI process, so every website on the server spawns its own process to handle the requests. So if there are 20 PHP sites then there are 20 x PHP processes running (think of this like 20 instances of ColdFusion). The process runs within the security context of the website that spawned it, so in the case of Windows it runs under the application pool identity. So this means that as long as you have every website/application pool set to run under a different user account with access only to that website root, and so will php also have only this permissions, so it is more secure and also isolates each site in a separate process.
So if site1 crashes php or ASP, it will have no effect on any other site because they are running php/ASP in a separate process.
Here is a diagram to illustrate.
This is the primary reason why CFML is not suited to shared hosting, no application isolation and no control over security.
Imagine the following (very common) scenario.
abc.com makes a cfhttp request to an external web service at xyz.com to get syndicated content for its pages.
The web service at xyz.com goes down, which means all the pages on abc.com are now going to timeout. On a shared server this will very quickly result in all the ColdFusion max number of simultaneous requests to be consumed, and subsequent requests to then become queued. The result of this is that every other CFML site on the server now becomes slow as well as all their page requests have become queued behind the problematic site, and now are likely to also timeout as a result.
An even worse scenario is where native java requests are concerned, such as database queries as these cannot be killed automatically, not even with FusionReactor. If a page hangs in the middle of a database query because it is waiting for a response back from the db server, then this request will not ever timeout and will hang indefinitely, thus 1 cf thread is now no longer available. If this happens 10 times, now 10 cf threads are gone and no longer available, if your “max number of simultaneous requests” is set to 10, then you now have 0 requests left and your server will stop serving up CFML and all websites will now hang/timeout untill the service is restarted.
If the original problem still exists then restarting CF also will not help, as the issue will simply continue until all the requests are again used up and all sites start to hang. The only solution at this point is to turn off the site causing the problem.
Then we have the security issues that I mentioned. Everyone by now is aware of the CFIDE hack which affected many cf servers. This was only possible because CF runs as service and because that service runs under the SYSTEM account by default, which has full file system access, which allowed the uploaded hack to access every part of the server. If CF worked like a CGI/ISAPI application, the effect of this hack would have been far less.
But my code has proper error trapping and caching and stuff, so this doesn’t affect me right ?
Wrong i’m afraid, on a shared server it doesn’t matter how brilliant your code is, or how well your have performance tested it, or how much error trapping you have, this does not stop the other sites on the server from causing you problems.
You could be lucky on a shared host for months or even years if you are on a server that doesn’t have many sites, or simple sites that are not problematic (at the moment), but It only takes one poorly written app to bring CF to its knees.
It is also important to realize that almost nobody using shared hosting has ever done any kind of load testing or performance testing on their website and in most cases do not even know what this means or how to do it, the result of this is that web site owners have no idea how their site will perform under load nor did the developer who made it. This results in another very common scenario which usually begins with a statement like “Nothing has changed on my site and it has been running fine for years, so it must be your server”.
Again this is totally irrelevant in most cases, sure your site may well have run fine for years with 20-50 visitors per day, but what happens when it suddenly gets 1000 visitors per day as a result of some marketing or media attention, or if it starts getting hit by search engine bots, suddenly this once stable site falls over horribly due to poorly written or legacy code.
But Railo/Lucee is better right ?
Ultimately no i’m afraid, as they run on Java so work the same way as CF so the primary issues mentioned above apply just the same.
Lucee is however an improvement in that the security sandboxing is automatically applied at website context root level (if you set this in your Lucee server admin) and does not require admins to set up sandboxes for each site as with ColdFusion which is a sandboxing nightmare, which makes Lucee better for shared hosting. However the sandboxes like ColdFusion’s only sandbox CFML and can easily be overridden with Java code.
Lucee also has its per site web admin allowing all users to admin their own site, which is again a bit improvement over ColdFusion which has a single Admin which must be administered by the host.
So by using Lucee you don’t have to rely on your host, you can pretty much do everything yourself.
So what’s the solution ?
The only solution is to do some research, educate yourself and use a bit of common sense.
ColdFusion is intended to be an enterprise solution, and thus run on dedicated hosting solutions, it was never intended to be used for shared hosting and is not built to do this. So the simple answer is, use the right tool for the job.
If you just want to run a blog, personal website or simple brochure ware website and you don’t have your own server and only have the budget for shared hosting but do not want to be affected by the above problems, then use a technology more suited to this purpose, one that runs as a CGI/ISAPI process, the most popular of course being PHP or ASP.net . Avoid any Java related choices as these will all suffer from the same issues.
If you love CFML and want to use it for everything you do, then do yourself a favour and get a VPS running Lucee (or ColdFusion if you can afford it).
On your own VPS you then also have the option to use multiple CF instances, so each of your sites runs on a dedicated instance of Tomcat or whatever is your java servlet container of choice, so you can still run multiple sites but avoid the shared hosting scenario and also lock down the security.
I am going to use shared hosting anyway regardless, what do you suggest ?
If you really have no choice (or simply won’t take good advice), then here are some tips on choosing a host.
- Choose a host that specializes in Lucee or ColdFusion and actually knows what they are doing, do not choose a generic host that simply has Lucee/CF installed and classes this as SUPPORTED.
- Test your hosts knowledge, see how much they know about CF/Lucee, ask to speak to a CF specialist.
- Make sure your host is secure
- For ColdFusion they should be using enterprise edition, otherwise no sandboxes, and no security. If they are running standard edition, avoid.
- Ask them if they run a bog standard out of the box CF installation, if yes then it is not locked down and is not secure.
- Ask them if they use FusionReactor or HackMyCF. Preferably go with someone who says yes.
- Ask them if they use security sandboxes, if no then avoid.
- Ask your host how many sites they run on each CF server. Too many = bad
- If you regularly need to set up data sources, mappings or anything that requires access to the CF Admin, you would be better of with Lucee.
- Ask if you can get RDS access, if they say yes then avoid, as this should not be enabled in production
- Check if you can access the cfadmin or adminapi from your site, is yes, change host now as they are not secure.
Unfortunately there are very few noteworthy CF hosts these days, the ones I see most commonly recommended are Viviotech, Hostek, HostMySite (although not so much since they got taken over by hosting.com), Host Partners (my company)
I got a new shiny Fire TV today, plugged it in, went to play some video and got “License_Error” on every single video, that was just great!!!
I noticed that all the prices were showing in $USD, but as I am in the UK this gave me a clue that the Fire TV thought I was in the wrong country, which I was sure was the cause of the license error. Sadly google did not furnish any answers for me today, so I started fishing around in my google account and found my country settings, you can find this under
Your Account -> Your apps and Devices -> Your Devices
Select your device, then click the action button and choose to manage that device and content.
And then look under the settings tab, and make sure your country is set correctly. You will possibly need to do this via the .com site as well.
Sadly this did not solve the problem for me, and I had to get on the phone to amazon support to solve the rest of the puzzle.
It turns out that my amazon account was actually registered to amazon.com and not amazon.co.uk, which I presume is because many many years ago I originally registered on amazon.com when there was no amazon.co.uk. As a result my fire TV had also been linked to amazon.com, thus why my prices were in $USD and why I was getting the error.
So the solution to this is that I had to transfer my account to amazon.co.uk, which is made more confusing by the terminology they use, as it is my Kindle Account I had to transfer even though I do not own a kindle, so it is not likely I would have ever figured that one out by myself. You can find instructions on how to do that HERE.
The final Step was that I had to factory reset my Fire TV and re-register it, after I did this everything was hunky dory and I was able to streak videos. This can be found under Settings -> System -> Factory reset.
Hopefully this will help anyone else googling this issue.