http://blog.wekeroad.com/blog/source-control-and-continuous-integration-on-the-cheap
16 August 2011
Version Control on the Cheap
http://blog.wekeroad.com/blog/source-control-and-continuous-integration-on-the-cheap
Subversion Server and Visual Studio Integration
http://www.visualsvn.com
For continuous integration I use TeamCity which I've written about before here.
10 August 2011
Change the Registered Company in Visual Studio
Company name is stored in the registry under:
HKLM\Software\Microsoft\Windows
NT\CurrentVersion\RegisteredOrganization
or on 64bit machines:
HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization
Run cmd.exe as Admin then run regedit to edit it.
03 August 2011
Installing Ubuntu as a Web Server
After my attempts to quickly and easily create a linux based Mono enabled web host with OpenSuse and Debain I turned to Ubuntu server. I am installing it as a virtual machine (VM) on VirtualBox
Download
http://www.ubuntu.com/download/server/download
Create Virtual Machine
- Create VM hard disk:
C:\Program Files\Oracle\VirtualBox\VBoxManage.exe createhd --filename "F:\Virtual Machines\[Machine name].vmdk" --size 20480 --format VMDK --variant standard –remember - Create the VM in VirtualBox (see previous post)
- Mount the iso and add it and the hard disk to the VM
Install
- Start up the machine/VM and answer the questions when asked. FYI I answered:
- Primary network interface eht0 or 1
- Hostname (computer name)
- Disk partition, I used:
- Guided, use full disk
- User name (Administrator)
- Proxy (none)
- Install security updates automatically
- Package selection: none
Update
After logging in enter:
sudo aptitude update && sudo aptitude dist-upgrade
To get the latest updates and install them. Enter Y when prompted then reboot: sudo shutdown -r now
Install Apache
- Enter: sudo aptitude install apache2
- Edit the config to stop it displaying information about itself:
sudo vi /etc/apache2/apache2.conf
Change “ServerTokens Full” to “ServerTokens Prod” and “ServerSignature On” to “ServerSignature Off”
SSH
See previous post.
Apply Mono package for apache
https://help.ubuntu.com/community/ModMono
01 August 2011
Installing XenServer
I’ve been using VirtualBox on a Windows server host for sometime now but I want to be able to utilise the full power of my host for VMs and this is only really possible if you have what I call a ‘raw’ setup i.e. rather than having a full OS ‘under’ your VM you have a basic cut down OS whose only task is to run VMs. There are many options for this kind of solution but I’m going with XenServer for now as it has been recommended to me.
Installation
- Download the ISO from: http://www.citrix.com (go to XenServer/Download Now to get Free XenServer)
- Burn the ISO to disk: put a blank CD disk in the drive, double click the ISO in Windows and choose the drive.
- Put the disk in the drive and turn the system on.
- Answer the various questions, including which disk to install onto. I also installed the Linux supplemental pack and Verified the installation source
- Install XenCenter (the desktop client for XenServer):
- Browse to http://[ip of the XenServer host] and click on XenCenter installer.
- Once installed add the server.
- Request a key: Tools/License Manager
Installing a Supplemental Pack on a running host
It’s much easier to install supplemental packs at install but you may not have the them at installation so want to install them retrospectively:- Download them from http://www.citrix.com go to http://www.citrix.com XenServer, Downloads then login to go to the XenServer version and view downloads.
- Mount the network share:
- Edit hosts to give the source computer a name
vi /etc/hosts
i
[ip of computer] [name]
<ESC>:wq<Enter> - Create destination for mount:
mkdir /mnt/[share name] - Edit fstab to add line for the mount:
vi /etc/fstab
//[server name]/[share name] /mnt/[share destination name] cifs exec,credentials=/etc/cifspw 0 0 - Create a file with the windows credentials:
vi /etc/cifspw
i (to enter insert mode)
username=[domain or computer name]/[username]
password=[password]
<ESC>:wq<Enter> - Secure the file: chmod 600 /etc/cifspw
- Mount it: mount –a
NB if you get Permission denied try adding your computer name as a prefix to username eg:
username=[domain or computer name]/[username] - Check it worked:
ls /mnt/[share name] - Mount the iso and run:
mkdir /tmp/iso
mount -o loop /mnt/[share name]/XenServer-5.6.1-fp1-linux-cd.iso /tmp/iso - Run the install:
cd /tmp/iso
./install.sh - Clear up:
cd
umount /tmp/iso
rmdir /tmp/iso
Create a VM
Once installed and running you may need to download some isos to set up a VM. You can do this from the command line using:wget 'http://www.ubuntu.com/start-download?distro=server&bits=64&release=latest' –O [output filename]
Alternatively you can install across the network. e.g. select URL and enter a source e.g. http://ftp.uk.debian.org/debian/
Then using XenCenter setup a new VM.
- Install the XenServer Tools on the Guest
In Linux:
cd /mnt
ls
sudo mkdir xs-tools
sudo mount /dev/xvdd /mnt/xs-tools/
#mount: block device /dev/xvdd is write-protected, mounting read-only
cd /mnt/xs-tools/Linux/
bash install.sh
Auto Startup a Virtual Machine
- Get the UUID of the VM:
xe vm-list - Set it to autostart:
xe vm-param-set uuid=[UUID of VM] other-config:auto_poweron=true
Auto Shutdown
I wanted to shutdown the server daily to conserve energy. I found the answer on the Citrix forums here but in case that moves or gets deleted I include a summary here:- Find your Server name and VM names with:
xe vm-shutdown vm=<TAB><TAB>
xe host-shutdown host=<TAB><TAB> - Log in to the server via SSH
Create the script in vi:
vi /usr/local/etc/shutdownscript.sh
Enable insert mode: i - Type:
#!/bin/bash
xe vm-shutdown vm=VMNAME1
xe vm-shutdown vm=VMNAME2
xe host-disable host=HOSTNAME
xe host-shutdown host=HOSTNAME
End insert mode and write the script to disk with:
<ESC>:wq - Make it executable:
chmod 700 /usr/local/etc/shutdownscript.sh - Get cron to start at at 10pm:
crontab –e
Enable insert mode:
:i
Insert the following line:
* 22 * * * /usr/local/etc/shutdownscript.sh
End this edit and write back the crontab with:
<ESC>
:wq - Restart cron: