HNHacker News
TopNewBestAskShowJobs

mct

233 karma · joined June 16, 2007

http://github.com/mct
submissionscomments
mct··on Show HN: A DOS-like hobby OS written in Rust and x86 assembly
I love that the networking stack uses SLIP and slattach(1)!

I was playing with a toy TCP/IP stack, and decided using SLIP over a pty on Linux was a great way to interface with the kernel. Unfortunately it looks like macOS previously shipped with slattach(1) a very long time ago, but no longer does.

I'm curios if other people have used SLIP on macOS to get a dead-simple, cross-platform API to the networking stack?

The alternative would be to use tun/tap on Linux and utun on macOS, but SLIP would be so much nicer.

mct··on Let's compile like it's 1992 (2014)
Another option is to use the p5.js library. They also have a nice online editor, at https://editor.p5js.org/, which makes it easy for students to get up and running quickly.
mct··on Voyager spacecraft begin to power down
Very interesting telnet site, thank you for sharing!

FYI, though, I think this may be looking at the wrong object ID. It selected "31", which appears to be the entry for one of the Lagrange points. Voyager 1 and 2 appear to have negative ID numbers, "-31" and "-32".

mct··on Internet Mail 2000
I have a domain I've been using for some 20 years as my primary email address. There are some gmail users I can send mail to without any problems at all. For other gmail users, my messages appear to go into a black hole, not even showing up in their spam folder. Looking at my postfix logs, I can see gmail's SMTP servers don't report any problems at delivery time. It's frustrating.
mct··on Zoom court hearing postponed after accused found in same location as witness
Thanks for the link!

Are there any other court feeds you've found interesting?

mct··on Netcat – All you need to know
The post does a poor job explaining it, but the term "gaping security hole" comes from traditional netcat's source code. In order to enable the "-e" (exec) flag, it must be compiled with "-DGAPING_SECURITY_HOLE".
mct··on Python is 1.3x faster by just adjusting some compiling options for libpython
I'm seeing "You must log in to continue," with no "not now" option.
mct··on Look Up Unknown Phone Numbers Using Facebook Reset Password
CallerID information. There are a bunch of lookup services available for it: https://www.voip-info.org/cnam/
mct··on The UNIX Time-Sharing System (1974)
> A “crash” is an unscheduled system reboot or halt. There is about one crash every other day; about two-thirds of them are caused by hardware-related difficulties such as power dips and inexplicable processor interrupts to random locations.

Youch. Was the PDP-11 really so unreliable?

mct··on Netcat.c
The README that Hobbit (author of the original netcat) wrote is a really good read. I learned a lot when I first read it years and years ago. I especially remember it describing how it is possible to get "in front" of another daemon. If the daemon has bound a listening socket to 0.0.0.0, as most do, you can bind to a more specific address on the same port and intercept inbound connections. Fun!

http://sysunconfig.net/unixtips/netcat_readme.html

mct··on Show HN: Manage passwords with GPG
I've been doing the same with vim for years, using this vim script: https://github.com/mct/dotfiles-public/blob/master/.vim/plug...
mct··on Show HN: Calc, a simple command-line calulator in C
I've been using a perl-based calc for a number of years now. It started as a one liner eval-ing expressions on the command line. My favorite feature is that if symlinked as "hex", "oct", or "bin", it prints the output in hexadecimal, octal, or binary. And, because the evaluation is done by perl, hexadecimal, octal, and binary numbers can be entered using "0x", "0", and "0b" prefixes. A minor improvement was the substitution of commas with underscores, which perl allows in numbers for easier readability. Entering "1,000,000" is much nicer on the eyes than carefully counting the number of trailing zeros.

Two weeks ago, after becoming fed up with having to copy and paste results from one line to the next, I wrapped it in a repl and added bc(1)-like support for "." expanding to the last value. Rather embarrassingly, I started to implement bc(1)-style variables, but then realized this was incredibly silly as you can simply use perl variables directly. :-)

https://github.com/mct/junkdrawer/commits/master/bin/calc

I fully support writing other calc implementations, especially in languages such as C! It's a great exercise, and can become very complex very quickly. bc(1) supports arbitrary precision (try: echo "scale=500; 4a(1) 42" | bc -l), which is super awesome. In C, I've only implemented RPN calculators, never infix, which would be fun to try.

mct··on How to Install Ubuntu Linux on your Dell PC
It looks like the new XPS models have a single trackpad soft-button area (as all new laptops seem to). Have you been able to middle click to paste in X with this configuration?

Thanks!

mct··on Get Your Shit Together
Don't die without a will. If you do and you appoint an executor, you are giving them a very dirty job

This is one of the reasons I've been putting off completing a will :-( Is there a good option for going about this without naming an executor?

mct··on Get Your Shit Together
Regarding a living will, one I've seen that I really like is Five Wishes (https://www.agingwithdignity.org/five-wishes.php). I have one filled out that I've been procrastinating giving to friends and doctors, which is a mandatory step for having it be an effective document. Thank you to GYST for reminding me I need to take care of this.
mct··on Using BitTorrent with Amazon S3
(You probably want Arvid's libtorrent, at http://www.libtorrent.org, not the one linked above.)
mct··on Spacemacs – Emacs advanced kit focused on Evil
You're right, "missing" was a poor choice of words. I meant, "vim keybindings for these commands isn't supported".

They are keybindings my fingers reach for everyday without thinking about it, similar to how I use j, k, h, l without thinking about it.

mct··on Spacemacs – Emacs advanced kit focused on Evil
I get my hopes up when I see another vim emulation project, but after using it for just a few minutes, I already found a few missing vim features I use every day:

* Toggling if search results should be highlighted (:set hls, :set nohls)

* Opening the filename under the cursor in a new window (^W f)

Completely emulating an entirely different editor is very, very difficult :-(

I applaud everyone contributing to these projects, and hope they continue to improve! They've already come a very long way from evil, and viper-mode.

mct··on How doctors choose to die (2012)
A few years ago, I heard an NPR interview with a doctor who's friend was terminally ill. Rather than opt for treatment, the friend spent his remaining time living with his doctor friend. He died a few months later. The doctor said that this is how she wanted to die, too. I've tried a number of times to find the story, but I haven't been able to. Does it ring a bell for anyone? I'd love to listen to it again.

Thanks!

mct··on Standard way for Authoratitive DNS servers to refuse ANY query
I wish I had time to cite a reference, but my memory is that an ANY query is not guaranteed to return all RRs, anyway. Running a quick experiment against bind 9.8.4 (as packaged in Debian stable), I can confirm that:

* When no entry already exists in the cache, bind will forward the ANY query to an authoritative server and return the result.

* When some information is already present in the cache, bind will return only the information already cached, without querying more information from an authoritative server

Thus, if you need to know if a specific RR exists, you must query for that specific RR.

Still, to aid humans in debugging DNS problems, a nice compromise might be to allow ANY queries only over TCP. That would alleviate the spoofing problem.

mct··on Hand-picked space wallpapers for desktop and mobile
Adding support for categories/tags would be awesome, too :-)
mct··on gettimeofday() should never be used to measure time
Under what conditions do you have a usefully functioning system when the clock is so off you need to do multi minute jumps?

One example is embedded systems. Many don't have an RTC, or boot after the RTC has lost power. If a network connection finally comes up, NTP will instantly fast-forward the clock by years

mct··on Understanding Traceroute [pdf]
I wrote the original tcptraceroute in 2001.

The article mentions many traceroute implementations change the source port to associate queries with responses. Another technique is to use the IP ID field, leaving the source port static. In tcptraceroute, you can choose either method using "--track-id" or "--track-port". By comparing the two, you can sometimes see traffic being load-balanced across multiple links.

I just did a quick write up of this at https://gist.github.com/mct/2ae1dbc2d596f59f5aff (which I should add to the examples.txt file)

mct··on Dissecting OpenBSD's divert(4)
There is a similar feature in Linux which I've used a number of times over the years to simulate various network problems, and to modify packets flowing through my router in interesting ways.

You can select packets to be sent to userspace with the "-j QUEUE" iptables target handler, and then read those packets using libnetfilter.

mct··on An Orangutan Has Some Human Rights, Argentine Court Rules
Humans most certainly have rights. In this case, those rights were shamefully violated.
mct··on The world's smallest self-replicating program
I once wrote an implementation of the classic Redcode "Imp" program in x86 assembly. It does not satisfy the requirements of this contest, but it does act as the Imp program, perpetually copying itself through RAM. :-)

I just uploaded it to https://github.com/mct/assembly-toys/tree/master/imp

mct··on Ask HN: Apps for travel
When I'm travelling internationally, a currency converter is always a good one to have.

You can try searching for public transit apps specific to the cities you'll be visiting. Depending on where you'll be travelling, there are some nice ones that have built-in maps of the transit system, trip planning, and real-time departure estimates. For a city like San Francisco, you may need more than one to cover the various public transit providers available (BART vs MUNI, etc). Lacking a specific app, you may want to just bookmark mobile versions of the public transit provider's website.

I also like installing a maps program that can make use of offline data. On Android, there's OsmAnd. That way, even if you no longer have data service, you can use the GPS to get a sense of where you are and what's nearby.

TripIt can be nice for keeping your travel itinerary easily accessible -- but of course it's always good to have hardcopies either on your person or in your carry-on.

Good luck!

mct··on Shellshock DHCP Remote Code Execution – Proof of Concept
While this is generally true of newer Debian installations, older machines that have been been regularly updated over the years to stable may still have /bin/sh pointing to bash. I fixed a few of my machines yesterday to use dash.
mct··on Alleged leak of more than 5M Gmail accounts
Interestingly, there are a large number of non-gmail.com addresses in there, including 123k yandex.ru addresses, plus a (very) small number of yahoo.com and hotmail.com addresses. Here's the output of "cut -d@ -f2 | sort | uniq -c | sort -nr":

https://gist.github.com/anonymous/255959493c0a26cce856

The data hasn't been very well edited from whatever dump it came from. For example, there are lines that end in "gmail.com_xtube", "gmail.com7777", "gmail.com|login", etc, which are curious.

mct··on How Apple and Amazon Security Flaws Led to My Epic Hacking (2012)
(From 2012)
Page 1 of 3Next →