Hello World in Bash

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

This is how you would display “Hello World” in Bash.

Create a text file called hello_world.sh containing the following code:

#!/bin/bash
# declare STRING variable
STRING="Hello World"
#print variable on a screen
echo $STRING

Navigate to a directory where your hello_world.sh is located and make the file executable:

$ chmod +x hello_world.sh

Now you are ready to execute your first bash script:

./hello_world.sh

Hello World in Javascript

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

This is how you would display “Hello World” to the browser in Javascript.

<!DOCTYPE HTML>
<html>
<body>
 
  <p>Header...</p>
 
  <script>
    alert('Hello, World!')
  </script>
 
  <p>...Footer</p>
 
</body>
</html>

 

Top 5 Databases for Web Developers

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

When listening to developers talk about databases you will usually hear buzz words like robust, scalable, efficient, etc. Discussions will focus on the power of the DBMS (Database Management System) and how it integrates with other technologies. In our case, however, we don’t really care about most of those things. Instead we are going to be looking at the cost of getting started, tools, the user interface and availability of help, especially help for the beginner.

In the following list we’ll talk briefly about each DBMS, give you some pros and cons, and show you how to download and get started with each of them.

Continue reading

Modelling for Distributed Network Systems

Watch out! This tutorial is over 8 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 attached sample chapter from Distributed Network Systems: From Concepts to Implementations (Jia, W. and Zhou, W.,2005) is designed to introduce the client-server model and its role in the development of distributed network systems.

The chapter discusses the cooperation between clients and servers/group servers in distributed network systems, and addresses extensions to the client-server model. Service discovery, which is of crucial importance for achieving transparency in distributed network systems, is also elaborated in this chapter.

Custom Excerpt Length in WordPress

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

Define how many words to return when using the_excerpt();.

//custom excerpt length
function itlc_custom_excerpt_length( $length ) {
	//the amount of words to return
	return 20;
}
add_filter( 'excerpt_length', 'itlc_custom_excerpt_length');

 

Post Thumbnails in WordPress RSS Feed

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

Include the post thumbnail in your RSS feed.

// Put post thumbnails into rss feed
function itlc_feed_post_thumbnail($content) {
	global $post;
	if(has_post_thumbnail($post->ID)) {
		$content = '' . $content;
	}
	return $content;
}
add_filter('the_excerpt_rss', 'itlc_feed_post_thumbnail');
add_filter('the_content_feed', 'itlc_feed_post_thumbnail');

 

Can you ride a pig? Minecraft Server on Raspberry Pi

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

Written in C++ (rather than Java like Minecraft itself) Cuberite is a Free and Open Source (FOSS) Minecraft-compatible Game Server. It is designed with performance, configurability, and extensibility in mind, and also aims to accurately recreate most vanilla features.

Continue reading

Customise WordPress Admin Footer

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

Change the message that appears in the admin footer, why not give yourself a credit for the theme?

// Customise the footer in admin area
function itlc_footer_admin () {
	echo 'Theme designed and developed by <a href="#" target="_blank">YourNameHere</a> and powered by <a href="http://wordpress.org" target="_blank">WordPress</a>.';
}
add_filter('admin_footer_text', 'itlc_footer_admin');