OpenVPN on Windows Vista / 7 – Ping says: TTL expired in transit
Oct/090
Hi there!
When I set up my VPN with OpenVPN yesterday, I found out about a little difficulty under Windows Vista and 7. Thankfully it was not that much of a hurdle as the UAC was the reason for this bug just like for a series of other bugs with different software I experimented with over the last few weeks. Nevertheless I hope that this piece of information helps you get rid of the following problem.
If you have set up your VPN and got it running without any major problems, and everything seems to be running just fine (connecting works), but you still can’t establish connections to the other machines, you might find that pinging returns the error message “TTL expired in transit”. This is due to the fact that Vista (or Windows 7) needs administrator privileges to adjust your computer’s settings properly in order to function when you’ve connected to the VPN successfully. I think it’s about the route.exe process, but I’m not 100% sure.
Windows Vista and 7 have the equally famous as infamous UAC (User Account Control) that prevents even administrator privileged accounts from executing programs with administrator rights by default. In order to enable these rights you have to right-click the program (or program shortcut) and click on “Run as administrator” next to the yellow-blue shield if it does not run with administrator rights exclusively anyway (in which case you’d see the yellow-blue shield in the bottom right corner of the program icon itself and would be asked for administrator privileges automatically when you launch it as any other program).
Please note that the following steps are for on-demand OpenVPN connections. For automatic connections, read further below.
OpenVPN on-demand connection
So what you need to do is launch the connection with UAC. But how do you do that if you usually launch OpenVPN connections with a right-click and “Start OpenVPN on this config file”? Even creating a shortcut to the .ovpn file doesn’t give you the “Run as administrator” option.
A simple solution is to create a batch file that simply changes to the work directory and executes .ovpn with the openvpn.exe.
Example file “ovpn_connection1.bat”:
@echo off D: cd \Programs\OpenVPN\config-ondemand\ D:\Programs\OpenVPN\bin\openvpn.exe D:\Programs\OpenVPN\config-ondemand\connection1.ovpn
This batch file has the following parameters/assumptions:
- Your OpenVPN dir is on the D: partition (otherwise change the drive letter in the respective paths and leave the “D:” line out altogether).
- The path to your OpenVPN dir is D:\Programs\OpenVPN.
- Your connection configuration file is located in the config-ondemand subdirectory.
Basically, you just switch to the work directory and execute OpenVPN’s openvpn.exe located in its bin dir on the configuration. In a way, this works as a shortcut, but just as an executable batch.
The @echo off part is just so that you won’t see the other commands displayed in the window each time you start the connection.
Now you either make a shortcut to this batch file or use it itself.
Whenever you want to start the connection, right-click on it and select “Run as administrator”.
Done! Test your ping and it should be fine.
OpenVPN automatic connection
All you need to do is to move the .ovpn configuration file and all the other required files into the config subdirectory of your OpenVPN installation.
When the OpenVPN service (Start => Run => services.msc) is started, it will look for .ovpn files in its config subdirectory and execute them all – with SYSTEM privileges. No UAC circumvention needed.
So just set your OpenVPN service to “Automatic” and you’re good to go!
OpenVPN on-demand connection with OpenVPN service
Just do what is described under the “OpenVPN automatic connection” paragraph except for setting the service to “Manual”.
Now each time you want to launch the connection, you just need to type “net start OpenVPNService”. To stop it, type “net stop OpenVPNService”.
Note on using connections with the OpenVPN service
As the OpenVPN service feature executes *all* .ovpn configuration in the config subdirectory, there is no way to manually interfere with one particular connection of that directory and let’s say disable it shortly. All config-connections are handled as a group with the OpenVPN service.
So if you need manual independency, look at the on-demand section.
I hope this wasn’t all too fuzzy with the wordings and such.
Please comment or contact me if you have any questions on this matter.
Thanks for reading!
CountSMS – iPhone SMS Counter
Sep/090
If you ever attempted to send a text message on your iPhone, you will probably have noticed that it is kind of hard to estimate the amount of letters you have entered. Which is quite annoying though, seeing as a miscalculation might cost you money.
When I dug around the internet in order to find a capable app that could replace Apple’s standard Messages app, I could only find solutions for jailbroken phones (“BiteSMS”, I believe). My iPhone however isn’t, and it won’t be (at least not for a long time), so that wasn’t an option.
A nice little application that doesn’t integrate with your standard Messages app (sadly
) but however does the job quite well (as in: count the characters AND have a landscape mode keyboard) is CountSMS (iTunes link). It is for free and you can use it with the clipboard of course without any problems whatsoever. It even has nice Copy and Paste buttons on the top corners!
I know it’s not an absolute amazing app, but it gets the job done (a lot better than Apple’s standard Messages app! Shame on you, if I might say so
)
Thanks for reading and I hope you can benefit from that.
iPhone Mail Push Notification without App and for free
Sep/090
Hey guys!
It’s been a little while and I’ve come to own an iPhone now
One thing that frankly bothered me a little was the fact that apparently you can’t have your mail show up automatically (especially with that nifty little badge with the number of new mails in the main menu) if you
- have a mail account on a server that doesn’t bring Apple Push Notifications
- and you don’t want to let your Mail app check on your mails periodically.
The best solution would of course be Push Notifications. But how would you do that without having to buy an extra app (and risking a trust-wise questionable third party to get your login details) and/or registering on such a website that creates an e-mail address for you, maybe even in exchange for subscription fees?
Actually, the latter part gave me the solution itself. As it says on the Wikipedia page for Push e-mail (iPhone/iPod touch section), Yahoo! Mail supports Push Notification – even for free accounts!
So what can we do with that?
We can set up a separate account at Yahoo Mail that will exclusively handle the e-mails we want to be Push Notified about. And in conjunction with appropriate mail filter rules we can redirect e-mails to our actual e-mail account(s) to the new Yahoo Mail address.
On the iPhone/iPod touch we keep the actual, old e-mail account as it is and create a new one (Setting => Mail, Contacts, Calendars => Add Account) for the Yahoo Mail address. We choose of course Yahoo Mail and enter the correct details. You can leave the Outgoing Mail Server settings as they are.
Now, why do we keep the actual account on the phone and why would we leave the Outgoing Mail Server settings on Yahoo settings if we wanted to keep that Yahoo address hidden from everyone else (and also replying with another e-mail address would be mildly confusing to the person who wrote to you).
Well, personally, I just use the Yahoo account as a pure Push Notification service. I see the number of new mails in the badge on the top right corner of the Mail app icon, I navigate to the Yahoo inbox folder, delete the mails (maybe clear it altogether), navigate back to my main mail account and read (and reply to) the new mails from there.
You get my point?
Hopefully that’s of good use to you. For me, it saves me the trouble of having to buy an app which I’m probably not going to like completely
PS: If you run into trouble on Yahoo Mail with having all your forwarded mail dumped into the spam folder, set up some rules to move mails with “To: your@originalmail.com” into the inbox folder. That should take care of it.
Disabling Windows Vista / 7 Explorer’s Automatic Folder Type Discovery
Aug/091
Hey!
I very recently installed Windows 7 on my desktop computer and I’m loving it so far.
One of the major things that bugged me though was the new Explorer behavior. The automatic folder type discovery just goes ahead and tries to determine a folder type just by looking at how many (or if there are) files of a certain type (pictures, videos, songs, …) are in the current folder, and then it adjusts the viewing settings accordingly. For example, if you open a folder that contains mainly video files, it would show those with big icons instead of my default, a detailed list. Pictures are displayed as thumbnails.
Disabling this behavior proved to be interestingly difficult. As with most things that have been declared a default setting by Microsoft, it luckily can be done – but only via registry.
First we need to delete our current folder type settings.
- Close all open Explorer windows.
- Open the registry editor with Start => Run => cmd and browse to HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell.
- Delete and confirm the deletion of the keys BagMRU and Bags.
- Now create a Key (right-click on the current key in the left pane and select New => Key) called Bags.
- Create a subkey for Bags called AllFolders.
- Create a subkey for AllFolders called Shell.
- Create a String value (right-click in the right pane and select New => String Value) called FolderType and set the value to NotSpecified.
- That’s it for Windows 7. Please read the note for Windows Vista x64 below. Otherwise, just reboot and your new settings should be applied.
That’s it for Windows 7. If you’re using Windows Vista x64, it might be possible that there is a copy of (or a similar) the Local Settings\Software\Microsoft\Windows\Shell key in HKEY_CURRENT_USER\Software\Classes\Wow6432Node. I could not confirm this for Windows 7, though I am using the 64 bit version (it just had a CLSID subkey, nothing more). In that case, delete the Shell\Bags and Shell\BagMRU folders like I told you above before finishing your modifications with a reboot.
Warning: as always, playing around with the Windows registry can be dangerous when done incorrectly. If you do not feel safe about it, make sure to back up the keys you’re about to modify via File => Export, or leave it altogether. I do not take any responsibility for any damage, nor do I give any guarantee that the steps I provided here will work for you. At least they worked for me.
Hopefully that was of help to you
I discovered the initial instructions on mydigitallife.info. Thank’s so much
Had a hard time finding a guide for that.
AJAX with Chrome – empty responseText
Aug/092
Hi there!
When I implemented AJAX today in a new script of mine and persuaded
a couple of friends of mine to visit the page, I found that the Chrome users received error messages when trying to use the AJAX functions. However, they actually worked. The server received the AJAX request and processed it correctly, leaving me scratching my head.
Turns out that Chrome only received an empty AJAX response in responseText which caused the JavaScript function to throw out an error message. But why was it empty?
A couple of web searches later I realized that apparently not too many people had come across that problem. Luckily enough I found a post in a forum that pushed me in the right direction.
Chrome seems to be a little sensitive concerning headers in the AJAX responses. Because I hadn’t given my server-side AJAX processing script the appropriate “Content-Type: text/plain” header, it didn’t “accept” the response as text.
Why it has to be so picky, however, I cannot understand
If you have encountered that problem before, I hope I managed to help you out.
Certainly made me go a little crazy for a while there
New Blog URL
Jul/090
For better compatibility I changed the blog directory into a sub-directory instead of a subdomain.
Thanks and sorry for not writing, I’m waiting for something interesting to come up so I can give you relevant information
Compiling Exim and MySQL on a (CentOS) 64 bit Environment
Jun/090
Hey there!
I was recently trying to compile Exim with MySQL support on a CentOS 5.x 64 bit system. However, I had my dear share of trouble when it came to adjust the Local/Makefile for the 64 bit architecture.
The following error was what I got stuck on:
...
gcc dkim-exim.c
awk '{ print ($1+1) }' cnumber.h > cnumber.temp
rm -f cnumber.h; mv cnumber.temp cnumber.h
gcc version.c
rm -f exim
gcc -o exim
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make[1]: *** [exim] Error 1
make[1]: Leaving directory `/root/incoming/exim-4.69/build-Linux-x86_64'
make: *** [go] Error 2
Turns out it was easier to solve than I thought. The point was that it was looking for 32 bit libraries where it should have been looking for 64 bit ones. I adjusted the following lines in Local/Makefile:
LOOKUP_INCLUDE=-I /usr/include/mysql LOOKUP_LIBS=-L/usr/lib -lmysqlclient -lz -lm
to say this:
LOOKUP_INCLUDE=-I /usr/include/mysql LOOKUP_LIBS=-L/usr/lib64/mysql -lmysqlclient -lz -lm
And – hurray! – it works
Be careful though, it seems to need the /mysql after /usr/lib64.
Firefox Lags + Sysinternals
Jun/090
Hey!
I’ve recently found out about a majorly annoying phenomenon that can be experienced if you launch a performance-hungry application through Firefox, mostly through downloading a file and opening it directly from Firefox.
Why?
Speaking in terms of process trees, firefox.exe is the root process (or parent process) of the child process, say for example Azureus / Vuze. Vuze is known to be rather performance demanding and when it needs resources, it will take them not only from the system itself, but also noticably from the parent process. I don’t know if it’s common behavior, but usually that shows in Firefox experiencing the occasional couple-of-seconds lags.
The solution? Close Firefox and restart it. That way, all its child processes are raised to the same level firefox.exe was on and you can now browse without any more lags disturbing your streaming videos or anything else
I realized this when I was running Process Explorer by Sysinternals (a company that creates awesome tools for Windows. In fact so awesome they ended up being bought by Microsoft
). It’s a great tool to see not only Process IDs, CPU usage, RAM usage and executable names, you can also see dependencies (parent/child processes), CPU time, threads, etc. As a very nice feature it can also show little diagrams of resource usage (CPU and I/O ops) as task icons in your task bar next to the system clock! So much better than the built-in task manager!
Also check out the other tools by Sysinternals. I use Process Explorer and Process Monitor.
How To: Migrate an Existing Windows System to Another Hard Drive Using Acronis TrueImage
Jun/090
Hi!
Because of a new hard drive I bought a week ago I decided to transfer my existing system, running on a 250 GB hard drive, to my new 1 TB one. I was lucky enough to at least have made some experiences with migrating an existing system to a Virtual Machine in conjunction with Acronis TrueImage Home 2009 before, so that’s what came in handy for me.
What you need
- Backup software like Acronis TrueImage Home 2009
- BartPE with Acronis TrueImage Plug-In / bootable version of your backup software
- Windows installation disc (preferably the same Windows version as your current system)
- New system hard drive which is either empty or ready to be re-formatted (backup your important data on it!)
Procedure
- Start Acronis TrueImage Home 2009 and make a backup of your system partition.
- Save the backup to a partition / hard drive that you will have access to later on while using the bootable backup restorer. This means: No (TrueCrypt-)encrypted partition. Ideally it would fit on a disc or USB stick (which my didn’t with a size of 7 GB). Just make sure you will be able to access it later on. I know BartPE is able to access all hard drives (without encryption at least) and should give you access to a USB drive as well, as long as you have it connected while it’s booting up. If you don’t want to move it over to a USB drive or DVD or anything else, there is also a nice little trick at the end of this howto: (*).
- Shut down your computer and make sure your new system drive is connected as the first device to avoid improper device numbering. This means using the first connector for SATA/IDE or whatever. If you are using both SATA and IDE, I don’t know how that’s handled. I’m just assuming you somehow have figured it out
- Boot from your Windows installation disc.
- If you haven’t done it previously under Windows, partition the new system drive properly. That means to have the partitions created in the correct order. If you haven’t (or aren’t sure any more), delete them and do it over again just to make it right. Maybe the order is not necessary, but I had a lot of trouble with that before, so I’m just playing safe.
- Install Windows as usual to the point when you’ve started up your brand new Windows installation for the first time and are watching the Start Menu in awe.
- Boot from your bootable backup software (or BartPE with the plugin) and fire it up.
- Restore the image. Don’t select MBR / Track 0, however, because we just created a proper MBR (Master Boot Record) by installing Windows.
- That’s it! You should be done. Now a reboot should provide you with your old system on a new hard drive. Congratulations
I don’t guarantee anything, and I admit to having tried several methods for half a day till I got it right
This should work fine though, because it basically is what I did the time when it finally worked.
If you have partitions with programs on it that would be started on bootup, make sure you copy it (file by file) before you start your system on the new hard drive.
While you could do that by connecting your old system drive and booting from that, then copying the files over, you could also do it beforehand by using the Windows Disk Management tool to erase all partitions and partition it properly before the Windows installation. This allows you to format the specific partitions and copy the files over to it while you’re still on your old system. (*) Also, you can add the backup image onto that partition, so you don’t have to burn a DVD or move the image over to a USB stick or … (you get the point). However, if you create and format the partitions on your old system, make sure to
- (naturally) not touch them during the Windows installation progress or your data on them will be inaccessible
- rename your partitions properly after booting up your new system because your old Windows already assigned them (probably different) drive letters. You can do that in the Windows Disk Management tool as well.
I hope I didn’t forget anything. If I did, I’ll be sure to add it later on
Thanks for reading and good luck!