Hello, and welcome to part two of our Linux command line series. You will learn some more interesting tips that you can use to master your system, so hold on to your seats, because here we go.
The tasks, part two
Setting date and time
I must confess, this was a task that I had to do a long time ago in front of a terminal and had no idea how to do it. That is because I was used to the Gnome way of doing that but at the time I had no Gnome. So what to do?
, of course. Depending on the country you live in, the date format differs from other parts of the world. In the United States, the date/time format is of the form mm/dd/yy or mm/dd/yyyy, where m is month, d is day and y is year, either in two-digit format (e.g. 86 for 1986). Where I'm getting at is the fact that the way that you set your date with the date command may differ from the format you're used to (or what is used in your country). This paragraph will not be a manual page replacement, but it will help you set your system's date/time quickly, provided you have root privileges. If you simply type
with no other arguments/flags, it will show you the current date. To set the date, you should type something like
M is month, D is day, h is hour, m is minute, C is century (the first two digits of year, like 20 for 2012), Y is year and s stands for seconds. Therefore to set your date for example to "Fri Jul 6 13:45:50 2012" you would do:
# date 070613452012.50
Read more ...
By creating a Logical Volume snapshots you are able to freeze a current state of any of your logical volumes. This means that you can very easily create a backup and once needed rollback to a original logical volume state. This method is very similar to what you already know from using Virtualization software such as Virtualbox or VMware where you can simply take a snapshot of entire virtual machine and revert back in case something went wrong etc. Therefore, using LVM snapshots allows you to take a control of your system's logical volumes whether it is your personal laptop or server. This tutorial is self-contained as no previous experience with Logical Volume Manager is required.
In this article we will explain how to manually create and restore logical volume snapshots. Since we do not assume any previous experience with Logical Volume Manager we will start from a scratch using a dummy physical hard drive /dev/sdb with size of 1073 MB. Here are all steps in nutshell:
- First we will create two partitions on our /dev/sdb drive. These partitions will be of "8e Linux LVM" type and will be used to create a physical volumes
- Once both partitions are created we use pvcreate command to create physical volumes
- In this step we create a new Logical Volume Group and a single 300MB in size logical volume using ext4 filesystem
- Mount our new logical volume and create some sample data
- Take a snapshot and remove sample data
- Rollback logical volume snapshot
Read more ...
For many years people have wanted to protect their right to privacy. As technology changes, it seems that privacy evolves away more and more. I2P is a protocol used for an encrypted multi-proxy on the Internet. While, this sounds simple, there is actually a lot of work going on with I2P to achieve this. Unlike some multi-proxies, I2P will allow you to tunnel many more applications through it than just web browsing, making it a very robust protocol.
I2P is available for all platforms, not just Linux. For this example I have used Debian Sid to perform the installation. With the exception of 'apt-get', these instructions should work fine with any Linux distribution. But if you experience problems, please seek documentation for your distro.
As I explain this to help you maintain priviacy, there will always be a few bad apples in the crowd. I do not condone this use of this article for anything illegal. Even if you are not passing illegal information on I2P, please check your country's laws on encryption and it's exportation before you begin.
The Problem with Tor
One would probably see I2P as an overkill without knowing the downfalls of its predecessor. Tor was once a wonderful multi-proxy used for hiding ip addresses and bouncing off servers all over the world. At one time, it was even trusted by most governments for strong anonymity. All of that seemed to change after an article was posted in 2600 Hacker Quartley. One author exposed how becoming an exit node for Tor allowed all the traffic on the Tor network to pass right through your machine. Becoming an exit node was the same as performing a Man-In-The-Middle attack. All one had to do was open up a packet sniffer and see all the traffic going through encrypted. Tor is still used by people trying to protect their privacy. But at the same time it has become a playground for hackers and governments monitoring what they consider suspicious. I2P has secured this problem while adding more functionality.
Read more ...
One of the essential reflexes every new Linux user must develop is the reflex to search for information when something's amiss. But despite the fact that we live in a connected world, with search engines, wikis and huge quantities of information at our fingertips, it's always good to have the info we need already installed on the system we're working on. This makes for easy and fast access, and also for higher availability, should we lack access to an Internet connection. Besides, one can't always trust what one finds on the Web, and the manual pages are available in a consistent form, ready to answer questions to the impatient. One of the design philosophies standing behind Unix, and by inheritance Linux as well, is that the system should be well documented. This is how man pages came into being. While all Unix-based OSs have man pages, there are differences between them, so what works on Linux might not work on Solaris, for example. There is an issue, though: the writing style of these pages is terse, minute, impatient to the newcomer, so you might want to read a manpage a few times until you get accustomed.
Read more ...
Although you may think that you have learned to master Linux command line with bash shell, there are always some new tricks to learn to make your command line skills more efficient. This article will teach you a few more basic tricks on how to make your life with the Linux command line & bash more bearable and even enjoyable.
Bash Command History Expansion
This section will mostly deal with bash shortcuts in combination with three bash history expansion characters "!", "^" and "#". Bash Command History Expansion character "!" indicates start of history expansion. The "^" is a substitution character to modify a previously run command. The last optional character is "#", which denotes the reminder of the line as a comment.
Repeat last command
$ echo Bash Shortcuts
echo Bash Shortcuts
!! is probably the easiest and most popular bash shortcut, which simply shows and executes your last entered command.
Read more ...