08/10/2008

Network print on a Windows machine

Here is the howto for connecting to a Windows printer from Linux

Prerequisites: installed samba (maybe samba-client is sufficient), cups, ghostscript, foomatic-filters (most of them are default anyway), the printer must be shared and accessible over the network.

  1. Open a browser of your choice and type localhost:631 into the address bar
  2. Click "Add printer" and fill name, location and description and continue
  3. For device choose "Windows Printer via SAMBA"
  4. Device-URI: smb://<windowsboxname>/<printersharename> - no port required, so leave it empty
  5. Choose the model of the printer - if the driver is not in the database you'll have to provide the ppd-file.
  6. At around this point you'll be asked for user name and password for CUPS (most likely, your root password, depending on your configuration)
  7. Change options if neccessary and enjoy

06/10/2008

Packages to add to a standard installation

These are the packages I would always install from the main repo (more a reminder for myself, but I guess it is useful for many people out there as well). This list is by far not complete and will be updated.

  • ntfsconfig (gui helper for setting read/write ability for ntfs drives)
  • quanta (web site development suite)
  • lynx (text browser for console - old, but can be very useful if you're left with a shell only)
  • texlive (LaTeX System)
  • kile (LaTeX Editor)
  • miktex-tools (if you use LaTeX and want to have a convenient package manager
Additionally, there are some packages which are not really usable or functional in the standard installation and should be replaced by packman versions (see post by avocadohead)

03/10/2008

Keep track of your YaST updates

Right on top of my YaST Installer wishlist would be a "sort by install date" option in order to easily revert what yesterday's uncautious update screwed up. At least I found out where the installer log is: /var/log/YaST2/y2logRPM.
sudo tail -n 100 /var/log/YaST2/y2logRPM (100 last lines) ought to give you a hint about the most recent changes.

Note: Doesn't work for SuSE 11.1. Try
# sudo tail -n 100 /var/log/zypp/history
If you want to compare when you installed which version of a certain package:
# sudo cat /var/log/zypp/history | grep -i <packagename>

25/09/2008

HTML special characters with KFileReplace

O my beloved Umlaut! … and all the characters I never wanted to know about … €¶Ŧ←↓→ØÞ¨ÆßÐŊĦĸŁ …
Copy and paste of non-standard ASCII text in Quanta can be cumbersome as the automatic replacement plugin only works with typing (Settings->Configure Quanta…->Automatic replacement of the accented characters). Another option would be to do some batch search-and-replace.
KFileReplace works both as a standalone app and a Quanta plugin (I don't think there is a Kate plugin yet). Multiple strings can be replaced directory-wide in one go, the session format is XML. I just googled a special character map (for reference, see e. g. here), wrote the .kfr XML file with a spreadsheet editor, and loaded it from KFileReplace. (Search/Replace->Strings->Load Strings List From File...)
Warning: Alpha-Howto! This has not been tested rigorously and might do some unwanted replacements; neither can it be a comprehensive list (e.g. no Greek characters except µ, sadly, I also decided against Chinese). Also, KFileReplace overwrites your original file (no undo!). I strongly recommend to enable "Do backup copy instead of overwrite" in the "Customise Search/Replace Session" dialog.
Whoever finds another culprit in the replacement list, please leave a comment.

Firefox 3.0.2

According to the German Heise Security page Mozilla has patched some important security issues in Firefox 3.0.2. As of this morning, that version is not yet available in the main update repo, but you can get it from the Mozilla Build Service Repo.
Update: 3.0.2 had another bug, passwords containing non-ASCII characters can't be accessed. 3.0.3 is already out and fixed (same repo).

19/09/2008

KRDC/KDE4 screws up my keystrokes...

...and just now I have neither time nor nerve to look for a fix. "O" apparently is transmitted as enter, the left mouse button opens context menus, and so on. Neither a VNC restart on the remote machine nor a KRDC restart change anything - I've had that problem before (maybe it's the compressed ssh tunnel). Most forum and blog posters complain about apparent tightvnc bugs, but for me, switching to a different viewer already did the job.
Usually, the KDE3 KRDC version is less buggy (look for package kdenetwork3-vnc), but if you need just a plain vanilla VNC without extras like full screen windows and special key transmission, tightvnc's vncviewer (package tightvnc, binary is /usr/bin/vncviewer) has a nice minimalist interface (no space-eating menus). The -fullscreen option is also very useful.

18/09/2008

Setting up an Apache server for testing purposes

First, why the hell would we do that? In my case, I have to play around with some simple PHP gallery scripts at the moment, and I am not very keen on testing them instantly on our university server (I expect the sysadmins aren't very keen on that, either, I'm a complete noob on a steep learning-by-doing curve).
Note: I include some MySQL directions here, because a lot of scripts manage MySQL databases. However, e.g. for a not-too-complicated image gallery PHP alone should do the job.
Warning: Don't follow this to configure a fully functional web server: a little knowledge is a dangerous thing - and who lets a total noob configure a web server anyway? This is just to get some practice - reduce my amount of noobness, so to say - working locally, I didn't care too much about security.
Packages to install: Either go for the full LAMP glory (YaST->Software->Patterns>Web and LAMP server), or install by hand apache2, php5, apache2_mod_php5 (if you want php4, find a repo, it's not in the official openSuSE 11 distro any more), if you want Mysql, also mysql, php5-mysql and probably phpMyAdmin. For any kind of server administration, Webmin is also not a bad idea.
To start the apache daemon: run sudo /etc/init.d/apache2 start (at least that's where the http daemon is on my system - you need the full path because it's not in PATH). Guess the code for stopping…

Check your firewall (YaST->Security and users). The allowed services for the External zone should include nothing like 'Apache' or 'HTTP daemon'. Thus, you won't need to fiddle with access control settings, the server is only accessible from localhost (however, some good information on that subject is here and here).
I don't know about other distros, but on openSuSE there is a public_html directory in your home folder. Any HTML documents you store there can be accessed on http://localhost/~<your user name>.
This is comfy if you keep the server local. On a public server I would strongly advise against public folders in one's home directory. However, you can change that in the Apache config files: Remove the userdir entry from the APACHE_MODULES list in /etc/sysconfig/apache2 (either modify the file directly or use the YaST module System->/etc/sysconfig Editor).

Konqueror wants to open web documents in editor

Konqueror trying to open HTML web document
One of the problems when you marry a file manager to a web browser. I don't recollect why the file association got changed in the first place, but it's easy to change it back again:
Settings->Configure Konqueror...->File associations: Search for HTML under 'Find filename pattern', it's probably in 'text' or 'application'. Set 'Show file in embedded viewer' in the Embedding tab and make sure 'KHTML' is the first item under Services Preference Order.
If you still want to edit local HTML documents, use the right-click menu.