Apr10

Tried to give some looove to this blog, found problem with Disqus

Tagged with: .
Comments

I’ve been quite inactive blogging because of work commitments. To try to spice up the blog a bit, I installed the Disqus plug-in. The concept of centralizing comments into an specialized service is great. Unfortunately it is eating some of the older comments, so I had to put it on hold.

The image below shows the Wordpress dashboard with 115 comments
Comments on the Wordpress Dashboard

And this one shows the Disqus dashboard with only 87.
Less comments on the Disqus dashboard

It looks like other people have the same issue.

Do you know how to fix it? If so, please drop me a comment.

Jan27

How to fix an upsized Apple TV stuck in 1.0 software

Tagged with: ,,,.
Comments

Some months ago, I swapped some hard drives, and ended up upgrading my Apple TV’s 40GB hard drive. The process was the standard procedure you can find in many sites: back-up the drive, create the correct partition map on the new drive and restore the data into the new drive.

When I upgraded the hard drive, the software version was already 2.x. However, the Apple TV restore partition was still the original 1.0. Here is where the problem started. Whenever new software upgrades were downloaded, they just failed. I’m not sure the upgrades check the hard disk size. Most likely, when restoring into the larger hard drive, some permissions got messed up. A “factory restore” takes the Apple TV back to 1.0 (no YouTube, no Apple Store menus) but once again the upgrades fail.

The process I document here doesn’t require to re-open the Apple TV case. You could go that route, of course, but I think it may even take longer.

You will need:

  • External USB drive that can be completely wiped (512MB or more)
  • A copy of ATV USB Creator
  • A DMG from Apple with the latest firmware. At the time of writing 2Z694-5573-24.dmg. I believe ATV USB Creator tries to download it automatically. However, we’ll need the file for the extra step described here, so you’d be better off by getting the DMG yourself.

(more…)

Dec18

Dynamic DNS woes

Closed

My home network has the typical configuration NAT behind a hardware firewall with a dynamic IP address provided by the ISP. I use DynDNS to have a fixed name that I can use anywhere on the internet to access the home network.

The Linksys WRT54G I use supports DynDNS updates, however, from some weeks ago, I started having issues with the updates. A cryptic error -1 wasn’t of much help.

To avoid the hassle of debugging what’s going on, I decided to give the responsibility of the updates to a Linux box inside my home network, instead of the router.

The software I used is ddclient, which is in the list of recommended clients for DynDNS. From version 3.7.0 ddclient supports SSL, so the password isn’t traveling in cleartext.

Installing ddclient in Gentoo Linux is a breeze: emerge -a ddclient

The configuration file /etc/ddclient/ddclient.conf is quite straightforward and the sample file installed should get you going right away. Mine now looks as follows.

daemon=300                              # check every 300 seconds
syslog=yes                              # log update msgs to syslog
#
## To obtain an IP address from Web status page (using the proxy if defined)
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
login=yourlogin
password=yourpassword
protocol=dyndns2                                # default protocol
server=members.dyndns.com
ssl=yes
#mx=mx.for.your.host                            # default MX
#backupmx=yes|no                                # host is primary MX?
wildcard=yes

your.domain.net

To get there, I had to jump through some hoops, which I hope this post avoids you:
1. Do not use members.dyndns.org as the documentation states. Use .com
2. The ssl option doesn’t seem to work and it is not because IO::Socket::SSL is not installed, as hinted in the DynDNS FAQ and the ddclient FAQ — well, you DO need it installed but I’ve read the fine manual already and that was not my problem for sure.

I discover #1 after starting the ddclient daemon as usually in Gentoo /etc/init.d/ddclient start and discovering syslog errors like

Dec 17 03:24:50 host ddclient[9348]: WARNING:  cannot connect to members.dyndns.org:8245 socket: IO::Socket::SSL: connect: Connection timed out IO::Socket::INET configuration failederror:00000000:lib(0):func(0):reason(0)
Dec 17 03:24:50 host ddclient[9348]: FAILED:   your.domain.net: Could not connect to members.dyndns.org:8245.

It may be that I’m in China and dyndns.org is blocked from there. I don’t know. But you can check easily on any web browser. Browse to http://checkip.dyndns.com/ and you should get Current IP Address: 111.222.333.444. For me dyndns.com works.

Next it was the ssl issue. Fortunately, debugging ddclient is very easy. Stop the daemon /etc/init.d/ddclient stop and then run ddclient -daemon=0 -noquiet -debug from a terminal. Doing that I was able to see that even with the ssl=yes in the config file, the request was done using http. On the output of the command I was able to see

DEBUG:     nic_dyndns2_update -------------------
DEBUG:    proxy  =
DEBUG:    url    = http://members.dyndns.org/nic/update?system=dyndns&hostname=your.domain.net&myip=111.222.333.444&wildcard=ON
DEBUG:    server = members.dyndns.org

I changed the file /etc/init.d/ddclient — I know it is not recommended because any update to ddclient will overwrite the change. However, these days I’m always rushed and therefore less of a purist :)

The change was adding the -ssl switch in front of --exec /usr/sbin/ddclient to the start function, as seen below

start() {
        checkconfig || return 1
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon \
                --start \
                --chuid ddclient \
                --exec /usr/sbin/ddclient -ssl \
                --name ddclient \
                --pidfile "${PIDFILE}" \
                -- -pid="${PIDFILE}"
        eend $?
}

I’d love to hear comments on a better way to get this problem fixed.

Dec3

ActiveScaffold summary fields

Closed

In one project I am the “gatekeeper” of a list of potential initiatives that the organization would like to explore as sources of revenue.

These initiatives are cross-regional in Asia, and best practice would call for the subject matter experts on each country to “own” and maintain the initiatives.

Thanks to the beauty of Rails, ActiveScaffold and other wealth of plug-ins available for Rails, in just 2 or 3 days of coding I was able to get the basics of a web application to handle this. Much better than a shared Excel Spreadsheet.

By the way, I tried using Sharepoint to maintain this list, and was underwhelmed. Anyway, recently added a summary field on the initiatives I track, to be able to show total (forecast) revenue and sales.  Followed the documentation on the ActiveScaffold website, and started receiving an error:

Showing vendor/plugins/active_scaffold/frontends/default/views/
_list_calculations.rhtml where line #12 raised:

undefined local variable or method `_erbout' for #<actionview ::Base:0xb518c850>

Extracted source (around line #12):

9:         override_formatter = "render_#{column.name}_#{column.calculate}"
10:         calculation = self.method(override_formatter).call(calculation) if respond_to? override_formatter
11:
12:         _erbout.concat calculation.to_s
13:         -%>
14:       < % else -%>
15:         &nbsp;

Trace of template inclusion: vendor/plugins/active_scaffold/frontends/
default/views/_list.rhtml, vendor/plugins/active_scaffold/frontends/
default/views/list.rhtml

The variable _erbout is the default output variable from an Erb object (see http://noobkit.com/show/ruby/ruby/standard-library/erb/new.html)

My proposed fix (I’ll send a patch to the ActiveScaffold devs) is to remove the _erbout reference and replace by

  < % if column.calculation? -%>
    < %
      calculation = column_calculation(column)

      override_formatter = "render_#{column.name}_#{column.calculate}"
      calculation = self.method(override_formatter).call(calculation) if respond_to? override_formatter
    -%>
    < %= calculation.to_s -%>
  < % else -%>
    &nbsp;
  < % end -%></actionview>

Aug1

Connecting Mac OS X to the net through a Treo 680 GPRS

Closed

This is more a note to self than anything else, as there are many posts already on the internet about this.

Recently I’ve needed to get mail on the road, and my employer’s policy forbids to connect a non-standard device to their network. So, a GPRS connection through the phone is an OK alternative. Nothing as the 3G connection I used to have in the United Sates, but it is OK. My provider is China Telecom, but the instructions here work for any other provider.

  1. Pair the Treo and the Mac, if you haven’t already do so. The Bluetooth Setup Assistant should do everything required. Just follow the steps. Choose “Mobile Phone” as the type of device

  2. Check the services on the newly added device. When selected on the Bluetooth panel, the Dial-up networking service must be present

  3. Go back to see all the control panel modules, choose Network, and now you should have a Bluetooth connection (if it wasn’t already present). Add a new configuration for your service provider – handy if you travel a lot

  4. Now fill in the required login information. For China Telecom, account and password are guest, check this page if you don’t know the correct info for your phone provider. Bear in mind that data rates are expensive if you don’t have the appropriate plans.

  5. Click on Advanced. In my case, the Treo worked fine with the Generic script as shown below. If not, find out what works for your phone. For instance, for a RAZR V3xx I used in the US, Ross Barkman’s scripts worked well, as mentioned in a post some time ago.

  6. Finally test, try to connect.

Hope this post helps someone else. If you have other suggestions, please leave me a comment.

Oct27

Two neat small things in Leopard

Tagged with: .
Comments

Yesterday I upgraded my Macs to Leopard.  The main reasons for the upgrade were XCode 3.0, Time Machine and BootCamp.  I had been using the latter very robustly on my machines.  I read rumors a while ago about the BootCamp beta program ending for previous OS versions once Leopard was released, and I haven’t had the time to double-check.

Two features that have not received as much publicity but were very pleasant surprises (I know, I never Read The Fine Manual) were the inclusion of the A2DP profile in the Bluetooth stack, and TextEdit’s ability to read OpenOffice .odt files.

Nice touch.  As usual with Apple, new functionality is rolled out in a seamless, intuitive and non-intrusive way.

A2DP in Leopard

Aug9

Recover lost pictures from a memory card on Mac OS X

Tagged with: .
Closed

Lifehacker posts this article about recovering lost pictures on memory cards. Mac OS X owners may want to try these two commands before purchasing additional software: dd and fsck. Linux users most likely already know what to do :) — if not, the instructions below are 98% the same…

  • Find the device id: Connect your camera using the USB cable, or mount the card in a reader. Then you can type on the console the command mount, to see the mounted volumes. Look at the output for a line that contains /Volumes/name_of_your_card. On the same line, you will see a device identifier, something like /dev/s1d0. Take note of it, exactly. Then eject the card (you can drag it to the trash)
  • Backup your card: The command makes a low level block copy of your card. Type
    sudo dd if=/dev/the_id_you_wrote_down of=~/backup.hex
    You’ll need to enter your password to run this command under sudo. It will create a file on your home directory with the card contents, so if you have a 1GB card, you’ll have a 1GB file, even if the card has no contents
  • Attempt recovery: The proper step here is to attempt recovery on the image. It’s a bit more involved, as Mac OS usually doesn’t allow to mount a file as a loopback as Linux does. I’ve had success using the dangerous route of working directly on the card:
    sudo fsck_msdos -p -f /dev/the_id_you_wrote_down
    The problem with this is, it will modify your memory card contents, so further attempts to use recovery tools are more likely to fail.

Jun3

Wireless access on my Macbook Pro

Tagged with: .
Comments

This weekend I set up a backup wireless connection using my Bluetooth cell phone (Motorola RAZR v3xx). Pretty painless, thanks to Ross Barkman’s scripts, and Ed Thomson’s post.

More or less standard modem configuration. I had almost forgotten about such old good times when you had to deal with modem connection strings and those type of things.

Anyway, the process was:

  1. Downloaded the Motorola GPRS modem scripts from Ross Barkman’s page into /Library/Modem Scripts
  2. If you are trying to follow these instructions, but have not paired the phone already, you can do it now and the Bluetooth Setup Assistant will guide you through the steps. If you had already paired the phone, then from the Bluetooth menu item, you can choose “Open Bluetooth Preferences” to open the Bluetooth Setup Assistant. Here I was able to configure the phone.
  3. The specific settings I used:
    • Account Name: ISP.CINGULAR, which should allow me to use the GPRS 128k/sec service, or ISPDA@CINGULARGPRS.COM
    • Password: CINGULAR1
    • Modem type: Motorola GPRS CID1 (will only appear with Ross’ scripts

My speed test was OK: 690-860 kbps downstream, and 220 kbps upstream with delays of up to 220 ms. Not a T3, but quite acceptable for occasions where I have no other net access

I’ve had a couple of issues using ISP.CINGULAR, where after 3 or 4 times of connecting fine, it stopped connecting. Last 2-3 times I’ve used ISPDA@CINGULARGPRS.COM it seems to work better, and with the speed described above

With both of the address, there is something causing the first connection attempt to fail. Perhaps I’ll look into it later – my current workaround is not that bad, just reconnecting after it fails once.

May22

Webcam tips

Tagged with: .
Closed

The guys at Strobist posted today a series of tips on how to get the most out of your webcam. Very interesting. One thing that still is puzzling me is why after I installed Windows XP on our 17 inch iMac with BootCamp 1.2, the quality of the webcam image on Windows is better than what I’m getting on MacOS!! Really strange.

The Windows drivers that come with BootCamp make a USB emulation of the built in iSight, and perhaps there is either some color correction done during the emulation, or what would be most ironic, that the color correction algorithms on MacOS are actually trying too hard to compensate and end up making the image worse.

That iMac’s setting is problematic for video conferencing because the iMac is in the opposite side to a window, and facing the wall. The back light coming through the window creates a dark webcam pic. If anyone has solved this problem, I’d love to know.

Mar17

Home automation with Gentoo Linux and Heyu

Tagged with: .
Comments

Heyu is an excellent package for managing the X-10 CM11A serial interface (and some others, as well). I use it at home for automatically turning on and off lights. My home servers run Gentoo Linux, which gives a great amount of control over what packages are installed on your system and how these packages are compiled.

Unfortunately, heyu is not in the official Portage (Gentoo’s package manager) tree. So, here is an ebuild that can be placed in an overlay. It is a tar file, compressed with bz2. Download it to your machine and type tar xvjf heyu.tar.bz2

(more…)