Tag Archives: linux

Windows clients with CUPS and Samba

After starting my new job, I battled a bit with getting a printer/scanner working on the local network.
The fileserver was a mess as well… a real mess.

My boss gave me permission to install linux on it (since I haven’t really used windows for a long time now) and fix the filesharing and printing on it.
I jumped into the task, knowing in the back of my head, that printing always is a bloody mess to fix, when you have WINDOWS clients on the network.

Anyways, without looking back, I grabbed the new Ubuntu 10.04 server and installed the system. Didn’t take long, not even for the old machine we have.

After the system was installed, I setup a shared folder and some user shares. I even added our printer (Some old HP CM1015 printer, with a scanner).
No worries!… well.. on my Mac at least.
The windows clients kept having problems connecting to the printer, but the file shares worked perfectly.

After 2 months of hearing complaints on and off, I finally did some more work with the server and found that this samba -> cups configuration works:

load printers = yes
printing = cups
printcap name = cups

  browsable = yes
  printable = yes
  public = yes
  create mode = 0700
  guest ok = yes
  use client driver = yes
  guest account = smbprint
  path = /var/spool/samba

As you can see I added a guest account as well.

/usr/sbin/adduser --system --disabled-password smbprint

The printer can now be discovered on the network simply by choosing Networks->SERVER_NAME, the shared folders and printers are now displayed.
Just right click on the printer and choose connect.

A special thanks to this guide: http://tldp.org/HOWTO/Debian-and-Windows-Shared-Printing/sharing_with_windows.html

Cycle through history in linux/mac terminal

If you are like me, you often use the terminal for… well.. let’s face it, most things.
I cannot remember one day, when i’m not bashing the keys in the terminal, trying to find, script or copy my way out of things.

Often I need to do the same things more than once. This could be connecting to a server to configure something, run a script I made earlier to resize some images, some FFMPEG command that I used earlier…

Eventually you get tired from hitting the arrow up key, and some years ago I got introduced to the “reverse history search”.
This is a way to search through your recent history (history being commands you’ve used in the terminal).

Simply hit CTRL+R to start the search, and the terminal will now look like this:

When you start typing, it searches through the history of your terminal.

One thing that bothered me though, was that I could only get the most recent result, and arrow up/arrow down doesn’t search through the results.

Hitting CTRL+R again displays the next result, that has the same command.

Just wanted to share it, happy bash’ing