-
How to use a Windows .bat file to delete files on a schedule
This is how you delete files of a certain age using a scheduled task to execute a .bat file. These instructions mainly apply to Windows Server 2012 R2, but they are applicable to most newer (and older) versions of Windows. This is similar to the post I made many years ago but with some additions mainly around the commands you need to find files that are older than a certain date and then deleting them. It also focuses on Server 2012 R2 versus the older 2008.
The first thing we want to do is create the batch file that we will use to delete the files older than X days. To do this we will need to use the forfiles command in Windows. This is a very handy command for batch files IMO. Here is a run down of the forfiles command and how to use it:
Read the rest of this entry » -
ASP.net 4.6.2 application failing to build
Our Hudson build server was throwing the following warning and then failing to build our code:
warning MSB3644: The reference assemblies for framework “.NETFramework,Version=v4.5.2” were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed.
Fixing this problem was very simple and just required us installing the following:
Read the rest of this entry » -
Reverse Proxy from IIS Website to WordPress
Our client has a corporate site at www.domain.com hosted on IIS and the blog hosted on a subdomain on a separate LAMP server at blog.domain.com. Our client feels serving their blog up under www.domain.com/blog will help their SEO and they will rank better (this is debateable but what client wants is what they will get).
The objective of this project is to serve a wordpress site on a linux server under a subdirectory on IIS. In order to accomplish this we need to setup IIS to act as a reverse proxy, thus serving the the wordpress site under the desired blog subdirectory.
The first step is to make sure your version of IIS is compatible (IIS 7+). Once you have determined this, you will need to install the Application Request Routing Module. The easiest way to go about installing these is using the
Read the rest of this entry » -
Remote Desktop MAC and wrong keyboard
Recently I upgraded to the remote desktop app from microsoft that is available in the app store. Previously I was using the 2.1.1 version which worked quite well but felt like changing anyway. Upon switching I noticed that some of my keys were not working as they should, in particular the @ key was coming up with ” and # was ? instead. In fact there were many keys that were not outputting correctly. It turns out that upon making a RDP connection from my MAC to a windows server, the RDP connection was incorrectly identifying my remote keyboard.
-
Simple Bash Automation for EC2 Instance Backups using Cron on a Mac Mini
The problem that needed to be solved was to have a simple backup system that could be used to maintain a bunch of EBS backed Windows instances on AWS. We wanted to keep a weeks worth of backups, always discarding the older AMI’s. A local mac mini was used to run the necessary scripts and cron. We didn’t want just EBS snapshots, we wanted a full AMI everyday. There are other solutions if you just want to backup an EBS drive on a schedule, and even for this but this one suits our needs.