Quantcast
Channel: User mwfearnley - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 37 View Live
↧

Comment by mwfearnley on SNMP query the network range for multiple OIDs

It's possible to do something like for ip in 10.{0..255}.{0..255}.{0..255}; do snmpget ....; done, but it will take a long time to scan 16 million IP addresses, particularly if most of them time out.

View Article


Comment by mwfearnley on stat: modification timestamp of a file

Other BSD won't show as Darwin. It might be better to check the version of stat itself. stat --version |& grep -q GNU will be true on GNU and false on BSD (--version will actually return an error...

View Article


Comment by mwfearnley on What is this folder /run/user/1000?

Just to say, $uid doesn't generally store the userid, but according to askubuntu.com/a/468239/37574, $UID does (possibly depending on the shell). So it might be worth using that in the answer instead.

View Article

Comment by mwfearnley on Mark an ext4 filesystem as read-only

If a filesystem has the read-only flag, it should be possible to see it in the filesystem features with something like sudo tune2fs -l /dev/ext4test | grep '^Filesystem features'

View Article

Comment by mwfearnley on How to see list of curl ciphers?

Generating a self-signed cert is as "easy" as openssl req -x509 -subj /CN=example.com -nodes -out cert.pem -keyout key.pem. For some reason the linked answer was deleted, but is at...

View Article


Comment by mwfearnley on How to stop auto mounting of devices in Ubuntu?

Yeah, the GUI option is nice, but if you're willing to run a command-line program anyway (sudo apt install ...), you might as well run a gsettings command instead.

View Article

Comment by mwfearnley on date - Can't Go Back More Than 115 Years or Can't Go...

I suppose the future date problem might either be due to the relative difference or the absolute result. If the latter, can you pin down the exact date that becomes invalid, e.g. date -d '11 Aug 5881588?

View Article

Comment by mwfearnley on How to send Screenshot to STDOUT

Version 1.5 also doesn't seem to work - it just outputs a png file called -.

View Article


Comment by mwfearnley on How to send Screenshot to STDOUT

The ability to use - to save to stdout was added in 1.7, according to github.com/resurrecting-open-source-projects/scrot/commit/…

View Article


Comment by mwfearnley on Merging folders with mv?

If the first -exec can cause the -or to be evaluated if it fails, then I guess this relies either on mkdir -p never failing, or the subsequent mv being harmless if it does?

View Article

Comment by mwfearnley on How to change current copy position or skip over...

Maybe they should revise the note to say something like "this is not necessarily the point from which ddrescue immediately starts working".

View Article

Image may be NSFW.
Clik here to view.

What is the default openSUSE Rescue login?

On booting the Rescue System from an openSUSE DVD, I find myself at a "rescue login" prompt:What are the default login details?

View Article

Answer by mwfearnley for How do I find the offset of an ext4 filesystem?

Based on @derobert's answer, I wrote a program (gist) that will parse an input stream from dd and scan each sector for something that looks like the start of an ext partition.It will work at least as...

View Article


Answer by mwfearnley for Permission denied on mounted devices

I was having "permission denied" errors while trying to read the contents of some files on an NTFS partition - even as root. There were no permissions problems with the folder tree (checked with namei...

View Article

Answer by mwfearnley for How to scroll in a terminal using keyboard?

On FreeBSD, you can use Scroll Lock to toggle screen scrolling mode. Press it once, then use Up/Down, PgUp/PgDown, Home/End to scroll. Press it again to jump back down and resume typing.

View Article


Answer by mwfearnley for Emulate unplugging a network cable with qemu-kvm

Based on the advice at https://lists.gnu.org/archive/html/qemu-discuss/2017-01/msg00103.html, you can plug/unplug a cable in the qemu console using set_link <name> on|off.info network shows you...

View Article

Answer by mwfearnley for Is zswap eligible to reduce swap IO?

At the LSFMM summit in 2013, there was no compression on pages written to the swap device. But it doesn't sound like there are any technical reasons why not, just that it would increase the...

View Article


Answer by mwfearnley for What does aux mean in `ps aux`?

The key to understanding the manpage is not to search for "aux" (which I tried first), but to focus on the section that describes the kinds of parameter ps takes:This version of ps accepts several...

View Article

Answer by mwfearnley for How to mount ufs file system under Debian testing?

According to mount freebsd slice partition under linux, you may need to specify an offset into the partition.partx -l should be able to identify the sector offset of the filesystem, which you'd need to...

View Article

Answer by mwfearnley for speedtest-cli: ValueError: invalid literal for int()...

From this speedtest-cli Pull Request, I gather the speedtest site have changed something in the response their API gives out. Looking at the first commit in the PR, you just need to modify a single...

View Article

Answer by mwfearnley for What is the equivalent of 'update-grub' for RHEL,...

The update-grub script in Ubuntu is actually just a stub for grub-mkconfig, and it can be adapted to other distros without too much pain. Here it is in its entirety:#!/bin/shset -eexec grub-mkconfig -o...

View Article


Why is 'cryptsetup luksFormat' not prompting for a passphrase?

I am expecting cryptsetup to prompt me for a passphrase, but instead it's just trying and failing to open a key file:sudo cryptsetup luksFormat test.img cryptsetup-testWARNING!========This will...

View Article


Answer by mwfearnley for Why is 'cryptsetup luksFormat' not prompting for a...

You are confusing the syntaxes for luksFormat and luksOpen.luksFormat does not open the device, so doesn't take a device name to map to. So if you try to pass one, it will interpret it as a filename...

View Article

Answer by mwfearnley for awk: Built-in FILENAME variable on empty file

Note: parts of this answer are specific to GNU awk, specifically 4.0 and later, which added BEGINFILE/ENDFILEPer-line blockawk '{print "File name: " FILENAME}' myfileThis will print File name: myfile...

View Article

Answer by mwfearnley for How can I filter read only file systems out of df...

Yes, snap's intrusion into the filesystems list can be annoying...You're on the right lines with df -x - as Snapcraft says, all snaps use the read-only Squashfs filesystem, so you can filter them all...

View Article


Answer by mwfearnley for Tab completion errors: bash: cannot create temp file...

I had this issue on a read-only root filesystem.I was able to get tab-completion working for the time being by mounting a temporary filesystem in /tmp (sudo mount -t tmpfs tmpfs /tmp), and reopening...

View Article

Answer by mwfearnley for UUID Of A drive that won't show up in...

I have found that file -s can give the UUID for a partition in a case where blkid will not:sudo file -s /dev/sda1/dev/sda1: Linux rev 1.0 ext2 filesystem data (mounted or unclean),...

View Article

Comment by mwfearnley on Systemctl remove unit from failed list

@Yetti99 Note, it's generally best to encase a wildcard in quotes, otherwise if you have any matching files in the current directory, it will substitute for them instead.

View Article

Answer by mwfearnley for What is the mkdict command and what does it do? (It...

On my system, /usr/sbin/mkdict is a symlink for cracklib-format, which as pointed out in comments, is a simple shell script. It's short enough to post here.#!/bin/sh## This preprocesses a set of word...

View Article



Comment by mwfearnley on Replace an XML attribute's value with the value of a...

Also, it's hard to tell, but the $FLDR is also unquoted, so spaces would also break it.

View Article

Answer by mwfearnley for Replace an XML attribute's value with the value of a...

I don't recommend sed in the general case, but this case is perhaps simple enough for it to handle, we just have to watch out for some hazards:if $FLDR contains " then that will break the XML.If $FLDR...

View Article

Comment by mwfearnley on How do I set time and date from the Internet?

I think the main issue with this question is that it doesn't specify which version of Unix or Linux is being used, and the correct answer is going to depend on that. The accepted answer seems to assume...

View Article

Comment by mwfearnley on Show the year while listing files in the current...

The OP's ls -al probably had the same behaviour (choosing the year or time depending on how far into the future/past it is), only with modified rather than created times.

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 latest articles
Browse All 37 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>