Ruby Methods (Part 1)

Watch out! This tutorial is over 7 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

Functions (and later methods) are defined with def. Parameters are given, without types of course. Default values may be provided. Note that when we send an integer, the method does not change the value sent.

Continue reading

Use Certbot Standalone Mode to Retrieve Let’s Encrypt SSL Certificates

Watch out! This tutorial is over 7 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

Let’s Encrypt is a service offering free SSL certificates through an automated API. The most popular Let’s Encrypt client is EFF‘s Certbot.

Certbot offers a variety of ways to validate your domain, fetch certificates, and automatically configure Apache and Nginx. In this tutorial, we’ll discuss Certbot’s standalone mode and how to use it to secure other types of services, such as a mail server or a message broker like RabbitMQ.

Continue reading

Ruby Iterators

Watch out! This tutorial is over 7 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

Ruby iterators are methods which take and run a block of code. The block can be delimited by curly braces or by the keywords do and end. The brackets have higher precedence, and variables declared in them are destroyed when the bracked code exits.

Continue reading

Ruby Case Expression

Watch out! This tutorial is over 7 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

The ruby case statement is similar to the C/C++/Java switch, but more directly related to the similar (and superior) structures from Pascal and Ada. First, it assumes that each case ends where the next one starts, without needing a break to terminate a case. Secondly, each case can be expressed rather generally, with a single value, a range of value, or a list containing some of each.

Continue reading

Anatomy of a WordPress Plugin

Watch out! This tutorial is over 7 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

To learn the anatomy of a WordPress plugin and how plugin works, we will start looking at a simply plugin, a plugin that comes pre-install with WordPress.  It is the “Hello Dolly” plugin.  In fact this plugin is there to show you an example of how to do a WordPress plugin.

Continue reading

Ruby For Loop

Watch out! This tutorial is over 7 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

The Ruby for loop is similar to the Python for or the perl foreach. Its basic operation is iterate over the contents of some collection. This may be an actual array or a range expression. A range expression is two numbers, surrounded by parens, and separated by either two dots or three. The three-dot form omits the last number from the range, while the two-dot version includes it. The three-dots version can be quite useful for creating a range of legal subscripts since the array size is not a legal subscript.

Continue reading

Using Xen Orchestra to create Virtual Machines

Watch out! This tutorial is over 7 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

Using VirtualBox, HyperV or similar in the labs is a great way to fire up Virtual Machines. However, this method pretty much ties you to that lab machine, unless you are willing to do a (pretty big) export/import of your VM on a regular basis… not very realistic. What if you could access your VMs from anywhere in the college… or even outside… using just a browser? Well now you can!

Continue reading