How To Disable IPv6 in Red Hat Linux

Since it may be a while before I'm ready to use the IPv6 on my systems, I've been disabling IPv6 on most servers so far. And since there's a particularly elegant way of doing this in Red Hat Linux, I think it's worth sharing.

How to confirm if IPv6 is running on your system

IPv6 is implemented as a kernel module, so you can use the lsmod command to confirm if it's currently running on your Red Hat system:

$ lsmod | grep ip
ipv6                  410913  36

If lsmod doesn't return anything, it confirms that your system isn't running IPv6.

Prevent IPv6 from getting started by modprobe

As you probably know, modprobe command is used for probing modules upon system boot. Probing simply means a module is loaded and an attempt is made to start it up. With any luck, the module starts successfully and its functionality becomes available to the Linux kernel.

[Read more…]

Climate Change: How You Can Help Prevent It

Since it's Blog Action Day 2009 today, I'd like to remind all the readers of my blog how climate change can be prevented by following really simple rules.

Since Unix Tutorial is a technical blog, I'll try and stay as technical as possible within the topic.

Virtualize to consume less energy, get rid of old hardware

Old servers required a much bigger commitment in the past: not only did they cost a fortune, but they also needed a lot of space and required a lot of power. These days, 1u or 2u server solution can easily outperform a computing system which used to take a whole cabinet in your datacentre. And since the cost of supporting old hardware only increases with each year, it makes a lot of sense to simply but a new server to replace the old infrastructure.

[Read more…]

Ask me a Unix question on Twitter

Hi everyone, it seems to be really long since my last technical post here – too much stuff happening at work, plus I'm studying for a CCNA exam.

If you're in need of quick help – drop me a message on Twitter – I'm UnixTutorial there. I can't promise a prompt reply, but at least this way you'll have some interactivity.

I see how many people leave questions in comments to my posts, and I don't always have the time to reply – so feel free to send me an email if you really need my help.

Unix Tutorial membership – registration open for a week

Hi everyone!

I'm back from my holidays, and it's time to open the Unix Tutorial members area for new registrations once again!

If you're still looking for a reason to become a member – please read the Becoming a Unix Tutorial member post.

This time around, new users will receive a life-time access to just one course, the Unix foundations one. This is going to be a constantly updated and expanded course so I'm sure you'll benefit from revisiting it now and then. New courses added at a later stage will never be available for free: I plan to make them very specialized and will charge for access – more on this later.

Wait no more – here's your chance to join: Unix Tutorial members sign-up. I don't have nearly as much time to further develop the course, but please take time to leave a comment to this post or update a thread on the Unix Tutorial members discussion board about what exactly you're interested in.

Fixed calculations in Unix scripts

Although I've already shown you how to sum numbers up in bash, I only covered the bash way of doing it. I really like scripting with bash, but when it comes to calculations, there's quite a few important features missing from bash, and fixed point (thanks for the correction, Azrael Tod!) calculations is one of them. Fortunately, bc command comes as a standard in most Unix distros, and can be used for quite complex calculations.

Basic calculations with bc

bc is a very simple command. It takes standard input as an expression and then evaluates this, performing all the necessary calculations and showing you the result. Thus, to quickly sum numbers up or get a result of some other calculation, simply echo the expression and then pipe it out to the bc command:

ubuntu$ echo "1+2" | bc

[Read more…]

Command Aliases in Unix shells

One of the really useful features almost every Unix shell has is support for command aliases – a way to run a command or a series of Unix commands using a shorter name you get associated with such commands.

An example of a command alias in Unix shell

Here's one of the most useful aliases I have for Solaris systems:

solaris$ alias ls='/usr/local/gnu/bin/ls --color -F'

[Read more…]

Ubuntu SSH: How To Enable Secure Shell in Ubuntu

SSH (Secure SHell) is possibly the best way to remotely access a Unix system – it's very secure thanks to automatic encryption of all the traffic, and it's also quite universal because you can do all sorts of things: access remote command line shell, forward graphics session output, establish network tunnels, set up port redirections and even transfer files over the encrypted session.

Today I'm going to show you how to get started with SSH in Ubuntu.

Installing SSH server in Ubuntu

By default, your (desktop) system will have no SSH service enabled, which means you won't be able to connect to it remotely using SSH protocol (TCP port 22). This makes installing SSH server one of the first post-install steps on your brand new Ubuntu.

The most common SSH implementation is OpenSSH. Although there are alternative implementations (closed source solutions and binary distributions maintained by various Unix and Unix-like OS vendors), OpenSSH is a de-facto standard in the secure transfers and connections industry. That's exactly what you want to install.

[Read more…]

Useful Solaris OS tips from my Solaris Blog

As some of you may know already, I've recently restarted my activity on another technical blog of mine: Solaris blog.

Solaris blog:

Solaris blog is the very first blog I started, I was actively posting new material in 2006-2007.  Since then my primary focus had shifted to Linux systems, but I realized that I miss Solaris so much that I still need to play with latest versions and features in Solaris 10 and OpenSolaris.

Today I'd like to offer you a few articles from Solaris blog, let me know if you find them useful:

Most of these topics are fairly technical and expect you to have previous knowledge of Solaris OS, but Unix Tutorial is here to take care of the basics – so ask away and I'll be glad to help you discover Solaris in my future posts.

How to Confirm Disks Capacity in Linux

show disk size in Unix is a very popular request visitors use to arrive at my Unix Tutorial pages. Since I never addressed the question of confirming the number of hard drivers available on your system or the task of finding out a disk's capacity, I'd like to document a quick and easy way of doing just that.

I hope that when someone looks for a way to show disk size, what's really expected is a command to help you confirm the capacity of a disk in gigabytes.

Using fdisk command in Linux

One of the easiest ways to learn a lot about hard drives installed on your Linux system is to use the fdisk command: [Read more…]