myprogram > /dev/null 2>&1 With: stdin == 0 stdout == 1 (default if omitted) stderr == 2 > /dev/null, redirects stdout (omitted) into /dev/null. 2>&1 Redirects stderr into stdout. Some confusing syntax: 2>1 Would redirect stdoud into a file called 1. 2&>1 Execute file 2 in the background and redirect its output to a file [...]
Ctags is a program that generates an index (or tag) file of names found in source and header files of various programming languages. A nice introduction to ctags and other related programs can be found here. An example of using ctags is this function counting script: 1 2 3 4 5 6 7 #!/bin/sh [...]
This is not a finished example, but it contains enough information for me to use as a template most of the times. A bit of previous experience with GNU make and the places to modify are obvious. It helps me with the blank page syndrome. Some helpful links: GNU make GNU gcc GNU binutils [...]
#include <stdio.h> #include <unistd.h> #include <string.h> #include <fcntl.h> #include <signal.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <errno.h> #include <pwd.h> static int debug = 0; static const char * log_file = "logfile.log"; static char * lock_file = "lockfile.lock"; #define BUFF_SIZE 64 /* Change this to the user under which to run [...]
Also filed in
|
|
#include <stdio.h>: #include <unistd.h>: #include <string.h>: #include <fcntl.h>: #include <signal.h>: #include <stdlib.h>: #include vsys/types.h>: #include <sys/stat.h>: #include <errno.h>: #include <pwd.h>: static int debug = 0; static const char * log_file = "logfile.log"; static char * lock_file = "lockfile.lock"; #define BUFF_SIZE 64 /* Change this to the user under which to run [...]
Also filed in
|
|
Did you ever want to know how much memory your kernel is using? Linux caches a lot of memory on disk accesses to try and speed up future disk accesses. As a consequence the free command displays the following: total used free [...]
The command cp attempts to open the destination file in write-only mode and write the new contents. The contents of an executable or dynamic library are mmap’d into the linear address space of relevant processes. Therefore, any change in the underlying file affects the mmap’d memory regions and can potentially break programs. When trying to [...]
The Intel core architecture Traditionally CPUs are connected via a front side bus (FSB) to the northbridge which contains the memory controller. Other I/O devices (PCI/PCIe,SATA/PATA,USB/IEE1394 etc) are connected to the southbridge. Interprocessor communication travels through the FSB, as does the communication between CPU and RAM. All RAM access uses the northbridge. CPU and [...]
The big difference: ILP32: int, long and pointers are 3 2bits.LP64: int are 32bits, long and pointers are 64 bits. Look out for: Problems with 64 bits long and pointer types: 32 bits applications usually assume int, long and pointers are the same size. int and long are not to be used interchangeably. All pointers [...]
Surely this is a useful thing to keep handy, via Sonic840 at DeviantArt. Download in low resolution or high resolution.