TinyCC – Solid URL shortener

TinyCC – Solid URL shortener


Solid is a small URL shortener service that also serves as a web tag protector.  It's very simple to use, but you have to edit your /etc/hosts file first on Linux or Mac OS X. Once it's set up, all you have to do is visit the site and start registering URLs with Solid. You can share those URLs with anyone on the Internet and they'll be able to access them without even visiting the Solid website first (although if they copy-paste them from a browser window they won't get redirected). The idea behind this approach is that even if someone were going through great lengths to hide their destination websites from Google and such, everyone who has the link would still be able to see where it's pointing to. Also, by default the links are very short and easy to remember.

This is somewhat similar to bit.ly or goo.gl, but Solid has an actual website where your links will redirect people instead of just doing it on-the-fly. It also offers much more advanced features than those two services (and, at least for now, there's no limit on the number of shortened URLs you can create). That said, I don't know about you but I rarely use URL shorteners since they usually break when shared with other people who aren't using the same service as me (or simply because they make the link really long), so it makes sense that someone came up a better solution. The twist being that this is all done locally on your computer.

TinyCC – an ultra minimalist C compiler

A few weeks ago I announced the initial release of TinyCC, a very minimal C compiler written in less than 2000 lines of code. At first it seemed to have no uses other than being yet another way to play with the GCC internals, but I recently found out there's an important use case for it: compiling our own versions of existing libraries which are too complex to compile using only assembly language (for example because they depend on other libraries that are not implemented in assembly). This means that one could create their own "C micro-framework" without needing to write much code or any #ifdefs, by simply re-compiling the libraries they depend on. The first such library I found is SDL, and here's how one can create a TinyCC-based version of it:

Download and extract SDL

$ wget http://www.libsdl.org/release/SDL-1.2.15.tar.gz $ tar -xzvf SDL-1.2.15.tar.gz $ cd SDL-1.2*

Remove unnecessary files from the source tree

$ rm Makefile README *.a *.o *.so COPYING AUTHORS ChangeLog TODO \ build_makefiles/* host_src/* install_docs/* test_tone_ * test_harshal * src/libm/** src/stretchy_ * src/video_ *

Configure the source tree to use TinyCC instead of its default compiler

$ ./configure --host=i386-tinycc --disable-shared --enable-static

Compile the resulting source tree (this may take a while)

$ make -j4 V=1 all install strip

This creates an SDL static library archive in /usr/local/lib that you can then use to statically link your own executables. If you want to share this with other people, you can strip the debugging symbols (the file size will be reduced by about 70%):

$ strip -g /usr/local/lib/*.a /usr/local/lib/*.o \ /usr/local/lib/*.so

If you're wondering how all this works, I encourage you to read the code  and ask questions in the comments, but if you're just looking for a quick solution then feel free to grab the binaries from here . TinyCC has not yet been tested on anything other than Linux x86-64 (although it should be working on other i386-based Linux distributions), so please report any bugs you may find by leaving a comment below or directly by dropping me an email at tristan [at] gentooexperimental [dot] org . You can also visit #gentoo-cc @ Freenode  to discuss the project with its developers and users.

Shared hosting vs. Managed WordPress hosting

As you may know, I've been running my blog on a shared hosting plan since the beginning of last year. As it turns out, though, shared hosting has some hidden costs that are often overlooked by new bloggers (and even old ones who haven't done their research). These costs include:

Bandwidth costs: I haven't seen my bandwidth meter since I moved to this hosting plan, but if we take a look at the shared hosting page for my current provider and add our own blog's statistics to it we can see that we'll most likely run out of bandwidth every month. This means we'd have to pay $9.95 for an additional 25GB of bandwidth to avoid having our sites go offline for a few days. Hosting costs: The hosting cost for this type of plan is usually around 1-2 cents/day, which works out to $7-$14/year (assuming we don't need the bandwidth limit raised). This means that we'd end up paying more than $30/year extra to maintain our blog with this type of hosting.


We are social