tech drops

RSS

Posts tagged with "tech"

Quick tip: Empty a file’s contents with the Terminal

> filename

In other words: dump whatever is in front of the “>” sign (nothing) into the specified file.
Comes in handy for flushing files, while keeping permissions.
For a while I was doing rm+touch+chmod, until I found out about this.

Error #1062 - A (somewhat) curious MySQL situation

When I was importing a bunch of records from CSVs into a MySQL database, at some point I ran into an intriguing issue. Totally legit, but still strange in the way it shows up:

#1062 - Duplicate entry '127' for key 'PRIMARY'

How can the AUTO_INCREMENT’ed primary key be duplicated?
My table is pretty straightforward: some varchars, some ints, a couple of dates.

The important detail here is the primary key, the typical id that is generally the first field. Turns out, for some reason I set it as tinyint(4) when I created the table, thinking it would be enough, being the table not supposed to be big. As this table shows, the maximum value for signed tinyint is 127, just like the error message reported. When MySQL tries to increase that value, the field is capped to 127 and it reports the duplication issue.

The solution is to simply set it a bigger cap value. A int will work fine for now.

Avería – The Average Font

In the end, I decided to release the font using the SIL Open Font License – which means anyone can use it pretty much however they like – and to include within the family Regular, Bold and Light variants with Italics.

I personally find it to be very good for movie subtitles (and so I set it up in VLC).

(Source: bigweek.co)

Jun 4

What a strange way to show off a new, future product…

I can see innovation in thought here, but once again Microsoft is doing it wrong… running “normal” Windows environment alongside this touch interface is like running virtual machines, or using – for that matter – the now deprecated Front Row to consume your own media. Awkward and unproductive.

(Source: youtube.com)

Ode to Time Machine™

Sometimes, people happen to overlook some of the greatest and most useful tools that they have in our hands. I believe that one of these is Apple’s Time Machine™, and its ability to not only backup files and search through them, but to restore a whole system. If this doesn’t click to you, listen to my story:

Read More

Setting up a NAS as a Time Capsule

To whom it may concern, if you want to set up your LaCie NAS as a Time Capsule, or any Network-Attached Storage that supports such technology, here are some tips from my personal experience. They will be valid for any network storage, just think of them as best practices, not as procedures to follow.

  1. Set up a dedicated “share” (sharepoint) for backup. You can call it whatever you like. Be sure that you enable AFP and Time Machine™ protocols for it, so that it’s gonna be enabled to work with Time Machine. If you don’t select both protocols, you’ll get a “OSStatus error 2”. You can disable all other protocols if you don’t want to see the backup sharepoint in Finder or when connecting by FTP, if you do so.
  2. Set up a dedicated “user” for the backup sharepoint. Give it an unique name and password. When adding the drive to Time Machine™, it will require to login with this “backup user”.
  3. Configure that only the backup user has access (read/write) to the dedicated share point. No other user should need access this share point. This improves security in accessing your backup data. I guess it’s encrypted by OS X anyway, but with this you can block anyone with another account to access it.

These are the real basics. Extra tips:

  • Exclude Time Machine™ amongst the default protocols for any other sharepoint on the NAS. This will prevent possible misuse of other sharepoints by other users.
  • Do the first backup while connected to the wired network, it’s likely that it’s gonna be a lot of stuff to be copied over the network.

If this could mean anything to you, I’m configuring Time Machine™ on a MacBook Pro with Mac OS X Snow Leopard 10.6.7 with a «LaCie 2big Network 2» storage over a wired gigabit and wireless connection too.



[UPDATE]: If you, like me, have a LaCie 2big Network 2 and use OS X Lion, make sure it gets the updated firmware, version 2.0.5. To install it, activate the auto-update feature if the NAS is connected to the internet, or just download the file and use LaCie Network Assistant. You can find everything on its download page on LaCie website.
This version fixes the updated AFP compatibility.

A vision: the “Digital Hub”.

From the YouTube video description:

On January 9, 2001, Steve Jobs gave one of his greatest Macworld keynote presentations. The main topics included the original version of Mac OS X, the original SuperDrive and the original widescreen PowerBook G4.

But perhaps the most profound was the introduction of the “Digital Hub” concept in which the Mac would evolve into becoming the center of the digital lifestyle of the 21st century. It has been the subject of much discussion by Steve and his substitutes when talking about the Mac ever since. This definitely the beginning of something huge.

Sometimes we forget how much innovation and concepts are brought along by Apple. It’s also interesting to see how other companies are bluntly copying these visions. Of course, in a sad and unstylish way…

PS. it’s funny to see how in those days Steve used Marker Felt for keynotes.

(Source: youtube.com)

Portal 2 level design & The Impossible Space

ALERT – This post contains spoilers to the game. So, don’t read if you don’t care about the awesomeness of this feature. I’m serious. It’s awesome.

Read More

lawsuit against in-app purchases?

It’s funny, I realized today that two months ago I have written a post about the topic that in these days is being covered everywhere in the tech blogs: Lodsys threat of lawsuit against indie iOS developers.

Basically, the idea of distributing an app for free, which has the possibility to sell a premium paid version of itself from within itself (the in-app purchase mechanism) is a patented technology. It’s getting clear to me why Lodsys aimed at such developers and not Apple: it’s because they used the in-app purchase for this specific marketing scheme. Who uses in-app purchase to sell, let’s say, virtual currency or extra content, should be okay, as far as I understand it.

The problem is: there are loads of apps that are free and sell the premium version, not in the form of a separate paid app, but through the in-app purchase system. Some of them are small, some of them are big. It’s quite odd to see that only two developers were threatened.

As an European, I can’t help but facepalm in front of the situation of software patenting in the US.

Ubuntu 11.04 installed on a SD card on a eeepc

My dad used to have a Asus eee PC, the 4G model with only 4 gigabytes of internal memory. Quite little for a decent usage. It had Ubuntu 10.4, and it struggled everytime it needed a apt-get upgrade. Since he wants to lend it to a friend, I wanted to update it to 11.04. In doing so, I had to install the OS on a 8GB SD card.

During the install process, it was enough to create a ext4 partition on the SD card and set it as the / (root) mount point, while using the internal memory for swap (one partition) and for the /boot mount point (in another dedicated partition). I’m not sure if this was necessary. Anyway, important is to install the boot loader on the internal memory and not on the SD card: otherwise you’d have to press esc every time you boot you netbook and choose to boot from the card. The BIOS doesn’t support auto-boot from the SD card from the boot order list. With the configuration explained above, it will boot the internal memory, but the system knows where all the systems file are, on the SD card.

Ubuntu is pretty sleek, but Canonical never thought of tiny screens… I’m sure my dad’s friend will never remember the Alt+drag trick to see windows that are designed bigger than the 7” screen of the eeepc.