Posts

Ubuntu Server : Update server software from command line

You can update your Ubuntu server from remote ssh login by following simple command. sudo apt-get update sudo apt-get dist-upgrade Cheers!

Wrong Command : May Loss all

Alas! Today I loss almost all the data in /var/. I wanted to move a folder from /var/www/cron-script  to /var/ Unintentionally I gave the command rm instead of mv . Then I lost all of my webserver content in a second.   Fortunately I had a backup of 10 days ago. That save me to loss all. So friends be careful! Now I need to reinstall the OS(I use Ubuntu) again. Just 3 days before Ubuntu relese a new version 10.10 on the Binary day 10.10.10. So now I am downloading that version. Thanks Abser

Install Ioncube Loader while SELinux Enabled

When you install free ioncube loader under CentOS 5.x, which has SELinux enabled by default, you will see following error message: “cannot restore segment prot after reloc: Permission denied” You have a few options here. You can disable SELinux, edit /etc/selinux/config, look for” SELINUX=”, put “disabled” to the right of “=”, it reads like this “SELINUX=disabled”, when you restart the machine, SELinux will be totally disabled. But when you want to enable SELinux lately, the system will relabel all the files at the boot time, it will take very long time to finish the relabeling process, so disable SELinux is not recommended. Then you can put “permissive” in place of “disabled”, or run “ setenforce 0 ” on command line(“ setenforce 1 ” re-enable it),  you will see warning messages but SELinux won’t do anything to stop unauthorized access. If you are serious about security, probably you won’t feel comfortable when SELinux is not ...

20 Linux System Monitoring Tools Every SysAdmin Should Know

Image
Need to monitor Linux server performance? Try these built-in command and a few add-on tools. Most Linux distributions are equipped with tons of monitoring. These tools provide metrics which can be used to get information about system activities. You can use these tools to find the possible causes of a performance problem. The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as: Finding out bottlenecks. Disk (storage) bottlenecks. CPU and memory bottlenecks. Network bottlenecks. #1: top - Process Activity Command The top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds. Fig.01: Linux top command Commonly Used Hot Keys The top command provides several useful hot keys: Hot Key Usage t Displays summary information off and on....

How To: Disable Firewall on RHEL / CentOS / RedHat Linux

iptables is administration tool / command for IPv4 packet filtering and NAT. You need to use the following tools: [a] service is a command to run a System V init script. It is use to save / stop / start firewall service. [b] chkconfig command is used to update and queries runlevel information for system service. It is a system tool for maintaining the /etc/rc*.d hierarchy. Use this tool to disable firewall service at boot time. How Do I Disable Firewall? First login as the root user. Next enter the following three commands to disable firewall. # service iptables save # service iptables stop # chkconfig iptables off If you are using IPv6 firewall, enter: # service ip6tables save # service ip6tables stop # chkconfig ip6tables off

See file content

There are various way to see the file content in linux. 1. cat Symbol: cat fileName will show the content of file in shell. 2. head head will show the content from the top of the file. In head you can specify number of line you want to see. Symbol: head -20 fileName will show the first 20 lines from the file. 3. tail tail will show the content from the bottom of the file. like head you can specify the number of line you want to see Symbol: tail -100 fileName will show last 100 line from the file. *** I f you want to see content from a log file which is continuously written by system/other application use tail as follows. tail -20f fileName. This will continously show the last written 20 line from the file.

Format Pen Drive in Linux

Insert your USB pen drive. Let it get detected and mounted. Open Terminal. Type The Following commands 1. dmesg |tail –> here the ‘|’ key is the pipe, ie, the key before the backspace key(the upper one, so press shift) You’ll get something like sathya@shaman:~$ dmesg |tail [ 9921.681164] sda: Write Protect is off [ 9921.681174] sda: Mode Sense: 23 00 00 00 [ 9921.681178] sda: assuming drive cache: write through [ 9921.709138] SCSI device sda: 4030464 512-byte hdwr sectors (2064 MB) [ 9921.720951] sda: Write Protect is off [ 9921.720963] sda: Mode Sense: 23 00 00 00 [ 9921.720967] sda: assuming drive cache: write through [ 9921.721225] sda: [ 9921.727896] sd 0:0:0:0: Attached scsi removable disk sda [ 9921.744187] sd 0:0:0:0: Attached scsi generic sg0 type 0 Note the terms in bold. In your system it will be different, maybe sdb or something. Whatever it may be, make sure to substitute it in the commands below, else your hard disk may get formatted. 2. Unmount your pe...

Truncate a file or Log

To trancate a log file which is used by a continuous process is simple:): :>logfile

File compression tools for Linux

File compression tools for Linux Share Print Comments Among the confusion new Linux users often face is the variability among archived and compressed formats used by downloaded applications. "Should I use the tar.gz file, the zip file, or the tar.bz2 file?" they may wonder. Here's what you need to know about compression formats in order to easily install any application. First, consider the distinction between archiving and compression. Archiving means combining a number of files together into one file. The idea is to achieve easier storage and transportation. It's like having a briefcase in which to keep all your files. The archive must contain some information about the original files, such as their names and lengths, for proper reconstruction. This ensures that your paperwork will remain as-is when you open your briefcase. Some popular archive file formats are tar and zip. Compression, on the other hand, is the process of using encoding schemes to store inf...

Cron Help

Cron This file is an introduction to cron, it covers the basics of what cron does, and how to use it. What is cron? Cron is the name of program that enables unix users to execute commands or scripts (groups of commands) automatically at a specified time/date. It is normally used for sys admin commands, like makewhatis , which builds a search database for the man -k command, or for running a backup script, but can be used for anything. A common use for it today is connecting to the internet and downloading your email. This file will look at Vixie Cron, a version of cron authored by Paul Vixie. How to start Cron Cron is a daemon, which means that it only needs to be started once, and will lay dormant until it is required. A Web server is a daemon, it stays dormant until it gets asked for a web page. The cron daemon, or crond , stays dormant until a time specified in one of the config files, or crontabs . On most Linux distributions crond is automatically in...

Compiling and Installing Software from Source

So you've downloaded a software package with tar.gz or tar.bz2 extension and have no idea what to do with it. Or perhaps you already know that it's most likely the source code of the program you want to install and you have to compile it, but don't know how. Don't worry, compiling and installing software from source in Linux isn't as hard as it may sound! The installation procedure for software that comes in tar.gz and tar.bz2 packages isn't always the same, but usually it's like this: # tar xvzf package.tar.gz (or tar xvjf package.tar.bz2) # cd package # ./configure # make # make install If you're lucky, by issuing these simple commands you unpack, configure, compile, and install the software package and you don't even have to know what you're doing. However, it's healthy to take a closer look at the installation procedure and see what these steps mean. Maybe you've already noticed that the package containing the source code of the progr...

Introduction to Linux

Linux Shortcuts and Commands: Linux Newbie Administrator Guide by Stan and Peter Klimas This is a practical selection of the commands we use most often. Press to see the listing of all available command (on your PATH). On my small home system, it says there are 2595 executables on my PATH. Many of these "commands" can be accessed from your favourite GUI front-end (probably KDE or Gnome) by clicking on the right menu or button. They can all be run from the command line. Programs that require GUI have to be run from a terminal opened under a GUI. Legend: = single special or function key on the keyboard. For example indicates the "control" key. italic = name of the file or variable you probably want to substitute with your own. fixed width = in-line Linux commands and filenames. Notes for the UNIX Clueless: 1. LINUX IS CASE-SENSITIVE. For example: Netscape, NETSCAPE and nEtscape are three different commands. Also my_filE, my_file, and my_FILE are three different files...