Resize your VirtualBox

http://stackoverflow.com/questions/11659005/how-to-resize-a-virtualbox-vmdk-file

C:\Users\mruckman\VirtualBox VMs\Ubuntu-12.04-64-bit-16Gig-WINT-MLR\
Ubuntu-12.04-64-bit-16Gig-WCS-DEMO-disk1.vmdk

"C:\Program Files\Oracle\VirtualBox\VBoxManage" clonehd "Ubuntu-12.04-64-bit-16Gig-WCS-DEMO-disk1.vmdk" "cloned.vdi" --format vdi
"C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyhd "cloned.vdi" --resize 51200
"C:\Program Files\Oracle\VirtualBox\VBoxManage" clonehd "cloned.vdi" "Ubuntu-12.04-64-bit-50Gig-WINT-MLR-disk1.vmdk" --format vmdk

Then you need to use gParted for LiveCD

Installing MongoDB in Ubuntu 12.04

Unable to install latest version in Ubuntu 12.04
Refer: http://gordoncluster.wordpress.com/2013/07/12/how-to-install-mongodb-on-virtualbox-ubuntu-12-04/

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list
sudo apt-get update

We're going to specifically install an older version (you will need to run this as root):
sudo su -
apt-get install mongodb-10gen=2.2.3

The service should already be running, the output: mongodb start/running, process 2254
sudo service mongodb status | stop | start

now we just run:
mongo

The output you should see is:
MongoDB shell version: 2.2.3
connecting to: test
>

UI Tools
http://www.robomongo.org/

MongoDB Restore

$ mongorestore --drop testcms

Using canned mockup with booking flow

Refer: https://www.npmjs.org/package/canned

  • $ npm install canned
  • Unzip canned responses in bookingflow folder canned.zip
  • Update configuration.js file
    cmsUrl: 'http://localhost:3000/hal-cms',
    dsUrl: 'http://localhost:3000/hal-ds',
  • Launch canned server from root of bookingflow, default port is 3000, left here for documentation
    ./node_modules/canned/bin/canned -p 3000 ./canned

Limitation, rest calls that return images do not work properly.

Example on how to define a call

  • You will need to determine if it is a get or a post to generate the proper index file of either index.post.json or index.get.json, see the last statement of example
  • Use chrome to get the URL of the rest call, and then also to get the curl version of the rest call
  • You can string all of these together and create a bash script to do everything at once

mkdir -p /home/mruckman/Documents/bookingflow/canned/hal-ds/rest/pricing/v1.0.0/companyCode/HAL/cpp/countryCode/US

cd /home/mruckman/Documents/bookingflow/canned/hal-ds/rest/pricing/v1.0.0/companyCode/HAL/cpp/countryCode/US

curl 'https://qabook.hollandamerica.com/hal-ds/rest/pricing/v1.0.0/...

Adding Prettify JSON to Sublime

In Ubuntu, open preferences, browse packages, to get location of packages folder, and open a terminal and change into that folder

$ git clone https://github.com/dzhibas/SublimePrettyJson.git

Ubuntu: /username/.config/sublime-text-2/Packages

The use [Ctrl]+[Alt]+[j] to run the prettify command

or in iOS us [Ctrl]+[Cmd]+[j]

Refer: https://github.com/dzhibas/SublimePrettyJson

Change your Computer Name in Ubuntu

Ran into trouble when using the same VirtualBox appliance on the same network.

1. Open a terminal window.

2. Input the following command and hit Enter:
gksudo gedit /etc/hostname

3. When prompted, enter the administrator password and click the OK button.

4. The hostname file will open, displaying the current computer name. Replace the current computer name with the desired new name.

5. Click Save.

6. Close all open windows and restart your system.

After your system has restarted, it will have the new computer name.

Use Python to format JSON

Easier way to format JSON instead of JSONLINT

With Python 2.6+ you can just do:
echo '{"foo": "lorem", "bar": "ipsum"}' | python -mjson.tool

Citrix Receiver in Ubuntu

Download the receiver from the Citrix site:
http://www.citrix.com/downloads/citrix-receiver/linux/receiver-for-linux-130.html

So, you've upgraded Firefox on Ubuntu and Citrix no longer works, well do the following:

  • uninstall Firefox
  • install Firefox
  • $ sudo rm -rf /opt/Citrix/ICAClient/keystore/cacerts_old
  • reinstalled Citrix
  • redo the Citrix installation steps below
  • When you launch Citrix, make sure you ALLOW pop-ups, if asked!

Here are the steps to install Citrix for the first time:
For Ubuntu you will need to download the *.deb version and install through the software center

Now you need to get the certs to work properly in Firefox:
Refer: https://www.geekpete.com/blog/ssl-error-61-using-citrix-ica-client-on-linux/

You are going to copy the certs and create a symbolic link for all of the certs then:
$ sudo mv /opt/Citrix/ICAClient/keystore/cacerts /opt/Citrix/ICAClient/keystore/cacerts_old
$ sudo cp /opt/Citrix/ICAClient/keystore/cacerts_old/* /usr/share/ca-certificates/mozilla/
$ sudo ln -s /usr/share/ca-certificates/mozilla /opt/Citrix/ICAClient/keystore/cacerts