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

More CommandLineFu One-Liners Explained

Up
vote
Down

Remember the previous post on CommandLineFu One-Liners Explained?

This article explains the next ten top one-liners.

For example, did you know "dd if=/dev/dsp | ssh username@host dd of=/dev/dsp" outputs your microphone on remote computers's speaker? This article explains how it works. read more...
permapage | score:9355 | -pkrumins, March 25, 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:9330 | -falko, June 28, 2011

Tutorial: Creating graphics with PHP

Up
vote
Down

Imagine creating Web-page graphics dynamically using just code. Creating and manipulating images is yours for the doing with the power of PHP. This tutorial steps through using the GD library, showing you how to create and alter images on Web pages. It starts with the GD construct, and then builds on it to showcase graphics techniques. read more...
permapage | score:9329 | -jmalasko, July 8, 2008

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:9329 | -pkrumins, September 19, 2011

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:9324 | -solrac, May 18, 2009

Space Tyrant Index Page: Linux game server development project

Up
vote
Down

This page links to the various articles that have been published about Space Tyrant, a multithreaded, network socket programming Linux game server project in C.

[Update: 07Jun2014 You can play a development version of an upcoming MMORPG in text mode at telnet://textMMOde.com:2323
or, on a command line, enter:
telnet textmmode.com 2323
to log in and play. This game is based on Space Tyrant and the scenario is based on a modified Starship Traders.]

[Update: 03Jun2014 Starshiptraders, the parent of Space Tyrant, and the descendant of Czarwars, Lives Again]

Read below for the history and overview or just click these links for the articles:Space Tyrant is a C language Linux game server development project. It started out in February, 2005 as a humble echo server with high ambitions. On March 18, ST had its design and intentions announced to the world.
Today we kick off a new multithreaded, network socket programming project which we will call Space Tyrant. Our mission is to write an open source, multiplayer, networked, strategy game in the C programming language. The goal of this project is to make a solid code base which implements a simple space trading game upon which other games can then be built. The game will be a subset of The Last Resort (TLR) that currently runs at Ioresort.com. This project will be a learning exercise for me as well as for any interested readers. The current state of the source code will be released with each article update.
Source code to ST, then just an echo server, was not released.

Then, on March 27, 2005, ST was promoted to a crude chatserver.
This is the first code release of Space Tyrant. This is an early stage of development and, at this point, only implements the listening thread, the two IO threads for each player connection, and a skeletal game logic thread that does little beyond proof-of-concept code.
Next, on May 30, 2005, ST started to resemble some sort of incomplete text game.
It’s now possible to connect to the game via telnet and to create an account, log in, and be issued a ship. Once you’re logged in, there is a universe to explore filled with ports for buying and selling goods and planets for scooping free goods. From those trading activities you can earn money, called microbots. Other than trading to earn more money, you only use your microbots to buy fighters -- which you can use to attack other players or the neutral fighters that guard some sectors.
As of this release, the source code was placed under the GPL, version 2.

On June 26, 2005, Space Tyrant was released with many shiny new abilities. Players can now deploy fighters to guard sectors, navigate with the aid of an autopilot, rank the various players in the universe, and sleep peacefully knowing their alternate universe is being backed up constantly by a sporty new backup thread. Yes, good times are surely upon us.
If you’re looking for a planet, type the ‘L’ command that you would normally use to land on a planet in your sector. In the absence of a planet, the L key will engage the autopilot which will search for the nearest planet and give you a ‘/’ command to autowarp to it.
There is normally a copy of the development version of the server running on my decTOP on port 23. To access it, type (or click, if it works for you) the following command:

(telnet to my ST server)

The current development version of the code is usually at http://librenix.com/st/st.c but the individual articles link to the specific versions discussed in each article.

You can mail me about the project at spacetyrant [at] librenix.com -- or you can just telnet into Space Tyrant, as listed above, and send me a radio message. I'm likely to get that faster. ;)


The Space Tyrant project has a new website, SpaceTyrant.com, where the latest source code is always available. Also, new articles about ST programming and about ST gameplay will be posted there as they come available.


Information on The Last Resort follows. TLR is one of the two games that Space Tyrant is intended to replace someday. Space Tyrant has a long way to go before it replicates TLR's 25,000 lines of C code. So far, it has reused only about 40 lines of TLR code, a handy 'bit-plane' sort dating back to 1998.

  • TLR Survival Manual
  • Is this game for you? read more...
  • mail this link | permapage | score:9322 | -Ray, June 25, 2005 (Updated: June 7, 2014)

    Linux Kernel Debugging Tools

    Up
    vote
    Down

    Your Kernel just crashed or one of your drive is not working!! What do you do?

    Well, this article gives an introduction to some kernel debugging tools for Linux. These tools makes the kernel internals more transparent. These tools help you to trace the kernel execution process and examine its memory and data structures.

    The tools discussed here are :

    1. Kernel debugger, kdb

    2. Kernel GNU debugger, kgdb

    3. GNU debugger, gdb

    4. JTAG- based debuggers.

    Of the mentioned tools, the kdb and kgdb were introduced as patches to the kernel code. The plain debugger gdb doesn’t need the patching process with kernel code. The JTAG (Joint Test Action Group) based debuggers are hardware assisted and powerful tools, but are expensive.

    Here I will explain the installation and usage of the kdb tool. The rest of the tools are briefed. read more...
    mail this link | permapage | score:9315 | -shyju, November 15, 2008

    Tutorial: Build an Arduino laser game

    Up
    vote
    Down

    Arduino is an easy-to-use electronics platform. The entire platform, both the hardware and the software, is completely open source, and the language is loosely based on C/C++. Whether you're new to Arduino or a seasoned builder, this project has something for you. There's nothing quite as satisfying as creating an interactive physical object. Use this tutorial to create an interactive laser game called "'Duino tag," where players can play tag using devices built nearly from scratch. read more...
    permapage | score:9307 | -solrac, February 2, 2009

    Import XML into OpenOffice Calc with XSLT

    Up
    vote
    Down

    When it comes to importing generic XML into OpenOffice, the user is on his own. This article offers a quick XSLT tool for this purpose and demonstrates the Calc import of records-oriented XML. In addition to learning a practical trick for working with Calc, you might also learn a few handy XSLT techniques for using dynamic criteria to transform XML.
    The popular open source office suite OpenOffice.org is XML-savvy at its core. It uses XML in its file formats and offers several XML-processing plug-ins, so you might expect it to have nice tools built in for importing XML data. Unfortunately, things are not so simple, and a bit of work is required to manipulate general XML into delimited text format in order to import the data into its spreadsheet component, Calc.
    read more...
    mail this link | permapage | score:9299 | -solrac, April 4, 2005

    Vim Plugins: matchit.vim

    Up
    vote
    Down

    This is the third post in the article series "Vim Plugins You Should Know About". This time I am going to introduce you to a plugin called "matchit.vim".

    Matchit extends the existing functionality of “%” key (percent key). I'll first briefly remind you what the original “%” does and then explain how matchit.vim enhances it. read more...
    permapage | score:9294 | -pkrumins, February 6, 2009

    Dojo for Java programmers

    Up
    vote
    Down

    Many developers have strong skills in Java programming, but only limited experience in JavaScript. They can struggle with the conceptual leap from a strongly typed, object-oriented compilation language to a dynamic, weakly typed scripting language. This article helps you bridge the gap from Java code to Dojo, shows why it may be necessary to set context, and describes how to go about it. read more...
    permapage | score:9293 | -jmalasko, October 21, 2008

    Forking vs. Threading

    Up
    vote
    Down

    What is Fork/Forking:
    Fork is nothing but a new process that looks exactly like the old or the parent process but still it is a different process with different process ID and having it’s own memory. Parent process creates a separate address space for child. Both parent and child process possess the same code segment, but execute independently from each other.

    What are Threads/Threading:
    Threads are Light Weight Processes (LWPs). Traditionally, a thread is just a CPU (and some other minimal state) state with the process containing the remains (data, stack, I/O, signals). Threads require less overhead than “forking” or spawning a new process because the system does not initialize a new system virtual memory space and environment for the process. read more...
    mail this link | permapage | score:9291 | -Napster, March 1, 2010

    Unix signals list

    Up
    vote
    Down

    Processes are required to respond to signals sent to them. This is one way a user can communicate with signals and control them.
    Signals are asynchronous events that can occur to a running process and may be caused by hardware, software or users. Signals are numeric integer messages that have been predefined so they understand what these signals mean. When a process receives a signal, that process must respond to the signal. Uncaught signals will cause default actions to take place, which often means the process is terminated. If you use “kill -l”, or “trap -l” you can get a list of available signals:
    read more...
    mail this link | permapage | score:9288 | -aweber, December 31, 2010

    Scripting: Bash Array Tutorial

    Up
    vote
    Down

    An excellent introduction to bash arrays including 15 examples...
    $ cat arraymanip.sh
    #! /bin/bash
    Unix[0]='Debian'
    Unix[1]='Red hat'
    Unix[2]='Ubuntu'
    Unix[3]='Suse'

    echo ${Unix[1]}

    $./arraymanip.sh
    Red hat
    read more...
    permapage | score:9280 | -Ray, June 7, 2010

    Tutorial: Linux Dialog Boxes

    Up
    vote
    Down

    Dialog lets you create dialog boxes from Unix/Linux shell scripts...
    'dialog' is a utility for building console-based 'front ends' in UNIX like operating systems.

    In this brief tutorial I am mentioning the usage of few important basic controls available with this 'dialog' utility and later I have created a very simple front end application in UNIX bash scripting using dialog.
    read more...
    permapage | score:9255 | -Ray, January 1, 2010

    perl dispatch table examples

    Up
    vote
    Down

    Dispatch Table: The fancy name for a hash of code-refs...
    In perl, code is a first class data type... you can talk about it in the same way you would talk about arrays or hashes, you can take references to them (giving you a code-ref ) and you can de-reference them (which runs the code);

    Code-references are just scalars that refers to something, and you get them by using the reference-to operator:
    read more...
    permapage | score:9254 | -f00li5h, December 17, 2010

    Sed One-Liners Explained

    Up
    vote
    Down

    My previous post was about Awk One-Liners Explained and now I bring to you Sed One-Liners Explained!

    Most people are only familiar with one particular command of sed, namely the "s" (substitute) comand. s/comand/command/. That is unsatisfactory. Sed has at least 20 different commands for you.

    For example, any ideas what this sed one-liner does?

    sed '/n/!G;s/(.)(.*n)/&21/;//D;s/.//'

    Read the article to find it out! read more...
    permapage | score:9252 | -pkrumins, November 22, 2008

    Programming the Sony PS3 SPE cores under Linux

    Up
    vote
    Down

    Take even greater advantage of the synergistic processing elements (SPEs) of the Sony PS3 in this installment of Programming high-performance applications on the Cell BE processor. Part 2 looks in depth at the Cell Broadband Engine processor's SPEs and how they work at the lowest level, while Part 1 showed how to install Linux on the PS3 and explored a short example program. read more...
    mail this link | permapage | score:9226 | -Ida Momtaheni, February 21, 2007

    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:9220 | -pkrumins, February 4, 2012

    Debugging Shell Scripts

    Up
    vote
    Down

    Learning how to find the errors in your shell scripts is an important skill for successful shell scripting. The debug options in the Bash shell can help with that. read more...
    permapage | score:9213 | -aweber, February 2, 2012
    More coding articles...
    Large Abstract Art with Fine Details and Textures

    coding headlines

    JSEclipse Tutorial: A JavaScript Eclipse Tool

    PowerPC assembly language

    Vim plugins: snipmate.vim

    Space Tyrant: Multithreading lessons learned on SMP hardware

    Online Ruby Interpreter

    Porting C / C++ code from Windows to Linux / Unix

    Build Apps with Android SDK, Eclipse, PhoneGap (Ubuntu 10.10)

    Introduction to Java programming

    Space Tyrant: A multiplayer network game for Linux

    Mono-culture and the .NETwork effect

    Space Tyrant: A threaded game server project in C

    Eclipse: Use gdb from CDT

    Scripting: Put a clock in your bash terminal

    Tutorial: UDP socket based client server C programs

    String matching in regular expressions

    I wrote my first programming e-book: Awk One-Liners Explained

    Java: Real numbers

    Space Tyrant: A threaded C game project: First Code

    Tutorial: MySQL Select statement

    Tutorial: Android development environment on Fedora 14

    Tutorial: Android app development environment on Debian 6

    PHP: Associative Array Tricks

    Tutorial: Write your own operating system

    Why software sucks

    Why Programmers are not Software Engineers

    Art animation with the Java 2D API

    The Real Microsoft Monopoly

    Programming Language Tradeoffs: 3GL vs 4GL

    Secure String Coding in C and C++

    The Vim Scripting editor

    Python for Kids

    Tutorial: How to use named pipes

    Best practices for XML in Java programming

    Compile Crystal Space in Ubuntu 10.04

    PHP vs. ASP

    Tutorial: Multithreaded Programming with pthreads

    Tutorial: Install the Aptana AJAX IDE on Ubuntu

    Vim Plugins: ragtag.vim

    Book Review: Invent Your Own Computer Games with Python, 2nd Ed.

    Awk Tips, Tricks and Pitfalls

     

    Firefox sidebar

    Site map

    Site info

    News feed

    Features

    Login
    (to post)

    Search

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