Unix & Linux Stack Exchange Community Digest

Top new questions this week:

UTF-8 characters in POSIX shell script *comments* - anything against it?

I would like to include a couple of non-ASCII characters in my POSIX shell script comments. Note this is in no way a duplicate of e.g. "Which character encodings are supported by posix?" as ...

shell-script posix unicode character-encoding  
user avatar asked by Vlastimil Burián Score of 11
user avatar answered by Stephen Kitt Score of 23

Probably a nit: "openssl x509" displays the serial number sometimes as octet string, sometimes as integer

I have noticed that openssl x509 -in $FILE -text sometimes displays the serial number of an X.509 certificate (a positive integer of up to 20 byte, thus most significant bit at 0) sometimes as an &...

user avatar asked by David Tonhofer Score of 10
user avatar answered by Gilles 'SO- stop being evil' Score of 12

How can UserA programmatically replace a text string within a file they own that's located in /etc?

A non-root linux user owns a text file that's located in /etc, where the non-root linux user does not have permission to create files. The non-root linux user can edit the file manually via vi without ...

linux bash sed perl  
user avatar asked by Tortoise Pirate Score of 4
user avatar answered by waltinator Score of 7

select() / poll() timeout stretches on Linux

Whilst writing this answer to another Q&A here, I noticed that the timing in the zsh solution that uses select() to sleep for a given number of centiseconds was off by an amount larger than what I ...

linux clock  
user avatar asked by Stéphane Chazelas Score of 4
user avatar answered by Stephen Kitt Score of 6

RAID5 - Mark a disk faulty during reshape

Context I have a software RAID5 array (mdadm) on 3 disks. Last week, one disk started to get reading issue: # dmesg ata3.00: exception Emask 0x0 SAct 0x30000001 SErr 0x0 action 0x0 ata3.00: irq_stat ...

linux mdadm software-raid raid5  
user avatar asked by BiBzz Score of 4
user avatar answered by frostschutz Score of 3

Convention of parameter naming - undocumented options

GNU has long pushed for a combination of short options (-h) and long options (--help), which goes a long way to clearing up the syntactical mess of commands like tar and dd, with their legacy syntax ...

gnu parameter syntax  
user avatar asked by Popup Score of 3
user avatar answered by Stéphane Chazelas Score of 6

giving variables a default value in a spec file

I have a spec (myspecfile.spec) file that looks similar to Name: package-%{myname} Version: %{myversion} Release: %{myrelease} License: gpl2 Summary: this is my package BuildArch: noarch %...

rhel rpm rpmbuild rpm-spec  
user avatar asked by basil Score of 3
user avatar answered by Stephen Harris Score of 5

Greatest hits from previous weeks:

How do you empty the buffers and cache on a Linux system?

Prior to doing some benchmarking work how would one free up the memory (RAM) that the Linux Kernel is consuming for its buffers and cache? Note that this is mostly useful for benchmarking. Emptying ...

linux kernel performance cache ram  
user avatar asked by slm Score of 400
user avatar answered by slm Score of 599

How to switch between users on one terminal?

I'd like to log in as a different user without logging out of the current one (on the same terminal). How do I do that?

login users  
user avatar asked by tshepang Score of 740
user avatar answered by Pratt Score of 878

How does reverse SSH tunneling work?

As I understand this, firewalls (assuming default settings) deny all incoming traffic that has no prior corresponding outgoing traffic. Based on Reversing an ssh connection and SSH Tunneling Made ...

ssh networking firewall ssh-tunneling remote-management  
user avatar asked by Ali Score of 490
user avatar answered by ghoti Score of 558

How do I change the extension of multiple files?

I would like to change a file extension from *.txt to *.text. I tried using the basename command, but I'm having trouble changing more than one file. Here's my code: files=`ls -1 *.txt` for x in $...

bash shell-script rename  
user avatar asked by afbr1201 Score of 450
user avatar answered by jasonwryan Score of 551

Connecting to wifi network through command line

I am trying to connect to my WEP network just using the command-line (Linux). I run: sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits' Then I try to obtain an ...

networking command-line wifi  
user avatar asked by Jayson Condor Score of 106
user avatar answered by Danijel-James W Score of 110

How can I get my external IP address in a shell script?

I need to find my external IP address from a shell script. At the moment I use this function: myip () { lwp-request -o text checkip.dyndns.org | awk '{ print $NF }' } But it relies on perl-libwww,...

linux shell-script ip  
user avatar asked by Eugene Yarmash Score of 347
user avatar answered by Timo Tijhof Score of 563

Execute shell commands in Python

I'm currently studying penetration testing and Python programming. I just want to know how I would go about executing a Linux command in Python. The commands I want to execute are: echo 1 > /proc/...

user avatar asked by Xanmashi Score of 93

Can you answer these questions?

Select files in ranger using ranger

I am a bit confused about using regex in ranger (Arch Linux). I have a folder of files that look like this: 'sometexthere - I. - sometexthere' 'sometexthere - II. - sometexthere' 'sometexthere - III. -...

regular-expression ranger  
user avatar asked by mor3dr3ad Score of 1
user avatar answered by mor3dr3ad Score of 0

xrandr not changing to propper resolution

I am trying to use an vga monitor with a 1024x720 resolution, however, xrandr is not detecting that resolution, nor dos it show other resolution options for it. Its weird because when doing the live ...

xrandr monitors resolution lubuntu  
user avatar asked by kris Score of 1

USB device not detected upon quest when I usb passthrough using qemu

I run an Ubuntu Iso as: $/bin/bash MEM_SIZE=4096 qemu-system-x86_64 \ -accel kvm \ -cpu host \ -m ${MEM_SIZE} \ -M q35 \ -bios /usr/share/ovmf/OVMF.fd \ -device qemu-xhci \ -usb -device usb-host,...

usb qemu  
user avatar asked by Dimitrios Desyllas Score of 1
You're receiving this message because you subscribed to the Unix & Linux community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 14 Wall Street, 20th Floor, New York, NY 10005