HNHacker News
TopNewBestAskShowJobs

charlesdaniels

918 karma · joined March 17, 2018

http://cdaniels.net
submissionscomments
charlesdaniels··on Pixel Art and the Hardcopy
I was able to work around this using Nitter[0]. Try this[1] link.

0 - https://github.com/zedeus/nitter

1 - https://nitter.eu/pinot/status/1357862266633408512

charlesdaniels··on VideoLAN is 20 years old today
VLC is a great software package for sure. However, if you are seeking a Linux focused music player, I have enjoyed Exaile, having tried many different alternatives.

https://exaile.org/

charlesdaniels··on RAM is the new disk – and how to measure its performance (2015)
This is indeed an idea that has been coming up from time to time for over 25 years at least. I think the earliest publication in this space was Gockhale's Terasys (DOI 10.1109/2.375174).

It is a good idea in principle, but it's never really taken off to my knowledge. Parallel programming is hard. Deeply embedded programming is hard. The languages we have are mostly bad at both.

If you want to search for more, the keyword is "processor in memory" or "processing in memory" (PIM). Also "in memory computing" is commonly used as well. A number of groups are working on this right now. The new buss is "memristors" (memristive computing). Whether or not any of it actually ends up working or being commercially viable outside of a lab remains to be seen.

charlesdaniels··on Kids find a security flaw in Linux Mint by mashing keys
Anecdotally, I use xidle[0] and xlock[1], and have found both to be very reliable. xidle supports locking the screen by sending it SIGUSR1, which is really useful since you can trigger it from a process that doesn't have DISPLAY set.

The trick on laptops is to block on sending the signal in the script you use to suspend, so that when the laptop resumes the display is already locked.

0 - https://github.com/steinex/xidle-linux

1 - http://sillycycle.com/xlockmore.html

charlesdaniels··on Ask HN: What's are your personal automations?
I have done this[0] to varying extents for different distros, though I've been distrohopping a lot lately and the scripts haven't quite caught up. I have a similar set of scripts used to provision workstations and servers in my lab.

I find that having a fully automated setup makes tech problems much less stressful. If something breaks, I can just re-install the system from scratch and be up and running again in an hour or two. It also makes changing hard drives or setting up a new machines very straightforward.

0 - https://git.sr.ht/~charles/provisioning

charlesdaniels··on CentOS Project shifts focus to CentOS Stream
I am a big fan of OpenBSD, but unfortunately I still need some Linux only software. I do try out freeBSD’s Linux emulation layer every couple years, but it isn’t quite there yet for the stuff I need to run.
charlesdaniels··on CentOS Project shifts focus to CentOS Stream
Having been a Debian/Ubuntu person for a long time, and being somewhat dissatisfied with that ecosystem, I recently started evaluating CentOS for my use cases instead. I want something with a non-rolling update model, so I don't have to deal with my environment changing out from under me.

CentOS 8 had been mostly working well for me, barring a few missing packages that were easy to port over myself, and I was really thinking of moving all my boxes to CentOS. I'm glad this news came out before I did; I don't know what I'll use instead, but it definitely won't be CentOS/RHEL.

charlesdaniels··on 1MB Club
At the risk of over-complicating things, perhaps there could be limits per resource type. 10Mb of images might be reasonable (e.g. for a photojournal), but only 128KB of JS, and 128KB for everything else. Something along those lines.
charlesdaniels··on YouTube-dl's repository has been restored
I think it is important to note that GitHub's parent company[1] Microsoft is a member of the RIAA[0], the group who initially filed this DMCA.

The cynic in me says this was deliberately pre-planned to garnet free press. That type of behavior would certainly be in-line for the company responsible for the Halloween Documents[2][3].

Even if we give GitHub, and by extension Microsoft the benefit of the doubt here, this is a lesson we should not soon forget: Microsoft will not go to bat for you, not unless you can wield the power of the HN/Reddit/Twitter/etc outrage machine to create a PR problem for them.

Don't rely on Microsoft to be the centralized underpinnings of the open source world. At worst, it paves the way for EEE[4] 2.0. At best, it creates a single centralized target for malicious actors, such as the RIAA.

0 - https://www.riaa.com/about-riaa/riaa-members/

1 - https://blogs.microsoft.com/blog/2018/10/26/microsoft-comple...

2 - http://www.catb.org/~esr/halloween/

3 - https://en.wikipedia.org/wiki/Halloween_documents

4 - https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguis...

charlesdaniels··on Your Computer Isn't Yours
As other commenters have said, just picking up an open source *NIX is a great start.

If the lack of open hardware bothers you, there are several non-x86 architectures that are fully open source. Chief among them is RISC-V[0]; SiFive[1] is taping out RISC-V processors to real hardware, selling dev boards, and stuff like that. These are real, competitive, Linux-capable CPUs, although widespread adoption has not happened yet.

On the more minimalist front, the ZipCPU[2] is simpler (though has less software support), and it's author writes some really great blog posts about HDL[3] (Hardware Description Language -- how these CPUs are defined).

You might also enjoy developing for very small embedded systems. I like AVR CPUs such as the ATMega328P (of Arduino fame) for this purpose. Although not open-source, they have quite good and thorough datasheets. AVRs are very small 8 bit systems, but as a result, you can fit most of the important details in your head at once.

If you want to talk more about these topics, feel free to get it touch with me. You can find my contact info on my profile, and on my website (also listed in my profile).

0 - https://riscv.org/

1 - https://www.sifive.com/

2 - https://github.com/ZipCPU/zipcpu

3 - http://zipcpu.com/

charlesdaniels··on Apple requests to remove WebAssembly support in a-Shell
I didn't realize they couldn't use any persistent storage. I would think this would break most web applications.
charlesdaniels··on Apple requests to remove WebAssembly support in a-Shell
The most logically consistent argument they could make is that alternative browser engines are disallowed... so logically an implemntation of "wget" which is just a wrapper around the Safari engine should be OK.

Of course, all of this is arbitrary. Apple just wants to be able to control their platform, they don't actually care about having rules and enforcing them with any semblance of fairness.

It's unfortunate that developers have to put up with this. I say "have to" in that my understanding is that Android users (in general, present company likely excluded) won't pay money for high quality ad-free apps. So if you actually want to make something good and be paid for your trouble, it's iOS or bust.

charlesdaniels··on Apple requests to remove WebAssembly support in a-Shell
Though I'm not normally one to advocate for "web stuff", what would stop someone from simply compiling a suite of shell tools to WASM, then distributing a "terminal" as a PWA. Of course there would be some slowdown compared to real native code, but I am told (not a web person) that WASM can be nearly as fast as native code, and is (?) supported by Safari. I have seen successful experiments where people have run AMD64 simulators in WASM that can boot Linux, so you could even go so far as virtualizing the whole system, though I imagine the performance would be even worse than "just" targeting WASM.

I guess this is somewhat rhetorical; the people who would be interested in such a tool are I imagine by and large willing and able to either jailbreak or buy an Android. Presumably getting a nice shell-type environment as a PWA would be tricky also considering the limitations of the browser (I know this makes networking hard).

I wish there was a product like an iPad that came with a root shell out of the box. I like the polish of iOS, but I'm not willing to trust random people on the internet with root code execution to jailbreak my iThings.

charlesdaniels··on What Happened to XPath?
Indeed, I wrote a tool[0] to make it easy to grab a page and run xpath queries on it. It’s really surprising how much mileage I’ve gotten out of it. Probably 95% of my web scraping needs can be solved withal xpath query or two. And if you realize you need selenium later, xpath is well supported there, so porting your existing query is usually quite straightforward.

0 - https://git.sr.ht/~charles/charles-util/tree/dev/bin/query-w...

charlesdaniels··on AMD to Acquire Xilinx
I agree yes. "Traditional computing paradigms" are (IMO) not all that interesting as research topics at this point. As far as I know, most of the work in that space is in branch prediction and cache replacement policies.

FPGAs are what you really want when you need to deal with high resolution data that is coming in at very high data rates. Often even a very fast general-purpose processor with hand-tuned assembly simply won't have even the theoretical memory throughput to process your data without "dropping frames". They also have the benefit of deterministic performance, which with modern caching/branch prediction systems you can't guarantee (AFAIK, my computer architecture knowledge isn't that cutting edge).

They can also work really well if you have some computation you want to do that is so far off the beaten path for general-purpose processors (or so memory bound) that FPGAs can take the cake.

There is also some work in sprinkling even more hardlogic into the FPGA dies, like processors or accelerator cores for various applications. FPGAs are great for implementing the glue logic to move data between those.

charlesdaniels··on AMD to Acquire Xilinx
I think GP meant in the sense that reconfiguration time is large. FPGAs cannot be effectively time-division multiplexed, as a full reconfiguration can take up to tens of seconds.

GP is also correct that DSP/SRAM blocks are critical to performance. FPGAs are not very efficient at raw compute if you have to synthesize everything out of LEs.

The performance benefit of FPGAs, which PIMs also share (in theory, there aren't any PIMs ready for real-world deployment AFAIK) is that they can leverage much larger memory bandwidths than general purpose CPUs can. An FPGA might run at a lower clock rate (low 100s of MHz), but be able to operate on several kb per clock cycle. This can work really well when paired with off-chip logic to convert high rate serial interfaces to lower clock rate parallel interfaces, then back after the FPGA is done processing.

There is also a lot of work going on in the space of time-division multiplexing FPGAs effectively. The two main approaches are overlay architectures and partial reconfiguration. The former implements another high-level fabric on top of the FPGA which will be less general-purpose, but can be reconfigured faster. The latter is a feature vendors have added to some high-end chips where specific regions of the FPGA can be reconfigured without affecting other regions.

charlesdaniels··on OpenBSD on the Desktop (Part I)
Right, but in CWM, you can also make it so that clicking on it doesn't raise it either. Which is useful if you want to click UI elements in a window without raising it.
charlesdaniels··on OpenBSD on the Desktop (Part I)
Oh for sure, focus-follows-mouse is widely available. But with CWM, it is easy to configure the WM so that a window being focused doesn't also cause it to be raised.
charlesdaniels··on OpenBSD on the Desktop (Part I)
I have really enjoyed CWM, and still use it even after switching from OpenBSD to Linux (I really liked OpenBSD, but need some programs that only run on Linux).

One of the features I find most useful is that you can have a window focused without raising it. So if you have some reference material open in a browser over top of part of your terminal, you can switch focus to and even click in the terminal without raising it (in my setup, I alt-click to raise). Admittedly, I'm not sure if this is the default behavior, as many of my settings are non-default.

I also really like the ability to search through window titles. I have alt+/ set to open the window search menu, then I can type a substring of the window title I want to raise, press return, and it's automatically raised and focused.

CWM is really, really nice, and every other WM I've tried before or since has disappointed me by comparison.

charlesdaniels··on Show HN: DevUtils.app – Developer Utilities for macOS
This reminds me a lot of CyberChef[0], which has a lot of similar features. That said, it's a web application(though it's easy to run locally). This looks like a nice native-UI version of some of the same ideas.

0 - https://gchq.github.io/CyberChef/

charlesdaniels··on Older people have become younger
The best banner experience is to use "I don't care about cookies" (https://www.i-dont-care-about-cookies.eu/), and then simply block the cookies you don't want. I didn't even realize that this website had a "cookie banner".
charlesdaniels··on People Expect Technology to Suck
I think a big part of this is the disincentive to not follow a pattern of learned helplessness. Something I've anecdotally noticed in talking to older people who need to use computers for their jobs, but who are not technologists, is that they complain about user interfaces changing.

If you run some old version of Windows or macOS in a VM with relevant versions of common office productivity software, you will see that the UIs are quite different now from 5, 10, 20, ... years ago.

My perception is that people are sick of learning how to use some operating system, software version, whatever, only to have to re-learn everything because a new version of release. Especially considering that many professionals upgrade when their employer's IT department makes them, not on their own time. As a result, you get the attitude of "why bother learning how to use this when it's going to change out from under me in six months?".

I'm not suggesting that the answer is to never change or improve any UI ever, but I don't think we've struck the right balance, at least in consumer-facing software.

Consider that most of the people on HN have a very different experience. If you live in a UNIX environment, you can often use the same workflow/scripts for decades on end. If a new version of Bash or Vim came out that was backwards-incompatible, it would never be adopted, or would at least take many years to be.

charlesdaniels··on On Hacking MicroSD Cards (2013)
Indeed, for educational use cases and hobbyists, there are tons of resources available for the AVR. Being able to buy it in a DIP package is ideal, since it really lowers the barrier of entry in terms of skills and tools required. There are also tons of libraries and code examples both for AVR itself and for the Arduino platform.
charlesdaniels··on On Hacking MicroSD Cards (2013)
This is very much the case. Arduino gives you a nice board with a decent power circuit, clock circuit with crystal oscillator, strips of headers to plug wires into, a USB connector, UART to USB adapter, and often other goodies. The exact same MCU, the ATMega328P can be had for $2.08 each[0], or less if you buy in bulk.

For your $2, you get:

* An internal oscillator which lets you run without an external clock circuit (typically limited to around 8MHz, and can cause clock drift, so not good of accurate timing is important).

* Hardware UART interfacing logic

* Hardware SPI interfacing logic

* Hardware I2C interfacing logic

* Several ADCs

* 23 GPIOs

* 2kB data memory

* 1kB EEPROM

* 32kb flash memroy

There are other microcontrollers out there, each with their own trade-offs. I personally like AVRs, as they have good quality open source compilers, you can mooch off the Arduino community for libraries[3], and in-circuit programmers can be had for cheap[1].

If you want to learn more, I suggest this article[2].

0 - https://www.mouser.com/ProductDetail/Microchip-Technology-At...

1 - https://www.adafruit.com/product/46

2 - https://www.evilmadscientist.com/2007/using-avr-microcontrol...

3 - https://github.com/oshlab/Breadboard-Arduino

charlesdaniels··on USBImager – A minimal GUI app that can write disk images to USB drives
If you care about showing the progress

    pv < input.iso > /dev/sdX
Is a more portable way to do that, as "status=progress" is a GNU modification to dd, as I recall. Of course the most portable is to use one of the POSIX mainstays like cat or cp.
charlesdaniels··on How we learnt to stop worrying and love web scraping
I'm surprised I don't see this discussed more in the context of web scraping, but XPath is not only much more powerful, but can also be made robust against such techniques.

Sure, if you change the page structure enough you could defeat it, but it would require more than just adding a few divs. XPath easily lets you mix and match matching against not just CSS classes, but also the page's structure itself, inner text, attributes, and so on. As a result, you can get some really powerful queries without having any kind of complex post-processing of the results.

charlesdaniels··on Implement an emulator for a fantasy CPU in JavaScript
> I personally think that MIPS is just not relevant enough in the real world anymore to deserve being taught at school. But I do get that there already is a lot of material out there.

From a pedagogy perspective, the course materials / textbooks haven't really caught up yet. Also, the project I was referring to was in an Architecture class; I would contend that the underlying concepts of how a pipeline works can be taught pretty much any architecture. MIPS is easy to understand, which makes it well suited for teaching.

That said, at my university, we are slowly transitioning to RISC-V, so hopefully within a few years it will have propagated to all of the courses.

charlesdaniels··on Implement an emulator for a fantasy CPU in JavaScript
I don't have a specific suggestion for learning to make CPU emulators in particular.

As thethirdone said in his comment, the official specification is the most important resource.

The actual body of the simulator is mostly going to be a lot of lookup tables. You'll probably have a struct or class that stores the state of the CPU at a specific instant in time. Your main loop will be calling a next_state() function on that object. For your sanity, I would highly suggest making your state object immutable.

I have found breaking out the ALU, instruction decoder, and control logic into separate functions is a good way to split things apart.

charlesdaniels··on Implement an emulator for a fantasy CPU in JavaScript
Hey, thanks for making RARS! I am TA-ing a class this semester where we are using RARS. It's my university's "build a CPU with Verilog class", and we just switched to RISC-V. We previously used MIPS with MARS, and lacking a MARS alternative was one of our blockers for switching to RISC-V.
charlesdaniels··on Implement an emulator for a fantasy CPU in JavaScript
Nice article! I would definitely recommend for everyone to write a CPU emulator at least once. It will give you a lot of perspective on how computers really work. As someone else pointed out CHIP-8[0] is a good one that's not too complicated.

If you want something more "real", MIPS and RISC-V are also not too hard, if you just do a subset of the instruction set and not the whole thing. You can skip most of the instructions that deal in bytes and half-words. It's also easier to implement main memory as being word-addressable only (but this can introduce incompatibilities with real assembler programs).

I wrote a cycle-accurate, pipeline simulator for MIPS for a course, which totaled only about 1200 SLOC. If you didn't need to simulate all the pipeline registers (you probably don't) and use a higher level language, this is probably a <750SLOC project.

0 - https://en.wikipedia.org/wiki/CHIP-8

← PreviousPage 2 of 6Next →