Hacker Newsnew | past | comments | ask | show | jobs | submit | Fnoord's favoriteslogin

Now, the OP has to remember, df -h -x tmpfs instead of df -h. The proper solution for this is to not have commands that are both meant for interactive and script usage. Then the defaults for their output can be changed over time to suit the evolving landscape. Or if you do want a single command for both have a --script flag that makes its output suitable for usage in scripts.

Many times a day both in scripts and interactively I use a small program I refer to as "yy030" that filters URLs from stdin. It's a bit like "urlview" but uses less complicated regex and is faster. There is no third party software I use that is distributed via "curl|bash" and in practice I do not use curl or bash, however if I did I might use yy030 to extract any URLs from install.sh something like this

    curl https://example.com/install.sh|yy030
or

    curl https://example.com/install.sh > install.sh
    yy030 < install.sh
Another filter, "yy073", turns a list of URLs into a simple web page. For example,

    curl https://example.com/install.sh|yy030|yy073 > 1.htm
I can then open 1.htm in an HTML reader and select any file for download or processing by any program according to any file associations I choose, somewhat like "urlview".

I do not use "fzf" or anything like that. yy030 and yy073 are small static binaries under 50k that compile in about 1 second.

I also have a tiny script that downloads a URL received on stdin. For example, to download the third URL from install.sh to 1.tgz

     yy030 < install.sh|sed -n 3p|ftp0 1.tgz
"ftp" means the client is tnftp

"0" means stdin


Hardcore History can certainly be off kilter, and the first eppy of any series tends to be a slog as he finds his groove. That said, Wrath of the Khans, Fall of the Republic, and the WW1 series do blossom into being incredible gripping series.

Doesn't (dyst)OpenAI have a clause that you can't say anything bad about the company after leaving?

I'm not convinced these board members are able to say what they want when leaving.


WD40 is used on concrete to make tags that show up only in the rain

sudo xattr -rd com.apple.quarantine /path/to/binary/or/app

should also allow anything to run without opening settings


> It is really not so repulsive to see the poor asking for money as to see the rich asking for more money. And advertisement is the rich asking for more money. A man would be annoyed if he found himself in a mob of millionaires, all holding out their silk hats for a penny; or all shouting with one voice, “Give me money.” Yet advertisement does really assault the eye very much as such a shout would assault the ear. “Budge’s Boots are the Best” simply means “Give me money”; “Use Seraphic Soap” simply means “Give me money.” It is a complete mistake to suppose that common people make our towns commonplace, with unsightly things like advertisements. Most of those whose wares are thus placarded everywhere are very wealthy gentlemen with coronets and country seats, men who are probably very particular about the artistic adornment of their own homes. They disfigure their towns in order to decorate their houses.

— G.K. Chesterton, The New Jersusalem

http://www.gkc.org.uk/gkc/books/GKC_New_Jerusalem.html


I like to hold mine between finger and thumb, and drop from low height(3/4 of an inch or so) onto a hard surface, keeping my finger and thumb nearby to catch it. A full battery will land with a thunk. An empty battery will make a fast tapping noise, like a basketball does near the end of its bounce.

Same exact concept of course, just pointing out that you don't have to actually watch it bounce and fall over, you can hear it pretty easily. Helpful when testing a drawer full of suspect batteries...


The article is from 2018, but to find and script settings, this person almost exactly does what I do with macOS.

I usually do:

% defaults read > 1

then tweak settings and then do

% defaults read > 2 % diff 1 2

I look at the diff and add those to a shell script, which I run when I do a new macOS installation.


You can use network namespaces too. As a reference, here is my torrent setup:

  ip netns add torrent
  ip link add wg1 type wireguard
  ip link set wg1 netns torrent
  ip -n torrent addr add 10.67.124.111/32 dev wg1
  ip netns exec torrent wg setconf wg1 /etc/wireguard/wg1.conf
  ip -n torrent link set wg1 up
  ip -n torrent route add default dev wg1
  ip netns exec torrent ip link set dev lo up

  ip netns exec torrent transmission-daemon -f 2>&1
AFAIK it's pretty bulletproof. But for good measure I also have transmission configured to only listen on the wireguard address.

Hacked it together myself.

I have a Containerfile with docker.io/library/ubuntu:22.04 base and a RUN step that installs steam + mesa-vulkan-drivers + some other GL and audio libs + 32-bit versions of those, creates a user with the same UID as my user on the host, and adds it to the input group (for controller support).

Then I have a `~/.local/bin/steam` script that runs `podman container run --userns=keep-id` with parameters to pass through `/dev/dri` (for GPU), `/dev/input` (for controller), PulseAudio socket, X11 socket, and an empty directory as the home directory.

Every week or so when I reboot my PC for updates, I rebuild the container image with whatever is the latest ubuntu base image and other packages at the time.

`~/.local/bin/discord` is the same except it doesn't have the controller and GPU stuff, and it has a pre-processing step to download the Linux binary tarball from their website and unpack it into the home directory.

I'd share it but it's part of a big private personal repo. I might separate it out into a GitHub Gist or something later.


>arrow keys

sane people will just use hjkl even on readline with ~/.inputrc and 'set -o vi' in ksh.


I'm sick of it too. In 2023-01 alone I have had 9,000 different IPs from Microsoft's ASN8075 crawling one of my sites with these "normal looking" user agents. Poring over the logs to see why your server is on fire takes non-trivial amounts of time. If I didn't have a ton of other stuff to do I'd say it was kinda fun, but I'm freaking fed up.

Just yesterday I put all their networks into an nginx geo map:

    geo $limit_bots_ip {
        # requests with an empty key are not evaluated by limit_req
        # see: http://nginx.org/en/docs/http/ngx_http_limit_req_module.html
        default '';

        157.55.39.0/24  'bot';
        207.46.13.0/24  'bot';
        40.77.167.0/24  'bot';
        13.66.139.0/24  'bot';
        ...
    }
Any request from these networks gets classified as a bot, which is then used as the key for a rate limit

    limit_req_zone $limit_bots_ip zone=badbots_ip:1m rate=1r/m;
It's incredible the amount of resources these companies have. I'm just one guy trying to keep a few dozen web servers up.

What the author is proposing is known in philosophy as the Pragmatic Theory of Truth, which says, essentially, something is true if it is useful to believe that it is true.

This is in contrast to the more widespread Correspondence Theory of Truth, which says that something is true if it corresponds to the way things actually are. This is a classical theory of truth held by both Aristotle and Aquinas.

Personally, I think the Correspondence Theory is far superior to the Pragmatic Theory. I don't want to believe in a religion because it feels good to believe in it. I want to believe in it because it's actually telling us true things about the way things actually are.

By the way, there are many other theories of truth, some quite out there. This entry on truth in the Stanford Encyclopedia of Philosophy gives a good overview: https://plato.stanford.edu/entries/truth/


I'd call this 7 lines rather than 20. The rest is function definition and argument parsing. But really it should be just 1:

  pyotp.TOTP('base32secret3232').now()
Why is this relevant? Because it's inadvisable to write security related software if you're not prepared to take on the full range of possible problems that introducing another security library brings (CVEs, supply chain security, etc.). The adage that doing security right requires doing everything right. Doing security wrong only takes 1 thing.

Somewhat timely. AHK is one of those utilities I absolutely cannot go without. I've been running it on all my Windows machines for 15 years now.

Just a few days ago I was complaining¹ about how Excel handles formula input. After some back and forth on my yak-shaving attempt, I realized I could shave it myself with AHK.

With this little bit of code, my [Enter] and [Tab] keys work the way I want them to in Excel. This is still version 1.1, not 2.0:

    ; Try to "fix" Excel formula bar
    ; ==============================
    IsExcelFormulaBox() 
    {
        ControlGetFocus, F, A
        return (F="EXCEL<1")
    }

    #if IsExcelFormulaBox()
    Tab::
        ; Look for the little function list that pops up when suggestions are available.
        ControlGet, X, Visible,, SysListView321, ahk_class __XLACOOUTER
        ; If list is visible, then pass [Tab] through. If not, insert 4 spaces
        if (X) {
            Send {Tab}
        } else {
            Send {Space}{Space}{Space}{Space}
        }
        return

    ; Swap [Enter] and [Alt]+[Enter]
    $!Enter::Send {Enter}
    $Enter::Send !{Enter}

    #if
[1] https://news.ycombinator.com/item?id=34176791

You're going to have to speak to them, and it's going to be a difficult conversation for both of you. I therefore would suggest reading a book called Difficult Conversations[1], I can't recommend it enough. It's part of a series based off of research conducted at Harvard, of which Getting to Yes, and Getting Past No are two of the others, also highly recommended.

[1] ISBN 9780143118442


I guess this is a good place to share my open source large format laser cutter design for sewing projects. It’s cheap to make, works pretty well, and the whole gantry assembly slides right off leaving just a sheet of plywood with low profile 3D printed rails on the sides. So I throw my rug over it and it becomes my floor when not in use. Important because the laser cutter can cut a full 60” wide piece of fabric two yards long. It’s basically 5 foot by 6 foot, and I don’t have space in my apartment for a dedicated machine that takes up all that space. But since this doubles as my floor it works great! Also includes a raspberry pi camera on the laser head which serves as a pattern scanner. I really want to finish my video on this thing, I’ve just been busy. But please take a look and considering building it! If you have any questions open a GitHub issue and I will do everything I can to help. I think it’s a great starting point (designed in three weeks) and I’d LOVE for other people to reproduce it and extend the design! The machine has a few hiccups but I use it all the time for my sewing projects and it is SO nice to get all the cutting done repeatably and automatically. You can even scan existing clothes often without disassembly and turn those in to digital patterns!

https://github.com/tlalexander/large_format_laser_cutter


> So the leading hypothesis seems to be that perhaps the SSDs were from the same manufacturing batch and shared some defect.

Really sorry that you had to learn the hard way, but this is unfortunately common knowledge :/ Way back (2004) when I was shadowing-eventually-replacing a mentor that handled infrastructure for a major institution, he gave me a rule I took to heart from then forward: Always diversify. Diversify across manufacturer, diversify across make/model, hell, if it's super important, diversify across _technology stacks_ if you can.

It was policy within our (infrastructure) group that /any/ new server or service must be build-able from at least 2 different sources of components before going live, and for mission critical things, 3 is better. Anything "production" had to be multihomed if it connects to the internet.

Need to build a new storage server service? Get a Supermicro board _and_ a Tyan (or buy an assortment of Dell & IBM), then populate both with an assortment of drives picked randomly across 3 manufacturers, with purchases spread out across time (we used 3months) as well as resellers. Any RAID array with more than 4 drives had to include a hot spare. For even more peace of mind, add a crappy desktop PC with a ton of huge external drives and periodically sync to that.

He also taught me that it's not done until you do a few live "disaster tests" (yanking drives out of fully powered up servers, during heavy IO. Brutally ripping power cables out, quickly plugging it back in, then yanking it out again once you hear the machine doing something, then plug back in...), without giving anyone advance notice. Then, and only then, is a service "done".

I thought "Wow, $MENTOR is really into overkill!!" at the time, but he was right.

I credit his "rules for building infrastructure" for having a zero loss track record when it comes to infra I maintain, my whole life.


Weinberg in one of his consulting books suggested replacing "just" with "have a lot of trouble" (as in, "we'll just add this feature" with "we'll have a lot of trouble adding this feature") and "should" with "isn't" (as in, "that information should be kept here" with "that information isn't kept here"). It's surprisingly effective. I think there was another such magic word or two on his list, but don't remember what they were.

For those who like using other mail clients there is the official Protonmail Bridge[1] (for paid customers). There is also Hydroxide[2] (which I use). I am able to use Apple Mail on mobile, Aerc[3] command line mail client on desktop (MacOS and Linux), and sync with the CardDav instance for contacts.

Understandably, this is not an ideal solution for everyone -- it works awesome for me! Just a PSA for those not aware.

[1] https://proton.me/mail/bridge [2] https://github.com/emersion/hydroxide [3] https://aerc-mail.org/


Wow! Thanks for that comment, I have a Dell U3818DW with a KVM switch and I didn't know you could control it with DDC commands!

So for linux (e.g. fedora):

  dnf install ddcutil
  ddcutil capabilities -d 1 # show the available commands
  ddcutil setvcp 60 0x11    # for example switch to HDMI 1
  # assign a global shortcut key to the `ddcutil setvcp` command you need
And for windows:

  - download the "Dell Display Manager" software from their support site
  - assign a shortcut key in the Dell Display Manager: "Input Manager" tab => "Favourite Input Shortcut Key"
I used the same shortcut (Ctrl-Alt-ScrollLock) for both linux(kde)/windows

You also need privacy.resistFingerprinting.testGranularityMask set to 4 for it to work.

https://old.reddit.com/r/firefox/comments/q9kql8/help_settin...


You can add exemptions to preference: privacy.resistFingerprinting.exemptedDomains

edit: wording


FYI, we've added support for the framework to nixos-hardware. I appreciate any feedback or improvements anyone has! https://github.com/NixOS/nixos-hardware/blob/master/framewor...

In my experience docker-slim[0] is the way to go for creating minimal and secure Docker images.

I wasted a lot of time in the past trying to ship with Alpine base images and statically compiling complicated software. All the performance, compatibility, package availability headaches this brings is not worth it when docker-slim does a better job of removing OS from your images while letting you use any base image you want.

Tradeoff is that you give up image layering to some extent and it might take a while to get dead-file-elimination exactly right if your software loads a lot of files dynamically (you can instruct docker-slim to include certain paths and probe your executable during build).

If docker-slim is not your thing, “distroless” base images [1] are also pretty good. You can do your build with the same distro and then in a multi stage docker image copy the artifacts into distroless base images.

[0] https://github.com/docker-slim/docker-slim

[1] https://github.com/GoogleContainerTools/distroless


Before you go to bed tonight: put a bunch of big spoonfuls of coffee grounds into a French press, add water, and stir. Into the fridge. Then put some oats into a big cup. Pour in milk til they’re “swimming”. Put that in the fridge.

When you wake up, press the coffee grounds out and pour that into a thermos. Put some honey in the big cup of oats and throw a spoon in there. Now you have the best breakfast and coffee to go, and it’s so easy it feels like cheating.


It depends what you are reading and why. Check out “How to Read A Book” by Mortimer Adler. The book is quite old but still extremely relevant. (He’s one of the best philosophers/thinkers I’ve ever read BTW. I suggest “How To Think About The Great Ideas”, but that’s for another topic.)

On the subject of note taking a professor once told me “don’t take notes, make notes”. Note taking is basically writing down what the author (lecturer) says. In college so many people would just blindly copy what the professor wrote on the board. That is note “taking”. Note “making” is adding you’re thoughts: what is the author saying (in my words) and do I agree with the ideas? What would other authors think, are there counter points, supporting examples, etc. Is this point elaborated elsewhere in the book? What terms, words, or concepts need more explanation?

I found this blog (https://fs.blog/how-to-read-a-book/) it has a good summary of Adler’s ideas. For example, on using the margins in a book:

    When you buy a book, you establish a property right in it, just as you do in clothes or furniture when you buy and pay for them. But the act of purchase is actually only the prelude to possession in the case of a book. Full ownership of a book only comes when you have made it a part of yourself, and the best way to make yourself a part of it— which comes to the same thing— is by writing in it.

    Why is marking a book indispensable to reading it? First, it keeps you awake— not merely conscious, but wide awake. Second, reading, if it is active, is thinking, and thinking tends to express itself in words, spoken or written. The person who says he knows what he thinks but cannot express it usually does not know what he thinks. Third, writing your reactions down helps you to remember the thoughts of the author.

    Reading a book should be a conversation between you and the author. Presumably, he knows more about the subject than you do; if not, you probably should not be bothering with his book. But understanding is a two-way operation; the learner has to question himself and question the teacher. He even has to be willing to argue with the teacher, once he understands what the teacher is saying. Marking a book is literally an expression of your differences or your agreements with the author. It is the highest respect you can pay him.

I thought kids could set their own boundaries with tech (like I did), but I no longer believe that's possible. The internet is like a drug and sometimes you need to take drastic measures to keep your kids safe from it.

I got my kid on all Apple devices and set screen time to completely block him out outside of school hours, when unfortunately he is required to have his computer all day. He's never been as respectful, attentive, or creative as he is now, and after an angry adjustment period, I only regret not doing this sooner.


You're lucky, and must have a typical child.

When my oldest child was 2, he snuck an allen wrench in his diaper and disassembled his whole crib. He is atypical with aspergers syndrome.

You "just don't know" how difficult it is for some children to learn self control through reinforcement.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: