User's ability to attach a priority value to its own process upon execution determines whether you are being nice to your fellow users on the same system. Are you being nice or you simply abuse system resources for no apparent reason? In this article you will learn how to manage your processes in terms of how much processing power they consume and how to change a priority value of your processes using nice & renice Linux command. We will start with some basic theory about what is process, process scheduling, how to fork new process and then we move to nice command and explain how to change process priority value.
What is process
In simple words a process is a naming convention used by Linux to assume role of a running program. A process is a collection of rules by which any particular program makes use of assigned processor time, memory and I/O resources. Each process running on a Linux system has its own Process ID ( PID ) by which it can be monitored and administered.
Linux kernel is designed to collect various information about each process. These include, but not limited to:
- process status ( runnable, sleeping, zombie or stopped )
- process execution priority ( niceness)
- information about used resources
- owner of the process
- what network ports and files had each particular process opened
- and more...
Now that we have some idea on what the process is we can go ahead and create some process. To do this simply open your terminal and execute yes command in background and redirecting its output to /dev/null:
$ yes > /dev/null &
Read more ...
In the previous article we have discussed how to install OpenJDK java on ubuntu from the standard Ubuntu repository or Oracle's Java JDK 7 using Personal Package Archives ( PPA ). This article will cover installation of Oracle Java JDK 7 from a source package or by converting RPM Java package to the Debian software package format.
Download Oracle Java JDK 7
First, we need to download Oracle Java JDK source package from the official Oracle website. Navigate to JDK Downloads, accept license terms and download jdk-7<version>-linux-<architecture>.tar.gz. Current version of this source package is jdk-7u11-linux-x64.tar.gz and this is also what we are going to use in this tutorial. Store this tarball source package into your home directory or some other arbitrary place.
Read more ...
How to install Java on Ubuntu Linux? Although, this topic is a quite self explanatory to an experienced Linux system administrator it still creates lots of confusion for beginners in terms what version of Java I need, how do I install it or how to change my system settings between multiple different types of Java versions. The aim of this short article is to shed some light on this topic as we will show how to install Java JDK for both Oracle and as well as OpenJDK.
What is Java
In short, Java is an object-oriented programming language. The current owner of the official implementation of the Java SE ( Standard Edition ) platform is Oracle Corporation. The free and open source implementation of the Java Platform SE is called OpenJDK and OpenJRE. There is also another Java version maintained by IBM. IBM provides also both JDK and JRE. Currently only OpenJDK and OpenJRE Java versions are available via standard Ubuntu repository.
Read more ...
In this article we will look on how to automatically chroot jail selected user ssh login based on the user group. This technique can be quite useful if you what your user to be provided with a limited system environment and at the same time keep them separate from your main system. You can also use this technique to create a simple ssh honeypot. In this tutorial you will learn how to create a basic chroot environment and how to configure your main system's sshd to automatically chroot jail selected users upon the ssh login.
Creating basic chroot environment
First we need to create a simple chroot environment. Our chroot environment will consist of a bash shell. To do this, first, we need to create a chroot directory:
# mkdir /var/chroot
In the next step, we need to copy the bash binary and its all shared library dependencies.
You can see the bash's shared library dependencies by executing the ldd command:
# ldd /bin/bash
linux-vdso.so.1 => (0x00007fff9a373000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f24d57af000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f24d55ab000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f24d51eb000)
Read more ...
As a system administrator or just a backup-conscious home user, sooner or later (usually sooner) you will have to deal with backups. Disasters do happen, ranging from electrical storms to drive failures, and one needs to be prepared. We cannot stress enough the importance of having copies of important data. While the whole concept of backup is too long for this article, we will focus on rsync for what's called incremental backups.
Incremental backups are based on the idea that, once you have a copy of the data you need to backup, consequent backups of the same data should be incremental, meaning that you only update the backup copy with the differences since the last operation occurred, not create another full copy. We will detail here a setup we have at home for backing up important data, but the examples here can be used at larger facilities. Once you get started, you will know what, where and when you need.
If you have a backup server that's up 24/7, you can create a cronjob to backup your data periodically. Since our example is home-based, we have a backup server, but since it's not up all the time, we will show you how to do it manually. rsync needs to be installed on both systems, and that's about it, no other setup chores must be performed, at least in simple cases. Please remember that you are not by all means tied to Linux or other Unix platform : rsync is available also for Windows. If you are worried about security, rsync is working over SSH and can be regarded as a secure replacement for
rcp (remote copy) command, so it's all good.
Read more ...