Computing related posts

Weird 302 redirect at GoDaddy

godaddy

It took me some time to realise what was going on, but I finally found out a weird bug (or feature?) on my GoDaddy web hosting this afternoon. Which made me switch to Namecheap later on.

This is what happens, totally randomly when a client is accessing a file. Let’s say you try to access the following URL: mysite.com/blog. These are the consecutive HTTP requests that will occur:

  1. GET mysite.com/blog
    302 redirect mysite.com/AbCdE/blog
  2. GET mysite.com/AbCdE/blog
    302 redirect mysite.com/blog
  3. GET mysite.com/blog
    200 OK

Where AbCdE is always a random string made of 5 characters. That’s right, randomly, requests happen to be redirected twice through a random directory that doesn’t exist before the server finally delivers the resource. What’s the matter, you will say? Well, this has absolutely no reason to happen, and even if a visitor wouldn’t notice it by loading the URL in his browser, this can have an impact in other fields.

First, Google tends to index the temporary URLs that doesn’t exist, and this leads to undesired pages to be indexed. Secondly, as this is an unexpected behaviour, this can fuck your scripts in some situations. It especially happened to me, when apps that are connected to my website couldn’t manage redirections that don’t output more than 255 characters for example. Because of this unwanted random 302 redirect, I couldn’t guarantee the availability of my app anymore.

I am sorry, but I am not responsible, as a developer, for this, and I don’t have to adjust my code to my web hosting in this situation. It seems to be a recurring problem at GoDaddy’s, you can check it out on Google, many people are talking about it, and GoDaddy doesn’t seem to be fixing the issue…

But I really wonder where this bug (or feature) comes from. I bet maybe for a feature, where by differing the actual delivery of the resource, it’s freeing some load on the server when too many connections are coming in at the same time.

Anyways, I am now hosting my site on Namecheap.

Like it? Share it!

What a 15 euros phone has that an iPhone doesn’t

Since I needed a Filipino number in addition to my French number, I ended up buying the cheapest phone I could find here. It’s a Samsung GT-E1080F that costed me around 15 euros in a Samsung store. I kept my iPhone for my French number and so I am using both of them. I intend to use my Filipino phone only for calls and text messaging, but I surprisingly found out 4 cool native features that my iPhone is missing. Two of them are unforgivable though and should really be implemented in the iPhone, the other one is just funny :-)

Auto-reject calls

Very handy when you don’t want to hear about some people. Enter her number to the block list, and all the calls from that number will be automatically rejected. I remember a friend of mine needed that feature last year, and we could never find something that works on his iPhone, neither in the native features nor in installable apps (even from the Cydia store).

Text messages: Block number

This is the same feature as the previous one, but for text messages. Again, you can edit a block list of numbers that you don’t want to receive SMSs from.

Fake call

That feature is funny. Actually, I haven’t checked if there is an app for it, there is probably one on the Cydia store. Well, this is a native feature on my Samsung phone. While in an annoying meeting that you want to escape, put your hand in your pocket and press four times the DOWN key of your phone. Then, after a variable amount of seconds (that you can change in the settings of the phone) a fake call from an unknown callee will make your phone to ring.

Privacy lock

This is quite redundant with the passcode lock of the iPhone, but still useful. Instead of locking the whole device with a passcode, the Samsung GT-E1080F will instead add locks to the key applications you wish, such as the calls logs, the address book or the SMS. So someone can still use your phone, like playing games or using the calculator, and the privacy of your SMS is still good. I think that could be a good feature for iPhone, as it often happens that I give my iPhone to friends who want to play, but not necessarily feel comfortable that they read my texts or calls logs.

There it is, I find the comparison between that little Samsung phone and a 50-times-more-expensive iPhone funny, regarding this foor little features. If you have a solution/workaround for the foor of them on iPhone, thanks to comment on that post, I am personally interested in knowing them!

Like it? Share it!

Nomad Internet with Huawei e5

I am writing this post from a coffee shop in Quezon City (Manila, Philippines) from my 3G connection that gives me a fair 1.5Mbps up/down for a bit less than 1 euro per day. (just for you to know the context)

Long before moving to Manila (Philippines) I have had wanted to get my hands on the Huawei e5 for its capability to turn a 3G connection into a wifi hotspot. I had tried to find it in Europe (France, UK, Romania…) and in the USA (Los Angeles, New York City), but now way to find any. Actually, that device seems to be available only in Asia (or online, but as I was going to the Philippines soon, I could wait).

Basically, what the Huawei e5 does, is to turn your 3G connection into a WIFI hotspot where you can connect up to 5 devices. There is also a USB port that allows you to connect another computer like any USB modem. So you can in the end connect up to 6 devices. read more… »

Like it? Share it!

Steve Jobs is gone

Steve Jobs has passed away last night, 5th of October 2011. He was a great innovator, inspiration for all the IT people and entrepreneurs and we will regret him a lot.

My breakfast was bitter this morning when I read the news, but later on I found myself energised back and got some big motivation. Eclipse/Photoshop are open and working hard this afternoon. I remember Steve, and how hard work, creativity, innovation and courage led him to build this empire. Yes, even if you’re gone, you will still be a model of entrepreneurship and innovation to me and my fellows. You can rest in peace now, Steve.

Note 1: homage to Steve Jobs is on Apple’s website
Note 2: you can send condolences to rememberingsteve@apple.com

Steve Jobs, 1955-2011

Like it? Share it!

Downgrade Mac OSX Lion with Time Machine

Snow Leopard

Last days, I told you about my disappointment when I rushed at installing Mac OSX Lion only a few hours after it was released. Quickly, I decided to downgrade back to Snow Leopard. Hopefully, Time Machine is a very good piece of software that works pretty well for restoring your OS to the exact state of the desired date. Here is how to do it.

  1. Check that yo have saved/backuped all of your work and data you carried out since you installed Lion (USB sticks, DVDs, whatever)
  2. Insert your DVD of Snow Leopard and shut down your mac
  3. When starting your mac again, press the OPTION key and wait until it offers a list of volumes to boot from. Select the Snow Leopard DVD
  4. In the Installer, don’t go on the process of installation. Instead, click on the Utilities menu, then choose Restore System from Backup
  5. Check that you are connected to your time capsule:
    - for networked time capsules, I recommend to link an ethernet wire instead of using wifi, it will be quicker. If you really can’t use a wire, then connect to your wifi access point via the Airport Utilities menu at the top left of the screen
    - for USB time capsules (or external HDD), you don’t have to do anything special
  6. In the list, select your Time Machine volume
  7. In the list, select the date at which you want to restore your system to. Dates and versions of the system are indicated, so just take the most recent backup you’ve made on Snow Leopard before you installed Lion

Now you’re good for waiting several hours, depending on the size of your backup and the speed of your connection. You have the time to go and make a coffee. Wait and relax, and forget about how Steve raped you with 24 euros.

Some hours later, your mac will reboot and your system is back like before. Lion is just now an old bad memory to you, until the day you have no choice but to upgrade because major softwares will not be supported on Snow Leopard anymore.

 

NB: if you don’t use Time Machine, I guess you’re going to have much more troubles while downgrading from Lion (if not possible at all?). Probabilities are that you’re to make a new clean install of Snow Leopard. And that you start to use Time Machine, at last (sorry dudes).

Like it? Share it!

Seriously, is OSX Lion a joke?

Seriously, OSX Lion is a joke, isinit?

I’m a huge fan of Apple products, and especially their OS for Mac, to me there is no better OS for my personal and professional usage. Mac OS X 10.7 (Lion) was released just this afternoon, 20th of July 2011, and in the next hour I already bought and downloaded the new fresh OS. Upgrade from my Mac OS X 10.6 (Snow Leopard) went well, I haven’t lost any of my data, and all of my applications are compatible with the new OS.

At first, I was especially excited about the security improvements, such as Filevault 2, Versions, and the ability to crypt Time Machine too. But now, I’m already very disappointed by Lion, on many points. I’ve been playing with Lion just for an evening, so the list of my disappointments might not be so exhaustive at the time I’m writing these lines, but here they are. read more… »

Like it? Share it!

Forex for beginners

Today, I’m taking the time to talk about my new project, Forexagone.com. It’s a website (in french only so far) whose aim is to teach Forex to very beginners, in a way it has not been done before. We really make Forex easy to learn for beginners, who can really start from the very beginning and end by reaching a good level in Forex trading. Our core business is divided into 3 main sectors.

Forex read more… »

Like it? Share it!

Change Chrome search default language

The last day, I was given a brand new MacBook Pro at my new job. First thing to do: open Safari … in order to download Chrome! But I don’t know why (some traces of French settings?), the default search engine for Chrome was google.fr (french language), and not google.com (english language). Impossible to change it in the list of search engines, and there was this google:baseurl setting (set to google.fr) that I couldn’t overwrite. No way until I found the solution below.

Stop Chrome.

Open the following file (on Mac OS X, files is located elsewhere for Linux and Windows users):

vim ~/Library/Application\ Support/Google/Chrome/Local\ State

And look for the three following lines:

"StartupDNSPrefetchList": [ 1, "http://www.google.fr/" ]
"last_known_google_url": "http://www.google.fr/"
"last_prompted_google_url": "http://www.google.fr/"

There, change the URL by the one you want (in my case I turned google.fr in google.com).

Restart Chrome.

The default language for google should be english now. At least, it worked for me :)

Like it? Share it!

Minimize windows into application icon

I’ve just discovered this feature in Snow Leopard and it’s changing my life. It allows me to reduce a window into the application icon (in my dock), instead of going to the right of the dock next to the trash bin. I’m really happy of that feature especially because I’m keeping the MAMP window up every time, and I didn’t like to waste space in my dock for that!

To activate this feature, go to System Preferences, then to Dock, and check the box called Minimize windows into application icon. From now on, your windows will reduce and not take more space into the dock.

Screenshot of the dock preferences in Snow Leopard

Like it? Share it!

Rotating your log files with logrotate

If you’re like me and you’re used to log what’s going on your web application, you might want to know how to rotate your log files just like Linux commonly does for its system logs. No need to code anything for that purpose, you can simply use the same software as your system: logrotate.

Attention: I wrote this post based on my personal server which is a Linux Debian 5.0 Lenny and logrotate 3.7.1, but it’s very likely that it works more or less the same way for any Linux server and version of logrotate.

When installing logrotate, it’s likely that it’s already designed to rotate some system logs (syslog, kern.log …), and in the case of a web server, it also rotates Apache or MySQL (access.log, error.log, mysql.log…). Having a quick look at the manual (#man logrotate), you’ll see you can easily tell logrotate to handle your own log files. Simply open /etc/logrotate.conf (or touch a new file in /etc/logrotate.d/ if it exists for your version), and add something like the following:
"/home/mysite/log/visitors.log" "/home/mysite/log/downloads.log" {
rotate 5
mail anon@ymous.com
size 100k
postrotate
/usr/bin/killall -HUP httpd
endscript
nocompress
}

This example section will handle both visitors.log and downloads.log (you can add as many file locations as you wish). The options are:
  • rotate 5: it means it will rotate 5 times before deleting data
  • mail anon@ymous.com: will send an email with the content of the latest log file before deleting it
  • size 100k: maximum size for a log file before rotating it
  • postrotate [...] endscript: enclosed is a piece of script you want to be run after rotating logs
  • nocompress: add this line to prevent logrotate from compressing rotated log files

These are the main options for logrotate, but of course many others can be found, please read the manual for more.

And there you are, your custom log files are being rotated without having to code a custom PHP script :-)

Like it? Share it!