SourceTree GIT Cheatsheet

Cherry Picking

  • Right-click commit before all of the changes you want to revert [from head of branch]
  • Select ‘reset current branch to this commit’ from context menu
  • Select ‘mixed’ from dropdown
  • Branch. New branch will have nothing to pull.
  • Stage the changes you want to keep and commit

Installing TeamCity on Ubuntu 16.04

Today I will spend some time trying to install TeamCity on Ubuntu 16.04 VPS.


First download TeamCity server file. Do not use the link above, instead get the latest link by navigating to

Unzip (your filename will be different)

tar xvzf TeamCity-2018.2.3.tar.gz

Java is required to run TeamCity, to check what version is currently running

java -version

If you need to install Java like I did follow this website

I’m going to use the default configuration and press the start button and see what happens. First I had to give myself permission to run the scripts

cd /TeamCity/bin
chmod 711 teamcity-server.bat
chmod 711 runAll.bat

And to run

./ start

Now when I navigate to <URL>:8111 I see a TeamCity configuration page.

Setup Database

I chose to use MySql and for that all I had to do what create a database for TeamCity

mysql -u  -p

If you get a JDBC driver missing error you will need to do the following:

sudo apt-get install libmysql-java
echo "# Set classpath for JDBC & MySQLCLASSPATH=\".:/usr/share/java/mysql.jar\"" >> /etc/environment

When I selected MySql it complained about not having a mysql jdbc driver. I had to create the following folders: ‘.BuildServer/lib/jdbc/’. Download mysql connector jar and copy to ‘.BuildServer/lib/jdbc/mysql-connector-java-<version>.jar’.

‘.BuildServer’ is the default data directory but you can set it to any path. Make sure it is secure!

And make sure you copy the jar to /TeamCity/lib/ as well (obviously).

When you have TeamCity server fired up, it will ask for a super token. You can find this by opening ‘TeamCity/logs/team-server.log. To search with vim press ‘?’ and type ‘Super user authentication token’ (obviously).

Voila! TeamCity is up and running

Installing Jira on Ubuntu 16.04

Today I wanted to replace my paid membership of Jira + Confluence with server edition. For most online membership is the way to go but for me I only experiment and dabble with Jira to keep my skills up to date.

This will not be an all inclusive set of instructions, it will only be the instructions I needed to get the website up and running, with links of where I stole the information.

My setup is an AlphaRacks VPS Ubuntu Server 16.04, Jira X, MySQL X

  1. Install MySQL

sudo apt-get update 
sudo apt-get install mysql-server
systemctl enable mysql

This will update your current packages, install mysql and then enable mysql startup when rebooting OS.

2. Install Jira user on Mysql

mysql -u root -p

Now that you are logged into MySql use the following:

mysql> create database jiradb character set utf8;
Query OK, 1 row affected (0.17 sec)

mysql> create user 'jira'@'localhost' identified by 'jira123';
Query OK, 0 rows affected (0.25 sec)

mysql> GRANT ALL Privileges ON jiradb.* TO 'jira'@'localhost' IDENTIFIED by 'jira123' with grant option;
Query OK, 0 rows affected (0.17 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.14 sec)

mysql> quit

This will create database jiradb and user jira and give privileges needed.

I tried to run wget to download Jira on Ubuntu but I received a ‘403 Forbidden’ message. I tried supplying username and password and still had no success, so instead I downloaded on Windows 10 and then uploaded to Ubuntu VPS via WinSCP. Everything is so much easier in Windows! *hides*

3. Install Jira

Change director to where you uploaded the bin installation file.

chmod +x atlassian-jira-6.4.10-x64.bin

This will give you permissions needed on the file and run the installation file. Personally I just hammered ‘enter’ button until it stopped asking my questions, using default installation and all of the default options.

At this point I can navigate to my server url and see Jira setup page e.g. I selected custom installation and database MySql 5.7+. When I tested my connection I get the following error: ‘
Could not find driver with class name: com.mysql.jdbc.Driver ‘.

4. Download and install ‘mysql-connector’

Download ‘mysql-connector’ jars and upload to Jira lib folder (default
/opt/atlassian/jira/lib). Something like this should work (I used WinSCP):

wget ''
tar -zxvf *
Now restart the service to load connector:

sudo /etc/init.d/jira stop
sudo /etc/init.d/jira start

5. Configure MySql database

Next we will need to edit my.cnf to Jira’s liking. I made a backup since my Linux skills are mediocre. First run ‘rm -r *’…no wait run ‘vi my.cnf’ and edit the file accordingly (see link below).


Now restart Mysql:

/etc/init.d/mysql stop
/etc/init.d/mysql start

6. Install Jira

I had issues with my collation. I think I need to adjust the above steps. It is an easy fix if I caused you grief. Let me know if you actually read this post and / or want me to improve it. I will gladly put more effort in if I know at least one person read my post.

Code Syntax Highlighting

This is an example post with a block of code to experiment with code syntax highlighting.


// Foo class
public class Foo
  public string Bar { get; set; }
  public int Foo;


SELECT * FROM users;


// Foo class
public class Foo
  public string Bar { get; set; }
  public int Foo;