VirtualBox Shared Folders

Here is a quick tutorial on how to add a automounted VirtualBox shared folder to Ubuntu without modifying the fstab.

  1. Boot the VM
  2. Goto Devices -> Shared Folders in VirtualBox
  3. Select Path and select the folder you’d like to share, then check Make Permanent and Automount. Then Ok.
  4. In terminal, run the command: sudo adduser your_username vboxsf
  5. Restart the VM
  6. Now you can access the shared folder in /media (i.e. /media/sf_sharename)
  7. Make a sym link to access the folder more easily: ln -s /media/sf_sharename share

Exchange Powershell Calendar Permissions

This is a brief write-up on how to connect to exchange and change the permissions of calendars for a domain through powershell. This was tested with Office 365.

Make sure you are running powershell in administrator mode, and have enabled scripts to run. If you’re not sure you can run the command:

Get-ExecutionPolicy
# If the policy is set to restricted, run this command:
Set-ExecutionPolicy RemoteSigned

Connecting to Exchange

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

Changing Permissions

If you have never changed anything before on the domain, you will need to enable domain customizations. This may take a while, but should eventually show a status at the top of powershell. Once enabled, you do not need to run this command again.

Enable-OrganizationCustomization

Now, you need to know what the policy name is before you can edit it:

Get-Mailbox -Identity user@yourdomain.com |fl *SharingPolicy*
# An example of what it returns:
# SharingPolicy : countableset.onmicrosoft.com\Default Sharing Policy

In this case the policy name for my domain is “Default Sharing Policy”, for the rest of the commands this is the name I will use. If yours is not the same substitute yours policy name instead.

To see what the policy is set to run this command:

Get-SharingPolicy -Identity "Default Sharing Policy" |fl *Domains*
# Will return something like:
# Domains : {Anonymous:CalendarSharingFreeBusyDetail}

To change the policy, run the command:

Set-SharingPolicy -Identity "Default Sharing Policy" -Domains "anonymous:CalendarSharingFreeBusyDetail"

Where “CalendarSharingFreeBusyDetail” is the permission for an “anonymous” user.

To change the policy for different domains or add in different domains, add in the domain and permissions afterward:

Set-SharingPolicy -Identity "Default Sharing Policy" -Domains "anonymous:CalendarSharingFreeBusyDetail", "nulldirective.ch:CalendarSharingFreeBusyDetail"

Disconnect

Remove-PSSession $Session

Adding Git to Windows 7 Path

Note: You must have msysgit installed on your machine. Also, the path to my git install is “C:\Program Files (x86)\Git” yours might be different. Please check were yours is before continuing.

Open Windows Environment Variables/Path Window

  • Right-Click on My Computer
  • Click Advanced System Settings link from the left side column
  • Click Environment Variables in the bottom of the window
  • Then under System Variables look for the path variable and click edit
  • Add the pwd to git’s bin and cmd at the end of the string like this:
;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd

Now test it out in PowerShell; type git and see if it recognizes the command.

Ubuntu 12.04 – Installing Gitolite and Gitweb

Note this is only tested on Ubuntu 12.04 Server with apache2, I’m sure it would work on the desktop version also.

Installing Git:

sudo apt-get install git-core

Optional, setup git global settings:

git config --global user.name "Your Name"
git config --global user.email your@email.com

SSH Key:

Generate ssh public/private key on the machine you would like to access git repo from and copy it to the server into the /tmp/ directory, for reference here is the command:

ssh-keygen -t rsa -C "name@computer"

Installing Gitolite:

sudo apt-get install gitolite

Create a user to access gitolite with, in this case I chose git since I don’t like to type:

sudo adduser \
    --system \
    --shell /bin/bash \
    --gecos 'git version control' \
    --group \
    --disabled-password \
    --home /home/git \
    git

Now login to the newly created user, and set the path, and move to its home directory:

sudo su git
echo "PATH=$HOME/bin:$PATH" > ~/.bashrc
cd

Run the gitolite setup command with the public key you copied to the tmp directory to initialized the location for gitolite use. Then change the $REPO_UMASK to 0027 when it opens the .gitolite.rc for editing during the installation process. If it didn’t open the file for any reason just open it up in vim (Note this is only if you’d like to use gitweb):

gl-setup /tmp/rachel.pub
# change $REPO_UMASK = 0077; to $REPO_UMASK = 0027; # gets you 'rwxr-x---'

Afterward, it has made the gitolite-admin.git, testing.git repo and all other necessary files. Check to see that everything works by cloning the repo on the machine with the public/private key.

git clone git@<server>:gitolite-admin.git

Here is a resource about the syntax for the config file and adding users.

Install Gitweb:

This is the tricky bit… Install gitweb and the highlight app. Gitweb is located at ‘/usr/share/gitweb’

sudo apt-get install highlight gitweb

Edit the gitweb config to the locations of the project list and repos, and add the highlighting bit at the end of the file:

sudo vim /etc/gitweb.conf
# change $projectroot to /home/git/repositories
# change $projects_list to /home/git/projects.list
# Add Highlighting at the end
$feature{'highlight'}{'default'} = [1];

Change gitolite instance to allow access for gitweb. First append www-data to git group so gitweb can access the repos, then change the permissions for git repos and the projects list, finally restart apache:

sudo usermod -a -G git www-data
sudo chmod g+r /home/git/projects.list
sudo chmod -R g+rx /home/git/repositories
sudo service apache2 restart

Finally you need to tell gitolite which repo you want to show up in gitweb. To do this edit the gitolite.conf file from the gitolite-admin.git repo:

repo testing
  RW+ = @all
  R = gitweb

Theme for Viewgit

Viewgit Screenshot 1

Viewgit Screenshot 2

Download Here