Monitor Memory, CPU usage, processes i.e. system resources on Linux

System administrators need to monitor their server to ensure proper functioning. The practice enables administrators to detect possible issues in advance and recover the system, before it causes any trouble. There are plenty of commands on Linux to monitor different system resources like cpu usage, memory usage, network, disk usage and so on. Popular ones … Read more

usbutils – USB userspace utilities for Linux, how to compile, install and use on Ubuntu

USButils is a collection of USB tools for use on Linux and BSD systems to query what type of USB devices are connected to the system. Clone the source code using below command, $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbutils.git $ cd usbutils/ first get usbhid-dump : $ git submodule init Submodule ‘usbhid-dump’ (https://github.com/DIGImend/usbhid-dump.git) registered for path ‘usbhid-dump’ … Read more

Convert bitmap ( bmp ) files to raw 16 bit data using C program in Linux

bmptoraw is utility to convert bitmap files to raw 16 bit data. This program assumes a 24 bit bitmap file with a 54 byte header, which is the most common form of bitmap. One can convert other image files to that format using GIMP or MS Paint. $ vim bmptoraw.c [bash] #include<unistd.h> #include<sys/types.h> #include<sys/mman.h> #include<sys/time.h> … Read more

C application to interact with frame buffer devices / Linux test case for framebuffer driver

Screen information are queried by applications using the FBIOGET_FSCREENINFOand FBIOGET_VSCREENINFO ioctls. Those ioctls take a pointer to afb_fix_screeninfo and fb_var_screeninfo structure respectively. struct fb_fix_screeninfo stores device independent unchangeable informationabout the frame buffer device and the current format. Those information can’tbe directly modified by applications, but can be changed by the driver when anapplication modifies the … Read more

Difference between static and dynamic library linking

Lets write a simple helloworld program and using which we will try to understand the difference between static and dynamic linking. $ vim helloworld.c [c] #include <stdio.h> int main(int argc, char **argv) { printf("Hello World !"); return 0; } [/c] Now, we will try to compile this program as, $ gcc -o helloworld helloworld.c $ … Read more

How to compile elfutils for x86 based platforms ?

elfutils is a collection of utilities and libraries to read, create and modify ELF binary files, find and handle DWARF debug data, symbols, thread state and stacktraces for processes and core files on GNU/Linux. [ Also READ : What is the difference between elfutils and binutils ? ] Note: During the compilation of elfutils, 0.176 … Read more