Feb 242014
 

My ideea was to set up a script running on Google’s servers that would automatically get files from my site and back them up on Google Drive. I would have gotten a free off-site backup. Unsurprisingly, it’s not working due to limits imposed by Google, even though I did manage to cheat on the 10MB limit for UrlFetchApp and file creation. Instead it now fails either because it’s execution takes too long, or because it tries to write to Drive too many times in a short period.

Some basics first.

What is Google Apps Script? JavaScript based, it can be used to make Google’s cloud do stuff for you. Basically web apps can be written that run on Google’s servers and use Google products like Maps or Calendar.

What is Google Drive? (Really?) It’s a site where people can store files. 15GB for free. Like Dropbox.

There are limits though and they are set pretty low. Understandable, as it would be easy to abuse otherwise. Like, for example, the maximum size that can be fetched from an URL is 10MB. The maximum size of a file that is created via scripting is also 10MB. Not really useful for backups.

Right. On to the actual script and why it (still) doesn’t work.
Continue reading »

Dec 302013
 

When trying to upgrade an official module, puppet complains that it can’t find it on the forge. It might actually be that it doesn’t recognize the SSL certificate as being valid. When trying to install a module from forge.puppetlabs.com, it returns the proper error, complaining that the certificate is invalid:

Apparently https is a jerk, so, other than the obvious, a solution is to use http instead of https for the repository:

On FreeBSD it might be that /etc/ssl/cert.pem isn’t symlinked to /usr/local/share/certs/ca-root-nss.crt, where the ca_root_nss package installs.

Apr 022013
 

How to redirect something like “www.example.orgto “www.example.com“, or “longer.subdomain.example.org” to “longer.subdomain.example.com” with a rewrite rule in nginx.conf:

Continue reading »

Sep 212012
 

The time zone settings in Windows are kept in registry, in two places. One has a list of all available time zones and their settings and the other has the currently set time zone. When the zone changes Windows copies the proper settings from the list to the current settings key.
The list of time zones is kept under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
The current zone is set in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

So, here are a few ways of doing that.
Continue reading »

Feb 212012
 

FSMO roles are tasks that domain controllers have to do in an Active Directory environment, they control the proper operation of the network. Each role can be held by only one server. These are ways to check who currently holds different FSMO roles and transfer them from one server to another, taken from various KB articles, condensed here for future reference, as well as a short explanation of what those roles are.

FSMO description
View role holders
– command line
– GUI
– script
Change roles
– command line
– GUI
Continue reading »

Jan 112012
 

A very basic .bat that archives a bunch of files using 7zip in a different package each day of the week (i.e. bak_1.7zip to bak_7.7zip), then copies the archive to a different machine in a shared folder and fires off an email with the result. Effectively a week’s worth of full backups. This is NOT real backup.
Continue reading »