Archive for 'Linux'

nagios love – vote on SourceForge.net Community Choice Awards

nagios

SourceForge.net Community Choice Awards have opened up for voting,
now is your time to go and vote for your favorite Open Source applications,
Show the love for those Linux apps your have been using for free for so long :)

I’m voting for nagios in the “Best Tool or Utility for SysAdmins” Category,
and here is the direct link to vote for nagios.

But don’t stop there – other apps I’ve been lovingly using for the last years and I’m gonna give some voting love for are:

  • xampp  -  apache mysql php and perl on windows/linux
  • TortoiseSVN  -  SVN client for windows
  • Notepad++  -  The best simple text editor
  • Audacity  -  Sound editor
  • phpMyAdmin  -  Management system for MySQL Database
  • OpenOffice.org  -  MS office replacement
  • KeePass  –  Password manager

There where some hard choices to do there, since in the same categories I had more then one app that I’m totally depending on for day to day work.

phpMyAdmin changed the way I’m working with Mysql databases,
Notepad++ is my favorite editor on my windows box,
and with Audacity i make all my ring tones :)

what are your favorite Opensource apps?

Technorati Tags: , , ,

chattr and lsattr – protecting Linux Files

Lets say you have a public folder in your firm and you want everyone to edit the files in that folder except of one. how would you go about protecting that file?

Lets add to the equation the fact that you have scripts running as root on the folder and you want them not to be able to touch that file. any ideas?

That’s where chattr and lsattr step in, they manage special attributes for files under ext2 and ext3, and the one I’m referring to here is the ‘i’ setting – immutable, for a sample:

lets create a file:
echo `date` > filename

as root do:
chattr +i filename

And that’s it,you cant delete the file, move it, rename it, or save into it any changes, until you remove the ‘i’ settings from it.

So next time you find a file that you cannot modify or delete even as root, check it with lsattr, to make sure its not protected in some other way.

A short update – This will not work on NFS mounted file systems,
you will get the following error:
lsattr: Inappropriate ioctl for device While reading flags on

Technorati Tags: ,

WordPress 2.8 and a new Theme

I have upgraded the site to wprdpress 2.8,
and it does feel faster for the admin part,
also I have installed the free Typebased theme from  http://www.woothemes.com/

From my first impression i can see SEO mistakes that need to be fixed, like H2 tags on widget titles like Categories,
ill finish the last updates soon.

Check the site out and tell me what you think !!!

Technorati Tags:

Linux Commands – Top 20 Most Used

Installing linux on ps3

The history file is a log file of your last used commands on the Linux server,
It can be found in your home directory and is called .bash_history (with the “.” in the start).
You can either read the file itself to see its content, or use the command history which will do the same thing.

When looking at my history files on my Linux servers,
I can see maybe 20 Linux commands which I keep using over and over,
They are the most important tools of my work, and I recommend learning them well to any starting Linux sysadmin.

Files and Directories Management

  • ls – Lists files and directories content, I usually use “ls -la” to have a long listing with all the details and hidden files
  • cd – move from the current directory to a different folder
  • pwd – lists your current location
  • mv – this command can either change the name of a file, or move it to a different location.
  • locate – find any file on the Linux server, to get an updated index of files (if for example you just installed a whole bunch of RPM’s) run the command updatedb
  • ln – create a shortcut to a file or folder
  • tar – create or extract files out of a storage file. with the correct arguments it will also compress the files

Editing and Viewing

  • tail – lists the last 10 lines of a file, but you tell tell it to show any number of last lines
  • vi – the best command line editing software :)   a little hard to learn how to work this one at first, buts its worth the effort
  • cat – list the content of the file. better know how long is the file you are running this command on, or you will get a very long scrolling of lines that will fill up your screen

A Very Good Linux Administration Book

Network

  • nslookup – very important networking tool – this will show you where a DNS name is pointing – to which IP or to another DNS
  • wget – get a file from the web from the command line – if you need to download some RPM directly to the command line without a browser, this is the command you need
  • ping – I think its one of the most used commands, you can check the time it takes you to get via the network to a remote server, whether that server is available, how many packets are getting to the server, etc

Installing linux on ps3

General

  • history – lists the last used commands on your Linux server
  • make – when compiling a software from source, this command will create the binaries
  • id – who am I right now? besides the philosophical angle, this command will show you as which user you will be running commands, I use this to check what is my status, and then sudo to the user I need
  • sudo – execute a command as another user – although  usually use it to change to root
  • ps – list the running processes on the server, it give more info like the process id, the parent process id, running time and much more
  • man – displays a manual page, whenever you are not sure about a specific command or config file, you should run “man command” to get info about it. to search the man database use “whatis command” to find which man file has the info you need
  • df – report file system disk space usage, use “df -h” to get a human formatted listing

Installing linux on ps3

Technorati Tags: , , ,

Linux Server Information – The Easy Way

cfg2htmlsml

In my last post I talked about listing your Linux server hardware information via command line tools,
but for the lazy Linux sysadmins there is a tool which will collect all your Linux server information for you in one swipe.

cfg2html tool

It will collect everything and sort it out, and will create a nice html for you to list everything you ever wanted to know about your Linux server.

it will list this info and much much more:

  • The Operation system installed and current status of it
  • reboots
  • memory consuming processes
  • uptime
  • services startup and runlevel
  • current and default runlevel
  • crontab listing
  • a lot of info about all the hardware installed
  • which packages are installed
  • Hard-disks information
  • LVM info
  • all the different network settings
  • Kernel modules and libraries
  • and a lot more.

simple cfg2html Installation:

download the package from the server:

cd /tmp
wget http://www.cfg2html.com/cfg2html-linux-1.60-20090415_all.zip
unzip cfg2html-linux-1.60-20090415_all.zip
rpm -ivh cfg2html-linux-1.60-1.noarch.rpm

if there is already an older version installed you can update it with:

rpm -ivh –freshen cfg2html-linux-1.60-1.noarch.rpm

edit the server details config text file:

vi /etc/cfg2html/systeminfo

and run the Linux server info gathering script:

cfg2html-linux

this will create a couple of files named after your computer name and a couple of images.
all you have left to do is open the server_name.html file with your favorite browser (eg. firefox) and that’s it – all your Linux server information is there to go through.

Technorati Tags: ,