Recent Posts

Linux by examples

Linux by examples

Return To Blog Listing

We explain every GNU/Linux command by examples. It includes tips and tricks, howto for linux commands.

Search This Blog's Tags For:

Recent Posts Tagged With 'developer'

  • Compile and execute 32 bits application in 64 bits operating system

    Posted on Thursday October 1st, 2009 at 07:02 in misc, developer, gcc

    The world is going towards 64 bits machines and operating system for personal computer, but there are still some libs and software only support 32 bits. Therefore in this transition period, there is a needs to support both 64 bits and 32 bits applica...

  • Serialize INI configuration to python dictionary

    Posted on Sunday August 30th, 2009 at 00:17 in python, developer

    A lots of configuration file is in the format of INI, if we manage to serialize INI configuration to python dictionary, we can write python scripts to analyse and generate back to INI files. Below is the sample of INI configuration: config.ini # # ...

  • Bit shifting can be done in python just like in c

    Posted on Wednesday April 1st, 2009 at 03:31 in python, developer

    It was amazing to discover that I can do bit shifting in python just like in c, the syntax makes no different at all. Let us look at how easy I can do a bit shifting. I write an example loop by shifting the bit leftwards. for i in range(0,10): p...

  • How can I avoid running a python script multiple times? Implement file locking.

    Posted on Thursday March 12th, 2009 at 11:07 in python, developer

    Sometimes we just need a single instance of the python script to run at a time. Meaning, the python script itself should detects whether any instances of himself are still running and act accordingly. Well, how to do it? The idea is simple, the first...

  • Plot your graphs with command line gnuplot

    Posted on Thursday February 12th, 2009 at 03:27 in developer, gnuplot

    gnuplot is a command line driven graph plotter tools for us to generate graphs. The common graphs that we are looking forward to present the resource performance per seconds, hours, days, weeks or months are usually plot graphs, which it consist of l...

  • Python: Manipulate string or binary bytes with StringIO

    Posted on Monday November 24th, 2008 at 18:55 in python, developer

    Sometimes it is not convenient to construct string using equal (=) like this: str = "Hello, " ... str = str + "my name is " ... str = str + Name print str In python, we have string stream (StringIO) that will behave like file stream, you can construc...

  • Python vs Lua, data structure

    Posted on Friday June 27th, 2008 at 13:24 in programming, scripting, python, developer, lua

    In python, we have various type of data structure, such as list, set, tuple, dictionary etc, but in Lua, we only have table. Table in Lua can be used as array, list, dictionary or object. Let see how you we construct list from Lua table. t = { 'a','b...

  • How to list shared library dependencies used by an application

    Posted on Sunday June 15th, 2008 at 09:05 in developer, ldd

    Almost every application in Linux uses shared library, even the one compiled by yourself with gcc. You may have realized that application compiled with gcc 4.1 in Fedora or Ubuntu does not able to run under Red Hat ES3 or ES4. Or some other new appli...

  • How to embed Lua 5.1 in C++

    Posted on Saturday June 7th, 2008 at 09:13 in programming, developer, lua, embedded programming

    Lua, is a scripting language providing dynamic data structures, maths, io and string manipulations just like any interprete language such as Bash, Python, Ruby etc. What is so special about Lua? Lua is Fast, Light-weight and Embeddable. Lua can be ...

  • vim with ctags for multi-level directory hierarchy

    Posted on Thursday April 24th, 2008 at 07:00 in programming, C++, developer, vim, vi, text manipulation, ctags

    I have wrote a post regarding vim with ctags, introduces how ctags allows you to travel across source codes, searching for function, objects, variables definition. To jump from function call to function definition, I usually do ctrl+] in vim. It shou...

  • gcore: Obtain core dump of current running application

    Posted on Monday March 24th, 2008 at 08:55 in developer, admin, gdb, pgrep, gcore

    Core dump is always developer’s friends and can be admin user’s nightmare. Developer’s can always get some clue of what’s going wrong through the core files, given that the apps is compiled with -g. In order to get core dump...

  • Experiencing with iPython

    Posted on Tuesday March 4th, 2008 at 10:40 in python, developer, ipython

    What is iPython? Is it something to do with Apple Macintosh? as stylish products like ipod and iphone? If you are enjoy coding python like me, yes ipython is a stylish and very interactive python interpreter. Auto Complete ipython support auto comple...

  • Python: How to run a command line within python?

    Posted on Monday March 3rd, 2008 at 12:25 in python, developer

    I always got this question in my mind. How to run a command line within python, get the output and manipulates it. Before I learn python, I was doing bash scripts all the while to helps me manipulates text which I get it from log files, or pipes out ...

  • python: convey the exception traceback into log file

    Posted on Wednesday February 27th, 2008 at 06:36 in python, developer

    Python is the interpreter language, you do not need to compile your code, and also you have no ways to check for your syntax error until you run your python script. Either syntax error or runtime error will be throw to standard output through python ...

  • Python: Manipulate Date and Time variables

    Posted on Saturday February 16th, 2008 at 12:56 in python, developer

    When comes to data time related calculations, we usually calculate for time difference, for example How long is the down time for a particular service? How many days or hours are used to finish a task? etc. With python datetime and time class, it mak...

  • python: user define sorting with callback

    Posted on Tuesday January 8th, 2008 at 06:29 in python, developer

    Theres a lots of people treated python as scripting language like bash, but I am going to tell you, python is real programming language. Python support callback like c/c++, and this feature is really God-like, because it is so simple to implement cal...

  • python: handle string from pipelines and list of param

    Posted on Monday November 12th, 2007 at 12:22 in python, developer

    While I was searching ways to implement pipeline input for my python apps, I read an article from linuxjournal.com that mention about how easy that python can works with pipeline. Here is the code quote from that article. #! /usr/local/bin/python imp...

  • python: how to identify the type of your variable

    Posted on Friday November 9th, 2007 at 12:24 in python, developer

    In python, every single variable is an object, every object must have a type, it is either data structure or class instances. Python’s variable can be dynamically change easily during runtime, for example >>> d={1:'one',2:'two'} >>> print d {1:...

  • Help yourself in python

    Posted on Tuesday October 30th, 2007 at 12:03 in python, developer

    If your computer science student, you study IT, click with technology, python is not a snake for you. It is a scripting-like programming language that are so famous today. You can type python into google, the first link is not the snake but the progr...

  • Use gprof to check your codes for performance issues

    Posted on Tuesday August 28th, 2007 at 12:08 in developer, gcc, gprof

    By reading the article Speed your code with the GNU profiler from IBM DevelopWorks, I have gain the knowledge of using gprof to easy my work to identify my module’s performance’s bottleneck. Here, I would like to share my experience on h...