FreeUnix.davidleemans.be

WordPress site for Linux and other computernerds

Page 18 of 18

Tell Samba to shut up about CUPS

 

The problem

 
Lately, I stumbled upon a minor but annoying issue with Samba on one of my file servers. There are no printers installed on this server, and probably never will be. However, smbd complains to no end in the client logfiles about not being able to connect to a CUPS server:
 

[david@Samba ~]$ head /var/log/samba.dfpc5
...
[2013/07/23 07:49:24.869727,  0] printing/print_cups.c:109(cups_connect)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2013/07/23 07:49:24.869790,  0] printing/print_cups.c:468(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
...

 
All of the client logfiles were spammed continously by Samba with these lines. While this did not seem to harm the performance of the server, I wanted to ged rid of them. After all, I never configured this Samba server to use CUPS, so why the hell is it trying to find one ?
 

The cause

 
This file server runs Slackware Linux, and the Samba package provided by Slackware, is compiled with – – enable-cups (like it is on most distros). Consequently, unless you tell it otherwise, Samba uses CUPS as the default printing system and tries to connect to a local CUPS server. And if fails to do so, it starts spamming your log files . . .

 

The solution

 

There are several solutions to this problem:

  • reconfigure your Samba installation not to use CUPS
  • recompile the Samba package without CUPS support
  • run CUPS anyway on that server so Samba can connect to it

 
I prefer the 1st solution. Just edit your smb.conf file, and look for the line that says “printing = cups”. Pay attention to the ; character at the front, which actually commnents out this line. You must remove the ; character.

 

;   printing = cups

 printing = bsd

 
Save the file and restart the Samba service. Those pesky CUPS lines in your logfiles should be history.
 

New hostname

 

Thanks to the ongoing efforts of Dyn.com (formerly known as dyndns.org) to chase away their free customers, this site will get a new hostname. I signed up with the folks at dnsExit.com, who still provide a truly free dynamic DNS update service, without the need to log in monthly, or other crappy measures like dyn.com started to impose on their free customers.
So, from now on, this site can be reached at http://freeunix.publicvm.com:8000.
Don’t worry, the old name will remain available for a few months.

 

USB2 vs USB3 external HD benchmark

 

Intro

 

In this post, I will benchmark an external USB disk, using HDTune and USBDeview. So, this is by no means a professional review, we are only comparing the obtained results. The disk I have used is a Seagate Momentus 7200.3 (120 GB, 7200 rpm), which I recovered from an older laptop. The Seagate is fitted in an el cheapo USB3 external disk enclosure, bought on Ebay for 15,00 Euros.

For the purpose of this test, the disk will simply be connected to an USB 2.0 port and benchmarked. Then it will be plugged in an USB 3.0 port, and benchmarked again. So, it is exactly the same disk, just a different port. The host computer is equipped with an Intel Core i5-2500 processor and 8 GB ram, and runs Win7 x64.

 

Test results

 

HDTune

 

  • USB 2.0 port
     

     
  • USB 3.0 port
     

 

USBDeview

 

  • USB 2.0 port
     

  •  

  • USB 3.0 port
     

 

 

Conclusion

 
Well, the results are not surprising: the Seagate achieves significantly better throughput when connected to an USB 3.0 port. The numbers simply double. This also demonstrates that USB 2.0 ports really are a bottleneck for external disks. Any regular laptop drive can read/write a lot more data than USB 2.0 can cope with.

So, if you are in the market for an external disk (or disk enclosure), do yourself a favor, and go for USB 3.0.  
 

Remote Desktop tricks for Linux users

 

If you like to make RDP connections to Windows machines from your Linux box, it is often convenient if you can set a few things right from the start. As such, I wrote a little shell script around rdesktop, in order to make life somewhat easier for me.
 
This script does the following:

  • invoke rdesktop
  • set the keyboard layout to Belgian AZERTY
  • set the screen resolution to something that fits the screen of my laptop
  • map a local directory so it is available on the remote Windows box

 

And here is the script:

#!/bin/bash
#-----------------------------------------
# simple wrapper for rdesktop
# set keyb layout on server to azerty BE
# set window size to 1370x840
#-----------------------------------------

 if [ $# != "0" ] ;
 then

   rdesktop -k nl-be  -r 'disk:homedrv=/home/david/' -g 1370x840  $1

 else
   echo "$0: No arguments were supplied. Please supply a valid target 
             hostname or IP address."
   exit 1
 fi

 exit 0

 

The script must be invoked with one arument, the hostname or IP adress of the machine you want to connect to. I guess the script is simple enough to understand what it does. Adapt it to your particular needs, and I hope you like it.

HDD vs SSD on a Linux powered laptop

 

Intro

 
In this post, I will compare 3 laptop harddisks, under Linux, using hdparm. So, this is by no means a professional review, but since hdparm is shipped with every goddamn Linux distro out there, it makes it very easy to compare my results with yours.

The 3 (Sata) disks are:

  • Toshiba MK8046GSX : 80 GB, 8MB cache, 5400 rpm
  • Seagate Momentus 7200.3 : 120 GB, 16 MB cache, 7200 rpm
  • Samsung 840 series : 120 GB, 512 MB cache, SSD

So, the Toshiba and Seagate are “classic” mechanical harddisks, while the Samsung is a shiny new solid state disk.  The 3 disks are tested on a Dell Latitude E6500 laptop, equipped with a Core2 Duo P8600 processor and 4 GB ram. It runs Slackware 13.37 x64, with kernel 3.7.1.

 

Test results

 

  • Toshiba (5400 rpm):
    [root@E6500 ~]$ hdparm -Tt /dev/sda
    
     /dev/sda:
    
    Timing cached reads: 3806 MB in 2.00 seconds = 1903.02 MB/sec
    
    Timing buffered disk reads: 144 MB in 3.04 seconds = 47.40 MB/sec 

     

  • Seagate (7200 rpm):
    [root@E6500 ~]$ hdparm -Tt /dev/sda
    
    /dev/sda:
    
    Timing cached reads: 3822 MB in 2.00 seconds = 1911.02 MB/sec
    
    Timing buffered disk reads: 236 MB in 3.02 seconds = 78.25 MB/sec

     

  • Samsung 840 (SSD):
    [root@E6500 ~]$ hdparm -Tt /dev/sda
    
    /dev/sda:
    
    Timing cached reads: 3862 MB in 2.00 seconds = 1933.08 MB/sec
    
    Timing buffered disk reads: 808 MB in 3.00 seconds = 269.00 MB/sec

    The Samsung is cleary limited here by the Sata controller (Intel ICH9 Sata Raid controller), which is a Sata-300 controller.

 

Conclusion

 
Well, the results are hardly surprising: the old Toshiba is the slowest, the Seagate is significantly faster, but the Samsung simply wipes the floor with both of them. The Samsung plays in a whole different league, you can’t really compare them.
 
There is one thing to keep in mind when replacing your old hardisk with an SSD. The latest breed of SSD drives are capable of reaching sequential read/write speeds up to 500 MB/sec. That’s awesome, but it also means that your laptop will need a pretty recent Sata controller (to be specific, a SATA-600 controller) if you want to realise these high speeds.
 
Older laptops are equipped with SATA-300 or even SATA-150 controllers. This means that in reality, you will reach at most 270-280 MB/sec on a SATA-300 controller, which is still impressive, and up to 130-140 MB/sec on a SATA-150 controller, which still beats most, if not all mechanical laptop drives.
 
Consequently, on these older laptops, you don’t need the latest and fastest SSD drives available, because you will never get the most out of it. But don’t let this news spoil the fun, upgrading older laptops with SSD drives provides a very signifant performance boost, well worth the investment.
 

Newer posts »