Hi, I’m venam and I write about Unix related topics on my blog.
Link: https://venam.nixers.net/
FWIW I really like Overcast, an independent mobile podcatcher (iOS/web) https://overcast.fm
Anyone else have a podcatcher they recommend?
I use antennapod. I’m a heavy podcast listener, 3h of traffic everyday, 100 hours a month.
The application doesn’t limit itself to itune you can also search on https://www.gpodder.net/ and others, or still add your own RSS feeds. It’s open source, so no ads and only good features that the people use.
I’ve used them all and for IOS Overcast is the clear winner IMO. I wish they’d polish their web player a bit but other than that it’s totally fab.
Cool post. I’ve also written about Vim, Ed, and Vi in this podcast.
Be sure to check the comments from jkl too, clarifying some parts.
Does justified text in CSS still look awful? Last time I used it (probably a year ago) it produced massive gaps between words on some lines, and tiny gaps on others.
E: I guess this is just personal preference, but it feels like it’s easier to keep my position when reading with a ragged right edge.
Usually books and papers all use justified text and the good vertical and horizontal spacing at the start and between paragraphs so I presume if the article is quite big with long paragraphs it would be easier to follow.
I no longer believe that daemons should fork into the background. Most Unix systems now have better service control and it makes the code easier to deal with if it doesn’t call fork(). This makes it easier to test (no longer do you have to provide an option not to fork() or an option to fork()) and less code is always better.
Not forking also allows logging to be an external concern and the process should just write to stdout and stderr as normal.
This is not so much about the forking per se, but rather the other behaviour that generally goes with it: closing any file descriptors that might be connected to a controlling terminal.
OpenBSD’s rc system seems to expect that processes fork. I don’t see an obvious workaround for processes that don’t fork.
It’s not that hard to write a program to do the daemonization (call umask(), setsid(), chdir(), set up any redirection of stdin, stdout and stderr, then exec() the non-forking daemon.
It’s even simpler when you have daemon(3): http://man7.org/linux/man-pages/man3/daemon.3.html
Which you do on OpenBSD, actually.
Note that daemon(3) is a non-standard extension so it should be avoided for portable code. The implementation is simple enough, though.
I’m not sure this is accurate, at least on -current. There are several go “deamons” that as far as I understand don’t support fork(2). These can still be managed by OpenBSD’s rc system:
# cd /etc/rc.d
# cat grafana
#!/bin/ksh
#
# $OpenBSD: grafana.rc,v 1.2 2018/01/11 19:27:10 rpe Exp $
daemon="/usr/local/bin/grafana-server"
daemon_user="_grafana"
daemon_flags="-homepath /usr/local/share/grafana -config /etc/grafana/config.ini"
. /etc/rc.d/rc.subr
rc_bg=YES
rc_reload=NO
rc_cmd $1
I’m not sure if there’s more to it that I don’t understand, I don’t write many deamons!
Well, it turns out, I can’t read! The key to this is rc_bg, see https://man.openbsd.org/rc.subr#ENVIRONMENT
For those that don’t know, daemontools is a nice service system that explicitly wants programs to not try to daemonize themselves. For services I build and run I try to use that.
The next problem is convincing folks that writing is not too difficult.
I think you mixed up inciting people to write and putting a guideline to follow. It might sound redundant but to start writing you have to start writing and not stop to look at guidelines. Make it simple quick, as it comes out of your head.
Grammar mistakes are not important as long as the content and ideas come across. If someone nags about how you structure your sentences and how you are misspelling words it just drives them away from writing.
Images are good, I’m actually going through some of my old articles and adding illustrations to help visual readers understand the topic. These days I’m slowly adding them to this one about data storage on Unix.
I also use the Firefox readerview when reading articles and this made me realize vertical alignment is important but overlooked (http://oceanpark.com/papers/vertical_white_space.html).
NB: it was awkwardly disturbing to have your face stare at me all along the scrolling.
I’m very, very pro-diversity in all walks of life (see my past comments for example) but there are a few problems here:
We acknowledge the value of non-technical contributors as equal to the value of technical contributors.
That’s not always true and it’s silly to think so. If my goal is to write a kernel device driver, having high-quality documentation or something is irrelevant if the codes doesn’t work.
Now, if you’re writing user-level software, the UI design work, documentation, and so on is critical. It doesn’t matter if the code works if no one knows how to use it or if it’s so clunky they choose something else.
We can add the most value as professionals by drawing on the diversity of our identities, backgrounds, experiences, and perspectives. Homogeneity is an antipattern.
Again, yes and no. For application software it’s critical you have diversity in development because you want to reach as broad a user base as possible (and you should get actually disabled people to use and help develop your accessibility mechanisms, dammit!)
But for low-level bit manipulation or parsing or whatever…there are only so many ways to skin a cat and technical skill is more important than anything else.
We are devoted to practicing compassion and not contempt. We refuse to belittle other people because of their choices of tools, techniques, or languages.
I’ll be dead in the cold, cold ground before I use Emacs!
The rest of it I agree with, especially this:
The negative impact of toxic people in the workplace or the larger community is not offset by their technical contributions.
Absolutely. If you’re such a jerk that you drive ten people away…well, chances are no matter how good you are, you’re not as good as those ten people put together. Good projects have lost good people because of asshole behavior.
And, finally, we gotta remember: projects are free to adopt whatever policies they like. If you think this sort of thing is like Hitler and Stalin combined, great! The beauty of software is you can go write your own thing.
Personally I dislike the notion of this skill is more important than that skill.
Skills are different they do different things.
“Value” assumes you can comparing something comparable.
Skillsets are so broad and categorically different, trying to place them in value order is like comparing apples and orangutans.
That said, it is the nature of many humans to more highly value the skills they personally have. It makes them a happier to think that way.
Absoultely, but certain skills are more valuable than others in certain domains, by which they become comparible. Fluency in French is absolutely essential if you’re translating french literature, and basically irrelevant if you’re an accountant in an English-speaking country.
The problem with the manifesto is that it takes an incredibly broad category of endeavor and implies that all skills within it are equally valuable in all situations, which is false. Bedside manner is critical if you’re a general practitioner and largely irrelevant if you’re a research doctor
Fluency in French is absolutely essential if you’re translating french literature, and basically irrelevant if you’re an accountant in an English-speaking country.
To go further, not all languages are equal and some are more valuable than others. English is the most widely spoken language in the world, Spanish, French, Mandarin, Hindi are all high-value languages to acquire. Individual minority language skills are arguably less valuable overall because they’re less widely spoken.
If it’s reasonable to argue that some skills are inherently more valuable than others in different fields, I don’t see why software should be different.
Individual minority language skills are arguably less valuable overall because they’re less widely spoken.
Well, except that the languages you speak forge the way you think.
I studied a couple of different languages (to various degrees): Italian is my mother tongue but I speak English and I used to speak Portoguese, a bit of Russian and a bit of Swahili (plus a couple of local Italian dialects that I understand but I cant speak).
Each time I learned a new language I discovered different ways of looking at things that I couldn’t conceive before. And this effect survive even after I completely forget the language, as it is for Russian and Swahili that I haven’t spoken in the last 15 years.
So basically the value of learning a language for a programmer might not be that low. At least if your work require some creativity, the more varied is your culture the more varied is what you can invent.
I agree that a culture of NIH does not require free thinkers, though.
I agree with everything you’ve mentioned however I would like to put forward two points you’ve made from a different angle. The wording of this manifesto is vague and you assumed that it emphasized on some aspects that maybe it didn’t, or maybe it did (It probably did but I’m just adding to the discussion for fun).
For instance:
We acknowledge the value of non-technical contributors as equal to the value of technical contributors.
What do we mean by contributions? Could it just be listening to a non-technical person’s ideas or is it limited to writing documentation, graphic design, translation, and other kinds of similar work? Nevertheless I still don’t see how anything in those could be looked at as equal, could be the ideas of technical people are more important in some cases or the ideas of non-tech in other cases. Maybe the word “equal” was meant as “don’t ignore them completely”.
We can add the most value as professionals by drawing on the diversity of our identities, backgrounds, experiences, and perspectives. Homogeneity is an antipattern.
If you understand this point as a “we have to cater to all needs” then I’m all in with your reply, it depends on what kind of work needs to be tackled. But if it’s about bringing diversity and creativity into thinking about problems and solutions then it’s another topic. It switched to “avoid doing the same things over and over again in the same way, invite people from different places maybe this will bring innovations in ways we couldn’t predict”.
We are devoted to practicing compassion and not contempt. We refuse to belittle other people because of their choices of tools, techniques, or languages.
I’ll be dead in the cold, cold ground before I use Emacs!
No clue how compassion and contempt got injected here… Unless language is meant as natural language (not programming language), and techniques as methods of learning and working. (But that’s probably not what is meant)
For the past weeks I’ve been trying to fill a gap by adding outline/vector font support to xcb: https://github.com/venam/fonts-for-xcb. This stems from a research I’ve done about the font stack on Unix and how I realized knowledge around this topic was lacking. At the same time I’m going to write more articles related to the X windowing system and other graphic related topics such as this one about drawables, regions, and others.
The font library still misses newline support, better font fallback (if requesting monospace we should also search for monospace), it doesn’t have kerning support yet and I’m unsure if I want it included, I didn’t do anything yet for vertical font support, the dpi is currently hardcoded but I’d like to have it in the Xresources like Xft, and it’s missing more documentation. Overall, it’s moving in a good direction, projects based on xcb can now include this mini header to get the font support.
I use adsuck with an extensive list for that. It has been working well so far.
https://github.com/conformal/adsuck/
Facebook used to be vulnerable to homoglyph attacks. You could register domains on dot.tk, something that resembled “facebook.com/something.dot.tk” and phish people to login there on a fake page.
Oh, I’ve written about that a lot if that interests anyone: https://nixers.net/showthread.php?tid=2111 or here
I don’t disagree with the article. However I also can’t help but to be reminded of the “I only own 1 fork, 2 tshirts, a backpack, and a laptop” people.
“I disable HTML, CSS, Javascript and all that bloat … I only browse the internet with Emacs … ALSO … oh my god did I tell you how much RAM this Electron blasphemy uses? … what is wrong with some good old ugly lightweight Tk GUIs? I mostly use tmux over SSH anyways so who needs GUIs right right? Everything is bloated. Everything is unnecessary. Disable everything. And make sure that your stuff gracefully falls back from 2018 to this authentic vintage record player that I feel like using as my alternative web browser today for extra privacy protection.”
I get it. I don’t even particularly disagree with it. But it’s turning into a bit of a meme.
Also for clarity I don’t mean to imply that the author said those things. The post just reminded me of this theme.
I get it. I don’t even particularly disagree with it. But it’s turning into a bit of a meme.
It’s to distinguish yourself, as opposed to those that that run Wordpress and use IDEs. And yes, it relates to the minimalism you mention.
(Did I mention my writing space uses pandoc and a couple of lines of shell ?)
I tried that, too, but found that pandoc is actually quite difficult to maintain, since it lives in the haskell ecosystem (which isn’t too available on the non-GNU Linux ecosystem)
Im with the markdown/jekyll stack now, i dont think its less bloated, but at least i can outsource the rendering (and therefore having the stuff installed) to github pages.
It has a lot of weird issues, like pandoc output not being really stable, so compiling with a newer version of pandoc leads to a lot of churn in the results.
pandoc releases binaries though, and whenever I’m on non-GNU, I just get the installer and install it.
I want to add that minimalism can have an nice payout: reduced resource usage. If you use tmux instead of Xorg, w3m instead of firefox, suddenly an 15 year old Laptop is not scrap metal anymore. They cost like 60$ each on eBay, but you can usually get them for free from relatives.
I think it’s good to have both extremes, like that everyone can choose something in the middle.
However, 2016 and 2017 have shown that there’s a trend to not take that middle way.
Maybe it gets a meme. There are memes for everything nowadays. There are meme for GUI too, or the GUI was a meme that grew too big to be called a meme, now it is the standard way of computing for most people.
If bulk can be stripped out of the interfaces (graphical, text, any kind!) it is good, but if it becomes yet another meme… Yes, it kills all the fun.
I’m using this: https://paste.xinu.at/HQx/ I call it remove_special
When you think about it, whichever character is going to be used as delimiter it’s probably also going to be allowed in the filename (anything other than \n or \0). So I’m not sure what the solution to this would be.
Then put the filename alone on the first line, or put the file name last so that you can read in the numeric parameters then the rest of the line is the filename. Right?
Seems like the simplest solution. And it’s not like files in /proc don’t use multilines already. I guess it’s made that way for legacy support. However, as mort mentioned you can also have \n in a filename.
Files can actually contain newlines. Try for example touch "$(printf "hello\nworld")".
It would probably work to use a slash as a separator though, unless the executable name might be a path.
EDIT: added quotes around $(printf "hello\nworld")
touch $(printf “hello\nworld”).
This creates two files where I’m testing. But it seems like I’m able to do it without the printf.
Sorry, I should’ve written touch "$(printf "hello\nworld")".
If you just run ls, it will show you 'hello'$'\n''world', but if you redirect pipe ls (for example to less), it will show up on two separate lines.
Or use a “safer” format like netstring, tnetstrings, or maybe even Bencode.
I’ve been testing yesterday getting those information through netlinks. There’s a kernel configuration called CONFIG_TASKSTATS (check if it’s enabled in your kernel config first /boo/config* or /proc/config.gz).
The documentation can be found here: https://www.kernel.org/doc/Documentation/accounting/taskstats.txt
There are a bunch of C headers to be able to access the features and there are even Go and Python libraries. I’ve been testing with the Python one, gnlpy (https://www.pydoc.io/pypi/gnlpy-0.1.2/autoapi/taskstats/index.html).
However I’ve been running into trouble with the permission part, the capabilities(7). This is something that I haven’t found that much documentation on. This rfc http://www.faqs.org/rfcs/rfc3549.html and this manpage https://linux.die.net/man/7/netlink say that users need the capability cap_net_admin but it’s not doing it for me.
5. Security Considerations
Netlink lives in a trusted environment of a single host separated by
kernel and user space. Linux capabilities ensure that only someone
with CAP_NET_ADMIN capability (typically, the root user) is allowed
to open sockets.
I’ve been trying sudo setcap 'cap_net_admin=p cap_net_admin+i cap_net_admin+e' t.py but it still doesn’t execute as a normal user. But it works perfectly as root.
Maybe someone here has more info on the topic.
EDIT: As 1amzave, copying the python interpreter and assigning the capabilities on it works fine.
I’m gonna hazard a guess that your setcap not being effective might have something to do with it being interpreted (via a shebang line) rather than a directly-executed binary. Maybe create a copy of your python interpreter (presumably you don’t want to blindly grant CAP_NET_ADMIN to all python code), setcap that, and change your shebang line to use it instead.
You’re right, that was the issue. Copying the python interpreter in a home directory and setting the capabilities on it did the trick. The python script itself doesn’t need capabilities.
Overall, I think netlink is great but unlike procfs it’s not that easily accessible.
ASCII actually has field delimiter characters, which are very rarely used – it’s a shame, because it would make parsing trivial in cases like that.
Not really, because file names can contain those field delimiter characters.
It would’ve been nice if there were stricter rules about what charcaters are allowed in a file name. When would you ever want a newline, or field delimiter, or carriage return, or BEL, in a file name?
BEL, in a file name
When I want to play a small prank by making ls in a given directory make the terminal beep. :)
Hacking the line discipline of V7, I love this post!
EDIT: I think I’ve read a link mentioning how to make V7 backspace working, but it’s lost amongst the show notes links of this podcast https://nixers.net/showthread.php?tid=2108 https://venam.nixers.net/blog/unix/2017/06/04/terminals.html I think it was some old posts from http://aplawrence.com but I’m not sure anymore.
I made a mini FAT12 fs reader to learn a bit about filesystem design:
https://github.com/venam/FAT12
Woah, what a coincidence. There’s a hackaton this Saturday and I was planning on implementing a FAT fs, which I’ve been wanting to for a while but didn’t have the time and patience to put my mind into.
I love how those kind of things happen in life! Thanks for the interesting article.
I implemented a 3 parts file transfer/storage with custom encryption per storage communication and custom protocol. The initialization handshake is done over UDP, agreeing if the storage encryption is trusted, and the file transfer is done over TCP.
There’s 3 programs/parts:
This was challenging and fun to do.
Still my favorite approach to this: https://www.cg.tuwien.ac.at/courses/CA/material/papers/AsciiArt.pdf (but it’s not real-time AFAIK)
https://vermaden.wordpress.com/
Blog about BSDs/UNIX/Linux on Servers/Clusters/Backup/Virtualization but also on the Desktop.
Love your blog. Keep up the good work.
Thanks ;)