Recent Posts
Linux by examples
Return To Blog Listing
We explain every GNU/Linux command by examples. It includes tips and tricks, howto for linux commands.
Recent Posts Tagged With 'developer'
Compile and execute 32 bits application in 64 bits operating system
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
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
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.
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
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
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
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
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++
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
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
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
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?
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
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
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
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
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
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
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
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...
