Entries Tagged 'Unix' ↓
January 15th, 2008 — Basic stuff, Unix
I've noticed how many people found other pages of this blog trying to find more information about Unix sockets, and so I thought it's about time we shed some light on this seeming mysterious, but really simple concept.
What is a Unix socket?
A Unix socket (the technically correct name for it is Unix domain socket, UDS) is a way of inter-process communication (IPC) in Unix. Like almost everything in Unix, a socket is a file. It's a special file, to be precise. Unix processes which want to communicate between each other use special set of functions to access the special file of a Unix socket, and easily exchange data in both directions.
In very simple terms, a Unix socket is nothing but a byte steam – a data transfer between processes running locally or on networked Unix systems.
January 2nd, 2008 — Basic stuff, Unix
Finding the compiler version in your Unix system should be the first step before you attempt to compile any package from its source codes. In fact, if you're familiar with the common compilation routine, the configure script which you run to generate the Makefile before compiling anything does exactly that – it finds out which compilers (if any) you have installed on your system, and confirms their versions and capabilities.
Continue reading →
December 14th, 2007 — Unix
Quite often there's a need for you to take a screenshot of your Unix desktop, and as always there's a number of ways to do it. Today I'm going to cover the command line approach to taking screenshots.
Taking a Screenshot with xwd
Most modern Unix desktop systems come with Gnome desktop environment by default, and use Xorg as their default X11 server. This means you are likely to have the xwd tool in your OS, which allows you to take screenshots.
Continue reading →
November 8th, 2007 — Scripts, Unix
I had a need to scan a huge directory tree today, identifying the users and Unix groups owning all the files. The problem I faced was too long usernames and group names which meant the
find /directory -ls
command which I normally use for such tasks wasn't terribly useful because there was no space delimiter between a username and a group. Results of such scan of the directory tree will have to later be parsed by other tools, and that's why proper splitting of the output into separate fields is so important.
This issue was motivational enough to refresh my Perl skills and sketch the following script (based entirely on this Never Run Unix Find Again article).
Continue reading →
September 25th, 2007 — Basic stuff, Unix
In Unix systems, there are 6 file types. Below I will give a very short description of each.
How to find out the type of file in Unix
The first and most obvious way to confirm the type of a particular file is to use the long-format output of ls command, invoked by the -l option:
$ ls -l *
-rw-r--r-- 1 greys greys 1024 Mar 29 06:31 text
Continue reading →
September 11th, 2007 — Advanced topics, Linux, Unix
I've recently upgraded Apache and PHP on my VPS, and one of the unpleasant surprises was that some scripts which tried including pages from remote sites (I know, not the most secure approach, but there were reasons for that) got broken.
allow_url_fopen
Traditionally, all the websites Google finds suggest that you double-check that your php.ini config has the allow_url_fopen enabled:
allow_url_fopen = On
Continue reading →