How to compile and install Eucalyptus 3.3.0 on Ubuntu 13.04 from GitHub sources (cloud-in-a-box)

 

This is an updated guide on how to build and install Eucalyptus 3.3.0 on Ubuntu 13.04. I have tested these steps on a freshly installed & updated Ubuntu 13.04 machine on Sunday, July 21st, 2013.

There is another guide here for Eucalyptus 3.2 and Ubuntu 12.04. :)

Continue reading

How to compile and install Eucalyptus 3.2.0 on Ubuntu 12.04 from GitHub sources (cloud-in-a-box)

 

Recently, I’ve been spending my time up in the clouds (sunt cu capul in nori) messing around with Eucalyptus.

Eucalyptus is an open-source cloud platform. In my experience, this means that you can download it from GitHub, compile it and then torture yourself trying to get it to run :)

Here, I am presenting a short guide on building, installing and configuring Eucalyptus 3.2.0. To maximize pain, feel free to ignore everything I say below.
Continue reading

Encrypting a file using AES in 256-bit CBC/CTR mode using the OpenSSL library

 

I’ve been using OpenSSL a *LOT* for work lately and I’ve learned some interesting stuff. Here’s a quick guide on how to encrypt and decrypt files using AES in CBC or CTR mode using 256 bit keys and 128 bits IVs. To do this, I used the EVP API in OpenSSL, which allows you to easily encrypt a file using any cipher of your liking.
Continue reading

Alin’s BaSH (Bourne again Shell) cheat-sheet

 

I’ve been using BASH a lot lately and have been quite humbled by it :)

How to check file types

[ -L "/path/to/symlink" ] # 'true' if the path is a symlink
[ -f "/path/to/file" ]    # 'true' if the path is a regular file
[ -d "/path/to/dir"  ]    # 'true' if the path is a directory

More on this can be found on TLDP here.

How to get the inode of the file pointed to by a symlink

stat -L --printf "%i\n" /path/to/symlink

Iterate through a sequence of numbers

for i in $(seq 1 $END); do echo $i; done

String operations

string="some string"

${#string}            # return length of string
${string#substring}   # remove shortest match of substring from front
${string##substring}  # remove longest match of substring from front
${string%substring}   # remove shortest match of substring from the end
${string%%substring}  # remove longest match of substring from the end

# More here: http://tldp.org/LDP/abs/html/string-manipulation.html

Continue reading

Alin’s Linux cheat-sheet

 

This is my Linux cheat-sheet, a place for me to remember what I forgot.

Zip a directory

zip -r archive.zip /path/to/directory/

Computing with floating point numbers using bc

echo "4.5 / 2.5" | bc -l
# Computes log_2(256)
echo "l(256)/l(2)" | bc -l

Renaming tricks
This renames all directories in the current working directory from b6-r9-a16 into b06-r09-a16 (bulk renaming).

rename 's/b(\d+)_r(\d+)_a(\d+)/sprintf("b%02d-r%02d-a%02d", $1, $2, $3)/e' *

This renames all directories in the current working directory from results_blablabla into blablabla (bulk renaming).

rename 's/results_.*b/b/g' *

How to hash a directory (quick)

find /usr/include -type f -print0 | sort -z | xargs -0 sha256sum | sha256sum

Continue reading