Objective

Iptables rules are by default not persistent after reboot. The objective is to make iptables rules persistent after reboot.

Requirements

Privileged remote or physical access to your Ubuntu or Debian Linux system is required to complete this task.

Difficulty

EASY

Instructions

iptables-persistent installation

In order to make your iptables rules persistent after reboot install iptables-persistent package using apt-get tool:
# apt-get install iptables-persistent

Introduction

One of the main concerns for people making the switch to Linux is how to run the programs that they’ve become accustomed to on other operating systems, mainly Windows. For most, there are one or two programs of games that aren’t available on Linux, and that puts a major hold on adopting Linux full time. Thankfully, WINE can help to solve this problem. introduction to wine on linux

WINE is a piece of software for Unix-like systems, including Linux, OSX, and the BSDs, that allows you to run native Windows applications. WINE stands for, WINE Is Not an Emulator. That’s because it isn’t. WINE isn’t a full Windows install or some kind of VM. It is a compatibility layer that essentially translates Windows binaries. This extends to graphics libraries like DirectX 9, which is converted to OpenGL. WINE allows Linux users to run many popular Windows applications and games at similar performance to if they were running on Windows itself.

Objective

Our objective is to check a disk space usage of one or more local XenServer repositories using Linux shell command line.

Requirements

Remote SSH access to XenServer is required to complete this task.

Difficulty

EASY

Instructions

SSH Login Login

First step is to gain a privileged access to you XenServer using SSH:
$ ssh root@XENSERVER

This config wil examplain how to add new ISO image store on XenServer Linux.

Access XenServer via SSH

First step is to gain an administrative access to your XenServer via ssh.
[root@xenserver ~]#

The following guide can be used to reset an administrative root password on XenServer 7 Linux.

Enter XenServer Boot Menu

In the first step, reboot your XenServer into Grub boot menu:
Enter xenserver grub menu

The following config will describe steps on how to install OpenXenManager on OpenSuse Linux.

Prerequisites installation

The first step is to install all prerequisites:
# zypper install python-setuptools pygtk2 gtk-vnc-python rrdtool

View cache

A configured domain name service ( DNS ) server such as Bind may store previously resolved domain names to a local cache. By default the cached records will be stored for 7 days. The cache can be reused for future domain name resolutions. First, let's see how we can view all cached domain name resolutions:
# rndc dumpdb -cache
The above command will dump bind's cache into /var/cache/bind/named_dump.db. In case you cannot locate this file after you have executed the above command then check your server's configuration files to reveal the location of cache dump file. To view cached dns records simply cat or grep the resulting dump file. For example:
# grep gnu.org /var/named/data/cache_dump.db
gnu.org.                86358   NS      ns1.gnu.org.
                        86358   NS      ns2.gnu.org.
                        86358   NS      ns3.gnu.org.
ns1.gnu.org.            86358   A       208.118.235.164
ns2.gnu.org.            86358   A       87.98.253.102
ns3.gnu.org.            86358   A       46.43.37.70

Let's assume that that you are playing with iptables and wish to remove rules which are no longer valid, required or incorrect. One way of accomplishing this task would be to save all rules using iptables-save command, open the output file, remove all rules and use iptables-restore to apply new rules. Another and perhaps easier way is to list all available rules along with rule line numbers. For example:
# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         
1    DROP       all  --  anywhere             10.0.0.0/8          
2    DOCKER     all  --  anywhere             anywhere            
3    ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
4    ACCEPT     all  --  anywhere             anywhere            
5    ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination         

Chain DOCKER (1 references)
num  target     prot opt source               destination         
1    ACCEPT     tcp  --  anywhere             172.17.0.3           tcp dpt:https
2    ACCEPT     tcp  --  anywhere             172.17.0.4           tcp dpt:http
3    ACCEPT     tcp  --  anywhere             172.17.0.5           tcp dpt:4000
4    ACCEPT     tcp  --  anywhere             172.17.0.7           tcp dpt:mysql
5    ACCEPT     tcp  --  anywhere             172.17.0.7           tcp dpt:http
6    ACCEPT     tcp  --  anywhere             172.17.0.6           tcp dpt:3142

The Linux Cron time-based scheduler by default does not execute jobs with shorter intervals than 1 minute. This config will show you a simple trick how to use Cron time-based scheduler to execute jobs using seconds interval. Let's start with basics. The following cron job will be executed every minute:
* * * * * date >> /tmp/cron_test
The above job will be executed every minute and insert a current time into a file /tmp/cron_test. Now, that is easy! But what if we want to execute the same job every 30 seconds? To do that, we use cron to schedule two exactly same jobs but we postpone the execution of the second jobs using sleep command for 30 seconds. For example:
* * * * * date >> /tmp/cron_test
* * * * * sleep 30; date >> /tmp/cron_test

The following guide will provide you with simple to follow steps on how to reset your administrative root password on Linux.

Stop MySQL

First, stop MySQL server:
# service mysql stop
 * Stopping MySQL database server mysqld              [ OK ]

Start MySQL server>

Start your MySQL server, but skip all grand privileges and networking:
# mkdir -p /var/run/mysqld
# chown mysql:mysql /var/run/mysqld
# /usr/sbin/mysqld --skip-grant-tables --skip-networking &
[1] 8142

AMD’s RX 480 has been out for a little over a week now, and in that week Linux gamers have been clamoring or information on whether and how the card works on their favorite distribution. Sure, Ubuntu 16.04 is officially supported by AMD’s proprietary Pro drivers, but what about everyone else, and what if you want to use those AMDGPU open source drivers that have been in the works for so long? Well, it’s definitely possible, but it’s not all that easy.

WARNING: Here be dragons, big ones. They’re pretty much the kind you’d expect to see flying around Mereen, so if you don’t want to take the chance of breaking your install and some singed eyebrows, turn back now.

July 08, 2016
by Rares Aioanei

Introduction

As the title might suggest, this article will show you how to run X applications without using a window manager or desktop environment. You might ask yourself : why would I want to do that? Well, you might want to run a kiosk system where you only need to run the browser and/or the hardware resources are limited. Or you simply use only one/a few X applications and spend the rest of the time in a terminal so you don't need the overhead of a window manager. Or, last but not least, because it's an interesting experiment, akin to the one where you have to spend X days exclusively in a terminal. Also, it's fun! So let's get started.

Making sure we have all we need

What you need is pretty simple : a minimal Linux distribution or a similar Unix-like OS with the desired X applications installed and Xorg. In RHEL-based distributions installing Xorg is accomplished by doing
 $ sudo yum install xorg-x11*
while in Debian-based operating systems this is done with
 $ sudo apt-get install xorg

Sharing files between computers and servers is an essential networking task. Thankfully, Linux’s NFS(Networked File System) makes it extremely easy. With NFS properly configured, moving files between machines is as easy as moving files around on the same machine. Since NFS functionality is built directly into the Linux kernel, it is both powerful and available on every distro, though the configuration differs slightly between them.

Setting Up The Server

Installing The Packages

Linux NFS uses the Client-Server model, so the first step in getting NFS set up is setting up the server. Because the core NFS capabilities are rooted in the kernel, there isn’t much required in the way of packages, but there are still a few regardless of the distribution as well as some configuration. Almost all major distributions have NFS enabled, so unless you’re running a custom one, it should already be set up. The next step in getting the server set up is to install the packages.
On Ubuntu/Debian:
$ sudo apt-get install nfs-kernel-headers
On Fedora
$ sudo yum install nfs-utils system-config-nfs

Here's another installment of the Linux CLI basics series. This time we will deal with other interest-worthy tasks, like setting up your keyboard layout or using utilities to find files on your drive(s). We hope that the series will help you become a keyboard/terminal guru.

The tasks, part three

Setting the keyboard layout

When you're using some fancy desktop environment, changing the layout of your keyboard is simple and easy. A few clicks, you choose your preferred layout and maybe other localization settings and that's that. But what if you find yourself at a command-line-only machine and you have to use the machine, but the layout is set to French? The keys show a symbol but you type another and nothing works as it should. What to do? Or you decided to dump bloated GNOME or KDE for some lightweight window manager like Fluxbox. What you should use for this task strictly depends on whether you have X installed or not. If you do, the utility is called setxkbmap. If you don't you can use various tools provided by your distro (by the way, remember that we are using Ubuntu for our examples), but we will show you how to do it in terminal-only mode without depending on some distro-specific tools.

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?

man date

, 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

date

with no other arguments/flags, it will show you the current date. To set the date, you should type something like

date [MMDDhhmm[[CC]YY][.ss]]

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

FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: