Posts in Category: uncategorized

Linux – How to build an RPM package

To do this, you need to use the rpmbuild command.

First you have to install this utility by installing the following package:

$ yum install rpmdevtools

And maybe also the following too:

$ yum install gcc make rpm-build patch
# the following I think are optional:
$ yum pcre-devel openssl-devel rrdtool-devel

You might need to do some patching:

$ patch -p1 --dry-run < /path/to/patch.patch
$ patch -p1 < /path/to/patch.patch

For more info about checkout out:

7 Patch Command Examples to Apply Diff Patch Files in Linux

$ yum info patch
Loaded plugins: rhnplugin, security, ulninfo
*Note* Spacewalk repositories are not listed below. You must run this command as															

bundle exec rake lint/validate/spec/beaker

befor you run a spec test, you first have to run:

bundle install

This will download all the dependencies (i.e ruby gems).

Then you do:


bundle exec rake {task}


This in parts means:

bundle exec – “execute the following script using the gems specified in the gemfile”

This in turn executes:

rake {task}

Here since we are calling rake it means that rake calls the rakefile, as a script, and it passes the “{task}” as an input parameter. This input parameter can take any of the following values:

  • lint                     – check for good formatting, e.g. code is properly indented
  • validate   – checks for syntax error
  • spec         – runs the rspec tests (unit tests)
  • beaker   – runs the beaker tests (acceptance tests, also written in rspec).


If you want

Cucumber – getting started

Cucumber runs on top of “ruby on rails” (ror). To install ror, go to:

Now set the path variable:
in cmd you do:

in powershell you do:

Now we create a folder to house all our rails projects e.g.:

mkdir RailsProjects

Now within this directory you create your first project:

PS C:\Users\Mir\RailsProjects> rails new cucumberproject1

This will create a new folder by this name and within this folder it will contain the project files.

next, cd into the project and install the relevent gems using the gemfile.conf file, insert the following at the bottom of the file:

group :CucumberGems do
	gem 'cucumber-rails'
	gem 'database_cleaner'

Next, while in the project folder, run:

install bundler

this will read the gemfile and download the specified gems. note you need internet connection for this because it downloads gems from the internet

vsphere – puppet and powershell, and Powercli

linux – telnet

telnet comes in 2 parts,


– telnet (client)

– telnet-server (daemon, that will by default listen on port 23)


How to Install Telnet in CentOS / RHEL / Scientific Linux 6.4


Telnet is also really useful to check if a certain port on a remote machine is open, here’s the format:

$ telnet {ip number} {port number}

For example, to check port 22, we do:

telnet 22
Connected to home-directories.
Escape character is '^]'.

This shows port 22 is open, whereas if we check a port that is closed, e.g. in my case 21, then we get:

[root@openldap-client01 ~]# telnet 21
telnet: connect															

Linux – Give your Linux machine a hostname and domain-name

When you build a brand new linux machine, you machine will not have a name. As a result, your router (i.e. network) will instead refer to your machine by it’s mac-address:

Now you can assign a name for your hostname using the hostname command, like this:

[root@localhost ~]# hostname
[root@localhost ~]# hostname

Here, I’ve called my machine “PuppetMaster”, which is the hostname. I also set the domain name as “”,

which you can confirm like this:

[sher@PuppetMaster ~]$ hostname --domain

Note, the above won’t work, unless you have set “” as your domain on your router. You can set the domain up in your router, by logging into your router’s web console, and change the

Chromecast – Access another countries Netflix

Take the following instructions: (i only created the script not the dnsmasq)
you can access above screenshot here:

Linux – Accessing the linux terminal

The way you access the   linux command line terminal, depends on the scenario:

Scenario 1 – Access your Linux desktop machine’s terminal

Using the gnome ui, interface, simply go to:

Useful Tip: you can create a desktop shortcut to save time.

Scenario 2 – Access a remote linux server’s   terminal from a windows desktop machine.

In most corporate workplaces, linux servers are locked away in server rooms. In these cases, you can access the server’s terminal remotely by using a software called putty. Putty creates a connection to the linux server and opens up a virtual terminal. After that you can use this terminal just as if you were access the linux server directly.

Useful Tip: In a corporate workplace, you may need to remotely connect to several remote linux machines. Then you might