Archive for the 'tips' Category Page 3 of 15



FAQ: How to retreive hardware manufacturer name, serial numbers, etc. in Linux command line

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

ibm serial numberQuestion: How can I get information about hardware manufacturer, model name, serial number, BIOS information using Linux command line (CLI)?

Answer: You are welcome to use dmidecode which helps to get information about your system’s hardware as described in your system BIOS. That information typically includes system manufacturer, model name, serial number, BIOS version, asset tag as well as a lot of other details depending on the manufacturer.

Beware that DMI data have proven to be too unreliable to be blindly trusted. Dmidecode does not scan your hardware, it only reports what the BIOS told it to. Dmidecode was first written by Alan Cox and is now being further developed and maintained by Jean Delvare. It is released under the General Public License (GPL).

This tool can be easily downloaded from here (source code) or can be installed as binary package included into repositories of many distributions like Debian, Ubuntu, Gentoo. FreeBSD version is also available. Actualy it is reported that dmidecode works well on the following systems:

  • Linux i386
  • Linux x86_64
  • Linux ia64
  • FreeBSD i386
  • FreeBSD x86_64
  • NetBSD i386
  • OpenBSD i386
  • BeOS i386
  • Cygwin i386
  • Solaris x86 (CVS version)

In Ubuntu (my favourite distro) just execute the following: sudo aptitude install dmidecode (sample output is here).

FAQ: static routes after restart/reboot in Fedora/RedHat/CentOS

route 66Static routing is the term used to refer to the manual method used to set up routing. An administrator enters routes into the router using configuration commands. This method has the advantage of being predictable, and simple to set up. It is easy to manage in small networks but does not scale well.

Question: How can I save static routes I set up in my Fedora/RedHat/CentOS Linux after I reboot server?

Answer: In Fedora Linux (or RedHat, CentOS) you can set up static routes for certain network interface (for example eth1) by editing file /etc/sysconfig/network-scripts/route-eth1.

For example, you have to save static route added by the following command:

route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.100.1 dev eth1

To do it, just add the following line to /etc/sysconfig/network-scripts/route-eth1:

ADDRESS0=192.168.0.0
NETMASK0=255.255.255.0
GATE
WAY0=192.168.100.1

Why and how to migrate to ext4

Ext4 is the latest in a long line of Linux file systems, and it’s likely to be as important and popular as its predecessors. As a Linux system administrator, you should be aware of the advantages, disadvantages, and basic steps for migrating to ext4. IBM DeveloperWorks article explains when to adopt ext4, how to adapt traditional file system maintenance tool usage to ext4, and how to get the most out of the file system:

The single most dramatic improvement in ext4 is in file and file system size. Thus, the users who are most likely to need ext4 are those who have more than a few terabytes of disk space. The list of features in Table 1, though, may present some other tempting improvements. For instance, you might want to try ext4 if you have directories with huge numbers of subdirectories or if you need timestamps accurate to less than a second. Read more >>

Real 10$ Wi-Fi antenna (Video)

wifi logoWhy spend $100 or more on a Wi-Fi antenna when you can create your own one for $10? The following components are needed:

  • 35-mm foam (like the kind desktop and laptop PCs usually come with)
  • Solid-core copper wire
  • Small brass plate
  • Multiple BNC connectors

Follow the instructions in the video:

Install Ubuntu as Windows XP/Vista Application (with Wubi)

wubi logoToday it is possible to install Ubuntu Linux 8.04 (Hardy Heron) under Windows XP or Vista without necessity to create separate partition for it. The tool that allows to do it is called Wubi. Actually it is Ubuntu installer for Windows helping you ro install and uninstall Ubuntu with few clicks. Here is nice brief article on how to set it up under Vista:

Wubi adds an entry to the Windows boot menu which allows you to run Linux. Ubuntu is installed within a file in the Windows file system (c:\wubi\disks\system.virtual.disk), as opposed to being installed within its own partition. This file is seen by Linux as a real hard disk.

Sweeet! :)

OpenBSD: Secure Mail Server with Postfix, MySQL, ClamAV, SpamAssassin, Amavis-new

openbsd logoFew days ago I started configuring corporate mail server that should be deployed on OpenBSD and comprise the following features:

  1. Easy to configure and powerful MTA (Postfix)
  2. Virtual domains and user accounts (this information is stored in MySQL database)
  3. Antispam and antivirus checking for all accounts (spamassassin and clamav via amavis-new)
  4. Secure access to mailboxes through POP3, IMAP and HTTP (squirellmail)
  5. Secure SMTP server
  6. Extremal Stability and Security

Actually OpenBSD 4.2 was chosen because of it’s “security by default”. Thankfully Daniele Mazzocchio from friendly site www.kernel-panic.it wrote an excellent article about how to build such mail server on this operating system:

Offering a reliable and secure email service is probably one of the top priorities of most system administrators; therefore, in the next chapters, we will build a full-featured mail server, based on open-source software and focusing on security. Read more…

The only thing that is not covered by it is mail content filtering with maildrop and vacation messages that users often ask to set while they are out. Working on it! :)

Tiny perl script for UDP flooding

Sometimes it is necessary to perform UDP flood towards some network device(s) in order to test its behavior in stress… Actually I am sure that every system administrator might use this small perl script for this purpose. Certainly there are many special programs for this but believe me that it is much more easier to do the following:

1. #touch > /tmp/flood.pl
2. #chmod +x /tmp/flood.pl
3. Copy the this code to /tmp/flood.pl:

4. Then /tmp/flood.pl 192.168.0.1 0 0 0, where 192.168.0.1 is IP you would like to flood with huge amount of UDP datagrams.

Thanks to Ivan Pepelnjak from http://ioshints.blogspot.com/.




Information Improvisation: Operating system is the backbone for every organization. Having professionals with CISSP certification in organization ensures the life running through its networks. Organizations manage tremendous amounts of traffic due to the use of pc phone and people with 646-058 certifications are ideal for this job. They can also manage online networks which can be hosted on lunarpages, which also provides free email hosting. With the company's logo design every page and a well crafted web template the site can be given a graceful look.

 

Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | LinuxHaxor.net | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››