Bookmarklet for the Wayback Machine

17 April 2018

I use the following bookmarklet to quickly open up the current page in the Wayback Machine. Which is super convenient whenever I come across a broken link.

Wayback Machine current page

Simply bookmark the above link, and then click the bookmark on any page to open that same page in the Wayback Machine.

I used to use Vimperator, and had a shortcut in Vimperator that did the same thing. Since Vimperator isn’t compatible with Firefox 57+, I’ve stopped using it, and started using Saka Key instead. Saka Key however isn’t as flexible, and I haven’t figured out a way to do the same thing in Saka Key.

Today however, I was reminded of bookmarklets, something I hadn’t used for a long time. The last bookmarklet I remember having used is the Katamari hack bookmarklet, which apparently now has its own website.

Now all I need is to figure out how to make some kind of shortcut that opens the current page with mpv (to use its youtube-dl hook.)

A horrifying fibonacci hack

24 October 2015

It is very simple to implement programs that recursively calculate fib(n), that is the nth fibonacci number, pretty much identically to the mathematical definition of fib(n). But the problem with such programs is that they’re very slow (without DP, anyways.) O(fib(n)) slow to be specific. I realized that there would always be exactly fib(n) calls to the fib function, and this got me thinking of writing a program to calculate fib(n) by having a global counter, and then simply incrementing that counter each time fib is called.

I implemented this in C as such

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdlib.h>
#include <stdio.h>

int fib_real(int n)
{
        if (n <= 2) {
                return 1;
        } else {
                return fib_real(n-1) + fib_real(n-2);
        }
}

int count = 1;
void fib_hack(int n)
{
        if (n <= 2) {
                return;
        } else {
                count++;
                fib_hack(n-1);
                fib_hack(n-2);
        }
}

int main(int argc, char *argv[])
{
        printf("Fib real: %d\n", fib_real(atoi(argv[1])));

        fib_hack(atoi(argv[1]));
        printf("Fib hack: %d\n", count);

        return 0;
}

This program also contains the standard recursive definition of fib(n), and then shows the result of both. Of course the thing to note is that the “real” function as implemented here is just as slow as the hack.

I wonder if spammers don't use IPv6

19 August 2015

I first started using this beautiful jekyll site at the same time I got my hands on the c4k3.net domain, having previously used c4k3.org. On the new site, I decided to put my email in the footer completely unobfuscated, because I’m pretty sure it’s already on just about every spamlist out there, and I’ve gotten pretty good at ignoring spam.

One slight thing I did differently however, was to put my new @c4k3.net address instead of the old @c4k3.org. They both end up in the same inbox, but I’m slowly trying to move things over to using c4k3.net. Reading some of the more hilarious spam I’ve received, I realized I hadn’t noticed any spam sent to my @c4k3.net address, it’s all addressed to my @c4k3.org address. My @c4k3.net address has been listed unobfuscated on this google-indexed site for almost 3 months now, and apparently not a single spammer has gotten ahold of it.

Now I’m no expert on spammers, it could be that their crawlers really are that infrequent, but one explanation I like better is that having your site be IPv6-only is at the moment the number 1 defense against spam out there. To test this hypothesis, I’m going to temporarily enable IPv4 on the site, put an email in this post, and see how much (if any) spam ends up at that email.

idonthaveipv6@c4k3.org

Will post back with results.