Quantcast
Channel: User mwfearnley - Unix & Linux Stack Exchange
Browsing index pages (56 articles)

Comment by mwfearnley on Why isn't screen on macOS picking up my ~/.terminfo?

Possibly not relevant to you, but I was getting $TERM too long - sorry when accidentally trying to run screen from within itself.

View Article


Comment by mwfearnley on Adding timestamp into log file via cronjob command

Note: make sure you have ts from moreutils and not ts from task-spooler. Some distros might use tsp for the task spooler, but not all.

View Article


Answer by mwfearnley for How to resize the `/run` directory?

As per https://askubuntu.com/a/876610/37574, you can change the size of /run/user/... by setting RuntimeDirectorySize=... in /etc/systemd/logind.conf.It can be set to an exact size (e.g. 15G) or a...

View Article

Answer by mwfearnley for How to check if wpa_supplicant.conf has any syntax...

The check you've come up with can provide an appropriate return code if you grep the output for error lines:#!/bin/bashgrep -q . "$1" &&! wpa_supplicant -c "$1" -iNonexistentInterface | grep...

View Article

Comment by mwfearnley on Can I write comments inside a "normal" diff/patch file?

Well, if a normal diff line can start with either [<>0-9], and a unified diff line can start with [-+ @], then any line starting with any other character couldn't be a valid part of the...

View Article


Comment by mwfearnley on get age of given file

In BSD/macOS (bash or otherwise), you're likely to need stat -f %m -- "$1" instead.

View Article

Comment by mwfearnley on Determine whether a file has no EOL at the end from...

Is there a particular reason to pipe into tail rather than read it directly (tail < $filename rather than tail $filename)? In the latter case, tail only needs to read the end of the file.

View Article

Comment by mwfearnley on How do I go about identifying / using this (exotic?)...

It seems that DB 1.86 is very old now. en.wikipedia.org/wiki/… says it was around at least as far back as 1996.

View Article


Comment by mwfearnley on Using -d with 2 versions of the same domain in Certbot

Thanks. I had the same problem with a CSR - some of the SANs had been added with a comma at the end.

View Article


Comment by mwfearnley on tar: Removing leading `/' from member names

GNU tar allows --transform 's,^/,,' to remove the leading slash if present. Although -P is still needed to remove the warning.

View Article

Comment by mwfearnley on Loop device with 4K sectors

It may be worth noting that in that commit, you could use -b or --logical-blocksize, but it was later changed to -b or --sector-size

View Article

Comment by mwfearnley on Sort based on the third column

Can someone clarify why this was downvoted?

View Article

Comment by mwfearnley on Sort based on the third column

It seems like this repo doesn't exist now, and archive.org doesn't seem to have it. (I didn't downvote though.)

View Article


Comment by mwfearnley on Mount USB drive (FAT32) so all users can write to it

It should be possible to skip the umount by doing -o remount,.... (Also note: I think the umask is just an octal number, so probably any amount of 0's is equivalent.)

View Article

Comment by mwfearnley on Command to print name of SSID to which I am connected

As DuckSecOps mentions, this won't get the full SSID if there's a space in it. You could replace the grep/awk with sed -n 's/.*ssid //p', which will find just the ssid line and print everything after it.

View Article


Comment by mwfearnley on Encrypt a password the same way mysql does

Fun fact: for the string right, both sha1 steps contain a 00 byte, making it a good test to make sure the hashes aren't being null-terminated.

View Article

Comment by mwfearnley on Encrypt a password the same way mysql does

You could do away with the sed and use $NF instead of $0.

View Article


Comment by mwfearnley on Encrypt a password the same way mysql does

bash: printf "$(echo -n "right" | sha1sum | sed 's/ .*$//; s/../\\x&/g')" | sha1sum | sed 's/ .*$//; s/^/*/' | tr a-f A-F

View Article

Comment by mwfearnley on Glob and regex matching

I notice that the table consistently uses ^...$ for the RE. I think it would be reasonable to treat those as implicit. Removing them makes it clearer that the Glob syntax can be used in a substring,...

View Article

Answer by mwfearnley for Porting Linux date parsing to FreeBSD

You can parse a date in a specific format in FreeBSD using:date -j -f "$input_fmt" "$input_date" +"$output_fmt"According to the date manpage:-jDo not try to set the date. This allows you to use the -f...

View Article
Browsing index pages (56 articles)


Latest Images