PC Plus HelpDesk - issue 267
This month, Paul Grosse gives you more insight into some of the topics dealt with in HelpDesk.
From the pages of HelpDesk, I look at:
- Process tree;
- 3D modelling software;
- Well beyond 3D text; and,
- Reverse proxy server.
On Linux, you can change user by using 'su' and giving the correct password. So, how does it change the user or is there something else going on?
The 'su' command ('Substitute User') actually opens another shell under the new user and then everything that it does inherits that user although they maintain the string of user processes as in the screenshot - Kicker's Parent Process ID (PPID) is 1 which is ultimately the parent of all processes except for one special process which sits at the top of the process tree.
Here, you can see that the KDE kicker program has called the xterm program which uses bash as its shell. The user (500) has then used su to open another shell (also bash) as the root user (0) and then used it to run mp3blaster.
Some programs require that the user have special privileges and that they input the root password before they will run. These effectively have the 'su' command built in - some programming languages (such as Perl) will allow you to do this.
Finally, some programs will separate from the parent program so that they don't appear to have a parent with a different user ID - they have become the child process of init which has a UID of 0 (root), a PID of 1 and a PPID of 0.
You can see the process tree in special programs such as KDE's System Guard process table. You have the option of seeing a tree (as displayed in the screenshot) or displaying each process in an order selected by one particular column. This can be useful if you are trying to kill-off or re-nice something in particular.
3D modelling software
3D modelling software usually comes at quite a price but there are programs that don't cost the earth and, because this one (Blender http://www.blender.org/ ) in particular uses the Open Source model of development, any features that you might need can be incorporated into it fairly quickly - you don't have to wait a year or so for the next, expensive version to come out.
The current version is 2.45 (32-bit for Windows and 64-bit for Linux) and it runs on Python.
To install it on Windows, you have a self-extracting installer but for other systems, it will simply run from the directory that you unpack the compressed file into.
When running, is uses around 152MB of virtual memory but the amount of memory it consumes depends, of course, on the complexity of what you are doing with it (the glass and the bottle, below-right, are quite complex [the way that light traces around with reflections off the surfaces and refractions within the bodies of glass] and took just over 1GB of RAM).
In addition, you can run several copies at the same time on the same machine if you want to. The license will allow you to run as many copies on as many machines as you want so if you want to take your work home with you, you can without there being any licensing issues to worry about.
The program is quite easy to use and there are plenty of tutorials on the Internet showing you various ways of achieving what you want to get out of the program
The image on the right is one that I made earlier - my first go with Blender.
The glass is just a cylinder that has been extruded and the bottle is similar, except that it is green.
To make the glass, just create a cylinder, select one end and then press 'E' to extrude (makes an extra set of vertices between the highlighted vertices and their unhighlighted neighbours) and then pull them to where you want the next set to be, click to place them there, then press 'S' to scale/size them and change the diameter.
Repeating these steps allow you to elongate and then expand/constrict the cylinder until it has the shape of the glass or the bottle.
You can zoom in and render by altering the focal length of the camera.
Here, I have done this to show you how it renders the base of the glass (showing the detail of how the base of the stem is flared) ...
... and here, how it renders the mouth of the bottle (showing the transparency of the green glass and how it thickens away from the rim of the bottle mouth).
The image on the right is one that my son (he's in his mid-teens) threw together in about half an hour.
Well beyond 3D text
Three dimensional graphics programs usually end up doing internal combustion engine parts or the odd building but with a good rendering engine, decent modelling and lighting, there is no reason why you shouldn't go the whole hog and produce advanced still images or even your own film. This is what has happened with Blender.
If you look at http://blenderartists.org/ , click on 'Features and Gallery', then on 'Gallery' and have a good look around, you will get some idea of just what can be achieved with the program.
There is, of course the option of using the program to produce films - from short, concept demonstration films, through music videos to full length films if you have enough time and money to throw at a project.
Open source films with Blender include (amongst many) The Elephant's Dream ( http://orange.blender.org/ ), which is a free download for you to see, and the current project is Peach ( http://peach.blender.org/ ). If you look at http://www.blender.org/features-gallery/movies/ you can see for yourself a number of short films that various people have produced in a number of different video formats.
On the right, you can see the detail from the image above, showing you hair rendering in Blender.
You can, of course, have a go yourself and on the right is a still from a fluid simulation that is fairly easy to recreate.
There are plenty of video tutorials on the Internet on YouTube, Google Video and so on so that you can see how to produce videos of fluids like the one on the right, hair, smoke, flames and so on.
Reverse proxy server
Proxy servers are usually thought of as collecting pages from the Internet to serve to a LAN. However, you can use them to speed up a server as well.
If your server produces pages that change, say, daily or hourly then rather than having to update them manually, you might have them produced using dynamic pages. However, your pages can be quite complex and take a lot of processing, using a lot of back-of-house database and network resources so the production of each page can be slow.
However, you could get the page to be produced by the server, only when it is changed and only if it is requested.
So, if the data for a page changed but nobody requested that page before it changed again, it would not have been generated (in that way, you would not get a mass of page reproduction every hour on the hour, only the first time the page was actually requested).
Getting your web server to produce its pages on, say, port 8080 and passing that through the firewall (another potential bottleneck) then having your proxy pick up incoming port 80 requests and querying the server on 8080 will allow it to serve any unchanged pages quickly, as though they were static.
In this way, your web server and its resources aren't under such a high load and any bottle necks are written out of the equation. However, you must make sure that your proxy server is secure (choose a secure OS like OpenBSD and make sure that the connection between the proxy and the firewall are tied down to just those machines (IP address and port number) and the same with the web server).
The Squid Proxy server (www.squid-cache.org) will do this for you for free and just in case you think that this might might be difficult, there is plenty of help on-line on the Squid website, including configuration file examples.
Back to PC Plus Archive Index Page