What you're reading is only the first of the many articles from the "Learning Linux commands" series. Why would we want to do such a thing? Because it's useful to you to have every option and possible use of a widely used command all in one place. You will find some options or even some commands that you didn't even knew existed, and your life as a Linux user / admin will become easier. If you're not afraid of opening a terminal and know the basics of using a Linux system, this article is for you.
We chose dd as the first contender in our series because it's a useful tool that has lots of options, as you will see. This makes it almost one of the Swiss army knives of the Linux world. Yeah, this term (Swiss army knife) is used more than it should be by the Linux-oriented article writers, so we couldn't pass the opportunity to use it ourselves.
Before we start we wanted to give you a general idea of how dd is used. First of all, the name comes from "data duplicator", but it's also jokingly said to stand for "disk destroyer" or "data destroyer" because it's a very powerful tool. So we recommend extra care when using dd because one moment of carelessness may cost you valuable data. The general syntax of a dd command is
# dd if=$input_data of=$output_data [options]
Input and output data can be disks, partitions, files, devices...mainly everything you can write to or read from. As you will see, you can use dd in a networked context to send data streams across your LAN, for example. You can have only the input part in your dd command, or only the output command, and you can even eliminate both in some cases. All these will be treated in the table below.
Join command is yet another example of text processing utility under GNU/Linux. Join command combines two files based on the matching content lines found in each file. Using join command is quite straight forward and if used currently and in the right situation it can save lots of time and effort. This article requires very basic command line experience.
Do you feel that someone is attempting to access you server? To find out, you can deploy a honeypot within your system to help you ease your paranoia by either confirming or dismissing your initial believe. As an example you can start the Kippo SSH honeypot, which allows you to monitor brute-force attempts, collect up today exploits and malware. Kippo also automatically records hacker's shell session, which you can replay to explore various hacking techniques and later use this gathered knowledge to harden your production server. Another reason why to install a honeypot is to take away an attention from your production server. In this tutorial we will show how to deploy a Kippo SSH honeypot on the Ubuntu server.
Kippo SSH honeypot is a python based application. Therefore, we need to first install python libraries:
$ sudo apt-get install python-twisted
Normally you would run you sshd service listening on default port 22. It makes sense to use this port for your SSH honeypot and thus if you already run the SSH service we need to change the default port to some other number. I would suggest not to use alternative port 2222 as its use is already generally known and it could sabotage your disguise. Let's pick some random 4-digit number like 4632. Open your SSH /etc/ssh/sshd_config configuration file and change the Port directive from:Read more ...
In this quick GNU R tutorial to statistical models and graphics we will provide a simple linear regression example and learn how to perform such basic statistical analysis of data. This analysis will be accompanied by graphical examples, which will take us closer to producing plots and charts with GNU R. If you are not familiar with using R at all please have a look at the prerequisite tutorial: A quick GNU R tutorial to basic operations, functions and data structures.
We understand a model in statistics as a concise description of data. Such presentation of data is usually exhibited with a mathematical formula. R has its own way to represent relationships between variables. For instance, the following relationship y=c0+c1x1+c2x2+...+cnxn+r is in R written as
which is a formula object.
Let us now provide a linear regression example for GNU R, which consists of two parts. In the first part of this example we will study a relationship between the financial index returns denominated in the US dollar and such returns denominated in the Canadian dollar. Additionally in the second part of the example we add one more variable to our analysis, which are returns of the index denominated in Euro.Read more ...
In the last two articles we have learned how to install and run GNU R on the Linux operating system. The purpose of this article is to provide a quick reference tutorial to GNU R that contains introduction to the main objects of the R programming language . We will learn about basic operations in R, functions and variables. Moreover, we will introduce R data structures, objects and classes.
Let us start with a simple mathematical example. Enter, for instance, addition of seven and three into your R console and press enter, as a result we obtain:
To explain in more detail what just happened and what is the terminology we use when running R, we say that the R interpreter printed an object returned by an expression entered into the R console. We should also mention that R interprets any number as a vector. Therefore, "" near our result means that the index of the first value displayed in the given row is one. This can be further clarified by defining a longer vector using the c() function. For example:Read more ...
$ sudo apt-get install pythonRead more ...
LaTeX is the typesetting system and a markup language that allows for the creation of documents. LaTeX is heavily utilized by the academic and scientific community. LaTeX produces beautiful type and is written in a language that is fairly intuitive. This article will discuss a brief history, introductory usage examples, front-ends, and further readings.
From its website, LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de-facto standard for the communication and publication of scientific documents. LaTeX is available as free software. LaTeX was first released in 1985 by Leslie Lamport as an extension of TeX. Tex was developed by Donald E. Knuth. It was first released in 1978. LaTeX is used, as mentioned, earlier in academic environments for book publication and article publication. Not to go off-topic, but LaTeX is also used to create the formulas displayed on wikimedia applications such as Wikipedia! In addition to its ability to display formulas and beautifully created pages, LaTeX can do much more but that goes beyond the scope of this article. Look at LaTeX's homepage for further documentation on LaTeX.Read more ...
One of the major differences between various Linux distributions is package management. Many times, this is the reason somebody steers away from one distribution to another, because he/she doesn't like the way software is installed or because there is software needed that isn't available in the distro's repositories. If you are a beginner in the Linux world and are wondering about the differences between distributions, this will be a good start. If you've only used one or two distributions for some time and you want to see what's on the other side of the fence, this article also might be for you. Finally, if you need a good comparison and/or a reminder about major PM systems, you'll find something interesting too. You will learn the most important things a user expects from a PM system, like install/uninstall, search and other advanced options. We don't expect some special knowledge on your part, just some general Linux concepts.
We chose as terms for the comparison some popular systems from popular distributions, and those will be dpkg/apt*, rpm/yum, pacman and Portage. The first is used in Debian-based systems, rpm is used in Fedora, OpenSUSE or Mandriva, but yum is Fedora/Red Hat only, so we will focus on that.Gentoo is a source-based distribution, you will be able to see how things are done both in binary and source distributions, for a more complete comparison. Bear in mind that we will talk about the higher-level interfaces to package management, e.g. yum instead of rpm or apt* instead of dpkg, but we will not cover graphical tools like Synaptic, because we feel that the CLI tools are more powerful and usable in any environment, be it graphical or console-only.Read more ...
In part one we introduced you to Linux editors and gave a storm course on vim. It's now time to dismantle the rumors that we're subjective and talk about the other side, emacs. In some ways, the two editors are opposite one another, mainly from historical reasons, as you will see. We hope you will enjoy this tour and that we'll help you make up your mind.
I remember writing somewhere in one of my articles that I won't under no circumstances reveal what's my editor/WM/DE/Hollywood actor of choice. Not because I consider myself important, but because I want to avoid any flame material. The true reason for which emacs has an entire article's space, while vim has only half (or less) is the differences between them, and this is what we'll talk about right now.
vim, through its' predecessor, vi, is very much linked to Unix in terms of evolution, just like emacs is with the GNU movement. Here's a crucial difference that influenced the design of the two editors. When Bill Joy developed vi in 1976, hardware resources were scarce, and every character sent to the terminal mattered. In order to imagine what we're talking about, imagine that vi version 2.0 was still (almost) too big to fit inside the memory of a PDP-11/70. So this is the reason why vi(m)'s commands are short and perhaps cryptic for a beginner, and maybe that's why it has its' well-known simplicity. emacs is a wholly different story. It has over 2000 (yes, two thousand) built-in commands and many critics acuse it for its' size and overly complex commands. The name stands for "Editing MACroS", but it's said that it also has to do with a certain ice cream store in Cambridge, MA. Why Cambridge? Because the man responsible for emacs is none other than Richard Stallman, aka RMS, who was working at MIT at the time. That leads to one conclusion: working at MIT equals Richard had access to more powerful hardware, where characters or buffer space weren't an issue, at least not in the amount Bill Joy had to deal with. So although the first year of existence is the same - 1976 - access to hardware made a difference. Not the only one, but an important one, for sure.Read more ...
It's a very common fact that nobody likes to write documentation. Heck, nobody likes to read it either. But there are times when we have to read it in order to, say, finish the project on time, or, especially when working in software development, even write it. If you only have to read it, we always encouraged you to do so, but if you'll have to write the manual pages and need a kickstart, here's the article for you. If you worked previously with HTML your life will be easier, but if not it's alright. Writing manual pages for Linux is not that hard, despite the look of the pages when read in plain-text. So basically you'll need some Linux knowledge and the ability to use a text editor. You will learn (with examples, of course) the main concepts in text formatting as applied to man pages and how to write a simple manual page. Since we used yest as an example for our C development tutorial, we will use snippets from its manual page to illustrate our point during this article.
The first manual packages written are said to be authored by Dennis Ritchie and Ken Thompson in 1971. The formatting software used was troff, and that format continues to be used to this day, although the tools may be different. The text formatting tool on Linux systems is now groff, with the leading 'g' coming from GNU. groff's existence is owed to the fact that when troff was written, terminals meant something different in terms of capabilities than what they mean today. Another strong incentive for the GNU project to create groff was troff's proprietary license. troff still lives on on other Unix systems, like OpenSolaris or Plan9, although under open source licenses.Read more ...