humbled

u/humbled


r/linuxquestions•

Both of these commands find the current logged-in user, despite how they may have su'd or sudo'd to different accounts.

Variant one:

who am i | awk '{print $1}'

Variant two:

getent passwd $(</proc/self/loginuid) | awk -F: '{print $1}'

getent is part of glibc (uclibc also provides it); who is part of coreutils. AFAICT BusyBox provides whoami but not who. The who variant is short, whereas the getent is more complicated. I know getent works even with NIS; I'm unsure about who.

I personally lean to #2: it seems to be more portable.

Edit: eliminate redundant/useless 'cat'.

Edit: Hijinks! On one of my boxes, /proc/PID/loginuid returns a junk value:

$ u
018

r/audiophile•

So... I was chatting with a friend who is into psychoacoustics. He mentioned that the ~5 kHz range is generally very grating/bad sounding to the human ear. It probably stems from the typical vocal range of humans (i.e. it's on the upper side; shrill, screechy).

It just so happens that I have a software EQ that has a 5 kHz band, so I dropped it to -3 dB. I tried dropping it more, but it turns out that this shrill frequency is kinda important to percussion, among other instruments. (Or, for fun, try isolating 5 kHz.)

The experiment is just to copy that EQ - zero all bands and drop 5 kHz by 3 dB. Report back whether you think it sucks or makes an improvement (and please specify songs, sounds,

911

r/vim•

This is failing for me and I expected it to work. Let's say I have a file full of data like this:

absolute_length_data:variable_length_data

Many, many lines of it. My mission: create line pairs of absolute length data and variable length data. It's not a clear-cut separator character; imagine that the colon separator can appear 0 or n times in the absolute length data, and it can also appear 0 or n times in the variable length data.

I had hoped that I could Ctrl-v and then find the absolute length separator, move down to block highlight all the lines I want to separate, and then A<CR><Esc> to break the lines up. But it only seems to insert on the first line of the visu

95

r/debian•

On my Debian sid installation, when I do an update, the mirror I'm using supplies pdiffs - which I assume are differences from the master repository list. The thing is, establishing a connection and downloading each file is quite latent (I'm using my closest mirror - already checked).

Similar to putting icons into a single PNG and then using offsets in CSS to prevent multiple file downloads, might it be a good idea to figure out a way to compute differences? I.e. I tell the server via a header that I have package list <timestamp>, it checks to see if it already computed diffs between now and <timestamp>, and either computes and caches the list into a single pdiff or directs m

00

r/boardgames•

Recently, I was faced with a situation where a character became completely blocked. Here is a diagram of it, where the red blocks were top: the police barrier; bottom: a lamp post; middle: a construction site.

The rules state that when a character activates, she must move - movement is 1 through 3 spaces. However, this situation came up and the rule book's FAQ didn't have a ready answer than I could see.

Checking my assumptions:

  1. Characters that drop tiles can drop them anywhere on the board.
  2. Lamps cannot be adjacent to lamps, metros cannot be adjacent to metros, but there are no adjacency rules for construction sites.

Or did I perhaps miss a rule

44

r/ketoadapted•

Sorry for the crappy link, but you guys probably don't want to wait months for this to be on TED's main site. I use an adblocker, I hope this isn't a catastrophe for those of you who surf without one.

http://curezone.com/forums/fm.asp?i=2062182#i

Fast-forward to 1:12 or thereabouts to get right to it.

If anyone has a better link, I'll switch it out.

20