Print from PHP on a Linux system printer

Monday, February 14th, 2011

Suppose you have a script in PHP and you want to print on the system's default printer, you can use the function system (<command>, $retval) The following example shows the printing of a content including a variable coming from the PHP script: system('echo "'.$message.'"|lpr -o page-left=35 ', $retval );

Automatically mounting a remote directory in Ubuntu using autofs + sshfs

Thursday, May 27th, 2010

Memo to self...

uPnP Media Server with llink.

Saturday, January 16th, 2010

Let's start this new year by referencing an excellent system I happened to find on the Internet to perform uPnP server functionality on my Linux system. The name of the thing is LLink and although I haven't exploited at full yet, it looks VERY promising. Some features: Parses various video containers: vob, avi, ...

Scripting Galore – The beauty of randomic sort

Thursday, December 31st, 2009

Although it could seem an oxymore, sort something in randomic order might be usefl sometimes. Give a look to the script below, which I’m writing here for future reference. #!/bin/bash # # This script creates a list of file or symbolic link to ...

Extending an ext3 partition on Linux (without losing data)

Tuesday, November 3rd, 2009

Here’s another successful operation done on fantastic Linux OS that is a pure dream for other operating systems. Situation: I have a virtual machine with 20 GB HDD, partitioned as follows: 95% ext3 on primary partition 5% swap on first partition of extended partition I certainly ...

Enabling root access to vsftpd

Friday, March 6th, 2009

It took me a while to figure out due to misleading information over the vast Internet suggesting to search for non existing /etc/vsftpd.users or something like this. Thing you have to do is to edit /etc/ftpusers and remove root from there.

My Linux changed eth0 with eth1…

Wednesday, December 10th, 2008

This is happening, for instance, when moving a Virtual Machine from one Server to another or when changing the physical network adapter of a server. The reason is that NIC's MAC Address changes, therefore Linux perform a new HW detection and creates new adapter definition, ending in situation where ...

What does it need to have graphical XFCE4 environment at startup in Ubuntu 8.10 (intrepid)

Friday, November 14th, 2008

Taking short note so I'll never forget this again ;) apt-get install x11-common (if not already there) apt-get install xfce4-session apt-get install xfce4 ...and naturally ;) apt-get install xdm Should you need to set runlevel 3 by default (I wanted it), edit /etc/rc-default and replace lines running telinit 2 with telinit 3. Reboot.

Installing VMWare Server 1.0.5 tools on CentOS 5.1 guest

Tuesday, April 22nd, 2008

Running vmware-config-tools.pl script on a guest CentOS 5.1 virtual machine in a VMWare Server 1.0.5 environment will not find the proper kernel modules, so it will prompt you to compile the modules. To do this you need a compiling environment (namely gcc) and the C kernel headers installed. If your machine is ...

How to resize a filesystem to match size of a partition.

Saturday, March 29th, 2008

One of the things I like of Linux is that despite I'm working with it since 1994 I never end learning part of it. Today my need was the following: I dd a 20 Gb backup onto a 40 Gb HDD and it worked smoothly, but problem is that filesystem on ...