CloudFiles curl example

CloudFiles curl example
I wrote the following script to simplify accessing CloudFiles container’s by utilizing cURL. This example will show you how to list your containers as well as their contents, via the command line without having to login to your control panel. This can also be a useful example to provide you with a sample code base to implement within your own infrastructure. CloudFiles uses a a “ReST” API which allow’s you to interact with it in a variety of ways by using curl, PHP, Python, and Ruby. This particular script was written in bash so that I could utilize it from a shell, however the...
read more

clipboard hacks – social copypasta

clipboard hacks – social copypasta
Have you ever had someone post you a code snippet, error, log data or some other type of long formatted text via an instant message or otherwise? It usually comes out all jacked up, formatting is off and its hard to read. If you have experienced this and find it annoying, then this script may be what you are looking for. Pastebin is a great alternative, however if you need privacy or security of the data you are sending is a concern, then that is not the best option. So what does it do? Its pretty simple really. You highlight text, hit your hot key and paste a link that’s hidden away from the...
read more

Calling functions with pattern matching in bash

Calling functions with pattern matching in bash
This script is pretty simple in its functionality, however it shows how you can utilize passing bash arguments to get different results, or to call different functions within the script. In this example we are just echoing out the argument that is being passed, but only if it matches what the script is looking for. These types of functions are particularly useful if you have a multi function script which changes its behavior depending on the arguments which are passed to it. #!/bin/bash function init() { if [ "${1}" == "string1" ]; then f_test1 elif [ "${1}" == "string2" ]; then...
read more