Librenix
Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

Linux Iptables Examples

Up
vote
Down

Linux comes with a host based firewall called Netfilter. It is a set of hooks inside the Linux kernel that allows kernel modules to register callback functions with the network stack. A registered callback function is then called back for every packet that traverses the respective hook within the network stack.

This Linux based firewall is controlled by the program called iptables to handles filtering for IPv4, and ip6tables handles filtering for IPv6. This tutorial list most common iptables solutions required by a new Linux user to secure his or her Linux operating system from intruders. read more...
mail this link | permapage | score:9628 | -nixcraft, December 14, 2011

qrencode: Generate QR code from Ubuntu command line

Up
vote
Down

A QR Code (it stands for “Quick Response”) is a mobile phone readable barcode. simply encode a URL into the QR Code and then point a mobile phone (or other camera-enabled mobile) at it. If the device has had QR Code decoding software installed on it, it will fire up its browser and go straight to... read more...
permapage | score:9465 | -Linux Tips, October 26, 2011

Install skype from repository in Ubuntu 12.04

Up
vote
Down

Since Ubuntu 10.04 (Lucid Lynx), Skype is part of the Canonical partner repository. To install Skype add the Canonical Partner Repository. It is highly recommended to use the package provided in the Canonical partner repository, not the one distributed from the skype website...

(here are some nicely precise prints) read more...
permapage | score:9448 | -Linux Tips, April 12, 2012 (Updated: April 24, 2012)

Boxes: Draw Text Mode ASCII-art

Up
vote
Down

Boxes command is a text filter and a little known tool that can draw any kind of ASCII art box around its input text or code for fun and profit. You can quickly create email signatures, or create regional comments in any programming language. This command was intended to be used with the vim text editor, but can be tied to any text editor which supports filters, as well as from the command line as a standalone tool. read more...
permapage | score:9392 | -nixcraft, June 12, 2012

Install Skype in Ubuntu 10.10

Up
vote
Down

Skype software allows you to make free calls over the Internet...
Skype is a simple software which enables you to make free calls (Audio, video and conference) over the Internet by using VoIP protocol. It is available for all platform i.e. you can use it from Ubuntu, Windows or Mac OS X. It is very simple to use and graphical interface is also very user friendly with a lot of advanced features.
read more...
permapage | score:9308 | -Linux Tips, September 26, 2010

Tutorial: Identify Linux bottlenecks with kSar

Up
vote
Down

The sar command collect, report, or save UNIX / Linux system activity information. It will save selected counters in the operating system to the /var/log/sa/sadd file. From the collected data, you get lots of information about your server such as:

1. CPU utilization
2. Memory paging and its utilization
3. Network I/O, and transfer statistics
4. Process creation activity
5. All block devices activity
6. Interrupts/sec etc.

sar output can be used for identifying server bottlenecks. However, analyzing information provided by sar can be difficult, so use kSar, which can take sar output and plot a nice easy to understand graph over period of time. read more...
mail this link | permapage | score:9291 | -nixcraft, December 16, 2009

SSH Tricks

Up
vote
Down

Cool tips and tricks for SSH, including X forwarding, (s)ftp, remote filesystem mounting, and an SSH SOCKS function...
Most Linux users already know the bare basics of using OpenSSH. You use ssh to get a secure shell into a remote system, sftp for Secure FTP, and scp for copying files. All well and good.

But OpenSSH can do quite a bit more than many users realize. Let's take a look at some of the things you can do with OpenSSH and associated tools.
read more...
permapage | score:9193 | -Ray, January 20, 2011

Unix: Shell Script Wrapper Examples

Up
vote
Down

Shell script wrappers can make the *nix command more transparent to the user. The most common shell scripts are simple wrappers around third party or system binaries. A wrapper is nothing but a shell script that includes a system command or utility.

Linux and Unix like operating system can run both 32bit and 64bit specific versions of applications. You can write a wrapper script that can select and execute correct version on a 32bit or 64bit hardware platform. In cluster environment and High-Performance computing environment you may find 100s of wrapper scripts written in Perl, Shell, and Python to get cluster usage, setting up shared storage, submitting and managing jobs, backups, troubleshooting, invokes commands with specified arguments, sending stdout to stdout and stderr to stderr and much more.

In this post, I will explains how to create a shell wrapper to enhance the basic troubleshooting tool such as ping and host. read more...
mail this link | permapage | score:9115 | -nixcraft, June 24, 2012

ls* commands more useful than you know

Up
vote
Down

Everything is a file under Linux and ls* and friends can help you to dig out more information from the system than you originally thought. These Linux tips may come in handy when you need to find out information quickly without going through /proc or sysfs. read more...
permapage | score:9114 | -nixcraft, August 18, 2012

Tutorial: MySQL Linux C API

Up
vote
Down

MySQL database does support C program API just like PHP or Perl API.

The C API code is distributed with MySQL. It is included in the mysqlclient library and allows C programs to access a database.

Many of the clients in the MySQL source distribution are written in C. If you are looking for examples that demonstrate how to use the C API, take a look at these clients. You can find these in the clients directory in the MySQL source distribution.

This tutorial provides a sample MySQL C program and step by step compilation instructions to kick start MySQL programming via C API. read more...
mail this link | permapage | score:9025 | -nixcraft, June 1, 2007

Linux Sysadmin interview: Format and tips

Up
vote
Down

Recently I had to come up with a list of questions and a format for a sysadmin interview. From past experiences and talking to colleagues I found quite a few possible approaches and reasons, but there still are some common rules interviewers should keep in mind.

Use an email quiz to filter out the fakes and save heaps of time. We had a vacancy for a more senior role a while ago and received lots of good CVs. Barely the 2% of the applicants we sent the quiz to came back to us with decent answers, some wouldn't even finish it! Something easy is enough, we asked to describe a step-by-step backup restoration and to do some reformatting on a csv file.

Never scare them! Some people have an hard time during interviews but perform very well when on the job. Obviously you want to consider the emotional factor,especially for a sysadmin, which more than others might end up having to carry out critical tasks under pressure. But don't forget that the type of stress is different, and responding badly to one doesn't mean responding bad to the other, and vice-versa.

Avoid questions that can be answered with a RTFM! Otherwise it's cheaper to buy a parrot and read man-pages to it before bed time. As usual there are limits, some commands and options should be known. But try to prove they can use their brain rather than just remembering things. Possibly come up with problem-solving oriented questions, put together a bunch of different log files and ask them to reconstruct what happened; or ask them to explain you how they would deploy software to a large number of machines.

Leave questions as open as possible, you're moreinterested to understand their approach and attitude rather than in the actual answers (again, this is true to some extent, catch my drift). Invite them to think aloud, that generally works.

Find out if they are passionate about the subject, ask them about their distribution and why they use it (this is also a good way to spot zealots, avoid them as plague!). Ask them why they want to work as sysadmin and if they have particular reasons to apply for a position within your company.

If your company is mostly based on FLOSS, find out their knowledge and interest in free libre software, that is also a good indicator of passion.

Down to the questions (bear in mind the target was a junior admin):

Attitudinal questions

  • Test their knowledge of the "community", who's Linus Torvalds; Richard Stallman; Alan Cox; Eric Raymond, and maybe another few big names like Tanenbaum and Theo De Raadt.
  • Do you run Linux at home?
  • What distribution, why?
  • What project are you most proud of?
  • Why are you leaving your current job?
  • Why do you want this job?
  • Why should we hire you?
  • What is a sysadmin?

Geek questions
This is highly optional, but I'm possibly looking for a geek, and any person applying for a sysadmin position should be able to answer at least the first 2 questions.

  • Can you expand RTFM? BOFH?
  • What's the last man page you've read?
  • Do you read any webcomics?

Generic linux questions

  • What are setuid/setgid in relation to file permissions?
  • What are setuid/setgid in relation to directory permissions?
  • What is an inode?
  • What does init do? What does inetd do?
  • What’s PGP/GPG; Public/Private Key cryptographic systems
  • What’s ssh? Setting up trust between accounts.
  • How does ssl work?
  • What are different directories in / for?
  • What to do , if the newly build kernel does not boot.?
  • Do you know what source management is? have you used it? what software?
  • How does the boot process (init levels) work on Linux

Things we need
Depending on your business there might be some piece of software you heavily use, hence have particular interest for the candidate's knowledge about it Have you used Apache? Talk to me about it. In my case we primarily do web based services so I ask about apache and mysql.

  • What do you know about configuring and/or compiling Apache;
  • Virtual Hosts?
  • .htaccess files?
  • mod_perl? mod_php?
  • log files and log management
  • Are you familiar with SQL?
  • Do you know about indexes?
  • Can you name and explain some of the tables in the mysql database

Cli
We send an email quiz before the interview which includes a scripting test. You might want to setup one for the interview, generally parsing CSV files is a good one.

  • What shell do you use?
  • bash?
  • do you know any other?
  • Name some basic shell command like cut and explain what they do
  • Sed/awk?
  • Which editor? vim/emacs/something else

File systems and disks

  • What is the big difference between ext2 and ext3?
  • What about xfs?
  • Reiserfs?
  • Partitions layout
  • Different raid levels

Networking

  • What’s a hub?
  • Problems with hubs
  • What’s a switch?
  • What’s a router?
  • What’s the difference between UDP and TCP?
  • How would you find what ports are open on a machine (local and remote)?
  • What’s the OSI model? What are the seven levels?
  • How would you capture network traffic?
  • What’s a VLAN?
  • How does DNS work?
  • How does FTP work?
  • How does SMTP work?
  • What's traceroute?

Security

  • Do you know what a chroot is?
  • Do you know what a BoF is?
  • Do you know what an sql injection is?
  • Do you know what a DoS attack is?
  • Do you know what a botnet is?
  • What firewall applications have you used?
  • Can you name the problems of firewalling ftp?

read more...
mail this link | permapage | score:9024 | -Filippo Spike Morelli, May 21, 2007

Tutorial: Setup Linux iSCSI SAN

Up
vote
Down

Linux target framework (tgt) aims to simplify various SCSI target driver (iSCSI, Fibre Channel, SRP, etc) creation and maintenance. The key goals are the clean integration into the scsi-mid layer and implementing a great portion of tgt in user space.

The developer of IET is also helping to develop Linux SCSI target framework (stgt) which looks like it might lead to an iSCSI target implementation with an upstream kernel component. iSCSI Target can be useful:

a] To setup stateless server / client (used in diskless setups).
b] Share disks and tape drives with remote client over LAN, Wan or the Internet.
c] Setup SAN - Storage array.
d] To setup loadbalanced webcluser using cluster aware Linux file system etc.

In this tutorial you will learn how to have a fully functional Linux iSCSI SAN using tgt framework. read more...
mail this link | permapage | score:9019 | -nixcraft, November 14, 2008

Configure LEMP for maximum performance

Up
vote
Down

If you are using nginx as your webserver, you are looking for a performance boost and better speed. nginx is fast by default, but you can optimize its performance and the performance of all parts (like PHP and MySQL) that work together with nginx. Here is a small, incomprehensive list of tips and tricks to configure your LEMP system (Linux, nginx, MySQL, PHP-FPM) for maximum performance. These tricks work for me, but your mileage may vary. Do not implement them all at once, but one by one and check what effect the modification has on your system's performance. read more...
mail this link | permapage | score:8980 | -falko, September 24, 2012

Tutorial: RHEL 5.3 to 5.4 upgrade

Up
vote
Down

Red Hat Enterprise Linux v5.4 has been released and available via RHN for immediate update. The new version includes the kernel-based virtual machine (KVM) virtualization, next generation of developer features and tools including GCC 4.4, a new malloc(). Also included clustered, high-availability filesystem to support Microsoft Windows storage needs on Red Hat Enterprise Linux.

This tutorial explains how to upgrade RHEL v5.3 to RHEL v5.4. read more...
permapage | score:8927 | -nixcraft, September 3, 2009

Download: Linux 3D Client for Starship Traders

Up
vote
Down

[Note: Katrina Kirellii now maintains the Linux and Windows versions of the graphical client. The new code can be downloaded from this page.]

Linux game testers wanted

A new version of the Starship Traders multiplayer strategy game is under development. The new version, ST2, has a 3D interface and includes an X-Window-based client program. ST2 is considerably faster than its WWW predecessor and integrates a graphical display and point-and-click mouse controls with a complete keyboard interface. Linux users are needed to participate in the first test game since no other operating systems are yet supported.

The new server is up and running now and a Linux version of the client is available. The client is a dynamically linked Linux x86 binary and requires the Mesa3D or OpenGL libraries -- which should already be installed on most modern distros. Internet access is also required to play in the test game, of course.

To participate in the game you must download, gunzip, and run the Linux binary as described below. It should connect to the ST2 test game automatically and you will be prompted to log in.

[Here is a screenshot of a sector with a starbase, a planet, a tradingpost, some sector debris, a few fighters, a wormhole, and, if you look closely, a couple of small starships in the lower left quadrant intermixed with the text. This screenshot is with the window at 640x480. For a less cluttered appearance you can click resize -- while playing -- to expand (or shrink) the window.]

Download and setup instructions
  • Right click here
  • select Save ...
  • gunzip sst012.gz (your browser may do this step automatically)
  • chmod 555 sst012
  • ./sst012
... and you should be online.

The source code, released 17 September, 2001, can be downloaded from this page.

The Game

Starship Traders II is a trading and war game set in a universe divided into multiple galaxies. Individual locations within the game, called 'sectors', can contain ports, planets, nebulas, wormholes, and black holes, as well as objects owned by players. Players can park their starships, deploy their fighters, and build starbases in sectors.

Players can earn money ('microbots') by hauling commodities between ports and from planets. These microbots can be used as cash to buy equipment and military hardware at trading posts, or microbots can be used directly in combination with commodities to build fighters or starbases.

Players can deploy fighters and build starbases to guard prime trading territories and valuable sectors or they can use fighters to attack the deployed forces of other players. Players can also attack and destroy the starships of other players that they find.

Players can create teams which are ranked separately from the player standings. Players can apply to a team and the team captain can then either accept or reject the application. Team members can move safely through the fighter and starbase fortifications of their teammates and allied attack-mode starbases will not attack them.

Obviously, as in any multiplayer strategy game, politics and diplomacy can be important. Try to avoid making too many enemies early in the game!

Controls

F1 and F2 will scroll you back and forward in the scrolling portion of the heads-up display. F10, F11, and F12 will select different size windows. Running the client with a -w argument (eg.: sst012 -w) will cause it to load into a normal, resizeable window with the standard borders and window controls. Otherwise, it runs in a full-screen mode which may not include borders.

You can fly around within a sector using the arrow keys and pageup/pagedown. Don't do much of this or you may get lost. As you enter each new sector, you start out in the same relative position that you were in in the previous sector so it's possible to fly far away from the center of a sector and not easily find it again. If that happens, log out and back in to get back to the center of the sector.

Move the mouse over any clickable menu option (those that change color when the pointer is over them) and wait about 2 seconds for a popup tip about that menu item.

There is a log off (quit) command in the menu that logs you out, disconnects from the server, terminates the client, and closes the window. If you go link-dead while playing, however, or are otherwise left with an unresponsive client, press Escape to close the window and terminate the client.

Game play

Routine trading and galaxy exploration can be accomplished with as little effort as clicking Computrade on the heads-up display. You can also click on anything in the top half of the display to select that option. Note that options containing a capital letter can also be selected by pressing the appropriate key. Therefore, pressing the c key is equivalent to clicking Computrade.

Options without a capital letter generally have the hot key designated with parens. For example, "keyboard map (?)" can also be accessed by the '?' key.

Right click on any item in the top half of the heads-up display for a brief explanation of that menu option (and the corresponding keyboard key).

History

Starship Traders II is derived, through a long and meandering lineage, from The Last Resort, which evolved from Tsarwars, itself inspired by Czarwars. Czarwars was a DOS-based BBS game dating back to December, 1986. Czarwars was inspired by Chris Sherrick's version of Trade Wars, which drew it's inspiration from Hewlett-Packard's Star Trader, from The People's Book of Computer Games.

Changlog

5/22/01, v.0.02: Lockup after 5 minutes idle bug fixed
5/24/01, sst004: Menu items change color, Star clusters added
5/24/01, sst005: Popup tips added on clickable items
5/24/01, sst006: Rotating ports
5/26/01, sst007: Bigger, moving fighters, more popup tips
5/26/01, sst008: Moving ships, more popup tips
5/27/01, sst009: All heads-up display items now have popup tips
5/27/01, sst010: Bug fix: resizable window works again
5/29/01, sst011: Colors won't wash out on some displays, cursor added, in-sector movement speed scales better on high-speed displays, bar charts work correctly, bottom line of text doesn't disappear on some window sizes
5/31/01, sst012: minor popup documentation changes
5/12/02, sst012d: bug fix, new menu options added
mail this link | permapage | score:8840 | -Ray, May 12, 2002 (Updated: March 21, 2007)

Beginner Ubuntu Tips

Up
vote
Down

Twenty-five tips for Ubuntu beginners...
Adding another source for software is easy; once you've installed addrepo, you can do it in the terminal by typing something along the lines of addrepo deb http://mirror2.ubuntulinux.nl/ lucid-seveas all.

If you find new repositories online, they will usually give you the right details to enter. You could also do it graphically by going to 'System | Administration | Software Sources | Third Party Software | Add'. read more...
permapage | score:8829 | -Ray, November 9, 2010

Customize Linux Mint 10

Up
vote
Down

After a review of Linux Mint 10, the next logical step is to write a few tutorials and tips for those that might need it. The first of these tutorials is a very basic one: It will present several steps you can take to customize a new installation of Linux Mint 10.

The list of tips that will be presented covers basic desktop customizations, enabling and configuring Gufw, the graphical firewall client, and installing standard GNOME games. read more...
permapage | score:8828 | -finid, November 27, 2010

Handy shell aliases for Linux/Unix

Up
vote
Down

An alias is nothing but shortcut to commands. The alias command allows user to launch any command or group of commands (including options and filenames) by entering a single word. Use alias command to display list of all defined aliases. You can add user defined aliases to ~/.bashrc file. You can cut down typing time with these aliases, work smartly, and increase productivity at the command prompt. read more...
permapage | score:8802 | -nixcraft, June 11, 2012

Install Skype in Ubuntu 11.04

Up
vote
Down

Skype hasn’t been uploaded to the official partner repository of Ubuntu 11.04 Natty Narwhal. So for those who are trying out Natty out there will need to install Skype from their website. Below is the steps for that. read more...
permapage | score:8801 | -Linux Tips, January 11, 2011

PDFedit: A Linux PDF editor

Up
vote
Down

Adobe Acrobat is a commercial tool for manipulating PDF files. Earlier I was using CUPs - printing system, to export PDF files. I’ve also tried out gv for the same purpose. However, I needed complete editing of pdf documents. My search ended with PDFedit software, which is free and open source editor for manipulating PDF documents. The software available in both GUI and CLI (commandline) interface. read more...
permapage | score:8797 | -nixcraft, December 19, 2007
More articles...
Beautiful Abstract Art Prints

Recent headlines

Install Mplayer and Multimedia codecs on Ubuntu 13.04

A backdoor in all Internet products and services?

Upgrade Ubuntu 12.10 to 13.04

Using Multiple PHP Versions (PHP-FPM FastCGI) With ISPConfig 3 (Ubuntu 12.04)

Lynis: Security and system auditing tool

ARM-based EMB-2500: Like Raspberry Pi, but much better

Tutorial: Build an Ubuntu 13.04 Server (Apache2, BIND, Dovecot)

Tutorial: Ubuntu 13.04 Samba Server with tdbsam

Find wasted disk space with the Agedu Unix utility

Tutorial: PHP5-FPM with Apache2 on OpenSUSE 12.3

Virtual Hosting: Proftpd, MySQL on Ubuntu 12.10

Tutorial: Install Nginx, PHP5, PHP-FPM, and MySQL on CentOS 6.4

KVM Virtualization on CentOS 6.4

Setting up ProFTPd + TLS on Ubuntu 12.10

Virtual Users/Domains with Postfix, Courier, MySQL, SquirrelMail (CentOS 6.3)

Encrypt your data with EncFS (OpenSUSE 12.3)

Tutorial: Automatically add a disclaimer to emails with alterMIME (Postfix on Debian 6)

Tutorial: Install Lighttpd, PHP5, MySQL on CentOS 6.4

4 gui applications for installing Linux from USB key

Tutorial: Run Joomla 1.7 on Nginx on Debian 6, Ubuntu 11.10

Tutorial: Webcam streaming your desktop plus audio with ffmpeg, crtmpserver, Flowplayer

Tutorial: Install Piwigo Gallery on Nginx (Debian 7)

Tutorial: Replace Windows with Ubuntu 13.04

The Debate OS Project

Tutorial: Install Apache2, PHP5, MySQL on OpenSUSE 12.3

Google Reader axed. Is FeedBurner next?

Multiboot Linux distributions from one USB key

Tutorial: PrestaShop 1.5.x on Nginx (Debian 7/Ubuntu 12.10

Install Apache2, PHP5, MySQL on CentOS 5.7

Riak Cloud Storage released under Apache 2 license

The Coming HTML 5 Revolution in Linux

Kali Linux 1.0 review

Tutorial: Multiple PHP Versions (Ubuntu 12.10)

Infotainment systems: The next generation

Fedora 16 security features

Fedora 16 KDE review

tmux: terminal multiplexer

Virtual Hosting with PureFTPd, MySQL on CentOS 6.4

OpenBSD Tutorial: Configure Ralink USB Wireless Adapter

Deploy Piwik Web Analytics on OpenShift Online

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

 
Articles are owned by their authors.   © 2000-2012 Ray Yeargin