Monday, June 21, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Why is `root=PARTUUID=....` case sensitive? Why does it pause but still work if the wrong case is used?

Posted: 21 Jun 2021 10:20 AM PDT

I've noticed recently that when attempting to boot the Linux kernel (5.8.0-55-generic in a standard Ubuntu 20.04 distribution), if I specify the root drive using root=PARTUUID=..... and give the ext4 partition UUID in upper case, then the kernel boots, but hangs for 30s during boot (as shown in these lines from /var/log/dmesg):

[    3.087836] kernel: ...  [   32.329915] kernel: EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null)  [   32.498137] systemd[1]: Inserted module 'autofs4'  

If I specify the exact same UUID in lower case, there is no hang:

[    2.875182] kernel: ...  [    2.882524] systemd[1]: Inserted module 'autofs4'  

The upper case version of the UUID is being used, however (not e.g. overridden by something else): if I put in wrong a digit, then after the 30s hang the kernel complains that it cannot find the root file system, as expected.

Can anyone help to explain this? It seems at least that it should not work at all, if the case matters, not that it should work after a 30s delay.

Bash: Pass user input to program from file

Posted: 21 Jun 2021 10:05 AM PDT

i have a bash script that during it's execution wants some input form the user (let's say with the read function). Now I want to automate this and instead of user input, pass contents of a file to the program. Can someone tell me how to achieve this? Piping doesn't seem to work.

some APT packages are not showing up in Debian Buster after FGLRX install. how do I fix this?

Posted: 21 Jun 2021 10:02 AM PDT

Hello fellow Debian Users,

I recently purchased a Dell Optiplex 790 and put an ATI Saphire card in it. Needing drivers to fix screen discoloration upon display size change, I added the FGLRX proprietary driver. Now I needed to setup some applications like OBS studio and I can't seem to find them in Synaptic. I tried downloading the deb files manually to install but the dependencies conflict with core packages. I want to get synaptic back to having full main Debian repository packages. How do I do that?

to match the case insensitive pattern in if condition

Posted: 21 Jun 2021 10:20 AM PDT

There could be below 2 cases in a file: a.txt:

case 1:

V1=last  #case insensitive  V2=Last  #case insensitive  

case 2:

V1=last     #case insensitive  V2=LastNum  #case insensitive  

I need to check if both V1 and V2 should not be same at any given time. V1 and V2 could be assigned any numbers as well.

I'm using below code , but it's failing at the time when V2 is assigned : LastNum

if [[ ( "${V1}" =~ [Ll][Aa][Ss][Tt] && "${V2}" =~ [Ll][Aa][Ss][Tt]$ ) || ( "${V1}" == "${V2}" ) ]];then    echo "V1 and V2 are same"  else    echo "Not Same"  fi  

Any help is most welcome! Thanks in advance!

How are directory structures cached in Sway?

Posted: 21 Jun 2021 09:22 AM PDT

I am getting weird inconsistencies in Arch/Sway with regards to the file system.

For example, earlier this morning I created a directory in my home. This afternoon I was using Google Chrome and wanted to save a PDF from the web and using the Save As... dialog from Chrome, I went to navigate to the directory I had created (via the command line). However the directory was not there. It was amost as though Chrome had cached the directory structure from yesterday or something.

So, this raises the question, how exactly is the Chrome dialog getting its directory information and why is this not matching the real directory structure? Note that the problem seems to affect other Sway applications, not just Chrome. Also, note that most applications in Sway are not actually native Wayland, but use a GTK (?) compatibility layer.

Remove log files automatically after 30 days of creation

Posted: 21 Jun 2021 09:13 AM PDT

I am new to linux and wondering if someone can help me. I have a RADIUS server that has multiple directories in /var/log/freeradius/radacct folder. in each directory after radacct there are log files that start with date detail- and then the date they were created(so for example detail-20210515)

I am trying to remove these files after 30 days of creation. I know cronjob can do this but I am new to linux and just need a bit of help.

how does the wayland compositor work, if clients "draw directly into the framebuffer"?

Posted: 21 Jun 2021 08:47 AM PDT

I try to understand the linux graphics stack, two questions came up

  1. According to https://en.wikipedia.org/wiki/Wayland_(display_server_protocol) "Wayland compositor and its clients use EGL to draw directly into the framebuffer". How does that work exactly? Does each client have its own framebuffer and the compositor merges them and sends them to the display?

  2. Is there a simple example of the format EGL expects the data that is to be written into the buffer. Is this data-format defined by EGL or can EGL handle the internal format of Qt, GTK, ...

Controlled restart of systemd managed service?

Posted: 21 Jun 2021 09:12 AM PDT

Controlled restart of a systemd managed service? I have a service that I want to have restart by default if it fails, but not if a specific condition is encountered. Using Restart=ab-normal or Restart=always works but I want to stop halt the restart if a specific condition is encountered. This is use full of the service should always restart except when the applicable hardware related to the service has failed for example. Unfortunately, Restart=ab-normal or Restart=always does not seem to have any intelligence? Even if I write code logic to return a specific exit code, say 255, the Restart= parameter ignores such, and via code can't seem to find a way to control this in my code? I guess what or need is Restart=always unless exit code = 255, type of thing? Is there some way to implement this concept?

FreeBSD printer jobs will not print queued jobs but lpc shows printer enabled

Posted: 21 Jun 2021 08:27 AM PDT

I solved this problem by restarting the lpd service. However, if it is possible to determine, I would like to know why this situation developed and what other solution might be used.

The host involved runs FreeBSD-12.2 and CUPS.

We have a virtual printer running on a FreeBSD host to service a legacy system. This is set up using socat and it pipes the input from the legacy system through a series of filters to a networked printer named np4172. The specific command is:

socat -d -d -d TCP4-LISTEN:3178,bind=192.168.216.179,fork,reuseaddr,su=hp3000 SYSTEM:sed -r "1s/^.{42}//" | cat /var/spool/hp3000/forms/hll_inv_ljiii_85_idx999.ovl - | lpr -l -P np4172  

Over the weekend the reports that are usually routed through this virtual printer did not print. After searching for various possible causes it was discovered that these reports were waiting in the np4172 spooler.

# lpc status np4172  np4172:      queuing is enabled      printing is enabled      13 entries in spool area      sending to np4172    # lpq -P np4172  np4172:  vprinter.harte-lyne.ca: sending to np4172  Rank   Owner      Job  Files                                 Total Size  1st    hp3000     154  (standard input)                      207735 bytes  2nd    hp3000     155  (standard input)                      207743 bytes  3rd    hp3000     156  (standard input)                      250025 bytes  4th    hp3000     157  (standard input)                      250025 bytes  5th    hp3000     158  (standard input)                      207660 bytes  6th    hp3000     159  (standard input)                      207660 bytes  7th    hp3000     160  (standard input)                      207786 bytes  8th    hp3000     161  (standard input)                      207786 bytes  9th    hp3000     162  (standard input)                      207786 bytes  10th   hp3000     163  (standard input)                      207786 bytes  11th   hp3000     164  (standard input)                      209037 bytes  12th   hp3000     165  (standard input)                      209037 bytes  13th   byrnejb_hll 167  (standard input)                      12332 bytes    No entries  

There several things that I would like to discover:

  1. Given that the printer was enabled why did lpd stop sending print jobs to np4172?

  2. How does one 'release' these jobs to start printing without having to restart lpd itself?

  3. Using cron, is there a simple way to detect when this happens and apply a remedy?

Find files with Julian days in a specific range in their names

Posted: 21 Jun 2021 10:13 AM PDT

I have a list of files that contain a Julian calendar date in them. Examples: XXX_YY_AB21123.TXT, XXX_YY_AB21124.TXT etc. I have hundreds of them for the year. I need a way to search for the files based on the names and only return the ones for a specific range.

Example: Return all filenames that have the Julian date embedded in the name between 60 and 90 (Mar 2021) XXX_YY_AB21060 thru XXX_YY_AB21090

Any ideas?

I have several problems with DNS while upgrading from WSL1 to WSL2

Posted: 21 Jun 2021 08:11 AM PDT

I have a DNS issue after updating from WSL1 to WSL2 so i cant ping even google.com the only adress that i am able to reach is the loopback adress. Here is what i had tried :

  1. I created the /etc/wsl.conf file with the following content

    [network]

    generateResolvConf = false

  2. I removed the existing /etc/resolv.conf file and creating an other one with the following content :

    nameserver 8.8.8.8

    nameserver 8.8.4.4

    nameserver 1.1.1.1

But unfortunately without success i always got the following message :

ping: google.com: Temporary failure in name resolution

Debian sleeps / hibernates only during remote desktop session using remmina [duplicate]

Posted: 21 Jun 2021 08:07 AM PDT

I am running Debian Buster. On my desktop settings/ Power, suspend and hibernate are deactivated. As expected the computer never sleeps/ hibernates.

The problem: When working remotely, and the computer is idle then it enters into hibernation and it is unresponsive.

The only way to get it back is to restart the computer locally.

It looks 'sleep' and 'hibernate' are configured differently when the machine is used locally or remotely.

Any idea what is going on? and how to solve it?

thanks

How to use SLAB memory allocation instead of SLUB allocation in Linux kernel?

Posted: 21 Jun 2021 08:07 AM PDT

As I understand it, both SLAB and SLUB are still integrated into the kernel in stable release 5.12. Is there a way to enable SLAB allocation to run on the system instead of SLUB allocation? Or is there no "toggle" to switch between them/it doesn't work like that?

Mount Optane NVMe SSD for data recovery

Posted: 21 Jun 2021 08:03 AM PDT

Environment:

MMMMMMMMMMMMMMMMMMMMMMMMMmds+.        shawn@shawn-P67A-UD5-B3   MMm----::-://////////////oymNMd+`     -----------------------   MMd      /++                -sNMd:    OS: Linux Mint 19.2 Tina x86_64   MMNso/`  dMM    `.::-. .-::.` .hMN:   Host: P67A-UD5-B3   ddddMMh  dMM   :hNMNMNhNMNMNh: `NMm   Kernel: 4.15.0-54-generic       NMm  dMM  .NMN/-+MMM+-/NMN` dMM   Uptime: 13 mins       NMm  dMM  -MMm  `MMM   dMM. dMM   Packages: 2107       NMm  dMM  -MMm  `MMM   dMM. dMM   Shell: bash 4.4.20       NMm  dMM  .mmd  `mmm   yMM. dMM   Resolution: 1600x900       NMm  dMM`  ..`   ...   ydm. dMM   DE: Cinnamon 4.2.4       hMM- +MMd/-------...-:sdds  dMM   WM: Mutter (Muffin)       -NMm- :hNMNNNmdddddddddy/`  dMM   WM Theme: Mint-Y-Dark (Mint-Y)        -dMNs-``-::::-------.``    dMM   Theme: Mint-Y [GTK2/3]         `/dMNmy+/:-------------:/yMMM   Icons: Mint-Y [GTK2/3]            ./ydNMMMMMMMMMMMMMMMMMMMMM   Terminal: gnome-terminal               .MMMMMMMMMMMMMMMMMMM      CPU: Intel i5-2500K (4) @ 3.700GHz                                         GPU: NVIDIA GeForce GTX 1050 Ti                                         Memory: 1217MiB / 16024MiB  

I have an Intel Optane H10 NVMe SSD plugged into a PCI NVMe adapter card:

enter image description here

This does seem to somewhat work as it is seeing the Windows partition:

shawn@shawn-P67A-UD5-B3:~$ lsblk  NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT  fd0           2:0    1     4K  0 disk   sda           8:0    0 223.6G  0 disk   ├─sda1        8:1    0  53.1G  0 part /  ├─sda2        8:2    0     1K  0 part   └─sda5        8:5    0  11.2G  0 part [SWAP]  nvme0n1     259:0    0   477G  0 disk   ├─nvme0n1p1 259:1    0   260M  0 part   ├─nvme0n1p2 259:2    0    16M  0 part   ├─nvme0n1p3 259:3    0 475.7G  0 part <------  └─nvme0n1p4 259:4    0   980M  0 part  

enter image description here

I understand the architecture of the Optane so I don't need that explained. I realize none of this should work at all. But since it is seeing the partitions I figured there might be a slight chance for at least reading the data. I don't care about actually using it. I need to at least read the data off as this is for data recovery for a customer.

This is what I get when I try to manually mount the nvme0n1p3 partition:

shawn@shawn-P67A-UD5-B3:/mnt$ sudo mount.ntfs-3g /dev/nvme0n1p3 optane  ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 4096   usa_ofs: 0  usa_count: 0: Invalid argument  Index buffer (VCN 0x0) of directory inode 0x5 has a size (24) differing from the directory specified size (4096).  Failed to open $Secure: No such file or directory  Failed to mount '/dev/nvme0n1p3': No such file or directory  

The partition seems "readable" with dd:

shawn@shawn-P67A-UD5-B3:/mnt$ sudo dd if=/dev/nvme0n1p3 of=/dev/null bs=1M count=10  10+0 records in  10+0 records out  10485760 bytes (10 MB, 10 MiB) copied, 0.0279282 s, 375 MB/s  

I'm guessing a fix could be to "fix" the file system but I need to make 100% that would work as I don't want to obliterate the data on it.

Thank you in advance!

Split lines and substitute missing fields

Posted: 21 Jun 2021 10:19 AM PDT

Does anyone know how can I "split" the lines bellow (it is just an example):

mercedes|$40000|black|$42000|white|$41000|red  audi|$31000|blue|$10000|white  mercedes|$5000|blue  

The output I expect is:

mercedes|$40000|black  mercedes|$42000|white  mercedes|$41000|red  audi|$31000|blue  audi|$10000|white  mercedes|$5000|blue  

Thanks

How to repeatedly unpack tar.gz files that are within the tar.gz itself

Posted: 21 Jun 2021 08:19 AM PDT

There is a file with the name **flag_999.tar.gz** which has been packed maybe 999 times is there any way of unpacking all of them or a bash script because nothing is working for me.

The name is the file goes as flag_999.tar.gz and inside the archive, there is flag_998.tar.gz and inside that there is flag_997.tar.gz. So here the "flag_" is constant and then the number goes descending I reached flag_967.tar.gz manually to check the file names inside.

I tried:

file=(*tar); while [[ -e $file ]]; do tar zxf "$file"; rm "$file"; file=(*tar); done  

no output

awk -F'\0' '/[^\0]/{print $(NF)}' flag_999.tar.gz  

output not readable

for i in {1000..1}; do tar -xf $i.tar; done  

maybe this could work I don't know because I don't know how to use it.

Receiving traffic from 0.0.0.0

Posted: 21 Jun 2021 09:02 AM PDT

While monitoring network traffic with iftop, i saw that my server receives some data from 0.0.0.0 to ff02::16, each 10 minutes, 24h per day, for about ~10s, I did not found any cronjob. iftop shows that my server is receiving traffic from 0.0.0.0 or ::, where is it coming from? I don't think it's from outside, because i use iptables to block all incoming traffic that is not from CloudFlare IPv4 range. I use Centos 7 KVM.

I blocked (INPUT/OUTPUT/FORWARD) traffic from 224.0.0.0/4 and 224.0.0.0/5, and disabled multicast traffic with ifconfig eth0 -multicast, also blocked all traffic with ip6tables, this did not stopped my server from receiving this traffic.

iftop -B screenshot:

enter image description here

netstat -g:

IPv6/IPv4 Group Memberships  Interface       RefCnt Group  --------------- ------ ---------------------  lo              1      all-systems.mcast.net  eth0            1      all-systems.mcast.net  lo              1      ff02::1  lo              1      ff01::1  eth0            1      ff02::1:x:x  eth0            1      ff02::1  eth0            1      ff01::1  

netstat -tulpn:

Active Internet connections (only servers)  Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name      tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1132/nginx: master    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      844/sshd              tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      945/mysqld            tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1132/nginx: master    tcp6       0      0 :::22                   :::*                    LISTEN      844/sshd   

route -n:

Kernel IP routing table  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  0.0.0.0         x.x.x.1         0.0.0.0         UG    100    0        0 eth0  x.x.x.0         0.0.0.0         255.255.248.0   U     100    0        0 eth0  

iptables -S:

.  .  .  -A INPUT -s 173.245.48.0/20 -p tcp -m tcp --dport 443 -j ACCEPT  -A INPUT -s 127.0.0.1/32 -p tcp -m multiport --dports 80,3306 -j ACCEPT  -A INPUT -p tcp -m multiport --dports 80,3306,443 -j REJECT --reject-with icmp-port-unreachable  

ifconfig:

eth0: flags=4163<UP,BROADCAST,RUNNING>  mtu 1500      inet x.x.x.x  netmask 255.255.248.0  broadcast x.x.x.255      inet6 x:x:x:x:x:x  prefixlen 64  scopeid 0x20<link>      ether x:x:x:x:x:x  txqueuelen 1000  (Ethernet)      RX packets 80877180  bytes 35255600796 (32.8 GiB)      RX errors 0  dropped 0  overruns 0  frame 0      TX packets 56304808  bytes 41036019905 (38.2 GiB)      TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536      inet 127.0.0.1  netmask 255.0.0.0      inet6 ::1  prefixlen 128  scopeid 0x10<host>      loop  txqueuelen 1000  (Local Loopback)      RX packets 41236  bytes 535066002 (510.2 MiB)      RX errors 0  dropped 0  overruns 0  frame 0      TX packets 41236  bytes 535066002 (510.2 MiB)      TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  

Automated file backups/copies that are not symlinks

Posted: 21 Jun 2021 09:15 AM PDT

I have 2 directories:

/home/Documents/oppo/

/home/Backup/oppo/

If I wanted to manually copy the contents over, I would do:

rsync -av /home/Documents/oppo/ /home/Backup/oppo/

But I am actually looking for something that is like a symlink but not actually a symlink. Meaning that I want the backup to happen in /home/Backup/oppo without needing to run the rsync command manually each time.

I know symlinks are not the correct solution because they just point to the original folder, but is there something similar to it that actually preserves a backup automatically?

Also, I can't run a systemd service because this is a VM that I sparsely use.

tl;dr I want the power of symlinks that store actual backup copies of files automatically

How to freeze terminal in vim 8.2

Posted: 21 Jun 2021 09:00 AM PDT

On openSUSE Tumbleweed 20210606 with kernel GNU/Linux 5.12.9-1-default

I know that GNU screen flow control set XON/XOFF bind to ctrl-q(ASCII 17)/ctrl-s(ASCII 19), and it works fine in terminal. But in Vim82 I can not get it. It seems that vim hold the key I try to send to terminal. Besides the help entry of ctrl-s is redirect to c_CTRL-SHIFT-Q, the same as paste the clipboard.

Now I want to control other windows by xdotool without exiting vim, and the part of vim in screen can be locked while the xdotool command is being executed. Can I recover XON and XOF in vim 8.2? Or other ways to lock the screen in vim?

Thanks.


Edit:

I use gnome-terminal and the gnome-terminal --version is :

# GNOME Terminal 3.40.2 using VTE 0.64.2 +BIDI +GNUTLS +ICU +SYSTEMD  

X session is on /dev/tty1. In tty without X, ^S and ^Q cases are the same as in gnome-terminal.

stty -a shows :

speed 38400 baud; rows 52; columns 190; line = 0;  intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O;  min = 1; time = 0;  -parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts  -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel iutf8  opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0  isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc  

^S and ^Q works well in bash.

Extract servers' blocks and values from Nginx conf

Posted: 21 Jun 2021 09:55 AM PDT

How can we extract nginx server blocks using AWK? Input

server { # php/fastcgi  listen       80;  server_name  domain1.com www.domain1.com;  access_log   logs/domain1.access.log  main;  root         html;    location ~ \.php$ {    fastcgi_pass   127.0.0.1:1025;  }  }  server { # simple reverse-proxy  listen       80;  server_name  domain2.com www.domain2.com;  access_log   logs/domain2.access.log  main;    # serve static files  location ~ ^/(images|javascript|js|css|flash|media|static)/  {    root    /var/www/virtual/big.server.com/htdocs;    expires 30d;  }    # pass requests for dynamic content to rails/turbogears/zope, et al  location / {    proxy_pass      http://127.0.0.1:8080;  }  }  

How can we match the wanted values and print in one line for each server{} block?

for example

I need to get the values for listen|root|server_name. the desired output is

80 domain1.com www.domain1.com html  80 domain2.com www.domain2.com /var/www/virtual/big.server.com/htdocs  

chrony / gpsd with refclock

Posted: 21 Jun 2021 08:43 AM PDT

I'm trying to configure a CentOS 8 box to sync the time from a Meinberg PCI GPS receiver. I've built and installed the driver[1], and I get valid time from /dev/refclock-0. Running od -tx1 -Ax -w /dev/refclock-0 produces

000000 02 44 3a 33 31 2e 31 30 2e 30 31 3b 54 3a 33 3b 55 3a 31 33 2e 35 33 2e 31 35 3b 20 2a 20 20 03

or od -tc -Ax -w /dev/refclock-0 produces

000000 002 D : 0 1 . 1 1 . 0 1 ; T : 4 ; U : 0 9 . 5 9 . 2 7 ; 003

and the line updates every second. I believe this is mode-2 data, but I am having difficulty determining how to configure chrony / gpsd to read from /dev/refclock-0, and update the clock appropriately.

Where is the best documentation for configuring chrony / gpsd ?

[1] mbgtools-lx-4.2.18.tar.gz from https://www.meinbergglobal.com/english/sw/#linux

can I use multiple qdiscs per device?

Posted: 21 Jun 2021 09:45 AM PDT

Can I add multiple qdiscs to the same device with tc, or is it only possible to use on qdisc per device?

Also, can a qdisc contain child qdiscs, or only child classes? i.e. is it possible to do tc qdisc add parent <existing qdisk> handle <child qdisc> <qdisc type> ?

Break down string into array in shell script

Posted: 21 Jun 2021 08:03 AM PDT

I am trying to convert string for example string=11111001 to array which I will be able to access by calling respective array index like

arr[0]=1, arr[1]=0  

I am new to shell scripting and from what I read, it doesn't have a separator I am stuck.

Can someone help me?

0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. How can I upgrade that 1 package, or at least know which is?

Posted: 21 Jun 2021 10:24 AM PDT

I have tried many different solutions found around this and other websites, such as

sudo apt update && sudo apt upgrade  sudo apt list --upgradeable  sudo apt full-upgrade  sudo apt dist-upgrade  

and no information nor update of the package is displayed. I also tried

aptitude update  

and checked the log and no information about the package is displayed.

Any ideas on how to identify this package?

My guess at this point, is that it might have something to do with the sources.list file. Any comments on this?

I have Linux Mint with the latest distribution Ulyana / Focal.

Thank you very much!

Is there a free (libre) open source alternative to memtest86+ that works with UEFI?

Posted: 21 Jun 2021 08:28 AM PDT

In light of memtest86+ not working with UEFI, is there an open source alternative or something I can use from grub to test memory?

Install Onboard on-screen keyboard on Fedora 21

Posted: 21 Jun 2021 10:07 AM PDT

I am looking for guide to install Onboard keyboard on Fedora. https://launchpad.net/onboard

Looks like there is not package for this distributive and I should compile it from source. How do I do it exactly?

Relay server for generic TCP traffic?

Posted: 21 Jun 2021 08:07 AM PDT

Here's my situation:

  • I have a computer (Mac) on a school network that I want to port forward TCP 5222 to for ejabberd, but of course I can't.
  • I have a server at home (Mac with FreeBSD VM) that I can port forward to.

Is there a simple way to set up my home server to relay incoming and outgoing TCP traffic over port 5222 to/from my computer at school? I know it's possible to make my computer at school connect to the one at home and send/receive everything through it, and I could write a program to do this, but I want to know if there's an easier way. It seems like there would already be a Unix utility to do this.

Remove trailing new line from 'clipboard' to prevent execution on the terminal?

Posted: 21 Jun 2021 09:08 AM PDT

Is there some way to run whatever you copy to the 'clipboard' through some sort of filter? Ideally to strip out the trailing newline from something you copy, so that it doesn't auto-run in the terminal?

This is what it looks like when I copy the test in question, and I sometimes forget this is a new line.
enter image description here

How to check drive temperature on Linux?

Posted: 21 Jun 2021 08:23 AM PDT

I have used of hdparm -n and smartctl -A but it always seem to be a "per drive" technique as a drive may answer for only one of these tools.

So, is there a standard way to get the drive temperature on Linux (HDD or SSD)? If not, what (other) tools can I use to get this information?

No comments:

Post a Comment