Feed on
Posts
Comments

Advertise vacation rentals free -

If you own a vacation rental (aka. holiday apartment) you might be interested to know that you don’t have to spend money to advertise it. You can advertise it absolutely free on one of the following sites:

  • Craigslist – international website
  • free holiday apartment listing at www.tripolog.com - International website
  • Short term rentals listing at www.isralet.com – Local site in Israel

* The above sites allow you to advertise your vacation rentals for free!

I recently tried to install rar on my Ubuntu 10.4 server…
Naturally, the first thing I’ve tried was: apt-get install rar
Unfortunately, ubuntu responded with the following message:

Package rar is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package rar has no installation candidate

The solution found was to manually download and install it…

the files from

  1. Select the proper version from the resources box on the right at http://packages.ubuntu.com/oneiric/rar  and download it (if your server is running on 64bit os, download the amd64 file).
    Example: wget http://archive.ubuntu.com/ubuntu/pool/multiverse/r/rar/rar_4.0.b3.orig.tar.gz
  2. extract the file:
    tar -xvzf  rar_4.0.b3.orig.tar.gz
  3. type make or make install

 

Recently I was looking for a solution to backup my website and the MySQL database to a Dropbox account…

These are the steps you’d want to follow:

  1. Get the DropboxBack script from: https://github.com/Nyr/DropboxBackup#readme
    follow the instructions here to install: https://github.com/Nyr/DropboxBackup/blob/master/README.md
  2. Install rar on your server:
    apt-get install rar
    # if it fails, follow this post: install rar on ubuntu
  3. Setup cronjob that will run it daily. example (runs every day at 12 o’clock):
    # m h dom mon dow command
    0 12 * * * /bin/bash /root/dropboxbackup-daily.sh
  4. If during the backup process, you notice the following error:
    mysqldump: Got error: 1044: Access denied for user ‘root’@'localhost’ to database ‘information_schema’ when using LOCK TABLESThen do the following:
    # login to mysql
    $ mysql -u root -p#And type:
    mysql> GRANT SELECT,LOCK TABLES ON DBNAME.* TO ‘username’@'localhost’;
    (replace the username with the actual user that you see in the above error message).

Voilà!

 

Not so long ago (on January 2012), I’ve written about the Secret Google Weather API. Surprisingly, few days ago, Google decided to secretly shut down the Google Weather API entirely.

Many developers (including myself) who were relying on the free Google Weather API were left hanging in the air and began looking for a proper alternative to the free Google weather API .

My requirements for the Google Weather API alternative were as follows:

  •  The API should provide existing weather conditions for a given city name / coordinates.
  • International (should support at least the main cities world wide)
  • Should support at least 3 days weather forecast.
  • And last but not least… should be 100% FREE!

My personal hunt for an alternative for the Google Weather API took about an hour,  and I came up with the following findings…

  1. http://openweathermap.org – very nice projects with a free & open API that will let you retrieve the existing weather conditions in every country in the world
    PROs: absolutely free
    CONS: doesn’t seem to support weather forecastsSample JSON response: http://openweathermap.org/data/2.0/find/station?lat=55&lon=37&cnt=10
  2. http://www.wunderground.com/
    PROs: includes city weather reports (including forecasts).
    CONs: there’s a cap of 500 call per day (plus 10 per minute) for the free plan.API : http://www.wunderground.com/weather/api/
  3. http://www.yr.no/ -  weather service from the Norwegian Meteorological Institute (met.no) and the Norwegian Broadcasting Corporation.
    PROs: Free, 6 millions including 3 days weather forecastAPI: http://om.yr.no/verdata/php/ (English translation)
  4. http://www.worldweatheronline.com/weather-api.aspx
    I haven’t tested this service, but it looks promising…
    PROs: free including 3 days weather forecast.
    CONs: owners request developers not to excess 500 requests per hour (see FAQ: http://www.worldweatheronline.com/free-weather-feed.aspx?menu=faq)

I’m sure there are many more alternatives that I haven’t covered… so if you are familiar with another 100% FREE service, please post a comment.

 

 

 

The other day, I was looking for a free weather forecast api for a project I’m working on. I managed to find a few, but the one that seemed to be the fastest and easiest to implement was  ”The secret Google Weather API” (that’s the way it was called in few posts I’ve read).

Anyhow, the “Free Computer Advice” blog, had a nice post that explained how to use this weather API with PHP, but since the site went down on Dec 2011 it’s not accessible anymore.
Luckily, I managed to snag the post’s content from Google Cache before it was removed entirely, so here it is for your pleasure.

Sunday, August 2, 2009

Google Weather API

Every web designer has at one point or another been asked, “How can I get weather on my site?” The old answer was to have a giant ugly weather channel gadget. Something that looked very nasty and you couldn’t un-brand it no matter what. Some used an iframe to display external data and have it appear to be on their site. Lastly you could always just have a link that says ‘click here for weather’. My goal was to get weather data from an external source and be able to customize how it looks. Fortunately now there are some great resources out there. I’m going with one that is my favorite, something extremely easy to use and customize – Google’s Weather API.

To start lets pull up the URL in your browser.

http://www.google.com/ig/api?weather=new+york,ny

You’ll see XML data of the weather in New York! Easy enough, let’s take a look at the output.

  1. <xml_api_reply version=”1″>
  2. <weather module_id=”0″ tab_id=”0″ mobile_row=”0″ mobile_zipped=”1″ row=”0″ section=”0″ >
  3. <forecast_information>
  4. <city data=”New York, NY”/>
  5. <postal_code data=”new york,ny”/>
  6. <latitude_e6 data=” “/>
  7. <longitude_e6 data=” “/>
  8. <forecast_date data=”2009-08-02″/>
  9. <current_date_time data=”2009-08-02 12:19:00 +0000″/>
  10. <unit_system data=”US”/>
  11. </forecast_information>
  12.      <current_conditions>
  13.      <condition data=”Light rain”/>
  14.      <temp_f data=”72″/>
  15.      <temp_c data=”22″/>
  16.      <humidity data=”Humidity: 94%”/>
  17.      <icon data=”/ig/images/weather/mist.gif”/>
  18.      <wind_condition data=”Wind: N at 6 mph”/>
  19.      </current_conditions>
  20. </weather>
  21. </xml_api_reply>

Wow check out how easy that was. Now all we did was submit the location and hit enter. Now we have in XML weather data for that area. No advertisements and since the data is in XML we can make it look however we want. Note: I shortened the output to only one day. So what’s next? Well in my case I used a PHP script to output this data. Let’s take a look at that source code.

 

  1. <?php
  2. function getWeather() {
  3. $requestAddress = “http://www.google.com/ig/api?weather=21619&hl=en”;
  4. // Downloads weather data based on location – I used my zip code.
  5. $xml_str = file_get_contents($requestAddress,0);
  6. // Parses XML
  7. $xml = new SimplexmlElement($xml_str);
  8. // Loops XML
  9. $count = 0;
  10. echo ‘<div id=”weather”>’;
  11.      foreach($xml->weather as $item) {
  12.           foreach($item->forecast_conditions as $new) {
  13.                echo ‘<div class=”weatherIcon”>’;
  14.                echo ‘<img src=”http://www.google.com/’ . $new->icon['data'] . ‘”/><br/>’;
  15.                echo $new->day_of_week['data'];
  16.                echo ‘</div>’;
  17.                }
  18.           }
  19. echo ‘</div>’;
  20. }
  21. getWeather();
  22. ?>

I hope this tutorial was helpful! The Weather API is great on so many levels, fast, easy and customizable.

Download Source Files

I’m frequently being asked how to enable multiple concurrent remote desktop (RDP) sessions on windows 7 (in an old popular post I presented a solution for winxp, but hey, we’re already in the windows 7 era…). To be honest, I didn’t have much time to explore this issue up until today (when I actually needed to find a solution for my own personal use).

So just before pulling out my hacking kit, I decided to give good’ol Google a shot and see if someone has already done the “dirty” work for me… and I’m happy to let you know that someone did (actually it was a bunch of guys) – 4 cool guys from WinMatrix forum (Pinobigbird, untermensch, cocoa & Shipit).

So just before I’ll continue to the howto, I’ll give a short background explanation on why do we need this patch anyway:
Windows 7 has a built in remote desktop (RDP) feature that is limited by default to one concurrent user per session. Which means, that if two users are trying to connect the same machine at the same time, they can’t (actually they can, but the last user who logs in will kick out the user who is already logged in). So what I present here is a solution to allow multiple users with different or similar accounts to simoultaniously login to a windows 7 machine via RDP, by using a patched version of termsrv.dll.

So back to the cool patch by the WinMatrix guys… well, they’ve created a very nice package to contains the following files:
install.cmd – this is the script you’ll have to run
32_termsrv.dll – a patched version of termsrv.dll for x86
64_termsrv.dll – a patched version of termsrv.dll for x64

In order to use it, you’ll have to extract the files to a new folder and execute with administrator privileges (run as administrator).
When you run the install.cmd, you can use the following switches (remove the quotes):
“help” – quick help
“multi Enable” – enable multiple remote desktop sessions per user
“blank Enable” – enable remote logon for accounts which are not password protected

To download the package, click here

I found another patch by TCP-Z, that suppose to be better and support all Windows versions. However, since some users reported problems with this new patch, I’ve decided to keep the link to the old patch if someone needs it.
You can download the new patch from here: UniversalTermsrvPatch_20090425_by_TCP-Z.zip

Just for the reference, here’s a transcript of their hex magic:

x86 Hex edit

find:
00 3B 86 20 03 00 00 0F ** ** ** **
replace:
00 B8 00 01 00 00 90 89 86 20 03 00

find:
FF 43 50 C7
replace:
FF 90 50 C7

find:
F8 74 2F 68 ** **
replace:
F8 E9 2C 00 00 00

x64 Hex edit

find:
8B 87 38 06 00 00 39 87 ** ** ** ** ** ** ** ** ** **
replace:
B8 00 01 00 00 90 89 87 38 06 00 00 90 90 90 90 90 90

find:
60 BB 01 00 00 00
replace:
60 BB 00 00 00 00

find:
50 00 74 18 48 8D
replace:
50 00 EB 18 48 8D

Few years ago, I was looking for a simple way to embed a captcha solution on one of my sites (that was hosted on a shared IIS web-server). I looked all over for a captcha solution that won’t require installing an external DLL or connecting to a remote captcha server that will slow down the process (such as reCaptcha).

Back then I was coding in ASP3, so I decided to write my own class to do the job, and I named it “Captchavator”.

I’ve planned to release it to the public… but never did (I just forgot about it).

Last night, while I was browsing my HDD, I stumbled upon the Captchavator folder and the decided it’s time to make a move :)

You might say that ASP 3 is obsolete… and I’ll say “true, true…”, but since there are still many old sites out there, I think that even even if one person will find this useful, then it was worth releasing…

So what’s so special about this solution?

  • It requires your web-server to support ASP 3, Javascript and nothing more
  • Does not require installing any com/activex object on the server
  • Does not require storing images on the server
  • Developers can generate their own captcha characters using the included “painter” tool
  • Does not use any database to operate
  • Can be used with any shared hosting IIS web server

How can you use it?

The process is very simple and involves 4 simple steps…

Step 1 – Include the captcha class in your ASP page.

Step 2 – Create an instance of the Captchavatorobject

Set objCaptcha = New Captchavator

Step 3 – Generate a new captcha (pass the length of the requested captcha, in the following example, I’ve asked for a 6 chars long captcha).

objCaptcha.CreateCaptcha(6)

Step 4 – Print the captcha

objCaptcha.Print()

To validate the captcha, following these steps:

Step 1 – Include the captcha class in your ASP page.

Step 2 – Create an instance of the Captchavatorobject

Set objCaptcha = New Captchavator

Step 3 – Check if the passed POST/GET parameter matches the captcha

objCaptcha.Validate( Request(“txt1″) ) ‘will return true if validated successfully!

What’s included in the archive?

captcha.asp - This is the main Captchavator class

captcha_painter.asp - Use this file to generate your own captcha characters. Please note the painter only works with Internet Explorer (I’m too lazy to fix it to work with FF).

demo.asp - Demonstration of the complete process

I sure hope you’ll find this useful….

Try an online demo:  http://www.isralet.com/files/captcha/demo.asp

Download the Captchavator archive from here:

http://www.isralet.com/files/Captchavator_v1.2-ASP_3_Captcha.rar

Feel free to ask any questions by leaving a comment below.

If you have multiple users on your Windows XP machine, you might have heard it is possible to patch the terminal services service, to support multiple concurrent remote desktop connection (via RDP) to your computer.

Around the time Windows XP SP1 was released, a patched version of the file termsrv.dll could be found on the Internet, replacing this file with your existing one enabled the concurrent remote sessions support.

Yesterday I upgraded to Windows XP SP3 (you may ask if it isn’t too early? maybe so, but since I’ve already been using the latest RC for some time now, I felt confident enough to apply this update on my home computer). Anyhow, after updating to SP3, I discovered my computer no longer supports concurrent remote sessions.

Short Googling returned few articles explaining how to patch the termsrv.dll to support concurrent sessions, so I pulled out my favorite HEX editor and with few clicks everything was up and running again.

To save so time for other users (and myself when upgrading more computers), I’ve packaged the updated termsrv.dll file with another file that will make the required changes to your registry. (see the included readme.txt file for further instructions).

Download the patched version: termsrv_sp3_patch.rar

Installation instructions
0. Go to C:\Windows\system32\dllcache and rename the termsrv.dll to termsrv.dll.bak
1. Go to \Windows\System32 folder and rename termsrv.dll to termsrv.dll.bak
2. Copy the new SP3 patched termsrv.dll to \Windows\System32 folder
3. Run the included registry patch “ts_concurrent_session_patch.reg” (by double clicking it), it will update the relevant registry values which are relevant to the concurrent sessions support.
3. Restart windows.

NOTE:
if you are currently using Terminal Services, you will need to start windows in safe mode before you can overwrite the existing termsrv.dll files.

Alon

UPDATE 7/June/08:
I’ve added a note to the installation instructions suggesting to  remove another copy of termsrv.dll that resides in the dllcache directory (Anthoney, thanks for the tip).

UPDATE 1/Aug/08:
The previous download link died. I uploaded the file to a new location.

Hi

Lately I’ve been doing some reading on online backups (aka. off-site backup) and it got me thinking…

Everybody knows the importance of backups, but every few weeks or so, I’m still getting this call from another poor soul that usually sounds like this: “oh no, my HDD just died.. what can I do to restore my data?”.

Thing is, most home users fail to backup their data regularly. I must admit that although I consider myself an advanced computer user (who is aware of how important it is to backup your data) I’m still not doing half than I should to make sure my data will be available to me when a catastrophe happens.

So yes, I’ve evolved in the last few years (after losing my laptop HDD and all the data that was on it) and started doing some daily backups between the computers in my home network (copying the data from one computer to another)… so now I feel pretty safe in the occasion of another HDD crash, but I’m still not doing any offline backups.

So what will happen if, god forbids, a burglar will visit me one day and take all my computers with all my precious data? in three words – I am fucked.

Of course the cheapest way to do backups (defiantly not the easiest) is to do it offline – Cassettes/CD’s/DVD’s or what have you. I really don’t know, maybe it’s just me being lazy, but even after losing all the important data I had on my dead laptop HDD I’m still failing to do offline backups and I believe most home users fail to backup their data this way as well.

Which brings me to the point of this email – Online Backup Services

We’ve all heard about them, some of us even experience some of them like xDrive, iBackup and others (I know I have :) ), but I never liked any of them for few reasons:

Why? few reasons:

  1. Speed Speed Speed – if I started a backup session it would take ages until all the data is sent to their servers and it was hogging my bandwidth.
  2. Privacy – I’ve never felt I can trust them with my precious data – how can I tell if someone is actually looking at my nude collection?
  3. Laziness – I always had to remember to initiate the backup myself. Although most of the services do offer scheduling, it’s pretty worth-less when a backup takes approximately 34 hours

Mozy Logo

Today I came across another online backup service called Mozy (http://mozy.com/) – which promises unlimited online backup storage for ~55$/year.

To start backing up with Mozy, you need to create an account in their website and then you can download & install their backup software. You set an encryption password, choose the folders you wish to backup and Mozy will do everything else from there.

What I like about Mozy (and what actually differentiate their solution from what I’ve seen so far) is that their software is always running in the background checking which files have changed since the last backup (thus needed to be backed up again) and once your computer is idle, it will send these files to the remote server for backup. pretty neat, uh?

Being a true paranoid and all, I have one problem with Mozy (actually, the same problem applies to all the online backup solutions I know) – How can I be 100% sure nobody from Mozy is browsing my nude photo collection… Now seriously, although they offer a pretty impressive 448-bit Blowfish encryption and send the data over 128bit SSL connection, I still need to trust them not to send my private key to their server along with the data (allowing them to read all my data that is saved on their servers).
So if I was a normal person, I would probably trust them and use their product as is, but since I’m not, I’ve come up with a better solution – combining an external encryption software.

My new backup strategy is about to include another software – an external encryption utility named TrueCrypt (http://www.truecrypt.org/).

TrueCrypt

TrueCrypt is sort of an “on the fly encryption” utility. You predefine the folders to encrypt and TrueCrypt will create a new encrypted “virtual hard drive” that can be accessed like a normal drive. All the files on the “virtual HDD” will always be encrypted. TrueCrypt will keep encrypting transparently all files that are changing while I’m work with the computer.

To combine TrueCrypt & Mozy together, all I need to do is pointing Mozy’s backup software to the TrueCrypt “virtual hard drive”, and vwalla – I have a top notch secure backup service.

Few points to consider:

  • The Mozy service costs ~55$/year (for unlimited backup storage) but you can try it for free (with 2GB of free storage). I myself believe it’s worth spending the 55$.
  • Backup with Mozy can take long time (considering the slow upstream connections we have in Israel), but since Mozy is working when the computer is idle I don’t really care.
  • I’m aware that are some much more sophisticated backup solutions out there but I was trying to focus on services that are more suitable for home users.
  • Please consider, I’ve been using Mozy for only one day and still haven’t tried the combination with TrueCrypt, so before you trust all your precious data with these too, I can only suggest you test it for few days.

Alon