Live data from Hacker News

Ask HN: Small scripts, hacks and automations you're proud of?

news.ycombinator.com

191–200 of 340 posts

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#191

Recently developed a small embedded device (using a nRF52840 microcontroller) that allows me to open my front gate remotely using my phone. I no longer have to carry around a gate remote. And my friends/guests can now open the gate from their phone as well. I couldn't find anything on the market for doing that so I'm glad I managed to do it (and it was a good opportunity to learn some embbedded programming and electr…

Neat! How did you reverse engineer the signal that your microcontroller had to send to the gate?

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#192
in 1995, I thought that it would be good if advertisements could be served from hubs to large numbers of web sites. That would mean that advertisers wouldn't have to hire ad space salespeople, which was far too expensive for most sites. But then there was the problem of how to decide which ads to show to which visitors to those sites. To do that, it seemed like it would be a good idea to base that decision on the sites people tend to visit, which seemed like it would maximize the probability that they'd actually be interested in the ads.

I looked for a way to do that. Browser cookies seemed like a possibility, until I learned that one site couldn't read another site's cookies. When I asked people if there was any workaround I was told that there wasn't. But then I figured out how to use them to track people anyway. That hack is my answer to the OP.

I filed a patent in 1995 that showed how to do it. The patent tied that technique to my specific mathematical technique for selecting the ads the user would most likely be interested in, so it could not be used to restrict other people from using cookies that way as long as they didn't also use my specific math. The patent also contained a lot of features about how to give users complete control over their information and that protected their privacy. (That part didn't get implemented much!)

I eventually sold the patent to DoubleClick, and DoubleClick was eventually sold to Google for an amount I recall to be in excess of $1 billion. By then I'd seen a marketing site recommend that Google buy DoubleClick, with my patent listed as one of the reasons they should. DoubleClick had their own patent describing the tracking cookie, but their priority date was a couple months later than mine. And it didn't have the privacy features mine did, or the same degree of tech about how to actually select ads.

In defending against a patent troll in 2021, Google and Twitter together filed a joint brief calling the tracking cookie "Robinson's Cookie". My name is Gary Robinson. (In case anyone is curious there's more info at https://www.garyrobinson.net/2021/07/did-i-invent-browser-co....)

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#193
I was teaching online, and it involved a significant amount of grading on the LMS (Learning Management System.) It was a pain to click on the grade entry field for each student, then click "Next". I wrote a browser extension to autoselect the proper input field, and then on Enter it would both submit the grade and load the next assignment. Saved me hours and hours while grading.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#194
Not technically difficult, but I remember that it made me feel very proud: Back in high school (2004-ish) I made a small PHP script to generate a .m3u of my whole MP3 collection and I exposed this from my home PC. Since I could install Winamp on the school PCs this allowed me to stream my music collection.

Another one was a password rotation script for my university. There was an idiotic password policy that required you to change your password every 6 months via a web form, and if you tried to change it to a password you had used before you would get an error saying that the new password couldn't match the last 24 passwords you had used. This information was very useful as it allowed me to write a script that simply changed my password 24 times and then changed it back to the one I wanted.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#196
I use the following tiny script to make PDFs look like they have been scanned. There are still entities that require you to physically sign a document and scan it. So far, everyone accepted PDFs like these:

  #!/bin/sh
  ROTATION=$(shuf -n 1 -e '-' '')$(shuf -n 1 -e $(seq 0.05 .5))
  convert -density 150 $1 \
    -linear-stretch '1.5%x2%' \
    -rotate ${ROTATION} \
    -attenuate '0.01' \
    +noise  Multiplicative \
    -colorspace 'gray' $2

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#198
post #19

I write a ton of CSS and could not find a command line stylesheet checker. I did find the NuHTML checker from W3C, which also checks the file’s CSS: https://github.com/validator/validator/releases/tag/20.6.30 AFAIK it doesn’t have an option to check a standalone CSS file. I wrote a script to insert a CSS file into a dummy one-line HTML file, so that I can pass a CSS file to the script, and when errors are generated f…

* scripts not Scripps. Thanks, Siri.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#199

There is a specific small hotel that will remain unnamed, which my partner wanted to book for a long long time. At any given moment if you check the reservations page, it is most likely booked for two years solid. It is famous enough that people book it all the time, but it has lenient cancellation policy of 100% refund if cancelled before 2 weeks. This is not really a problem for them as these vacancies get booked i…

I've done this to get consulate appointments for visas as well. Was able to reduce from a 30-day wait to ~5 days.

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#200

in 1995, I thought that it would be good if advertisements could be served from hubs to large numbers of web sites. That would mean that advertisers wouldn't have to hire ad space salespeople, which was far too expensive for most sites. But then there was the problem of how to decide which ads to show to which visitors to those sites. To do that, it seemed like it would be a good idea to base that decision on the sit…

Wow. Or, is this a wind up?
Post reply on HN