Friday, July 9, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Check if display is being kept on

Posted: 09 Jul 2021 09:55 AM PDT

I use DPMS (configured with xset) to turn off my display after a fixed period of inactivity. Some applications automatically block this: for example, the display won't turn off while Firefox is playing video. Is it possible to check from the command line whether display auto-off is currently being blocked?

The reason for this is that I would like to configure autosuspend not to activate if the display is being kept on for any reason.

ProxMox OpenVSwitch with Guest pfSense Firewall

Posted: 09 Jul 2021 09:16 AM PDT

Here's what I'm trying to setup:

Proxmox will be top-level main machine that will have 16x ethernet ports.

I want to install pfSense as guest here and make it main gateway, firewall and where VLANs of the rest of the network will be defined.

I will connect 10 separate machines to these ethernet ports on ProxMox server and want to "bridge"? them to pfSense guest including WAN, LAN and other vLANs ProxMox itself will be only manageable and admin interface only accessible through a Vlan that will be assigned to another guest VM running inside ProxMox.

Is this doable? If yes, can someone explain for I can do that? Like how I can do bridging with OVS here?

postfix : list of all email addresses accepted

Posted: 09 Jul 2021 09:23 AM PDT

I would like to know if there is a way, internal to postfix or external (script or other) allowing to know the complete list of all the valid email addresses accepted for reception of mail by a postfix server for its administrator?

Otherwise, apart from manually collecting all these addresses and registering them in the secondary MX (in relay_recipient_maps), how do you do it?

Thanks

CentOS 8 boots to emergency mode after Raid 1 -> 5 upgrade & power outage

Posted: 09 Jul 2021 08:51 AM PDT

Yesterday I upgraded my CentOS 8 server from a

Raid 1, 2 disk setup

to a

Raid 5, 4 disk setup using mdadm

However after the final stage of the upgrade, the -- grow --add phase

and some time after multiple times checking the cat /proc/mdstat for progress

there was a power outage :(

When the power came back on, CentOS 8 wouldn't start anymore except after a long time to emergency mode.

The error given:

md: personality for level 5 is not loaded

failed to boot with md level 5 error

In this emergency mode, I cannot mdadm assemble the Raid as it errors with a wrong raid level issue. has wrong raid level

After a lot of Googling around, I finally created an Ubuntu 21.04 live bootable USB so I could maybe see more info.

Turns out, I finally could mdadm assembly the 4 drives again in the Ubuntu environment after which the raid system itself started to recover and continue the Raid5 process.

Finally after several hours this was done and after mounting the various volumes on the Raid system and seeing that everything was fine and finished, I rebooted.

Same problem..

Then I went into CentOS Rescue mode, which I selected in Grub and there the Raid5 4 disks comes online just fine! very strange

I only see 1 error which is /boot won't mount (can't seem to find if this is normal because of Rescue mode?)

but I can see the volumes as normal and cat /proc/mdstat outputs normal active information.

I don't know how to resolve this as Googling around shows me I might have to do some repair to the boot img, but don't know how to mount /boot in Repair mode and Emergency mode doesn't seem to have anything I can work with.

So basically I have a OS that won't start in normal mode, while the Raid disks seem to work just fine.

I tried manually editing the /etc/mdadm.conf file but that didn't work either on reboot and found out online it's just the assemble point.

Thank you very much for your help!

Nftables not matching TOS value in IP packets

Posted: 09 Jul 2021 09:26 AM PDT

I am attempting to write a rule for nftables which will match all IP packets received on interface eth1 that have a specific TOS value (0x02). My attempt so far:

sudo nft add table raw  sudo nft -- add chain raw prerouting {type filter hook prerouting priority -300\;}  sudo nft add rule ip raw prerouting iifname eth1 ip dscp 2 counter  sudo nft add rule ip raw prerouting iifname eth1 udp dport 41378 counter  

I am sending UDP packets from a seperate computer to the computer running nftables. The code to setup this sending socket, including setting the TOS in those packets:

    if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)      {          perror("socket creation failed");          exit(EXIT_FAILURE);      }        int optval = 2;      setsockopt(sockfd, IPPROTO_IP, IP_TOS, &optval, sizeof(optval)); //Set TOS value          servaddr.sin_family = AF_INET;      servaddr.sin_port = htons(41378);      servaddr.sin_addr.s_addr = inet_addr("192.168.10.100");  

I can see the packets arrive using sudo tcpdump -i eth1 -vv:

14:51:35.153295 IP (tos 0x2,ECT(0), ttl 64, id 7091, offset 0, flags [DF], proto UDP (17), length 50)      192.168.12.10.49089 > ubuntu.41378: [udp sum ok] UDP, length 22  

The raw header of these is as follows:

IP Header      00 E0 4C 00 05 8B 3C 97 0E C7 E1 00 08 00 45 02         ..L...<.......E.      00 31 7E 52                                             .1~R  

Decoded it shows:

IP Header     |-IP Version        : 4     |-IP Header Length  : 5 DWORDS or 20 Bytes     |-Type Of Service   : 2     |-IP Total Length   : 49  Bytes(Size of Packet)     |-Identification    : 32338     |-TTL      : 64     |-Protocol : 17     |-Checksum : 8873     |-Source IP        : 192.168.12.10     |-Destination IP   : 192.168.12.100  

The problem is that when I run sudo nft list ruleset I see:

table ip raw {          chain prerouting {                  type filter hook prerouting priority raw; policy accept;                  iifname "eth1" ip dscp 0x02 counter packets 0 bytes 0                  iifname "eth1" udp dport 41378 counter packets 8 bytes 392          }  }  

The rule matching based on udp destination port is working well, but the rule matching on dscp of 0x02 is not.

How can I make a rule to match on a TOS of 0x02?

So far I have tried other values of TOS, in-case 0x02 was special. I tried decimal 8, 16, 24, and 32. Each time I see the incoming packet with the TOS value I am setting, but the nfttables rule never counts, which I believe means it never matched.

Handy nftables guide: https://wiki.nftables.org/wiki-nftables/index.php/Quick_reference-nftables_in_10_minutes

A handy reference for DSCP values to names: https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus1000/sw/4_0/qos/configuration/guide/nexus1000v_qos/qos_6dscp_val.pdf

"cuda-runtime-11-3: Depends: cuda-drivers but it is not going to be installed" - want to install anyway

Posted: 09 Jul 2021 08:16 AM PDT

Background

I want to build (not run) a program using CUDA 11.3, on an Ubuntu 20.04 machine (a Travis CI machine actually). To do this, I want to install, among other things, the cuda-runtime-11-3 package (which becomes available when you add an NVIDIA apt repository).

Now, this works for me with CUDA 11.4:

CUDA_APT="11.4"  sudo apt install -y cuda-runtime-${CUDA_APT} cuda-toolkit-${CUDA_APT} cuda-compiler-${CUDA_APT};  

but with 11.3, I get:

The following packages have unmet dependencies:     cuda-runtime-11-3 : Depends: cuda-drivers (>= 465.19.01) but it is not going to be installed    E: Unable to correct problems, you have held broken packages.  

Actual question

Can I force an installation of the package despite the dependencies not being installed?

Alternatively, if there's another solution to this conundrum, that would be a good answer too.

SLE: installing certbot and its NGINX plugin

Posted: 09 Jul 2021 08:12 AM PDT

openSUSE Tumbleweed

Installing certbot and its NGINX plugin on openSUSE Tumbleweed was just straightforward:

zypper addrepo https://download.opensuse.org/repositories/home:ecsos:server/openSUSE_Tumbleweed/home:ecsos:server.repo  zypper refresh  zypper install certbot  

Then, install python36-certbot-nginx and finally run:

sudo certbot --nginx  

SLE 15 SP2

But I'm trying to do the same on SLE 15 SP2. I tried:

  • openSUSE backports repo
  • openSUSE Leap 15.2 repos
  • Instructions here
  • Couldn't figure out how to use this by command-line
  • ...

What am I missing? Is there a convenient way to install certbot and its NGINX plugin by the command line on SLE 15 SP2?

Numeric functions are not working for the applications I use but it works for the system

Posted: 09 Jul 2021 08:20 AM PDT

I'm a game developer, the framework I'm using has extra functions like showing information of an object on the screen, like a tree view, clicking CTRL-F1 opens this container that shows such information. I tested this on Windows and it worked perfectly, macOS too, but on my operating system which is Manjaro this function doesn't work, only another extra function is available.

These here are the functions I need and which keys they are linked to: https://github.com/ppy/osu-framework/wiki/Framework-Key-Bindings

I opened an issue in the repository, and the framework creator said I needed to find out what's consuming these keys

There is no way to change these key bindings. You will need to figure what is eating them on your system. - peppy, issue link

I can't figure out what's going on, I don't know where the key signals are going and why they aren't being sent to the game.

Here are the specs for my operating system:

Operating System: Manjaro Linux x86_64  Host: Inspiron 5548 A04  Resolution: 1920x1080  Desktop Enviroment: KDE Plasma 5.21.5  Window Manager: kwin  CPU: Intel i7-5500U (4) @ 3Ghz  GPU: AMD ATI Radeon R7 M260/M265 / M340/M360 / M440/M445 / 530/535 / 620/625 Mobile   GPU: Intel HD Graphics 5500  

Could someone help me in this problem?

How can I get the current time as an LDAP timestamp in Unix?

Posted: 09 Jul 2021 08:08 AM PDT

I want to be able to generate an ActiveDirectory LDAP timestamp in Unix for some tests I need to run. Active Directory stores date/time values as the number of 100-nanosecond intervals that have elapsed since the 0 hour on January 1, 1601 until the date/time that is being stored.

How can I do I get the current time in this format?

Minimal APT Update

Posted: 09 Jul 2021 10:02 AM PDT

Is there a way to only update the package lists without running all those scripts afterwards? Maybe even "by hand"?

My use case:

  • I am trying to install a package via apt and chroot.
  • Unfortunately the package version seems to be outdated in my package list, I get an 404.
  • Therefore I would like to run apt update beforehand.
  • Unfortunately apt update takes forever in chroot - at least in my configuration. It gets stuck at running some scripts afterwards, like updating the MOTD.

For loop over lines -- how to set IFS only for one `for` statement?

Posted: 09 Jul 2021 09:36 AM PDT

Here is an example of behavior I want to achieve:

Suppose I have a list of lines, each line containing space separated values:

lines='John Smith  James Johnson'  

And I want to loop over lines echoing name or surname only as user asked by prompt, so I change IFS globally:

oIFS=$IFS  IFS='  '  for line in $lines; do      IFS=$oIFS      read name surname <<< $line      read -p "Do you want to echo name? surname otherwise "      if [[ $REPLY == "y" ]]; then          echo $name      else          echo $surname      fi  done  

This works, and yet this approach doesn't look sane for me:

  1. We change IFS and may forget to restore it
  2. We restore IFS every single iteration of the loop

I discovered that while IFS=... can be used here like that:

while IFS='  ' read line ; do      echo $line      read name surname <<< $line      read -p "Do you want to echo name? surname otherwise "      if [[ $REPLY == "y" ]]; then          echo $name      else          echo $surname      fi  done <<< "$lines"  

But this is not an option because read -p prompt gets corrupted by continuous input stream

A solution would be IFS set only for one for statement like this:

IFS='  ' for line in $lines; do      ...  done  

but bash disallows that.

How to get apropos to show only executable programs/shell commands?

Posted: 09 Jul 2021 08:44 AM PDT

Most of the times when I use apropos I don't care about system calls, library calls etc — I'm just trying to find a command I forgot the name of. Is there a way to trim down the output of apropos to show only executables and commands (section 1 of the manual) and filter out everything else?

I need to use sed in Linux to find a portion of a line in XML and update a value in it?

Posted: 09 Jul 2021 08:52 AM PDT

I have a requirement to update a variable value in XML with a fixed value once there is a partial match in XML using sed on Linux.

Example:

Input value:

<Table tableName="Data" primaryKey="PGPU_ID=1234" DBaction="A" version="14.1,20.4,4.30,4.40,5.00,5.30,5.40,5.41,6.00,6.01,6.02,6.03,6.04">  

The requirement is to update the version value with only 6.02 whenever "6.02" is there in version value. So, output would be like:

<Table tableName="Data" primaryKey="PGPU_ID=1234" DBaction="A" version="6.02">  

Note: tableName="Data" is fixed value but PGPU_ID, DBaction and version can be different. So whenever tablename ="Data" and version is 6.02, then the sed command should replace the version with only 6.02 keeping other values exactly the same.

nftables whitelisting docker

Posted: 09 Jul 2021 09:21 AM PDT

I have two docker containers running on my machine where a very restrictive nftables configuration is active. I'd like to keep it that way but whitelist access to the docker containers from outside.

The containers open ports 80 and 6200. The docker service is started with iptables disabled.

Below is the current firewall configuration, including my attempt. icmp, ssh, http and https are already open. For docker, only the http port 80 and the application specific port 6200 are needed. I tried to allow access to docker only from 192.168.0.0/16 to be as restrictive as possible.

 table inet filter {      chain input {              type filter hook input priority 0; policy drop;              iif lo accept              iif eno2 icmp type echo-request accept              iif eno2 ip 192.168.0.0/16 tcp dport 22 accept              iif eno2 ip 192.168.0.0/16 tcp dport { http, https, 6200 } accept      }        chain forward {              type filter hook forward priority 0; policy drop;      }        chain output {              type filter hook output priority 0; policy drop;      }  }  

I tried adding additional rules for thr docker0 interface, but without any success. I suspect I have to modify chain forward?

how to convert output.mp3 to mp4 with ffmpeg?

Posted: 09 Jul 2021 09:05 AM PDT

i use this command to merge many mp3 files in a directory:

ffmpeg -f concat -safe 0 -i <(for f in ./*.mp3; do echo "file '$PWD/$f'"; done) -c copy ./output.mp3  

and now i want to convert output.mp3 to mp4 format. i want that my TV receiver read that mp4. what can i do?

Unwanted automatically started tmpfs and lib/systemd/systemd --user process for not logged in user

Posted: 09 Jul 2021 09:55 AM PDT

Debian 11 Bullseye pc, systemd, no display manager, startx is used to start X, multiple users.

When I login with a user, let's say auser-UID 1000, I see this on process list:

USER     PID %CPU %MEM    VSZ   RSS TTY     STAT START   TIME COMMAND  foo      550  0.0  0.1  15280  8928 ?       Ss   16:18   0:00 /lib/systemd/systemd --user  foo      554  0.0  0.0 166520  2732 ?       S    16:18   0:00 (sd-pam)  auser    657  0.0  0.1  15280  8928 ?       Ss   16:18   0:00 /lib/systemd/systemd --user  auser    658  0.0  0.0 166520  2732 ?       S    16:18   0:00 (sd-pam)  

Apparently they are related to these mounts (foo-UID 1001):
cropped mount command result:

tmpfs on /run/user/1001 type tmpfs (rw,nosuid,nodev,relatime,size=791080k,nr_inodes=197770,mode=700,uid=1001,gid=1001)  tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=791080k,nr_inodes=197770,mode=700,uid=1000,gid=1000)  

That's prior to starting X, very few processes, nothing in my knowledge is started automatically by foo which is not logged in.

How can I locate what starts these 2 foo processes? It happens automatically at boot, there is an entry in journal:

systemd[542]: pam_unix(systemd-user:session): session opened for user foo(uid=1001) by (uid=0)  

There are also other local users on the system, but no tmpfs is started automatically for them.

Switch between light and dark mode in Vim and Tmux with one command?

Posted: 09 Jul 2021 08:27 AM PDT

I want to be able to change my background color mode throughout my tmux session with one command... I have a shell function bgl and bgd to set the background/colorschemes to be light and dark, and similar vim keybindings.

When I have a bunch of open panes, it becomes tedious to switch each pane to the different color mode.

Is it possible to write a script using tmux send-keys to send the appropriate commands to each pane (like if running vim, we'd have to do escape then <leader>bgd<enter>)? If so... (dear god) ...could you please help me with some direction towards that?

Error when using Makefile..sed

Posted: 09 Jul 2021 08:11 AM PDT

An app is trying to configure with

sudo make configure  (cd /opt/ioapi-3.2/ioapi   ;  sed -e 's|IOAPI_BASE|/opt/ioapi-3.2|' -e 's|LIBINSTALL||' -e 's|BININSTALL||' -e 's|IOAPI_DEFS||' -e 's|NCFLIBS|-L/opt/netcdf/lib -lnetcdff -L/opt/netcdf/lib -lnetcdf|' -e 's|MAKEINCLUDE|include /opt/ioapi-3.2/ioapi/Makeinclude|' -e 's|PVMINCLUDE|include  |' < Makefile..sed > Makefile )  /bin/sh: Makefile..sed: No such file or directory  make: *** [Makefile:211: configure] Error 1  

I don't understand what the last part of the command is supposed to do and therefore why it's generating the error.

The output from make -n configure is:

(cd /home/centos/ioapi-3.2/ioapi   ;  sed -e 's|IOAPI_BASE|/home/centos/ioapi-3.2|' -e 's|LIBINSTALL||' -e 's|BININSTALL||' -e 's|IOAPI_DEFS||' -e 's|NCFLIBS|-lnetcdff -lnetcdf|' -e 's|MAKEINCLUDE|include /home/centos/ioapi-3.2/ioapi/Makeinclude|' -e 's|PVMINCLUDE|include  |' < Makefile..sed > Makefile )  (cd /home/centos/ioapi-3.2/m3tools ;  sed -e 's|IOAPI_BASE|/home/centos/ioapi-3.2|' -e 's|LIBINSTALL||' -e 's|BININSTALL||' -e 's|IOAPI_DEFS||' -e 's|NCFLIBS|-lnetcdff -lnetcdf|' -e 's|MAKEINCLUDE|include /home/centos/ioapi-3.2/ioapi/Makeinclude|' -e 's|PVMINCLUDE|include  |' < Makefile..sed > Makefile )  

Emulate x86 on rasbian

Posted: 09 Jul 2021 08:58 AM PDT

I want to run a Starbound server on my Raspberry Pi running rasbian.
The server is built to run on an x86 architecture, so my goal is to emulate an x86 architecture to run the server.

Edit: box86 does not run 64-bit x86 binary

To do so, I tried using box86.
It allowed to run a x86 program (steamcmd the program that allowed me to download the server). But running the server resulted in

bash: ./program: cannot execute binary file: Exec format error  

It's strange because box86 should emulate x86 program when encountered.

I tried using qemu to emulate the server.

sudo apt install qemu-user qemu-system qemu  sudo qemu-x86_64 starbound_server  

Resulting in

/lib64/ld-linux-x86-64.so.2: No such file or directory  

It seems like some dynamic library are missing.
I thought that those libraries would be shipped with qemu, so I tried to use the -L argument to specify a different ld- file. But it seems like the program only look at the /lib64 folder.
My last try was to create this folder using lib files from an x86 system. But this results in

ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.  

To fix this problem, people suggest to change /etc/ld.so.preload to remove the reference to libarmmem, but this file does not exist on the rasbian system.

I'd like to know if there is a better way to emulate the x86 program?
If there is none, where to find the appropriate libraries to fill the /lib64 folder?

Here are some infos I got with readelf.

machine: Advanced Micro Devices X86-64  type: EXEC  class: ELF64  

Shared libraries

[libpthread.so.0]  [libdl.so.2]  librt.so.1]  [libm.so.6]  [libc.so.6]  [ld-linux-x86-64.so.2]  

No mkinitcpio preset present

Posted: 09 Jul 2021 08:48 AM PDT

My laptop lost battery during an update, so the linux kernel got truncated. After arch-chrooting into it and reinstalling linux, it's OK, but /boot/initramfs-linux.img (and the fallback) are empty. Also, /etc/mkinitcpio.d/linux.preset is empty. How can I fix this, and how can I generate a preset?

ls /etc/mkinitcpio.d/ returns nothing

Bridge network stop working with kvm/qemu

Posted: 09 Jul 2021 08:03 AM PDT

2-3 months ago I followed this article https://brooks.sh/2017/12/22/configuring-kvm-on-clear-linux/ to setup bridge network for kvm/qemu guest ubuntu. My Host os is ClearLinux. However the guest OS network stopped working 1 week ago, couldn't get IP address from dhcp. I couldn't recall I did anything special other than follow ClearLinux update.

My case is quite similar to this one Configuring a bridge interface with systemd-networkd but the solution there doesn't suite me.

My configs

/etc/systemd/network/br0.netdev

[NetDev]  Name=br0  Kind=bridge  

/etc/systemd/network/br0.network

[Match]  Name=br0    [Network]  DHCP=yes  

/etc/systemd/network/80-dhcp.network

[Match]  Name=enp12s0    [Network]  Bridge=br0  

/etc/sysctl.d/90-bridge.conf

net.bridge.bridge-nf-call-arptables = 0  net.bridge.bridge-nf-call-ip6tables = 0  net.bridge.bridge-nf-call-iptables = 0  

$ brctl show

bridge name bridge id       STP enabled interfaces  br0     8000.fedc02dff363   no      enp12s0  

networkctl

IDX LINK             TYPE               OPERATIONAL SETUP         1 lo               loopback           carrier     unmanaged     2 enp12s0          ether              degraded    configured    3 br0              bridge             routable    configured    3 links listed.  

$ systemctl status systemd-networkd

● systemd-networkd.service - Network Service     Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: disabled)     Active: active (running) since Sun 2019-01-27 17:30:17 AEDT; 19min ago       Docs: man:systemd-networkd.service(8)   Main PID: 504 (systemd-network)     Status: "Processing requests..."      Tasks: 1 (limit: 4915)     Memory: 976.0K     CGroup: /system.slice/systemd-networkd.service             └─504 /usr/lib/systemd/systemd-networkd    Jan 27 17:30:18 clr systemd-networkd[504]: enp12s0: Gained carrier  Jan 27 17:30:18 clr systemd-networkd[504]: enp12s0: Configured  Jan 27 17:30:18 clr systemd-networkd[504]: br0: Gained carrier  Jan 27 17:30:19 clr systemd-networkd[504]: enp12s0: Gained IPv6LL  Jan 27 17:30:20 clr systemd-networkd[504]: br0: Gained IPv6LL  Jan 27 17:30:21 clr systemd-networkd[504]: br0: DHCPv4 address 192.168.2.107/24 via 192.168.2.1  Jan 27 17:30:32 clr systemd-networkd[504]: br0: Configured  Jan 27 17:31:06 clr systemd-networkd[504]: vnet0: Gained carrier  Jan 27 17:31:07 clr systemd-networkd[504]: vnet0: Gained IPv6LL  Jan 27 17:32:17 clr systemd-networkd[504]: vnet0: Lost carrier  

in my vm.xml, the network interface part is

<interface type='bridge'>    <mac address='00:16:3e:11:22:33'/>    <source bridge='br0'/>    <model type='virtio'/>    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>  </interface>  

on host ip link show, result is

$ ip link show  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00  2: enp12s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP mode DEFAULT group default qlen 1000      link/ether 40:8d:5c:11:22:33 brd ff:ff:ff:ff:ff:ff  3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000      link/ether fe:dc:02:df:f3:63 brd ff:ff:ff:ff:ff:ff  5: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq master br0 state UNKNOWN mode DEFAULT group default qlen 1000      link/ether fe:16:3e:04:22:5b brd ff:ff:ff:ff:ff:ff  

in the guest os, ethernet interface is en3, link status is also "BROADCAST,MULTICAST,UP,LOWER_UP".

tmux: is it possible to dim the inactive window and on the same time have transparent background?

Posted: 09 Jul 2021 10:01 AM PDT

is it possible to dim the inactive tmux panes and also still have transparent background in the terminal?

the part of the tmux.conf which dims the inactive looks like that

## FROM https://stackoverflow.com/questions/25532773/change-background-color-of-active-or-inactive-pane-in-tmux  #set inactive/active window styles  set -g window-style 'fg=colour247,bg=colour236'  set -g window-active-style 'fg=colour250,bg=black'    # set the pane border colors   set -g pane-border-fg colour235  set -g pane-border-bg colour238  set -g pane-active-border-fg colour236  set -g pane-active-border-bg colour250  

But with this setting I lost the terminal tranparency.

I am using gnome-terminal

ps output with iso date format?

Posted: 09 Jul 2021 09:41 AM PDT

I'd like to sort this output by lstart (start of process):

ps -eo lstart,pid,cmd   

Is there a way to output lstart in ISO format like YYYY-MM-DD HH:MM:SS?

But sorting alone does not solve it. I really would like to have ISO date format.

Does archiving files reduces number of inode

Posted: 09 Jul 2021 09:13 AM PDT

I read a couple of articles about Linux inode and understand that each file created always have a corresponding inode number. Since one of our servers is using ext4 there is no way to increase the inode to an already running production server.

There are two solutions we can do one is to delete older files and the other is to transfer older files to another server and archive it. My question now is if I archive and compress the files and then move it to another server. On the archive server how many inode number will be assigned to the compressed file I just transferred?

Systemd backed tmpfs | How to specify /tmp size manually

Posted: 09 Jul 2021 07:48 AM PDT

I mount /tmp on tmpfs using:

sudo systemctl enable tmp.mount  sudo systemctl start tmp.mount  

But this way /tmp takes up all the free RAM:

$ df -h /tmp  Filesystem      Size  Used Avail Use% Mounted on  tmpfs           3.9G   12K  3.9G   1% /tmp  $  

How do I tell systemd tmp.mount to use only 1G? I know I can alternatively not use systemd and manually add an entry to /etc/fstab and specify the size there. But I don't want to do that. I want to use systemd backed tmpfs.

Is space allowed between #! and /bin/bash in shebang?

Posted: 09 Jul 2021 08:05 AM PDT

In a shebang, is a space or more allowed between #! and the interpreter?

For example, #! /bin/bash. It seems work, but some said that it is incorrect.

named-checkzone fails reverse zone file with NS has no address records (A or AAAA)

Posted: 09 Jul 2021 08:10 AM PDT

I'm setting up a private DNS server using bind9 on raspian. I'm receiving this error on my reverse zone file:

root@dns:/etc/bind# named-checkzone dthacker.org db.dthacker.org.inv      zone dthacker.org/IN: NS 'dns.dthacker.org' has no address records (A or          AAAA)  

This is my reverse zone file:

$TTL    604800  @       IN      SOA        dns.dthacker.org. root.dthacker.org. (                          2015052003     ; Serial (NOTE: Needs to increment every time you restart BIND)                          3600           ; Refresh [1h]                          600            ; Retry   [10m]                          86400          ; Expire  [1d]                          600            ; Negative Cache TTL [1h]                          )            IN       NS      dns.dthacker.org.  30.1    IN      PTR      dns.dthacker.org.    61.1    IN      PTR      vhost.dthacker.org.  

The forward file is passing without errors. I can't see the error in this one.

Simulate Initial Login of user without using sudo

Posted: 09 Jul 2021 09:04 AM PDT

I'm writing a script to interface 2 third-party programs. (Datadog and AWS)

The data mining script uses sudo -u to run my script.

The script that I need to retrieve data from will segfault if initial login is not simulated.

The data mining script does not have permission to sudo.

I can reproduce the error like this:

[me] ~$ sudo -u dd-agent aws  [me] ~$ echo $?  139  

Of course, if I do a sudo -iu and run the command, it works just fine.

Is it possible to simulate initial login without going through sudo?

No comments:

Post a Comment