betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

Entries : Category [ digital ]
Things having to do with digital world items go in here.
[digital]  [language]  [life]  [security]  [media]  [zope]  [tourism]  [limnos]  [mac]  [athens]  [travel]  [montage]  [food]  [fire]  [zwiki]  [schnipsel]  [music]  [culture]  [shellfun]  [photography]  [hiking]  [pyramid]  [politics]  [bicycle]  [naxos]  [swim] 

11 June 2009

Linedrops While Copying Files over scp? Use rsync!

At least you can restart...

What to do when you want to copy a big file over scp and you get dropped connections, hangs, stalls, stuck connections? The problem is that scp does not pick up where it left off, it doesn't reconnect or recover dropped transfers... the magic trick is to switch tools: Use rsync.

Yes, rsync is usually used to "sync" two folders of files, but it can very well be used to copy only a single file too. Given the right "switches", rsync will pick up where it was when your line dropped...

Here is a sample command:

rsync -e ssh \
--partial --append \
--progress \ .

Which would be used instead of:

scp .

So what are those options? --partial and --append are doing the important parts: They tell rsync to check what it has so far and pick up from there. It will actually checksum what it got (which takes some time, but in generally is a Good Thing™). I also use --progress, which informs me where we are. You can throw in an additional -v to get more verbose output.

The best thing when using rsync with --partial and --append is that after you discovered your scp transfer has dropped, rsync can pick up from what you've already got, you're wasting nothing for switching tools.

If you think your line could be congested, you could try --bwlimit=XX on the rsync command line (you could do that too maybe if you want to be nice and share your bandwidth with some other users).

Posted by betabug at 14:56 | Comments (2) | Trackbacks (0)
21 July 2009

Off the Net Again

Cut a little bit here and there

For a very long time, the Internet connection at my home was working just so very fine. We're talking years now. Last week it decided to stop doing that. All the usual incantations of shutting down and restarting the router and other devices wouldn't help. I went and checked (and changed) cables... nothing.

So, off to do the boring deed of calling the provider (Vivodi), ah the joys of talking to the call center. Predictably they told me to do the same thing (the off/on game), check the cables, reset the router. Nothing. Then they asked me for my mobile number, as they would check things and call me back. Which they didn't. I kept on calling them day by day.

Today they told me, that there is a broken cable, a few meters from the telephone exchange (or however that is called) on the way to my house. Yeah, right, and that's why it's only our appartment that has the problem. Anyway, they have given a trouble ticket to OTE, which "owns" the last mile. I tell the guy in the call center: "So it's a matter of weeks now" and he responds "no no, just a few days". Yeah, right. Wish me luck, it being summer and all and digging in the streets being an ugly business when it's hot and when all the workers are on vacation. Assuming the story can actually be believed. Good for me that I have the means to get a connection over my mobile phone to post about it.

Posted by betabug at 20:52 | Comments (0) | Trackbacks (0)
20 October 2009

Little Patient W60

Sent the Pentax to the camera clinic

This morning I woke up slightly earlier and got my little digital point-and-shoot camera to the importers office for repair. The shutter button is stuck. The camera is a Pentax Optio W60, waterproof and fun. They told me there is a surge of camera repairs, since after summer, so it will take a week to hear about it.

Even though I got back into large format photography with my (very) old camera, I want the little Pentax back. It's just the right camera to have always with you. I really mean always, given that it's waterproof and quite robust (due to the lens not "zooming out" as in most point-and-shoot cameras). If you take the limitations of the optics and software (no manual mode) into account, it allows to take nice pictures too.

The last reason goes back to the large format camera too: I want to use the digicam as a photometer. Set it to "spot-metering", do some tests to get the metering about synced with the film and my handheld photometer and it should do a good job.

Posted by betabug at 09:10 | Comments (0) | Trackbacks (0)
03 December 2009

Map ex Commands in vim

... for example for a different keyboard layout

In vim, Greek, and utf-8 Keyboard Commands, Giorgos had asked in a comment if it would be possible to not only switch vi's keyboard shortcuts to a Greek keyboard, but also to use Greek letters for ex commands. For example to be able to write for :w. Yes, that's possible, do something like the following in your .vimrc file:

cab γ w
cab κ q
cab γκ wq
cab ε e

Due to the use of cab for these "abbreviations" (that's what the ab is for), they will work only in the command mode. There are some limitations. First of all, when entering you will not see it replace with :w right away (you can hit space to see it replaced), but it will work. Also if you have ex command lines with a single ε somewhere in them for example, you could get into trouble, as vim would continue to change that to an "e". I will not be using this myself for this reason.

Posted by betabug at 15:15 | Comments (1) | Trackbacks (0)
30 December 2009

Preparing Server Upgrade

Everybody cross their fingerz

These days "between the years", that I'm not working, I prepare to upgrade my server. That's right, the very server that you view this web page on. Still have a lot to prepare and read up, but once I'm done *preparing* there will be some "downtime" and hopefully the server will come out of that and be rebooted to a new self... or rather to a new system.

I've had a few not so lucky experiences with server upgrades, so wish me luck, cross your fingers, whatever lucky charms you feel like doing. I'll run some backups, but if things go wrong, it might be some time before I get things working again. By that time though, you will not be able to read this, irony of ironies. I'll get back to reading up and preparing, in order to avoid it now.

Posted by betabug at 13:54 | Comments (1) | Trackbacks (0)
05 January 2010

Can't get back into Open Firmware.

A little Open Firmware and OpenBSD lockin... sing along to the tune of "Back to the USSR"

Yesterday evening I attempted my server upgrade. Within 5 minutes I was stuck with an Open Firmware error running amok and blocking everything. I called it a day and was ready to relax and let my server be the pile of plastic, silicium and lowgrade problematic waste it had chosen to be, when helpful Raimund from IN-Ulm came to help and rebooted the box.

I managed at the second try to boot the server into bsd.rd (the RAMdisk install kernel for OpenBSD) and installed the new OS on the second disk. Now the only small problem is, that my machine is set up in macppc's Open Firmware to auto-boot directly on disk 1 into OpenBSD. And there is no way to change that once you have set up the server to a serial console... short of hooking up a keyboard and holding the magic Command-Option-O-F keyboard combo. Someone has a hint for something like a workaround to that, but the OpenBSD developers tell me there's no way around. I guess, "to be continued" is all I can say here...

Posted by betabug at 10:23 | Comments (0) | Trackbacks (0)
05 February 2010

Can I Call Home Now, Please?

Argh, the world of online telephony and payment

There was a time when I was doing my long distance phone calls either through my "normal" telephone or through Skype. Then I got fed up with both - due to the price for the phone and due to the whole Skype-is-a-black-box-giant thing. I switched to Gizmo, which coincidentally had a nice frontend for my mobile phone. There I was more or less happy for a while. OK, it would sometimes not work or was laggy, but that was expected. These aren't business calls, when they don't work, I'll call the next day. But then Google bought Gizmo and now I'm kind of stuck with what to do...

Gizmo placed me in the world of "open standards", "SIP" VoIP (which means that I can choose whichever program runs best on my computer, not what someone like Skype considers bugfree enough to feed everybody). Currently I think I could still top up my Gizmo account, but I'm a bit reluctant to do it.

So I'm shopping around for another VoIP provider. Something of the "road warrior" variety, what they call "BYOD" (Bring Your Own Device). I don't need any hand holding, I can configure whatever client program I chose.

Funny enough, the biggest stumbling block I ran into is actually paying for a good service: It looks like the world of VoIP intersects heavily with the world of fraudulent credit card charges. The result is various "verification" schemes that I've encountered so far.

There are some that want to send you an SMS (OK, that's not so bad, but the company didn't appear so, well "serious" in the first place). Some that will make two charges to your card and then you have to get the charge statement and find the amounts... good idea, but it would require a looongish phonecall to my credit card company for me and how do I prove them over the phone my identity? Then there are some who require a "verified" PayPal account, which A: results in the same "check your CC statement" game and B: damn I wanted to avoid these big brother companies in the first place!

Combine all this with the task that I would like the other party in the game to be trusted too, I'd like to not be ripped off myself either, so... For the moment things are still open... I can stay without a phone line to the "homecountry" for a while now, but I'll have to make up my mind and/or find a solution some day.

Posted by betabug at 16:55 | Comments (1) | Trackbacks (0)
23 February 2010

VPN from Nokia e71 to OpenBSD IPsec

uff, it really works

It took me some time, but this evening I finally got it rolling: I have set up a VPN connection from my Nokia e71 mobile phone to my OpenBSD server. On the Nokia phone I'm using Nokia's VPN client, on OpenBSD I'm using the standard, built-in IPsec with a setup in /etc/ipsec.conf.

I've learned quite a bit in the process, but mostly I've learned that I really want to learn more about this IPsec / VPN stuff. I'm looking for a good book now. As for my setup and config files, right now I'm reluctant to publish them. I'm tired and I'd like to go over them another time while I'm more awake, when I've done that, I can post my sample config and hope that it helps others.

What can I do now with this setup? Well, first of all I'll be much more relaxed to use open and/or unknown wifi networks. Second, I'm able now to connect to my VoIP/SIP provider even when I'm on a 3G connection, as all provider blocks are circumvented by going through the the VPN.

Update: Docs announced.

Update 2: Looks like dcasati from Mailbox 211 has confirmed the setup for 4.7-stable

Posted by betabug at 21:59 | Comments (11) | Trackbacks (1)
24 February 2010

Docs for VPN from Nokia e71 to OpenBSD IPsec

I wrote down some stuff

This evening I wrote down the documentation to go with yesterdays post about me getting the VPN from my e71 to my OpenBSD server working.

I've put the documentation into my little wiki, which makes editing for me easier, but commenting right there for you impossible. If you have comments, you can leave them here or contact me by mail.

The setup probably works for other Symbian phones too, but I have no idea. Actually I know very little anyway, I just got my setup working.

Here are the docs for my Nokia e71 to OpenBSD IPsec VPN setup finally.

Posted by betabug at 23:13 | Comments (7) | Trackbacks (0)
06 March 2010

pjsua: The Geek Out SIP Client

It's as geeky as making a phone call can get

There are many options for making SIP/VoIP phone calls over the Internet. There are some with nice user interface, some that get you over almost all the the little hurdles and problems (like for example X-Lite, which you should try if you're ever stuck unable to make a connection, as it seems to work around most problems on its own). But if you're a real geek at heart, there is only one choice: pjsua. pjsua does not have any such timewasting features as a GUI or an address book.

In fact pjsua isn't really meant to be used as an everyday SIP client. It's more of a reference implementation, helping to make sure that a setup is right, helping you to find out what's going on over the (virtual) SIP wire. In the default setup it spews out all kind of connection messages and status things. The configuration is done over command line arguments.

But then, if you want to geek out, you can use pjsua very well as your everyday SIP client. Some of the shortcommings it has, will only help to keep you interested... and in the end you could use one of the language interfaces to the pjsip API to build your own client anyway.

So here's some of my setup: First of all you can also place those command line arguments you need to set up accounts and all that into a file in order to get something like a "saved account preferences". I then call pjsua with only one argument, the path to that file. Next I've created an alias in the shell, to call pjsua with that one argument.

Here is how such a config file could look:

# pjsua SIP client config file
# get rid of almost all those status and debug messages
# ------------------------------------------
# when I'm in the office, I hook up to the PBX
--id sip:112@
--registrar sip:
--realm 'Registered Users'
# the realm used for our Panasonic PBX
--username 112
--password supersecret
# the PBX initially complained about a too short registration
# timeout value, that's why this is here
# ------------------------------------------
# ------------------------------------------
# a (hypothetical) SIP provider for my private calls:
--username 1234567890
--password supersecret
# this provider works only with UDP:

You separate different accounts with ``--next-account``, then you probably can set up as many accounts as you want. So, even if this file is just "command line arguments written into a file", it works as well as any Unix config file.

Given that I've used ``--app-log-level=3`` to cut out most of the debug infos, the user interface is much more useable. The debug info *does come in handy*, the moment something doesn't work out, like when I had to find out why the PBX complained about a "too short time given" or something. In everyday usage, I just cut the log-level down and the UI cleans up. It now looks something like this:

|       Call Commands:         |   Buddy, IM & Presence:  |     Account:      |
|                              |                          |                   |
|  m  Make new call            | +b  Add new buddy       .| +a  Add new accnt |
|  M  Make multiple calls      | -b  Delete buddy         | -a  Delete accnt. |
|  a  Answer call              |  i  Send IM              | !a  Modify accnt. |
|  h  Hangup call  (ha=all)    |  s  Subscribe presence   | rr  (Re-)register |
|  H  Hold call                |  u  Unsubscribe presence | ru  Unregister    |
|  v  re-inVite (release hold) |  t  ToGgle Online status |  >  Cycle next ac.|
|  U  send UPDATE              |  T  Set online status    |  [  Cycle prev ac.|
| ],[ Select next/prev call    +--------------------------+-------------------+
|  x  Xfer call                |      Media Commands:     |  Status + Config: |
|  X  Xfer with Replaces       |                          |                   |
|  #  Send RFC 2833 DTMF       | cl  List ports           |  d  Dump status   |
|  *  Send DTMF with INFO      | cc  Connect port         | dd  Dump detailed |
| dq  Dump curr. call quality  | cd  Disconnect port      | dc  Dump config   |
|                              |  V  Adjust audio Volume  |  f  Save config   |
|  S  Send arbitrary REQUEST   | Cp  Codec priorities     |  f  Save config   |
|  q  QUIT   L  ReLoad   sleep MS   echo [0|1|txt]     n: detect NAT type     |
You have 1 active call
Current call id=1 to [CONFIRMED]
>>> h
>>>  14:16:00.784    pjsua_app.c  Call 1 is DISCONNECTED [reason=200 (Normal call clearing)]

At the top is the status-and-command menu, a bit like on a BBS. Below is a prompt. There was a call in progress, which I just hung up using the h command. For example to make another call, I'd enter m, then I would be prompted to enter the number... but pjsua expects a sip-URI, something like the in the example screen. I'm not currently using the "buddy list" stuff, probably I could use that as some sort of rudimentare address book. For the few calls that I make currently, I just cut and paste these URLs.

So the usage of this beast can't get any more geeky. What's great though is the technical level: Since pjsip/pjsua is a reference implementation, you get the best that there is. The call quality is great. There are no delays to draw some GUI elements on the screen. (At least on my Macs,) audio just worked. I don't have to live with the limitation of some GUI SIP-clients (like the free X-Lite only giving you one account set up), I have my own geeky limitations!

Posted by betabug at 14:51 | Comments (13) | Trackbacks (0)
19 March 2010

Python e71 Image Editing

... well at least the resize and rotate part

Yesterday I noticed that the lack of image editing app for my e71 won't be so bad anymore... it should be fairly easy to hack up a python app with pys60 for the Nokia to turn and resize images!

I could then couple it with the phone's speech recognition and end up with the image editing UI from Blade Runner. "Up 20, stop. Enhance. Give me a hardcopy." Ah, the possibilities.

(Here are some code examples, full of little bugs, but a starting point. All I really need to post stuff on my philthy blogz0r is the ability to rotate and resize to standard sizes.)

Posted by betabug at 14:54 | Comments (0) | Trackbacks (0)
23 March 2010

S60 VPN: The reports of unusability have been greatly exaggerated

Sure, setup is a bitch, but daily use is great

It's been a month since I successfully set up a VPN from my e71 to my OpenBSD server. A twitter from Markus Mediger - that I found by chance - claimed that "S60 VPN only works with some obscore Nokia certified HW AFAIK. Practically unusable...". This reminded me to maybe publish a little report of what I'm doing and not doing with my e71 on VPN.

Because really, I don't have any business with Nokia (I didn't even pay for this phone, it's been given to me from my company), but I won't think it's right to have OpenBSD being called "Nokia Certified HW", even by mistake :-) Sure, finding out how to set it up was a chore, and setting it up is not really the easiest thing ever. VPN setup hardly ever is. Except maybe if you use a setup from some vendor where they control all parts of the solution. That just means that they did the hard part for you. In case of s60 VPN and OpenBSD, the OpenBSD guys and maybe me did the hard part for you.

So, I use the VPN for roughly two use cases: First, connecting to SIP/VoIP when the 3G providers setup blocks that. Using this is a breeze: Switch to the SIP-profile in question (I have 2 SIP profiles that I use, totally unrelated, if you have only one, you won't need this) and then select to connect through the VPN access point I have set up for the 3G connection. It just works. Sure, it's not always the best of sound quality, but it's roughly 1/3 the price of calling a mobile number or 1/30 of calling a fixed line number locally or ... I dunno, 1/100 of calling a foreign fixed number. The bandwidth used is pushed higher by the VPN encryption, so since I'm paying for the bandwidth, I use it sparingly. I can't compare the sound of "SIP/VoIP over 3G" with/without VPN, as SIP is blocked by the 3G provider here (I'm not 100% sure it's intentional).

Second: To browse and connect to SIP/VoIP from wifi hotspots that I can't control. This I do of course for security reasons, I don't like people to be able to sniff on me. Same setup here: Switch SIP-provider, select VPN access point, go... well, unless I haven't used that wifi hotspot before, in which case I have to edit or create a new VPN access point. That's currently my only user interface complaint about the s60 VPN, it doesn't matter much when you move amongst the same few wifi points, but for someone who travels all over the place it might be annoying. I don't go through the VPN when I'm in the office network, I'm not that worried about security.

Little tip: When you're on a public free wifi of the kind that uses a CAPTCHA to give free access, obviously the VPN client won't be able to connect. First open the web browser to go to any random URL, which gives you a chance to enter the CAPTCHA. Then use a different program to connect via the VPN, which now can use the same connection. Last, if you want to use the web browser over the VPN connection, close the web browser again and re-open it using the VPN access point.

Conclusion: It works. It works with OpenBSD, so it will work with all kind of other IPsec based VPNs. Setup might need some knowledge and tinkering. But reports of unusability have been greatly exaggerated.

A note on twitter: I'm not using or liking it. I think it's just a bad copy of IRC and where IRC was chaotic and open, this is just a commercial venture. What's more, as they say of IRC "what? you did that based on what a guy on IRC told you to do?" 140 characters does not give you the space to show all sides of an issue, to explain that you (e.g. Markus in this case) just doesn't really know (well, that's what the "AFAIK" could have been there for) and maybe better shouldn't talk about unknown stuff anyway besides saying "I don't know". On IRC that's not really a problem, since, well, it's IRC, just a place to rant and vent anyway.

Posted by betabug at 14:53 | Comments (2) | Trackbacks (0)
27 March 2010

Rack Trains and Village Internet

Enjoying the long weekend

Yesterday we went on an excursion to Kalavryta, taking the scenic rack railway up there. The railway trip is wonderful, travelling through a narrow gorge. The train moves quite slow and - at least now in spring - you can open the windows to take pictures. Kalavryta itself is nothing to write home about. It was rebuild after being destroyed in the war. I saw many nice scenes around Kalavryta and around the train track, but would have to return on foot to take pictures.

In the late afternoon we returned and stopped by the lighthouse at the northernmost tip of the Peloponnese. Finally as things weren't moving any more, I was able to take two pictures with the Arca. I was a bit disappointed though: I had bought two extra films in Athens and discovered they had given me the wrong films.

In the evening we were enjoying the old fashioned Internet in the village... a 56k modem connection. Due to a broken clip on the cable quite shaky too. We were able to look up things about the rack train though.

Posted by betabug at 11:24 | Comments (0) | Trackbacks (0)
06 April 2010

Picking up on a New Feature

Loose ends flapping around

The long easter weekend is over, today is high time to pick up work again on one of the new features I'm building for one of our Products. Being the sole member of my development team, when some bugfixes and other stuff came along, I had left off building this stuff a while ago. Now I'm here on the island, in a quiet and relaxed setup to continue from where I stopped last time.

Which would be really nice if it wasn't for the little things I've left for myself: Half-finished code not yet committed, a method that I don't really remember as being necessary, some functional tests that don't pass. Not to mention a lot of notes that document different approaches to build things, where it's not always 100% clear which one is the right one. It's not really helping too much to get a flying start, but at least with "clean up", my first task is well defined.

Posted by betabug at 15:22 | Comments (0) | Trackbacks (0)
23 April 2010

Flickr Shoulder Slapping Evaluator

... an idea for a funny app

If you use Flickr (or, as some people lovingly call it, "Fuckr"), you might have noticed, that it's almost impossible to get real critique or even real comments on your pictures. All most people ever seem to get is shoulder slapping in the form of "Good shot", "wonderful capture", and "well taken" etc.. This might be feeling good for an average of 3 days when you start out, but it turns sour and empty fast. Well, being a geek and all, I thought about a technical solution or, failing that, at least messing with the stuff in a fun way.

To be honest, I haven't even looked at the flickr API, so no idea if this is possible, but here is what I propose: Write a bot that trawls the comments on your photos. Analyse the comments (maybe some bayesian playtime is needed, maybe not even) to see which comments are shoulder slaps. Have the bot check out the users who posted comments, analyse the comments they get vs. the comments they make. Find some magic pagerank style number to give a real value to the comments people give you.

What you want to know is if the comment "wow, great capture" on the picture of the red plastic bathtub in your backyard comes from a user with a firehose of such shoulder slappings or if it's the one-off comment from someone who usually does careful analysis. While you're at it, discard all the "please add this picture to the worlds-greatest-red-bathtubs group" group invitations. Then assign a score to your pictures. Something that tells you "people who care really cared for this picture". Or at least it tells you "the shoulder slappers will know I see through them". And if you didn't like it you can still look at all those "amazing picture" comments.

Update: Had a short look at the flickr API, this stuff should be well inside the realm of the possible.

Update 2: Just found this flickr comment generator - wonderful work!

Posted by betabug at 10:03 | Comments (2) | Trackbacks (0)
28 May 2010

Ups, I did... C#

So, *that* was what that file ending meant

Since some time now, I'm finishing up a project for someone else (long story). There's a lot of Flash involved (aua) and some rudimentary cms in some files that run in a Micro$oft .NET environment. Today, as I was searching for a solution for a very stupid error message, it finally dawned on me that I was in fact doing C#! So, that was what that .cs file ending was all about! (If you don't know this: "C#" is not pronounced "See-Pound" or "See-Hash", but "See-Sharp", ergo .*cs*harp, duh.)

As my friend Javier put it: Now I could even write in my C.V. that I have experience in C#. In fact, I think C# is a very nondescript language. Could be almost anything, JavaScript, ActionScript, any language with c-style-braces all over, like dogsh*t in the park. (Uhm, why, yes, I'm a python programmer, why did you ask?) I didn't see anything using pointers, so I'm not so sure the reference to C is actually valid (I think I've heard that pointers are in there though). Why this language even exists? Beats me.

Posted by betabug at 20:31 | Comments (0) | Trackbacks (0)
Prev  ...  2   3   4   5   6   7   8   9   [10]   11   12   13   14   Next