Secure Windows File Sharing (Samba) over the Internet without Putty.

There are numerous articles describing tunnelling Samba over SSH with putty. In this post I will show you how to set up Samba tunnelling for everyday use without putty running all the time.

Things you need before you start:

  • A SSH server between you and the shares you want to connect to. It may be running on the same machine as the shares you want to access.
  • File Sharing (Windows) or Samba (Linux) configured correctly on the machine you want to access. Make sure your firewall lets the SSH server connect to your Samba or Windows shares.

1st Step: Create a local loopback interface

We need to create a loopback interface on your local computer first. There is a lot of HOWTOs on the web describing this. I suggest you read this one. As soon as you have the loopback working and putting properly forwarding ports to the local loopback interface, go to step 2.

2nd Step: Set up the tunnelling app

So you have the forwarding working now. Technically, that’s all you need. However, if you plan to use shares on a daily basis, there are a few things you will notice:

  • It’s annoying to have the putty window open all the time,
  • If you close it, your shares will become unavailable,
  • If your network goes down for a while, putty won’t be able to reconnect your ssh session.

Myentunnel ScreenshotThere’s a solution to these problems: a tunnelling tray application. Personally, I like myentunnel. It’s a simple wrapper for plink.exe from the putty package. Sitting quietly in the task-bar’s tray, it’s unobtrusive and reconnects automatically after a network failure.

Install and run myentunnel. Then set your hostname, username and password stuff in the Settings tab and go to the Tunnels tab. Add the Samba port and IPs in the Local box, press Save and then Connect. If putty connected and forwarded the ports properly, myentunnel should work without a hitch too.

If you have multiple servers to connect to, you can create server profiles. Read the myentunnel documentation for details.

That’s all, enjoy.

Paczkator - sending big scanned attachments made easy!

Paczkator LogoPaczkator is a small Windows utility I wrote for the company I’m currently working with. Its purpose is to simplify the process of sending multiple big images (usually scanned documents) by mail. It’s small, pretty fast and requires no configuration from the user.

Features:

  • Small, free and easy to install and use
  • Automatically finds any images in the folder specified and scales them down if they are too big
  • Zips the folder, opens your email application (Outlook Express by default) and creates an attachment for you.
  • Warns you if the compressed folder is too big to send by email
  • It’s localised. Currently it speaks English and Polish
  • No administrator privileges required to install and run
  • No additional software required to work properly

Download Paczkator 0.8 now!

Paczkator is distributed under the GPL2 license, which means the program is FREE for both private and commercial use. You can also redistribute and modify it. If you do so, I would be grateful if you notified me.

Feel free to contact me if you have questions or suggestions concerning Paczkator.

Version History:

  • 0.8 - current release: added localisation, installer and fixed a few bugs
  • 0.6 - improved image recognition and scaling procedures, a bug-fix release
  • 0.5 - initial release

Finally! A decent text editor for Linux with Windows key bindings.

I’ve been using Linux for more than 7 years now. The main thing I do on Linux is text editing. Editing configuration files, source files, html files and what not. Initially I used Midnight Commander’s built-in editor (as probably many of you coming from windowed systems). As I became more experienced and geeky I moved to one of the ‘holy editors’: Vim. Vim is an excellent editor with unlimited possibilities but unfortunately mastering it takes unlimited time as well. I used Vim for several years before realising that all this complexity and a user interface from the 70s were not for me anymore. I needed simplicity. I needed something with Ctrl-C, Ctrl-V for clipboard and Ctrl-F for find. I decided to look for another editor.

Here’s what I was looking for:

  • as many windows-like (CUA) key bindings as possible. At least Ctrl-C, Ctrl-V.
  • syntax coloring
  • basic editing functions like search&replace
  • needs to work on a VT as well as a console without rebinding keys
  • minimum configuration

These features are not particularly demanding, are they? Well, I tried at least a dozen various editors and couldn’t find any that would meet these requirements. Not until I stumbled upon Diakonos.

Diakonos is a simple programmer’s editor for the Linux console that I find almost ideal. It’s open-source, it has all I need and it works out of the box. I’m not going into details (you can read about its features on the homepage), just a screenshot and a list of pros and cons.

Pros:

  • very windows-like key bindings (all that I use, I didn’t rebind a single key!)
  • no configuration needed (although you can configure it pretty extensively if you want to)
  • works on a VT as well as console without reconfiguring putty, .inputrc or anything
  • has all the features you would expect in a basic programmers editor (regexps, etc)

Cons:

  • It’s slow. It is really slow when compared to any other editor (even Emacs). It’s written in Ruby, which is an interpreted language. I’m not sure if it is for Ruby or the author’s laziness but I don’t really care. It works sufficiently fast on my hardware. It saves a lot of my time which is more valuable to me than cpu cycles.
  • Syntax coloring has some problems. I think it has something to do with switching contexts. When editing a PHP file with HTML in it, the coloring sometimes gets funny. Well that’s not a major drawback for me too.

To summarise. If you’re frustrated with complexity of Vim and Emacs, try Diakonos.

J&L Creditor - a company site and webmail.

Another commercial project I undertook in cooperation with Marcin from K13 Graphic Design. It was a complete package of visual identification and web presence services. Marcin did the design and print, I was responsible for the Internet part, that is a CMS, Email+Webmail, domain stuff and hosting for all these services.

The client wanted a typical company website so I decided not to reinvent the wheel and use a general purpose open-source CMS as a base. I went for CMS Made Simple, which had almost all the features I needed: a tree-like page management, rich text editor and user management. No thrills, just the right tool for the job.

However, CMS Made Simple lacked an important feature: internationalisation. I’m sure the problem has been fixed by now, but back then there were only some hacks and half-solutions available. I had to implement my own internationalisation support.

The FCKEditor required a bit of bug-fixing too. It took ages to load and its responsiveness was comparable to that of a Linux desktop (Yes! Linux is still too slow). I tweaked it until its performance was acceptable but these days I suggest you use TinyMCE instead.

One more thing I had to code by hand was a custom tax calculator module. It calculated tax penalty interest over a period of time. Sounds trivial but the rates of penalty interest in Poland have changed in the last couple of years at irregular intervals. It’s not rocket science but it took a bit of thinking before implementation.

For Webmail I chose SquirrelMail, not cutting edge but reliable, which was the key thing for my client. I host both these services on one of my own servers for quick access and modification.

Screenshots of the result (you can take a look at the live site here):

Note: J&L Creditor logo is a property of J&L Creditor company. Logos and other pictures are used only for the purpose of presentation.

Decowood Saunas - a product site.

The task I’ve received recently was to develop a product site for a company producing saunas. The idea was to create a web equivalent of their printed catalogue of products. It was a pretty simple project but there were a few things I had to deal with:

  • It had to be pure a XHTML/CSS site. No PHP or any other server-side scripting used on the production server. That of course implied I couldn’t use a database.
  • I had to transfer all the texts, product descriptions and images from MS Word documents I received from the client.
  • The site had to be multilingual, so even more data to insert from *.docs.

The prospect of manually cutting and pasting those things from Word to XHTML sources didn’t sound exciting so I decided to use some scripting to do the tedious job for me. Here’s what I did:

  • Firstly, I made XHTML layouts from images I received from my friend who took care of designing the whole thing. I included a bit of JavaScript eye-candy to to make the site more attractive.
  • Then I developed a minimalistic CMS using PHP for automatic generation of product entries and pages from CSV input. It could also export the whole site to separate XHTML and CSS files.
  • Then I made a couple of Perl scripts to convert *.docs to HTML, extract all the data from them (images and tabular data) and create CSV files.
  • Finally I fed my minicms script with the CSV data and rendered everything to pure XHTML pages.

Of course not everything went OK automagically. Scripts needed quite a bit of tweaking because *.doc files didn’t have a regular structure and some things just were faster to import manually. However, the site was ready in half the time I would have needed to create it by hand and I saved myself from some serious headaches.

Screenshots of the result (you can take a look at the live site here):

Note: Decowood logo is a property of Decowood company. Both logos and pictures of products are used only for the purpose of presentation. Currently the site is maintained by a third-party contractor so it may look different.