Friday, January 7, 2011
RDP to Windows Server for Non-Administrator Users
To get around this open a command prompt and enter the following:
C:\> WMIC RDPermissions where "TerminalName='console'" call AddAccount "Remote Desktop Users", 2
Any user added to the Remote Desktop Users group on the server will now be able to start an RDP session.
Monday, October 4, 2010
Building a Recoverable Developer Computer
I wanted a developers computer that can easily be reimaged to a vanilla XP install at the completion of each project. My main reason for this is due to the fact that control systems software does not always play well with products from other vendors so it is best to start a new project with a fresh install.
The tool I ended up selecting to help with with this task was Parted Magic. This is basically a live cd Linux distribution that includes partitioning and cloning tools.
The computer I performed this setup on originally had one full size system partition with Windows XP installed. What I wanted was three partitions.
- C: “System”
- E: “Recovery”
- F: “Data”
My plan being to store the vanilla XP System image on the Recovery partition where it can be easily restored over the used System partition at the commencement of a new project. The Data partition is the same as is seen everywhere to keep important data separate from OS installations.
The steps I followed.
- Download the Parted Magic ISO and burn to a CD
- Boot into the Parted Magic environment from the live CD
- Use the GParted tool as described on the Parted Magic site to shrink my System partition
- Boot back into Windows XP and create the Recovery and Data Partitions. I made the Recovery partition identical in size to the System partition to avoid potential problems with imaging later
- Setup the XP system to a state that I want to be able to restore to later
- Boot into the Parted Magic environment
- Select System Tools –> Clonezilla
- device-image
- local_dev
- sda2 (Recovery)
- Expert
- saveparts
- I used the name “Vanilla-XP-img”
- sda1
- Agree to default options
- Increase the size of image file splits to something large to prevent splitting e.g 51200
- Agree to defaults and start
This leaves an image file on the recovery partition that can then be restored to the System partition to get back to a plain “Vanilla” XP install.
The steps to recover a partition from an image are nearly identical to the above, with the exception of selection restoreparts instead of saveparts.
Tuesday, September 21, 2010
P2PU: Drupal Introduction #1
I’ve started two drupal courses through P2PU and want to keep my work on each separated.
To achieve this I need:
- Two separate drupal folders
- Two separate drupal databases
- Two separate virtual sites for apache
I made the first site “drupalintro” in the same manner as outlined in my earlier post P2PU: Drupal Social Web Application #1 with the following changes.
- The drupal directory was named /var/www/drupalintro
- $ mysqladmin –u root –p create drupalintro
- mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON drupalintro.* TO ‘<drupaluser>’@’localhost’ IDENTIFIED BY ‘<drupalpass>’;
- mysql> FLUSH PRIVILEGES;
- mysql> \q
- $ vim /var/www/drupalintro/sites/default/settings.php
- edit: $db_url = ‘mysql://<drupaluser>:<drupalpass>@localhost/drupalintro’;
- $ cp /etc/apache2/sites-available/default /etc/apache2/sites-available/drupalintro
- $ vim /etc/apache2/sites-available/drupalintro
- edit: DocumentRoot /var/www/drupalintro
- edit: Directory /var/www/drupalintro
Now to make the second site called “openhippel” I did the same again with the following changes:
- The drupal directory was named /var/www/openhippel
- $ mysqladmin –u root –p create openhippel
- mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON openhippel.* TO ‘<drupaluser>’@’localhost’ IDENTIFIED BY ‘<drupalpass>’;
- mysql> FLUSH PRIVILEGES;
- mysql> \q
- $ vim /var/www/openhippel/sites/default/settings.php
- edit: $db_url = ‘mysql://<drupaluser>:<drupalpass>@localhost/openhippel;
- $ cp /etc/apache2/sites-available/default /etc/apache2/sites-available/openhippel
- $ vim /etc/apache2/sites-available/openhippel
- edit: DocumentRoot /var/www/openhippel
- edit: Directory /var/www/openhippel
Now to change between the two virtual sites I simply use the following (shown for selecting drupalintro)
- $ sudo a2dissite openhippel && sudo a2ensite drupalintro
- $ sudo /etc/init.d/apache2 reload
Then I can browse to my localhost address and see the home page for the desired site.
Saturday, September 18, 2010
P2PU: Drupal Social Web Application #2
Just finished the first Tokbox session for the Drupal Social Web course. Bit of a bumpy start with the first session starting half an hour late!
I’m starting by forking three repositories from GitHub that will be used for this project. The repositories as I understand them are:
- hippel_idea the features package
- hippel_kit which will contain drush makefiles
- hippelicious a hippel theme
It looks like the idea this week is to make sure we can fork these and edit them locally before commiting, pushing back to our own github forks and sending a pull request to the original repository.
At this stage I will consider it an added bonus if I can make these work in my drupal install…
Wednesday, September 15, 2010
P2PU: Drupal Social Web Application #1
I’ve enrolled in a P2PU course called Drupal Social Web Application. Over the next 6 weeks I’ll be learning how to use Drupal and git while working on development of the Open Hippel platform. Most of this stuff is pretty new to me so I’ll be in over my head. I’ll also be moving house at the same time, hopefully without too much of a no interwebs period. When it rains it pours!
I’ve been getting acquainted with Drupal this week and after some trials with the Ubuntu drupal6 package I’ve opted for the manual installation of Drupal as outlined in the Ubuntu Community Documentation. The manual installation allows me some more flexibility in terms of where I keep my files and which version I use when compared to a package install.
Here is a brief outline of the steps I followed on an Ubuntu Server 10.04 virtual machine.
- $ cd ~
- $ wget http://ftp.drupal.org/files/projects/drupal-6.19.tar.gz
- $ tar zxvf drupal-6.19.tar.gz
- $ sudo mkdir /var/www/drupal
- $ sudo mv drupal-6.19/* drupal-6.19/.htaccess /var/www/drupal
- $ sudo mkdir /var/www/drupal/sites/default/files
- $ sudo chown www-data:www-data /var/www/drupal/sites/default/files
- $ sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php
- $ sudo chown www-data:www-data /var/www/drupal/sites/default/settings.php
- $ mysqladmin –u root –p create drupal
- $ mysql –u root –p
- mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON drupal.* TO ‘<drupaluser>’@’localhost’ IDENTIFIED BY ‘<drupalpass>’;
- mysql> FLUSH PRIVILEGES;
- mysql> \q
- $ vim /var/www/drupal/sites/default/settings.php
- edit: $db_url = ‘mysql://<drupaluser>:<drupalpass>@localhost/drupal’;
- $ cp /etc/apache2/sites-available/default /etc/apache2/sites-available/drupal
- $ vim /etc/apache2/sites-available/drupal
- edit: DocumentRoot /var/www/drupal
- $ sudo a2dissite default && a2ensite drupal
- $ sudo /etc/init.d/apache2 reload
- From the host (or any machine on the same network) browse to “<server ip>/install.php” and follow the web based setup for Drupal
Tuesday, September 14, 2010
Mount a Windows Share in Ubuntu Server
It is really ease to access a windows share from the console of Ubuntu Server. The following steps were performed on Ubuntu Server 10.04 to access a share on a QNAP NAS with no username or password required.
- $sudo apt-get install smbfs
- $mkdir ~/temp
- $sudo mount.cifs //192.168.0.x/public ~/temp
Now it is possible to cd into temp and ls the contents of the public share.
Tuesday, August 31, 2010
Git and GitHub
I recently brought up version control systems at a circuit hacking evening at the Artifactory. Not surprisingly for a room of open source/linux type people almost everyone was in favour of using git. I was even pointed to a youtube video of Linus Torvalds on git which is not a tutorial on how to use git but does provide a good overview of why it might be better than other version control systems. I also found the video quite amusing due to Linus’ famously abrupt manner.
My concern with using git was that I am a windows user and didn’t expect it to work natively with windows. It doesn’t matter how many ways git is superior to other version control systems, if it doesn’t work well on windows it’s not for me.
Fearing that I would be wasting my time I tried out msysgit (git for windows) which includes such goodies as shell integration that allows for a gui or bash interface for managing repositories. It actually turned out to be quite good. The interface is not as nice as TortoiseSVN but the distributed version control nature of git more than makes up for that.
The only way to properly test something like this out is to use it on a real project so I started using git for version control of my BalanceBot project on my laptop.
I don’t like to have anything which is important to me stored in only one location so after checking out my options I started a GitHub account. It’s a safe place to push repositories to and it’s free as long as your projects are open source. There is also a neat Watch function that allows you to track other interesting repositories, kind of like social media for code.