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

No Starch Press has published my Perl One-Liners book!

Up
vote
Down

My Perl One-Liners book was just published by No Starch Press!

Perl one-liners are small and awesome Perl programs that fit in a single line of code. They do one thing really well—like changing line spacing, numbering lines, performing calculations, converting and substituting text, deleting and printing specific lines, parsing logs, editing files in-place, calculating statistics, carrying out system administration tasks, or updating a bunch of files at once. Perl one-liners will make you a shell warrior: what took you minutes (or even hours) to solve will now take you only seconds! read more...
mail this link | permapage | score:9971 | -pkrumins, March 24, 2014

Tutorial: Create an NFS-like Storage Server with GlusterFS on Ubuntu 12.10

Up
vote
Down

This tutorial shows how to set up a standalone storage server on Ubuntu 12.10. Instead of NFS, I will use GlusterFS here. The client system will be able to access the storage as if it was a local filesystem. GlusterFS is a clustered file-system capable of scaling to several peta-bytes. It aggregates various storage bricks over Infiniband RDMA or TCP/IP interconnect into one large parallel network file system. Storage bricks can be made of any commodity hardware such as x86_64 servers with SATA-II RAID and Infiniband HBA. read more...
mail this link | permapage | score:9830 | -falko, January 16, 2013

Better Grails apps with CSS

Up
vote
Down

This article focuses on dramatically changing the look and feel of a Grails application. With a few lines of CSS, you can change colors, fonts, and the spacing around block elements. Through partial templates and TagLibs, you can create some reusable snippets of code. In the end, you have all the benefits of the Grails framework and an application that has its very own look and feel, that looks nothing like an out-of-the-box Grails application you have ever seen.

(check out this dramatic canvas prints) read more...
mail this link | permapage | score:9795 | -solrac, January 22, 2009 (Updated: April 24, 2012)

OpenShift Online: a non-developer guide

Up
vote
Down

OpenShift Online is a developer-targeted service, but this article is aimed at non-developers, just to highlight the aspect of the service you can take advantage of. read more...
permapage | score:9793 | -finid, March 31, 2013

Detailed Error Handling In Bash

Up
vote
Down

Shell scripts are often running as background processes, doing useful things without running in a visible shell. To write such scripts can be quite painful, as all errors occur out of sight as well. While log files can hold a lot of information, finding the relevant information is a bit trickier. My solution is to log only the errors with all the details to a small database. This database contains tables for the message, the corresponding stack trace and the important environment variables. I have chosen for an SQLite database in this howto, but the same principle works with other databases as well. read more...
mail this link | permapage | score:9765 | -falko, February 21, 2013

Using Git for Source Control

Up
vote
Down

GIT is the source control tool, a distributed version control system (dvcs) which is written in C. This provides a history of the files that are maintained by it. In distributed version control each user has a complete copy of the code so there is no central code repository. In this scenario an administrator makes changes, adds them to the index (called staging) and then adds them to the repository (called commit). Git will take this information and maintain a version history that users can track. This is all performed locally but could be synchronized with a remote repository. read more...
mail this link | permapage | score:9759 | -aweber, May 5, 2012

Tutorial: Build a C/C++ memory manager

Up
vote
Down

As a developer, one of the most powerful tools that C/C++ arms you with to improve processing time and prevent memory corruption is the control over how memory is allocated or deallocated in your code. This tutorial demystifies memory management concepts by telling you how to create your very own memory manager for specific situations. read more...
permapage | score:9717 | -BlueVoodoo, February 23, 2008

Introduction to Perl one-liners

Up
vote
Down

Perl one-liners are small and awesome Perl programs that fit in a single line of code and they do one thing really well. These things include changing line spacing, numbering lines, doing calculations, converting and substituting text, deleting and printing certain lines, parsing logs, editing files in-place, doing statistics, carrying out system administration tasks, updating a bunch of files at once, and many more. Perl one-liners will make you the shell warrior. Anything that took you minutes to solve, will now take you seconds! read more...
mail this link | permapage | score:9703 | -pkrumins, May 28, 2012

E-book: Perl One-Liners Explained

Up
vote
Down

I'm happy to announce my 3rd e-book called "Perl One-Liners Explained."

Perl one-liners are small and awesome Perl programs that fit in a single line of code and they do one thing really well. These things include changing line spacing, numbering lines, doing calculations, converting and substituting text, deleting and printing certain lines, parsing logs, editing files in-place, doing statistics, carrying out system administration tasks, updating a bunch of files at once, and many more.

Here is an example. Suppose you quickly need to generate a random, 8 character password. You can do it quickly with this Perl one-liner:

perl -le 'print map { ("a".."z")[rand 26] } 1..8'

Overall, the e-book has 111 pages and it explains 130 unique one-liners. Many of one-liners are presented in several different ways so the total number of one-liners in the book is over 200. read more...
mail this link | permapage | score:9691 | -pkrumins, February 4, 2012

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:9670 | -nixcraft, June 24, 2012

e-book: Sed One-Liners Explained

Up
vote
Down

I love writing about programming and I am happy to announce my second e-book called "Sed One-Liners Explained".

Sed one-liners are short sed scripts for everyday situations in the shell, such as changing line spacing, numbering lines, and converting and deleting text.

For example, the following sed one-liner numbers the lines of a file:

sed = file | sed 'N; s/n/: /'

Here is how it works - it's made out of two sed commands. The first one uses the = command that inserts a line containing the line number before every original line in the file. Then this output gets piped to the second sed command that joins two adjacent lines with the N command. When joining lines with the N command, a newline character n is placed between them. Therefore it uses the s command to replace this newline n with a colon followed by a space ": ".

The e-book is 98 pages long and it explains exactly 100 one-liners. It's divided into the following chapters:

Preface.
1. Introduction to sed.
2. Line Spacing.
3. Line Numbering.
4. Text Conversion and Substitution.
5. Selective Printing of Certain Lines.
6. Selective Deletion of Certain Lines.
7. Special sed Applications.
Appendix A. Summary of All sed Commands.
Appendix B. Addresses and Ranges.
Appendix C. Debugging sed Scripts with sed-sed.
Index.

Did you know that sed was as powerful as any other programming language? Someone even wrote Tetris in it.

After you read the e-book, you'll be able to write your own Tetris if you wanted to. read more...
mail this link | permapage | score:9656 | -pkrumins, September 19, 2011

Perl One-Liners Explained: Handy Regular Expressions

Up
vote
Down

This is the seventh part of a nine-part article on Perl one-liners.

Perl one-liners are short programs that do one and only one task well and they fit on a single line in the shell.

Perl is not Perl without regular expressions, therefore in this part I come up with and explain various Perl regular expressions. Please see part one for the introduction of the series.

This part explains the following regular expressions:
  • Match something that looks like an IP address.
  • Test if a number is in range 0-255
  • Match an IP address
  • Check if the string looks like an email address
  • Check if the string is a decimal number
  • Check if a word appears twice in the string
  • Increase all numbers by one in the string
  • Extract HTTP User-Agent string from the HTTP headers
  • Match printable ASCII characters
  • Match text between two HTML tags
  • Replace all bold tags with strong tag
  • Extract all matches from a regular expression
read more...
mail this link | permapage | score:9648 | -pkrumins, November 11, 2011

Apache2, mod_rewrite tutorial: Redirect requests by device

Up
vote
Down

Since the massive rise of smartphones and tablets like the iPhone, iPad, Android phones and tablets, BlackBerries, etc. you might have considered creating a mobile version of your web site. This tutorial explains how to configure Apache to serve the mobile version of your web site if the visitor uses a mobile device, and the normal version if the visitor uses a normal desktop PC. This can be achieved with Apache's rewrite module. read more...
permapage | score:9644 | -falko, September 9, 2011

Tutorial: Linux game programming with Ogre 3D

Up
vote
Down

This tutorial starts at the beginning with opening a window...
This tutorial series steps you through the process of creating a 3D shoot'em'up game using the popular and powerful Ogre 3D engine. The tutorials compile on both Windows and Linux.
read more...
permapage | score:9638 | -Ray, January 1, 2010

Tutorial: Android app build environment with Eclipse, PhoneGap (Ubuntu 11.04)

Up
vote
Down

This tutorial describes how you can set up an development environment for building Android apps on an Ubuntu 11.04 desktop using Eclipse, the Android SDK, and PhoneGap. I will describe how to build Android apps from the command line with PhoneGap and from the GUI with Eclipse and PhoneGap and how to test them in an Android emulator and on a real Android device. PhoneGap allows you to develop your Android applications using web technologies such as HTML, CSS, and JavaScript (e.g. with JavaScript libraries such as jQuery/jQTouch), and it will turn these web apps into native Android apps (in fact, PhoneGap supports multiple platforms such as Android, iPhone, Palm, Windows Mobile, Symbian, so you can use the same sources to create apps for multiple platforms). read more...
mail this link | permapage | score:9630 | -falko, June 28, 2011

Develop your own Raspberry Pi OS

Up
vote
Down

Why use an existing operating system if you can bake your own? Well, for one thing, writing an OS is not an easy feat. It requires a lot of knowledge in a lot of areas regarding OS development. read more...
permapage | score:9606 | -finid, September 7, 2012

perl1line.txt: A handy Perl script collection

Up
vote
Down

The ultimate goal of the Perl One-Liners Explained article series was to release the perl1line.txt file. Last week I finished the series and now I am happy to announce perl1line.txt - a collection of handy Perl one-liner scripts.

The perl1line.txt file contains over a hundred short Perl one-line scripts for various text processing tasks. The file processing tasks include: changing file spacing, numbering lines, doing calculations, creating strings and arrays, converting and substituting text, selective printing and deleting of certain lines and text filtering and modifications through regular expressions.

The latest version of perl1line.txt is always at:
http://www.catonmat.net/download/perl1line.txt
Enjoy! It took me over 3 years to write all the one-liners down. read more...
mail this link | permapage | score:9597 | -pkrumins, November 21, 2011

Add Video Streaming to C/C++ apps with Nex Gen Media Server API

Up
vote
Down

Recently I took a closer look at Nex Gen Media Server and their API framework. NGMS is a multi-purpose streaming server which supports some of the popular streaming protocols such as RTSP, RTMP, Apple's HTTP Live, and MPEG-2 Transport Stream. NGMS comes with transcoding support and is able to capture and reformat live video streams and adapt them to be received by another type of device, such as capturing an HD video feed and converting it to be received by an iPhone over 3g. My focus was to integrate the NGMS API to control the streaming features directly from my own C application. In this example I am using Ubuntu Linux 10.04. read more...
mail this link | permapage | score:9588 | -falko, November 17, 2011

Python Client/Server Tutorial

Up
vote
Down

A tiny Python tutorial...
This application can easily be coded in Python with performance levels of thousands of transactions per second on a desktop PC. Simple sample programs for the server and client sides are listed below, with discussions following
read more...
permapage | score:9578 | -Ray, June 22, 2009

Open source Cloud Computing with PHP and MySQL

Up
vote
Down

In this article you will learn how Aptana makes it easy to develop applications based on PHP and MySQL, and how to deploy them to the cloud. Also explore some of the critical design differences between a cloud application and a traditional N-tier application. read more...
permapage | score:9567 | -solrac, May 18, 2009
More coding articles...
Buy Abstract Art Canvas Prints

Selected articles

Beneficial Computer Viruses

Space Tyrant: A threaded C game project: First Code

Programming Language Tradeoffs: 3GL vs 4GL

Space Tyrant: Multithreading lessons learned on SMP hardware

The Network Computer: An opportunity for Linux

Why Programmers are not Software Engineers

Linux dominates Windows

The life cycle of a programmer

Hacker Haiku

Librenix T-Shirts and Coffee Mugs!

How to install Ubuntu Linux on the decTOP SFF computer

Apple DIY Repair

Linux vs. Windows: Why Linux will win

Download: Linux 3D Client for Starship Traders

Space Tyrant: A multiplayer network game for Linux

No, RMS, Linux is not GNU/Linux

VPS: Xen vs. OpenVZ

The Supreme Court is wrong on Copyright Case

The Real Microsoft Monopoly

Microsoft to push unlicensed users to Linux

Space Tyrant: A threaded game server project in C

Missing the point of the Mac Mini

Closed Source Linux Distribution Launched

Why software sucks

Tutorial: Introduction to Linux files

Scripting: A parallel Linux backup script

Mono-culture and the .NETwork effect

MiniLesson: An introduction to Linux in ten commands

Apple to Intel move no threat to Linux

Graffiti Server Download Page

The short life and hard times of a Linux virus

Shadow.sh: A simple directory shadowing script for Linux

Testing the Digital Ocean $5 Cloud Servers with an MMORPG

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

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