Categories
Tech

Common Linux Commands

This will be an on-going post that I will use to keep track of my most commonly used commands.
Tested on Centos 6.3.

Linux Misc

List users

cat /etc/passwd

List groups

cat /etc/group

View free memory

free -m

View disk space usage

df -h

Git

Init new remote repo

git init –bare

Clone existing repo using HTTP

git clone http://repourl.com/path/to/repo

Clone existing repo using SSH on non-standard port

git clone ssh://user@repourl.com:8888/path/to/repo

Xen using LibVirt

List running Virtual Machines on Node

virsh list

List all Virtual Machines on Node

virsh list –all

Categories
Tech

Clone Xen & KVM Virtual Machines using LibVirt

This easy to use one line command is all that’s needed to clone an existing virtual machine.

virt-clone -o existing_vm_name -n new_vm_name –auto-clone

Categories
Tech

Convert Subversion Repo to Git

Create a local empty SVN repo.

svnadmin create /path/to/repo

In the newly created repo cd into hooks/ and create new file named pre-revprop-change and enter the following.

#!/bin/bash

Remember to make the newly created file executable.

chmod +x hooks/pre-revprop-change

Initialise the local repo to point to the SVN.

svnsync init file:///path/to/local/repo https://path/to/online/repo/svn

Sync the two together.

svnsync sync file:///path/to/local/repo

Import the local SVN repo to a newly created Git repo.

git svn clone file:///path/to/local/repo projectname

Create a new Git –bare remote repo and add a remote link to the local repo.

git remote add origin https://githost.com/project.git

Push the local repo to the remote.

git push origin master

Bish bosh job done! Your now free of the tiresome Subversion 😀

Categories
Tech

Clone Git Repo using SSH on a non-standard port

This command allows you to clone a git repo onto your local machine from a remote repository using ssh on a non-standard port (standard ssh port: 22). The example provided uses the non-standard port of 8888.

git clone ssh://username@remote_repo_host.com:8888/path/to/repo/from/root

Categories
Tech

VMware Fusion 5 Black Screen

After upgrading to my version of VMware Fusion 4 to 5, I noticed upon VM boot none of my machines displayed any graphics except a black screen, essentially rendering them useless.

The quick fix for this I found is to dive into each ‘.vmware’ folder for each of your VM’s located by default in:

~/Documents/Virtual\ Machines.localized/

Right click Show Package Contents will display VM contents.

Open the related .vmx file in your favourite text editor, append the following line, then save and quit.

mks.gl.use32core = TRUE

Support article from VMware here