Posted by & filed under Office 2013.

By default, PowerPoint 2013 starts slideshows in Presenter View when connected to dual monitors. For many, this is an unexpected and un-welcomed change that complicates things in multi-user situations.

When searching online, many sites list how to disable this as an end user, but when you utilize DeepFreeze or similar tools in a domain environment, this isn’t going to help if your profiles are built on-demand.

My work-around was to find the registry key responsible and change it on the fly via a simple batch file dropped into the All Users startup folder (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup in Windows 7).


@echo off
reg add HKCU\Software\Microsoft\Office\15.0\PowerPoint\Options /v UseMonMgr /t REG_DWORD /d 0 /f

Hope this helps others!

– Tim

Posted by & filed under Linux, Software.

SSHd is one of the most versatile applications I use in my day. Whether I’m looking for a quick commandline to a remote machine or tunneling traffic from a public network, SSH or Putty are almost always open in some fashion on my systems.

To facilitate easier logins and make use of scripts such as my BASH backup script without passwords, I generate SSH keys and copy them to the remote system. This can be done in two commands, however with the copy command, I often forget the format for non-standard ports.

To generate the key on the client system:
ssh-keygen -t rsa

With default values, this will place id_rsa and id_rsa.pub in your ~/.ssh/ folder.

To copy your new key to the remote system:
ssh-copy-id '-p 12345 user@remotehost.com'

That’s it! You should now be able to login just by typing:
ssh user@remotehost.com -p 12345

Posted by & filed under Admin Notices.

I’ve migrated the old site from the virtual machine to a hosted provider. I will write a how-to later. Basically all you need to do is upload the files, build the database, dump in a copy of the existing database, edit the config file and if any urls changed, edit the options table in the database with the new URL.

– Tim

Posted by & filed under VirtualBox, VMWare.

Hello World!

After well over a year of tips.timscomputer.com being offline, I decided I wanted to migrate it and a few other old web projects over to one of my hosted accounts. Problem — These sites lived on a virtual machine and I’m no longer running VMWare Server and have since had multiple OS reinstallations and a HDD upgrade.

From Linux I mounted my old harddrives, located the directory with the .vmdk and made a copy to experiment with. Turns out, it’s way easier to make this happen than you’d think.

  1. Install VirtualBox (if not already done) and start application
  2. Click the “New” button
  3. Tell VirtualBox the type of OS, allocate RAM, etc
  4. When prompted to create a new hard disk drive, load your existing .vmdk file
  5. Edit the network adapter settings to be Bridged instead of NAT (and clone your MAC if required)
  6. Start your virtual machine! You’re done!

Posted by & filed under Software, Windows, XP.

Over the years I’ve used all sorts of various scripts to automate mundane processes and backup procedures. Today I’m sharing a simple .bat file that xcopy’s 2 folders to a backup location. This script can easily be added to the windows scheduler to run at desired intervals.

@echo off
cls
set staffbackup=e:\NAS-BACKUP\staff
set groupbackup=e:\NAS-BACKUP\groups
 
set stafffiles=F:\NAS-BACKUP-WITH-ACL\staff
set groupfiles=F:\Aug22-NAS-BACKUP\groups
 
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
 
echo ### Starting Staff Backup Process
echo #
echo # Backing up %stafffiles% to %staffbackup%...
echo #
 
%backupcmd% "%stafffiles%" "%staffbackup%"
 
echo #
echo ### Staff Backup Process Completed!
echo #
 
echo ### Starting Groups Backup Process
echo #
echo # Backing up %groupfiles% to %groupbackup%...
echo #
 
%backupcmd% "%groupfiles%" "%groupbackup%"
 
echo #
echo ### Group Backup Process Completed!
echo #
 
echo #
echo #
echo ###############################################################
 
@pause

Nothing groundshattering, but definitely helps.

Posted by & filed under Hardware.

1. Enter BIOS setup using usual password.

2. Navigate to Power settings menu.

3. Adjust APM Configuration to include boot from PCIE devices

4. Hit F10 to save (may have to toggle f-lock key on MS keyboards)

5. Boot back up, login and press windows key + pause/break key to enter System Properties.

7. Navigate to the device manager (hardware tab) and select the properties on the Atheros network adapters and select the Advanced tab.

8. There are 2 settings here we need to adjust:
• Shutdown/Wakeup = ON
• WakeUp Capabilities = Magic Packet

9. Save all menus and exit out. Wait a moment while the network adapter re-enables itself and reboot the computer.

Posted by & filed under Google, Wordpress.

After spending at least 20 minutes pulling my hair out today, I stumbled across some cryptic post that made a whole lot of sense.

When setting up wordpress to accept posts via a google apps email address (or any gmail address I would assume), you enter the host as ssl://pop.gmail.com instead of just pop.gmail.com.

Funny what a little change like that will do to your sanity.

Posted by & filed under ReadyNAS.

After a major power outage here in Southern Ontario, our ReadyNAS 1100 and our active directory system stopped talking to each other. Before making any configuration changes, I wanted to create a backup of all data just incase things got worse.

I started by plugging an external USB drive into the front of the ReadyNAS and initiating a backup of volume C to the USB drive. 2.5 hours later and it was still “In Progress” with no log files indicating just how far into the process it was. Sick of waiting, I decided to map the staff, student and group shares and do an xcopy to a large drive on my desktop. It was actually very easy and uses one of my favorite command line tricks : net use. Remember, you’re using the ReadyNAS local admin account, NOT an AD account.

  1. Start -> Run ->
    cmd
  2. net use Z: \\orillianas\students /USER:admin   
    • (enter password when prompted)
    • confirm files are there by running
      explorer z:
  3. xcopy /s /c /d /e /h /i /r /k /y z:\ f:\nas\students

IF you want to retain the ACLs, add /o to the above command!

You should get verbose output in your command window showing the progress. Once it returns to the command prompt, you’re done and can exit.

Posted by & filed under Software.

Building some new PCs at work, there are a few annoyances that I’m removing before imaging. Here’s the first one; how to disable the via hdeck.exe welcome message popup.

  • Open \Program Files\VIA\VIAudioi\HDeck.ini
  • Find the bShowWelcomeMsg=1 line and change it to bShowWelcomeMsg=0
  • Save and close the file

No more annoying popups when you reboot!

Posted by & filed under Hardware, Linux.

Recently I embarked on a cleaning spree prompted by full capacity on my filedrive (where all my digital media lives). After shuffling files all around the system, deleting old OS files that were no longer needed, etc, I had 3x 100gb partitions with just a little bit of stuff in each. What I wanted was 1 big partition. I copied everything from partition 2 & 3 to partition 1 and did the following:

(all commands run as root user)

  1. umounted the drive:
    umount /dev/sda1; umount /dev/sda2; umount /dev/sda3
  2. started gparted:
    gparted
    • deleted partitions sda2 and sda3
    • quit gparted
  3. checked the filesystem:
    fsck /dev/sda1
  4. converted filesystem to ext2 (ext3 cannot be resized):
    tune2fs -O ^has_journal /dev/sda1
  5. started gparted again:
    gparted
    • resized /dev/sda1 by dragging the graphical representation to the end of the drive
    • applied settings
    • quit gparted
  6. converted back to ext3:
    tune2fs -j /dev/sda1
  7. re-checked filesystem:
    fsck /dev/sda1
  8. modified /etc/fstab to no longer include sda2 & sda3
  9. re-mounted filesystem:
    mount -a

That’s it!

Posted by & filed under FireFox.

As Firefox still is pretty vaguely suppored in an enterprise environment, it is handy to install AdBlockPlus for all users when setting up the Default User profile.

This post over in the AdBlockPlus FAQ describes the process a little more indepth, but the barebones of it is:

  1. Download & Extract current AdBlockPlus.xpi file to a directory.
  2. Copy extracted files to C:\Program Files\Mozilla Firefox\extensions\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}\
  3. Edit adblockplus.js in the defaults/preferences subfolders to your liking
    • extensions.adblockplus.currentversion = “1.0”
    • extensions.adblockplus.patternsfile = “/tsc/adblockplus/patterns.ini”
  4. Ensure you have writeaccess and everyone has read access.
  5. Load Firefox and set your subscription.

Posted by & filed under Anti-Virus, LU Software.

At work I have to install NOD32 in conjunction with DeepFreeze. One annoying thing about this, is the orange icon and annoying messages telling the user they should update the computer.

Turns out, it’s super easy to turn off this feature. Just go turn on the advanced settings tree and navigate to Tools > System Update and select No Updates in the notify me box.

eav_updates

Posted by & filed under Linux.

Update – May 2013:
I’ve received a few emails asking how to prevent this script from continuously eating up disk space… Rather than re-invent the wheel, I just use built in Linux commands in my root crontab that run once a day:

0 4 * * * find /home/tim/backups/ -mtime +10 -exec rm {} \;

In this example I’m searching /home/tim/backups/ for files more than 10 days old and deleting them at 4am everyday.


Faced with an ever-so-common task of creating backup versions of my webfolders and mysql server, I set out last night to create a simple bash script to be triggered from either the commandline or cron scheduler.

What originally was just going to be a quick script with my usual commands, quickly evolved into well over 200 lines of bash script including options to run specific tasks as standalone jobs and easy configuration changes through simple variable assignments at the top of the file. You even have notifications via email with a ‘slim’ report or by sending the output to a text file.

I’ve tested this on multiple servers with no problems. If this helps you, please let me know!

Here’s a closer look at it: backup

#!/bin/bash
function header {
clear
echo "##########################################################################"
echo "# Tims Backup Script - August 2009                                       #"
echo "# (backup web folders and mysql databases to local and remote locations) #"
echo "##########################################################################"
echo
}

## Define Variables

# local folders and filenames
backupdir="/backups/"          # include trailing slash!
basedir="/home/tim/www/tim/"   # include trailing slash!
webfile="$(date +%Y%m%d)-webdirs.tgz"

# MySQL variables (create a backup account)
sqlfile="$(date +%Y%m%d)-sqldump.tgz"
sqlhost="localhost"
sqluser="backup"
sqlpass="password"

# SSH variables (assumes you have already paired ssh key with remote host)
scphost="192.168.4.105"
scpuser="tim"
scpremotepath="/home/$scpuser/backups/"

# Mail  (requires /usr/bin/mail (mailutils package))
notify="backupscript@timscomputer.com"
tmpmailfile="/tmp/notifymsg.txt" # use this if you want to send stdout as email
finalmsgfile="./backupemail.txt" # use this for slim emails

######################################################################
###     USERS SHOULD NOT HAVE TO EDIT BELOW HERE!                  ###
######################################################################

# Define functions
function usage {
	echo "	Usage: $0 [OPTIONS] [confirm]"
	echo 
	echo " STANDALONE OPTIONS:"
	echo 
	echo "  --listvars  : List configured variables"
	echo "  --checkdirs : Check for required directories"
	echo "  --dumpmysql : Only dump MySQL"
	echo "  --dumpweb   : Only dump web file"
	echo "  --scp       : Only SCP existing files and exit"
	echo "  --rsync     : Only rsync existing files and exit"
	echo
	echo " AUTOMATED OPTIONS:"
	echo "  [confirm] sends email to $notify on completion"
	echo
	echo "  --local       : Create & copy to $backupdir locally ($HOSTNAME)"
	echo "  --remote scp  : Create & transfer files to $scphost using scp"
	echo "  --remote rsync: Create & transfer files to $scphost using rsync"
	echo
	exit
	}

function checkdirs {
	echo
	echo "Checking for backupdir $backupdir :"
		if [ -d $backupdir ]; then
			echo " ...Backup directory found!"
			echo
		elif [ ! -d $backupdir ]
			then 
				echo " ...Your backup directory does not exist!"
				echo
				echo "You can try manually creating it."
				echo
				echo "I am now crashing to your command prompt."
				exit
		fi
	}

function web2local {
	echo "Backing up web directory (may require sudo password):"
	# create a tgz with permissions from basedir to backupdir
	sudo tar cpPzf $backupdir$webfile $basedir 
	echo " ...finished creating web backup" 
	echo 
	}
	
function dumpmysql {
	echo "Now performing MySQL dump on entire server."
	# dump mysql data to tgz in backup directory
	mysqldump -h $sqlhost --user="$sqluser" --password="$sqlpass" --all-databases | gzip > $backupdir$sqlfile
	echo " ...finished MySQL dump"
	echo
	}

function scpfiles {
	echo "Copying $backupdir$sqlfile to $scpuser@$scphost:$scpremotepath$sqlfile"
	scp $backupdir$sqlfile $scpuser@$scphost:$scpremotepath$sqlfile
	echo "Copying $backupdir$webfile to $scpuser@$scphost:$scpremotepath$sqlfile"
	scp $backupdir$webfile $scpuser@$scphost:$scpremotepath$webfile
	}
	
function rsyncfiles {
	echo "Copying $backupdir$sqlfile to $scpuser@$scphost:$scpremotepath$sqlfile"
	rsync -av $backupdir$sqlfile $scpuser@$scphost:$scpremotepath
	echo "Copying $backupdir$webfile to $scpuser@$scphost:$scpremotepath$sqlfile"
	rsync -av $backupdir$webfile $scpuser@$scphost:$scpremotepath
	}	

function tasktimer {
	endtime="$(date +%s)"
	elapsedtime="$(expr $endtime - $starttime)"
	elapsedminutes=$(($elapsedtime/60))
	elapsedseconds=$(($elapsedtime%60))
	echo
		if [ "$elapsedtime" -lt "60" ]; then
			echo "    Total elapsed time = $elapsedtime seconds"
		else
			echo "Total elapsed time = $elapsedminutes min $elapsedseconds secs"
		fi
	echo
	}

function finalstats {
	webfilesize="$(stat -c%s "$backupdir$webfile")"
	webfilesizemb="$(expr $webfilesize / 1024 / 1024)"
	sqlfilesize="$(stat -c%s "$backupdir$sqlfile")"
	sqlfilesizemb="$(expr $sqlfilesize / 1024 / 1024)"
	echo
	echo "Final Results:"
	echo " $backupdir$webfile = $webfilesize bytes ($webfilesizemb MB)"
	echo " $backupdir$sqlfile = $sqlfilesize bytes ($sqlfilesizemb MB)"
		if [ "$backuptype" != "Local" ]; then
			echo
			echo "Transferred to $webfile and $sqlfile to $scphost using $backuptype"
		fi
	tasktimer
	}

function mailresults {
	SUBJECT="Backup Results for $UID on $HOSTNAME"
	TO="$notify"
	finalstatsmsg=$(finalstats)

	echo "$backuptype backup has been completed!" > $finalmsgfile
	echo "$finalstatsmsg" >> $finalmsgfile
	echo "Attempting to send mail to $notify"
#	if [ "$3" == "slim" ]; then
		/usr/bin/mail -s "$SUBJECT" -t "$TO" < $finalmsgfile
		rm $finalmsgfile
#	elif [ "$3" != "slim" ]; then
#		/usr/bin/mail -s "$SUBJECT" -t "$TO" < $tmpmailfile
#		rm $tmpmailfile
		echo " ...sent!"
#	fi
}


###  The goods.

starttime="$(date +%s)"
header

	if [ -z "$1" ]; then
		usage
		exit

	elif [ "$1" == "--help" ]; then
		usage
		exit

	elif [ "$1" == "--listvars" ]; then
		echo "Defined Variables:"
		echo
		echo "  Root Web Directory      : $basedir"
		echo "  Backup Directory        : $backupdir"
		echo "  Web Archive File        : $backupdir$webfile"
		echo "  MySQL Archive File      : $backupdir$sqlfile"
		echo
		echo "  MySQL Host              : $sqlhost"
		echo "  MySQL User              : $sqluser"
		echo "  MySQL Pass              : $sqlpass"
		echo
		echo "  SCP / Rsync Host        : $scphost"
		echo "  SCP / Rsync User        : $scpuser"
		echo "  SCP / Rsync Remote Path : $scpremotepath"
		echo
		echo "  Notification E-Mail     : $notify"
		echo
				
	elif [ "$1" == "--checkdirs" ]; then
		echo "** SINGLE TASK MODE **"
		checkdirs
		tasktimer
		echo "** TASK COMPLETED **"
		
	elif [ "$1" == "--dumpmysql" ]; then
		echo "** SINGLE TASK MODE **"
		dumpmysql
		tasktimer
		echo "** TASK COMPLETED **"
		
	elif [ "$1" == "--dumpweb" ]; then
		echo "** SINGLE TASK MODE **"
		web2local
		tasktimer
		echo "** TASK COMPLETED **"
		
	elif [ "$1" == "--scp" ]; then
		echo "** SINGLE TASK MODE **"
		scpfiles
		tasktimer
		echo "** TASK COMPLETED **"
		
	elif [ "$1" == "--rsync" ]; then
		echo "** SINGLE TASK MODE **"
		rsyncfiles
		tasktimer
		echo "** TASK COMPLETED **"
			
	elif [ "$1" == "--local" ]; then
		backuptype="Local"
		echo "** BEGINNING LOCAL BACKUP SEQUENCE **"
		echo
		checkdirs
		web2local
		dumpmysql
		echo "** LOCAL BACKUP SEQUENCE COMPLETE **"
		finalstats
			if [ "$2" == "confirm" ]; then
				mailresults
			fi
	
	elif [ "$1" == "--remote" ]; then
		if [ -z "$2" ]; then
			usage
			exit

		elif [ "$2" == "scp" ]; then
			backuptype="Remote SCP"
			echo "** BEGINNING REMOTE SCP BACKUP SEQUENCE **"
			checkdirs
			web2local
			dumpmysql
			scpfiles
			echo 
			echo "** SCP BACKUP COMPLETED **"
			echo
			finalstats
				if [ "$3" == "confirm" ]; then
					mailresults
				fi
			echo
			
		elif [ "$2" == "rsync" ]; then
			backuptype="Remote RSYNC"
			echo "** BEGINNING REMOTE RSYNC BACKUP SEQUENCE **"
			checkdirs
			web2local
			dumpmysql
			rsyncfiles
			echo
			echo "** RSYNC BACKUP COMPLETED **"
			echo
			finalstats
				if [ "$3" == "confirm" ]; then
					mailresults
				fi
			echo
		else 
			usage
			exit
		fi
	else
		usage
		exit
	fi
echo
exit

Posted by & filed under asterisk.

Frustrated with errors trying to upgrade my aging Trixbox CE installation, I decided to build a new virtual machine and take PBX in a Flash for a testrun. Now I’d tried PBXIAF in the past, but I was turned off by the (lets face it) juvenile look. (I’ve also tried Elastix, and was not overly impressed with that either, but to be fair though, I never did give either distributions much of a chance).

After a few small hurdles to configure my new PBXIAF system (maybe I’ll write about these later) to respond the way I was accustomed with my trix installation, I decided I wanted to add my work phones and a few other things to some applications and ring groups. In the past I had done this by editing one of the extensions.conf files, but in the new version of FreePBX, you can enter a “custom extension”. Turns out it’s super easy to use a PSTN number, all you need to do is assign a DN and name, and enter the following entry in the dial field:

Local/5551212@from-internal


(This is assuming you’re still using from-internal as your default context!!)

Posted by & filed under Linux, VMWare.

When you upgrade the kernel on a linux based host, you have to do a reboot for the system to actually start utilizing the new kernel. One thing you’ll notice, is that when you restart, your virtual machines, including the webaccess are unavailable and stopped responding. What do you do? Panic!!(?) No. You simply have to run a very easy command (the vmware config perl script) and follow the prompts. When in doubt, just hit enter all the way through.

sudo vmware-config.pl

Within a few minutes, your servers should be back up.

Posted by & filed under LU Software, Software.

At work we’re changing our anti-virus protection over from the McAffee VSE 8.5i with EPO framework out and moving to ESET’s nod32. While the majority of machines are fine if you just remove the program using add/remove programs, then follow up with the McAffeeCleanupTool.exe, although many machines (especially Vista based) are having difficulty removing the EPO client.

The manual removal instructions as found in McAffee KB article #55208 are as follows:

Full manual removal procedure for CMA 3.6.x

CAUTION: This article contains information about opening or modifying the registry.

* The following information is intended for System Administrators. Registry modifications are irreversible and could cause system failure if done incorrectly.
* Before proceeding, McAfee strongly recommends backing up your registry and understanding the restore process. For more information, see: http://support.microsoft.com/kb/256986
* Do not run a .REG file that is not confirmed to be a genuine registry import file.

Step 1 – Disable the McAfee Framework Service via the Windows registry

1. Click Start, Run, type regedit and click OK.
2. Navigate to and select the following key:

[HKLM\SYSTEM\CurrentControlSet\Services\McAfeeFramework]

3. In the right pane, double-click the Start string and change the Value data to 4.
4. Restart the system.

Step 2 – End all running CMA processes:

1. Click Start, run, type taskmgr, and click OK.
2. Click the Processes tab.
3. Select each of the processes below and click End Process. Click Yes when prompted to confirm:

* McTray.exe
* UpdaterUI.exe
* naPrdMgr.exe

4. Close the Task Manager.

Step 3 – Registry edits:

1. Click Start, Run, type regedit, and click OK.
2. Navigate to and expand the following key:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services]

3. Right-click the McAfeeFramework sub-key and select Delete.
4. Delete any entries for the McAfeeFramework sub-key under each of the following registry keys:

* [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services]
* [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services]
* [HKEY_LOCAL_MACHINE\SYSTEM\ControlSetXXX\Services]

5. Navigate to and select the following registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\Shared Components\Framework]

6. Make note of the Installed Path and the Data Path values.
7. In Windows Explorer, delete the folders mentioned in the above registry values.
8. Navigate to and expand the following key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\Shared Components]

9. Right-click the Framework sub-key and select Delete.
10. Navigate to the following key:

[HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\McTray]

11. Right-click the McTray key and select Delete.
12. Restart the system.

Posted by & filed under Linux, Open Atrium.

If you haven’t checked out Open Atrium yet, you really should. Dubbed as an opensource “out of the box intranet”, it is a very polished and slick looking fork custom installation of Drupal designed to assist in establishing efficient collaboration within working groups, and most importantly as an important building block towards your own customized intranet system.

Because Atrium is still in its infancy stages, there are some bugs and growing pains. I hit a few during installation, but managed to get everything up and running after exploring some of the files causing errors. My installation is on a virtualized Ubuntu server 9.04 machine running apache2 and PHP 5.2.6 (hosted on VMServer 2). This has also been an ongoing issue over at the OpenAtrium Github issue tracker. (See http://github.com/developmentseed/Atrium/issues#issue/110)

Now on to the good stuff.

The first thing you need to do is setup the install as you would for drupal (download the tgz, untar, setup a database & user, change permissions on sites/default and sites/default/settings.php). Right away I got an error. Know why? I mv’d default.settings.php instead of cp’ing it to settings.php. First error squashed!

Next I editted settings.php and set my basedir since I’ve got Atrium installed in a subdirectory.

Then I got this error when running the install.php script: Fatal error: Call to undefined function date_make_date() in profiles/atrium_installer/atrium_installer.profile on line 233

Looking at ./atrium/profiles/atrium_installer/atrium_installer.profile, I saw that the error comes from the $date = line, but really all it looked like it was doing to me, was automatically set the timezone offset based on the timezone name, so I changed mine to the following, hardsetting the date_default_timezone_name and date_default_timezone_offset

// Set time zone
variable_set('date_default_timezone_name', 'America/Toronto');

// Calculate time zone offset from time zone name and set the default timezone offset accordingly.
// You dont need to change the next two lines if you change the default time zone above.
//$date = date_make_date('now', variable_get('date_default_timezone_name', 'US/Eastern'));
variable_set('date_default_timezone', '-4');

And then everything installed correctly!