Skip to main content

Posts

Showing posts from 2013

How to enable VPN over ICMP / DNS in SoftEther VPN

Or where is the damn VPN over ICMP / DNS setting in SoftEther Because the infrequent times I need to install a SoftEther server I seem to waste half an hour trying to locate this setting. BUT, it's already enabled by default. Well enjoy this tip and if this has helped do thank me by following me on twitter @danielsokolows .

CloudAtCost Buyer Beware

March 14, 2014 Update - I have sold am selling my 'Developer 3' for life instance See performance stats below and email me at 'cloudatcost-dev3-for-sale [at] danols.com' if interested. Below is latest performance snapshot - it's usable but not for what I need. Make me an offer in the comment section, the first reasonable amount will be accepted and we'll use a paypal for the transaction. oot@debian7:~# . test-linode.sh $ openssl speed sha1 ... type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes sha1 34431.17k 90492.32k 200161.54k 303043.38k 328540.16k $ dd if=/dev/zero of=test bs=64k count=5k oflag=dsync && rm test 5120+0 records in 5120+0 records out 335544320 bytes (336 MB) copied, 84.5891 s, 4.0 MB/s ... Resolving ipv4.download.thinkbroadband.com (ipv4.download.thinkbroadband.com)... 80.249.99.148 Length: 536870912 (512M) [application/zip] Saving to: `/dev/null' ... 536,870,912 1.18M/s

Starbound Dedicated Server Setup

Setting up persistent Starbound on Debian Starbound is a Terraria survival/build like game set in space. Based on watching few videos and playing it for a bit I concluded that except for the over abundant life and loot on every planet this game appeals to me very much. And so along with my minecraft.danols.com server I have decided to run a starbound.danols.com 24/7 dedicated one for Starbound; below is how I did it. Get a dedicated Debian linux server If you don't have yet a linux server I recommend going with Linode Xen VPS hosting - the basic first package will suffice. I have been with them for over 5 years now and can not say enough good things about them. Yes, there are chepaer alternatives out there but heed the warning that you get what you pay for. With the basic package I am able to run a Freeswtich VOIP server, Minecraft, email, and few websites. Their setup instructions are solid so use that to provision a Debian 7 instance. Please use the above link or

Eclipse ANT View/Editor Missing

Installing the Eclipse ANT plugin directly All Eclipse distributions have ANT Java based build support (you'll find 'org.apache.ant_*' in your Eclipse install) however unless you also install the Eclipse Java development tools (JDT) you will be missing the ANT Editor view. Rather than installing the entire JDT package we can install the ANT UI component directly using Eclipse's P2 director through the command line as follows $ cd $ ./eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/kepler -installIU org.eclipse.ant.ui Installing org.eclipse.ant.ui 3.5.400.v20130514-1341. Operation completed in 19162 ms. Afterwards to activate the editor go to 'Window > Show View > Other > Ant' or right click 'XML' files and choose 'Open with > Other > Ant Editor'. If you found this useful feel free to follow me on twitter twitter @danielsokolowski .

Eclipse ZIP Plugin Install

Working with zipped staticresources in Eclipse IDE As I work toward mastering Salesforce's APEX language one of the thing that surprised me is the convention to store static resources (js, css, images, etc.) as a zipped archive in the Salesforce.com cloud; my uneducated guess this is so to avoid the Data limit imposted. To Edit staticresources in Eclipse IDE directly (most of my Team uses Sublime + Maven which I am evaluating and those experiences are for another blog) one could use the Eclipse Zip Editor plugin, however it does not have a handy url install and requires a manual one. Installing Eclipse Zip Plugin There is no friendly site install url, and selecting the local or archive install results in Eclipse throwing an error; the only way I was able to install is using Eclipse dropins folder mechanism. Download Eclipse Zip Editor form their site Unzip the plugin In the unziped folder navigate to the subfolder plugins Copy the file Navigate to your Eclips

Dual Strike Sidewinder Xpadder Profile

How to macro program the Dual Strike in Windows 8 By far I consider the Dual Strike Sidewinder the best Frist Person Shooter (FPS) controller device. Sadly though this controller is no longer manufactured and although Windows 8 does include the needed drivers the bundled software that allows you to program and create macros no longer works - without this functionality the controller is nothing but a shadow of it's potential. Xpadder to the rescue I stumbled onto this utility after reading this post and in my testing it is the perfect solution, not only for this controller but for any that you mihgt have and not only for controller aware games! That is if you ever wanted to play Minecraft, Xenominer, or Starmine with your favorite controller well with Xpadder you can make that happen. Yes it's not free and costs $9.99, yes it's not the best looking software, and yes the site look like it was made at the same time as my Dual Strike Sidewinder stopped selling bu

Minecraft server update cron script

Automatically update crafbukkit server to latest development version Modify as need and place or link the below script into your '/etc/cron.daily/' folder; remember not to use dots in your cron files as they will not be read - for example name it or soft link it as 'update-crafbukkit-minecraft'. #!/bin/sh # # file: update-craftbukkit-minecraft.sh /etc/init.d/minecraft-server.sh stop wget -N http://dl.bukkit.org/latest-dev/craftbukkit.jar # got the link by reading here: http://wiki.bukkit.org/Setting_up_a_server and guessing to change '-rb' to '-dev' rm minecraft_server.jar ln -s craftbukkit.jar minecraft_server.jar /etc/init.d/minecraft-server.sh start You can find my minecraft setup and my minecraft init.d startup script at an older post Minecraft Server on Debian .

Normalize '__unicode__' accross django models

Don't repeat your self, use monkeypatching - a better default '__unicode__' This latest top-secret project for sure is keeping me busy and time wise leaves little to keep blogging, however it being Friday and all and because you're worth it here is a Django expert tip. Django's default '__unicode__' representation leaves a bit to be desired to say the least. In a nut shell it returns the class name + 'object' for all instances and so requires that all your models have a '__unicode__' defined to have a useful string represenation. Well with a bit of friendly monkeys we can patch it right up as per the code below: from django.db.models.base import Model import logging import hashlib import re from django.conf import settings logger = logging.getLogger(__name__) #---------------------------------------------------------------------------------------------------------------------- logger.info("Patching 'django.db.models.base.M

Django Custom Chainable QuerySets

How to reuse custom defined 'models.Manager' QuerySets Django recommends to define custom query sets on your sublcassed models.Manager, there is one problem however that these are not chainable, that is you can only call your custom queryset once - assuming I have defined an '.active()' queryset the following will not work: >> PaymentTerm.objects.active().active() Traceback (most recent call last): File " ", line 1, in AttributeError: 'PaymentTermManager' object has no attribute 'active' >>> Current solutions on the web involve creating a subclassed 'models.Manager' and a custom 'QuerySet' which do work but are to code verbose for my linking. I believe the below approach is simpler, cleaner and more succinct. class OfferManager(models.Manager): ... STATUS_CHOICES = ( (STATUS_DISABLED, "Disabled"), (STATUS_ENABLED, "Enabled"), (STATUS_NEGOTIATED, "Negotiated")

CommandError: Unable to serialize database: Error encountered checking Geometry returned from GEOS C function "GEOSWKBReader_read_r".

ERROR django.contrib.gis libgeos.py@80: GEOS_ERROR: ParseException: Unknown WKB type 0 These cryptic messages are caused by using the vanilla Django `model.Manager` with your geo enabled models. This caused me a frew hours of grief trying to figure it out, thinking it's the import data, or an issue with the third party app, etc. but the fix is to just extend your custom model manager from the `gis.models.GeoManager` which is super easy to forget: from django.contrib.gis.db import models class MyCustomManager(models.GeoManager): """ Additional methods / constants to Base's objects manager - using a GeoManager is fine even for plain models: ``BaseManager.objects.public()`` - all instances that are asccessible through front end """ # Model (db table) wide constants - we put these and not in model definition to avoid circular imports. # one can access these constants through .objects.STATUS_DISABLED or ImageManager.S

Django import fixtures IntegrityError: Problem installing fixtures:

IntegrityError: Problem installing fixtures: The row in table 'geonames_alternatename' with primary key '1830' has an invalid foreign key: geonames_alternatename.locality_id contains a value '109436' that does not have a corresponding value in geonames_locality.geonameid. In a situation where a third party app data export works just fine but the fixutre fails due to any IntegrityError is most likley cause by an overiden `objects` manager that returns only a subset. The solution is to explicitly tell django to export using the default model managers using the `--all` argument for example like so: dumpdata geonames --indent=4 --all --settings=settings_development > geonames_ext/fixtures/initial_data.json This is clearly a situation where explicit is better then implicit, that is when defining custom model managers do not touch the `get_query_set` method rather instead add an explict method; for post completeness below is my Eclipse PyDev template I utli

Unable to configure handler 'console': __init__() got an unexpected keyword argument 'strm'

Django and upgraded from 2.6 to Python 2.7 Hopefuly this quick post will save someone time, I recently upgraded our Debian servers from stable (squeeze) to testing (wheezy). Unfortunately this resulted in an odd error: Traceback (most recent call last): File "manage.py", line 12, in execute_from_command_line(sys.argv) File "/srv/www/django/development.FOO.com/virtualenv/src/github-django-django-stable/django/core/management/__init__.py", line 453, in execute_from_command_line utility.execute() File "/srv/www/django/development.FOO.com/virtualenv/src/github-django-django-stable/django/core/management/__init__.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/www/django/development.FOO.com/virtualenv/src/github-django-django-stable/django/core/management/__init__.py", line 263, in fetch_command app_name = get_commands()[subcommand] File "/srv/www/django/development.F

mppe_compress[0]: osize too small! (have: 1404 need: 1408)

Windows VPN and PPTP Connectivity Timeouts In my pursuit for a personal cloud and convenient secure remote file system so as to be able to develop directly on the server I have researched, tested and decided against SFTP, WebDAV, and SAMBA/NFS over internet. The only approach still standing is the built in Windows VPN and PPTP + SAMBA/CIFS: However there was one bug that prevented some sites/services from working and timing out; the /var/log/syslog showed the following intermittently: Apr 19 10:15:15 sh1 pptpd[11330]: GRE: accepting packet #107 Apr 19 10:15:15 sh1 pptpd[11330]: GRE: accepting packet #108 Apr 19 10:15:15 sh1 pptpd[11330]: GRE: accepting packet #109 Apr 19 10:15:15 sh1 kernel: mppe_compress[0]: osize too small! (have: 1404 need: 1408) Apr 19 10:15:15 sh1 kernel: ppp0: ppp: compressor dropped pkt Apr 19 10:15:15 sh1 kernel: mppe_compress[0]: osize too small! (have: 1404 need: 1408) This due to the way  MPPE Microsoft point-to-point Encryption encodes data whic

Another Awesome Free Linode VPS Upgrade

Double memory, double CPU and 10x internet traffic. Our hosting of choice for self managed servers is Linode as this company continuously stays competitive and keeps giving back to it's customers. In the last two months they doubled the memory, updated CPU cores, increased transfer cap, and storage space you can read their blog for more info. Plan RAM Disk XFER CPU Price Linode 1G 1 GB 24 GB 2 TB 8 cores (1x priority) $20 / mo Linode 2G 2 GB 48 GB 4 TB 8 cores (2x priority) $40 / mo Linode 4G 4 GB 96 GB 8 TB 8 cores (4x priority) $80 / mo Linode 8G 8 GB 192 GB 16 TB 8 cores (8x priority) $160 / mo Linode 16G 16 GB 384 GB 20 TB 8 cores (16x priority) $320 / mo Linode 24G 24 GB 576 GB 20 TB 8 cores (24x priority) $480 / mo Linode 32G 32 GB 768 GB 20 TB 8 cores (32x priority) $640 / mo Linode 40G 40 GB 960 GB 20 TB 8 cores (40x priority) $800 / mo In my opinion the best VPS for a low cost $20 a month pla

Linphone Portable Version

Linphone PortableApps Beta Version Linphone is an excelent multi-line, multi-platform - iOS, Blackberry, Windows, Mac and Linux - opensource VOIP SIP client I have been using for over a year now; I have tried a number of VOIP clients before settling on it - it's so awesome it cooks breakfast in the morning and it deserved a PortableApps version so I created one. To download my beta version click LinphonePortable_3.5.99.0-snapshot-mar-21-2013_English.paf.exe and report any issues on this forum http://portableapps.com/node/36863 . If you find this useful do +1 this or follow me @danielsokolow .

Storing passwords in PuTTY

How to save SSH username/password for auto login in PuTTy The answer is you can't do it...at least in plain PuTTy. However there is an awesome fork with that let's you store the username and password and other additional features called KiTTy . So grab yourself a copy and +1 this if you do, thanks.

Eclipse Auto Refresh Browser on Save

Automatically refresh the browser window when saving a file in Eclipse IDE All of my Django webdesign (yes SEOing there) work is done in the excellent and plugin rich Eclipse IDE on a Windows machine. The edit/preview workflow pattern is make some change, save the files (CTR+S), swtich to browser (ALT+Tab), refresh the windows (F5), switch back to Eclipse IDE (ALT+Tab) and rinse and repeat. Even though I can do this quickly it is repetitive and cumbersome and the seconds it takes turn into minutes and hours wasted over many projects. Googling you will find posts that show how to automate the Alt+Tab F5 Alt+Tab sequence using VBScript and setting it as an automatic builder in Eclipse. Now this is a good enough solution and it does work very well except that it does not work with all browsers. Google Chrome being one of them where the SendKeys seem to be ignored. However using an alternative utility NirCmd I was able to make it work as follows: Download NirCmd and extract

/bin/bash^M: bad interpreter Error

Eclipse file saving and /bin/bash^M: bad interpreter The source of the error is having a bash file saved with line delimiter in Windows style rather the Unix format. To fix this you can use the 'dos2unix' linux utiltiy: $> aptitude install dos2unix The following NEW packages will be installed: dos2unix 0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded. $> dos2unix <file_to_fix>.sh dos2unix: converting file <file_to_fix>.sh to UNIX format ... Eclipse new line delimter setting But this post is about setting the Eclipse IDE to save in the Unix format, so let's get to it. To do so, right click on the 'project' in your navigation pane, select 'properties', and under the 'Resource' tab ensure to specify the 'New text file line delimiter' is set to Unix as shown above; while you at it select the same encoding as on your server which most likley is

Windows WebDAV Double Authentication 401 Requets

Speed up trick for Windows 7 WebDAV Client One way to conveniently develop remotely with Eclipse + PyDev is to run WebDAV on the remote server and map it as a networked drive in Windows (PyDev over Eclipse Target Managmenet does not play nicely). WebDAV works rather well except it is not the fastest especially on initial project creation /project refreshing and if your share is protected with a username/password; below is how I improved the performance. Apparently by protocol design and due to security Windows 7 client does not cache it's authentication and so on each request first an anonymous attempt is made followed by an authenticated one: ... 72.38.184.18 - - [22/Jan/2013:23:05:04 +0000] "PROPFIND /Files HTTP/1.0" 401 751 72.38.184.18 - username [22/Mar/2011:23:05:04 +0000] "PROPFIND /Files HTTP/1.0" 301 495 72.38.184.18 - - [22/Jan/2013:23:05:04 +0000] "PROPFIND /Files/ HTTP/1.0" 401 751 72.38.184.18 - username [22/Mar/2011:23:05:04 +0000]

GeoDjango + Spatialite (SQLite3) Setup Issues

Because there are fresh ones every time I start a new project! As of May 03 2013 I have opted to install virtualenv --system-site-packages and running aptitude-install python-pysqlite2 spatialite-bin gdal-bin ; the site are not as self contained any more but sure beats fighting with the issues. All my Django projects are self contained (as much as possible) with Virtualenv and use Spatialite database (SQLite3 +geo spatial stuff) installed so to enable GeoDjango functionality. This post is a list of issues I encounter related to that setup and how I resolved them; as I seem to run into a new one on every project start. And as always if you found this useful do +1, or follow me on twitter @danielsokolows /usr/include/spatialite.h:61: note: previous declaration of ‘spatialite_init’ was here Say what? --- this one threw me for a three hour fun time. It happened because I executed 'pip install pyspatialite' will install the 3.X vesion which is is broken and craps out with:

HTTPS and drop in Google Web Master Tools Impressions

Switched site to HTTPS and impressions and visits plummeted In an attempt to resolve the (No Provided) issue in Google Analytics I have switched our site Kingston Search Engine Optimization [yes I am doing SEO backlinking there :)] to HTTPS and experienced a massive drop in impressions and visits. Google Analytics reported no change in actual visits so the issue was left alone to hopefully sort itself out; but it didn't. By the way switching to HTTPS will not resolve the missing keywords in GA, if you analyze the browser requests you will notice Google just plainly strips them from the referral header information. Solution to HTTPS impression drop This was a mystery for a while until today when I found a solution which is very simple. By default Google Web Master Tools creates and tracks sites under HTTP protocol, and treats HTTPS as different sites entirely, just like it treats www.webdesign.danols.com and webdesign.danols.com as separate sites. Creating a new entry th

Django Template Eclipse Editor Plugin

Aptana Eclipse Django template editor alternative A solid lightweight alternative to Aptana Django template editor Eclipse plug-in. Definitively worth at a test drive - which is what I am doing now - since I have refrained from installing the Aptana alternative due to it's dependencies. You can download it here: Django Editor - plug-in for Eclipse . One shortcoming however is that HTML and JS editing is bare bones with no content assist, this is expected thought and can be mitigated by switching to a specialized editor as needed.

Setting up ZOTAC ZBOX nano AD Remote for XBMC

Getting the Windows, Info and Colored buttons to work The included Zotac remote is Windows MCERemote compatible but the additional buttons (Windows, Info, Colored buttons) will not work out of the box. The XBMC MCERemote add-on will fail with: * Warning * The ReportMappingTable registry key is not present * No Microsoft remote is installed Good News But before I begin, if this helps you please do +1 or share it as that helps me. So take the MCERemote registry files, this , this ,0 and this thread and a 3 hours and you get a tweaked Zotac Remote Registry Fix below; it labels all keys I could discover and maps some as follow: The Windows remote key to Win keyboard key (perfect if you are running Windows 8) The Colored Buttons to Ctrl 1 through 4 The Info button to 'Ctrl D' - XBMC display info [T] Teletext? key to send 'T' - XBMC toggles subtitlies The '≡' right of 'T' to send 'C' - XBMC display contextual menu Copy and paste

FreeSWITCH Call Audio Stuttering Issues

Reduce VOIP audio stuttering by increasing deamon priority On occassion our FreeSWITCH Linode VPS stutter which I believe is because the server overall gets a little busy with everything else that is installed. One noticeable way tp reduce or almost eliminate this is to run the FreeSWITCH VOIP daemon in real time priority. But before I begin please do +1 or share if it helps you as it helps me. On Ubuntu/Debian chaning FreeSWITCH priority is easily accomplished by modifying the `/etc/init.d/freeswitch` start-up script and adding the `rc` real time execute options to the `DAEMON_ARGS` argument – but if you want set the priority even higher scroll to bottom of post. An example of a FreeSWITCH init.d script can be found on the FreeSWITCH Wiki page which - I think is more complete then the sample included in the source files. #!/bin/bash ### BEGIN INIT INFO # Provides: freeswitch # Required-Start: $local_fs $remote_fs $network # Required-Stop: $local_fs $remote