Tuesday, August 10, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to use hostname rather than IP address for website

Posted: 10 Aug 2021 10:50 AM PDT

I've set up a VirtualBox VM which has an apache webserver running. I've created a webpage and I can navigate to it via the IP address on devices in the lan. However I want to use a hostname rather than an IP address. I've used /etc/hosts and put the hostname next to the IP address, and on the VM it loads the website, but when I try another device on the lan it cannot go to the website using the hostname, only by the IP address.

How can I get other devices connected to the lan to go to the website by using the hostname?

Remove the title bar but keep 3 buttons(X-quit application, square-minimize/maximize, "_" - minimize it to task manager) in KDE

Posted: 10 Aug 2021 10:48 AM PDT

In KDE plasma, by default, the title bar always shows on top of any application window. I could find a way to remove the title bar: go to system settings, click on window management, and specify window rules. Doing that hides the title bar. But it also makes disappear the three buttons: X for quitting an application, and the other two - minimize/maximize the window size and minimizing that to task manager and running the app background. Is there any way to remove the title bar but keep the 3 buttons in the application window? Please let me know.

Created /etc/nologin

Posted: 10 Aug 2021 10:47 AM PDT

I added /etc/nologin and now of course I can't login as a regular user or even as root. CentOS Linux release 7.7.1908 (Core)

Is there a way around this?
Thanks in advance

Sending logs between rsyslog (client) and syslogd (server)

Posted: 10 Aug 2021 10:43 AM PDT

I have two machines. First of them runs embedded Linux and the second one runs FreeBSD. The machine with Linux has rsyslog and needs to be a syslog client. The other one has installed syslogd and needs to be a server. The machine with FreeBSD and syslogd doesn't write remote logs to a file. When I changed just for test rsyslog to sysklogd on my Linux machine, remote logging was working. The problem is that I must have rsyslog on the client. What can cause the problem? Are rsyslog and syslogd incompatible with each other? As I know the log message format is the same.

When I run tcpdump -enpi <interface> on FreeBSD I see syslog messages

Linux MAC > FreeBSD MAC, ethertype IPv4 (0x0800), length 94: client_IP.35398 > server_IP.514: SYSLOG user.notice, length: 52  

In my rsyslog.conf file on Linux (client) I was added the following line:

*.* @server_IP  

In my syslog.conf file on FreeBSD (server) I was added the following lines:

+ip_klienta  *.*  /path/to/client/logs   

And in my rc.conf file on FreeBSD I was added the following lines:

syslogd_enable="YES"   syslogd_flags="-a client_IP -vv"   

Bazel Remote Cache not working with certificates/TLS

Posted: 10 Aug 2021 10:17 AM PDT

I'm runnig Bazel remote cache from https://github.com/buchgr/bazel-remote inside docker, by runnig the following commands to start the http and grpc server:

docker pull buchgr/bazel-remote-cache  docker run -u 1000:1000 -v /path/to/cache/dir:/data -p 9093:8080 -p 9094:9092 buchgr/bazel-remote-cache  

So far I can run some tests from my client by running one of the following commands:

bazelisk test  --remote_cache=http://<SERVER_IP>:<SERVER_PORT> <TEST_TARGET>  bazelisk test  --remote_cache=grpc://<SERVER_IP>:<SERVER_PORT> <TEST_TARGET>  

But when I put my server to run over TLS by adding the following flags to the server invocation:

-v /path/to/certificate_authority:/etc/bazel-remote/ca_cert  -v /path/to/server_cert:/etc/bazel-remote/server_cert  -v /path/to/server_key:/etc/bazel-remote/server_key  --tls_ca_file=/etc/bazel-remote/ca_cert  --tls_cert_file=/etc/bazel-remote/server_cert  --tls_key_file=/etc/bazel-remote/server_key  

Although I created a root CA certificate to sign both my server's and clients' certificates, I'm not able to access my server via https or grpcs. The following errors are being raised for https:

avax.net.ssl.SSLHandshakeException: General OpenSslEngine problem      sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target      sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target  

And the following for grpcs:

javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem    java.security.cert.CertificateException: No subject alternative names present    ERROR: Failed to query remote execution capabilities: General OpenSslEngine problem  

Is this problem related to the fact the root CA certificate is self signed itself or am I doing something else stupid?

Returning to main menu after calling a different script

Posted: 10 Aug 2021 10:47 AM PDT

I am having a menu based script which calls for an additional shell script. The challenge is that, after the additional shell script is finished, instead of returning to the main menu, it exits completely.

The code is something like this:

options=("Deploy code" "Backup a directory or file" "Transfer file SCP" "Start tool b" "Quit")  select opt in "${options[@]}"; do     case $REPLY in        1) command1; break;;        2) sh ./backup-script.sh; break;;        3) test1; break;;        4) bla2; break;;        5) break 2 ;;        *) echo "Invalid option selected" >&2     esac  done  

backup-script.sh is having the code:

#!/bin/bash    # define params  read -p "Provide full path of file(s) or folder(s) you want to create a backup of: " param_backup  backed_up_path=$(echo "${param_backup}_bkp_$(date +"%Y-%m-%d_%H-%M-%S")");    # execute backup with params  echo   echo "Attempting to create backup of specified file(s) or folder(s)..."  if cp -prvf ${param_backup} ${backed_up_path}       then          echo          printf "\033[1;32mSUCCESS: Backup created!\033[0m\n"      else          echo           printf "\033[1;31mERROR: There was an error and the backup could not be performed.\033[0m\n"          printf "\033[1;31m       Please try again and make sure that the source path is valid or exists!\033[0m\n"  fi  echo  

Tried sourcing the script and then using return function, but it didn't helped (or I have done something wrong).

Any idea on how to return to the main menu after the backup-script.sh is finishing running?

Thank you!

Manjaro hangs upon rebooting and shutting down

Posted: 10 Aug 2021 09:50 AM PDT

I've been having issues with Manjaro. Both restarting and shutting down just freeze the computer in this state: shutdown screen /dev/sda1: recovering journal
/dev/sda1: clean, 943535/73236480 files, 30595027/292934978 blocks

I'm using the latest LTS kernel (Linux 5.10.53-1). As for past solutions I've tried adding noefi to kernel options, but sadly it didn't help. As for what comes up when I do «sudo journalctl -xe»: enter image description here kernel: mce: [Hardware Error]: Machine check events logged
kernel: mce: [Hardware Error]: CPU 0: Machine Check: 0 Bank: 9: d00002c0000a008f
kernel: mce: [Hardware Error]: TSC 6c2d309b48d4
kernel: mce: [Hardware Error]: PROCESSOR 0: 206f2 TIME 1628519386 SOCKET 0 APIC 0 microcode 3b

Characteristics if needed:
CPU: 4x Xeon E7-4870
GPU: GeForce GTX 670

If any more information is needed to solve this issue, I'll be happy to provide it.

Why not ask this question on the Manjaro forum?
Well, I have and my question was ignored.

How to use a pattern when doing for loop of files in directory

Posted: 10 Aug 2021 09:44 AM PDT

I'm a novice bash scripter. Need help with the following. I have a script that uses inotifywait to watch a directory. Another process will drop a csv file in nightly. The file will be of the format filename_YYYYMMDD.csv. My script takes the oldest timestamped file and renames it filename.csv, so it's ready to be consumed by another external process. In a perfect world, one files comes in, gets renamed without timestamp, and is processed. The external process moves the file to an archived folder. If the external process is down, the timestamped files will accumulate in the folder. My script renames the first file when it hits the directory, but the rest will go untouched until that first file is archived. Then my script finds the oldest file, renames it, and exits.

When the timestamped file first hits the directory, my script checks for a timestamp in the name:

regex='_[0-9]{4}[0-9]{2}[0-9]{2}(.csv)$'  if [[ $file =~ $regex ]]; then  

This works fine. I check for a file already existing named filename.csv. If none, this file gets renamed.

When a file is processed and archived, the script detects that file is gone, gets the basename and looks for the next oldest file matching that basename, renames it, and exits.

Finally, here's where I need help. How can I modify the below code to look for the oldest file matching a pattern? If I just look for basename, I pick up a malformed filename, like filename_YYMM, which I don't want.

unset -v oldest  for f in $mybasename*; do     [[ -z $oldest || $f -ot $oldest ]] && oldest=$f  done  

Right now $mybasename is just filename. How can I get the for to use a regex like:

regex='$mybasename_[0-9]{4}[0-9]{2}[0-9]{2}(.csv)$'  for f in $regex; do     [[ -z $oldest || $f -ot $oldest ]] && oldest=$f  done  

Thanks!

Packet delay after route is added over new WiFi connection

Posted: 10 Aug 2021 09:41 AM PDT

Network Setup

  • STA is Ubuntu 18.04 (4.15.0-147-generic)
  • 2x Intel 7620
  • Each interface is connected to a different AP in the same subnet
  • STA is streaming 1080p video over UDP (~15Mbits/s) using gstreamer
  • Video is streamed exclusively over the WiFi one interface st a time, all other traffic uses a wired connection

Problem

I control which WiFi interface streams the video using a static route to the receive pipeline for each interface

Kernel IP routing table   Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  <receiver IP>    _gateway        255.255.255.255 UGH   99     0        0 wlp1s0  <receiver IP>    _gateway        255.255.255.255 UGH   100    0        0 wlp2s0  

In the above scenario, traffic is routed over wlp1s0. When I remove the route for wlp1s0, I see in iftop that traffic is then sent over wlp2s0.

I notice that there is a problem that manifests as one or two lost / delayed frames on the video receive pipeline if I reroute the video traffic over a connection that has not been used yet. Using the above scenario as an example, I start off with both interfaces authenticated, associated, and 4-way handshake complete, but the route for wlp1s0 has a lower metric than wlp2s0, so no packets have been sent over wlp2s0 yet. When I remove the route for wlp1s0, there is a very short blip in the video, then everything goes back to normal.

The strange thing is, after I experience this blip in the video and stay connected to the same APs, I can add and remove the route for wlp1s0 repeatedly with absolutely no noticeable effect on the video. I've verified using iftop that I can flip flop which interface is active, and there isn't any effect on the video quality.

Things I've looked at

I've run wpa_supplicant manually at the highest verbosity, and there are no relevant errors / warnings. I've also taken a look at the AP controller log, and there are no errors / warnings reported there. Using sudo tcpdump -c 10000 -n -B 10240 -i wlp1s0 while I induced the blip in the video also didn't report any problems.

What else can I look at to diagnose and fix this issue?

How do I change powerline?

Posted: 10 Aug 2021 09:26 AM PDT

I installed powerline with pacman, I modified a config file, but nothing changed, what do I need to do? i'm kind of wondering if the default configs are somehow taking precedence.

 EMACS  xeno  ~  cat ~/.config/powerline/default.json  {      "segments": {          "left": [              {                  "function": "powerline.segments.shell.mode"              },              {                  "function": "powerline.segments.common.net.hostname",                  "priority": 10              },              {                  "function": "powerline.segments.common.env.virtualenv",                  "priority": 50              },              {                  "function": "powerline.segments.shell.cwd",                  "priority": 10              },              {                  "function": "powerline.segments.shell.jobnum",                  "priority": 20              }          ],          "right": [              {                  "function": "powerline.segments.shell.last_pipe_status",                  "priority": 10              },              {                  "function": "powerline.segments.common.vcs.stash",                  "priority": 50              },              {                  "function": "powerline.segments.common.vcs.branch",                  "priority": 40              }          ]      }  }   EMACS  xeno  ~  systemctl --user daemon-reload   EMACS  xeno  ~  systemctl --user restart powerline-daemon  

In my zshrc

. /usr/lib/python3.9/site-packages/powerline/bindings/zsh/powerline.zsh  

note: before I get this answer, I can't use powerlevel10k because it conflicts with history-search-multi-word unless there's a valid replacment for that.

Then I opened a new tab, but the user is still in the prompt. What am I doing wrong?

Need help booting a REHL 6.1 virtual image - Kernel panic - Unable to mount root fs

Posted: 10 Aug 2021 09:19 AM PDT

I'm trying to virtualize a REHL 6.1 image. I restored a clonezilla backup on a .vmdk and I'm trying to get the image to boot successfully in the latest release of VirtualBox 5. Unsurprisingly, I'm getting a Kernel panic. Bootloader is lilo. Disk is on a SCSI (BusLogic) controller in VBox. 500MB of ram. Chipset PIIX3. Audio,Network,Serial, USB all disabled.

I would like to preface this post by saying that I am not the one who designed/partitioned this image and that my knowledge of linux is average at best.

Please see the screenshots. Image 1 Image 2

VFS: Mounted root (ext2 filesystem).  Loading aic7xxx module  scsi : 0 hosts.  /lib/aic7xxx.o: init_module: Device or resource busy  autodetecting RAID arrays  autorun...  ... autorun DONE.  kmod: failed to exec /sbin/modprobe -s -k block-major-8, errno = 2  VFS: Cannot open root device 08:03  Kernel panic: VFS: Unable to mount root fs on 08:03  

fstab:

/dev/sda3       /         ext2    defaults       1 1  /dev/sda2       /boot     ext2    defaults       1 2  /dev/sda4       /abc      ext2    defaults       1 2  /dev/sda1       swap      swap    defaults       0 0  none            /proc     proc    defaults       0 0  none            /dev/pts  devpts  gid=5,mode=620 0 0  

lilo.conf:

boot=/dev/sda  map=/boot/map  install=/boot/boot.b  prompt  tiemout=50  default=linux    #Default kernel ( orig )  image=/boot/vmlinuz-2.2-12-20      append="mem=376M"      label=linux      initrd=/boot/initrd-2.2.12-20.img      read-only      root=/dev/sda3  

When i try to boot with SystemRecovery live cd, it fails at "Checking root filesystem" and says my root partition (/dev/sda3) is mounted. Cannot continue, aborting. If i select Control-D for normal startup, it performs fsck on the other 2 partitions(/dev/sda2 and /dev/sda4) and then it just hangs.

I've used a livecd and I've succesfully mounted the partitions and even did a fsck on them to see if that would help. No luck. All clean btw.

Not sure if the AIC7xxx SCSI driver is causing problems... obviously the VM doesn't have an Adaptec SCSI controller...

Any help would be greatly appreciated.

Lenovo Carbon X1 Gen 8 Error getting sensor data: thinkpad/#2: Can't read

Posted: 10 Aug 2021 09:10 AM PDT

  in0: +0.00 V (min = +0.00 V, max = +0.00 V)  Chip: iwlwifi_1-virtual-0  Adapter: Virtual device    temp1: 38.0 C  Chip: thinkpad-isa-0000  Adapter: ISA adapter    fan1: 0 RPM    temp1: 45.0 C  Error getting sensor data: thinkpad/#2: Can't read  sensor read error (-1)  lines 1-21/21 (END)  
Linux manjaro 5.10.56-1-MANJARO #1 SMP PREEMPT Thu Aug 5 10:51:27 UTC 2021 x86_64 GNU/Linux  

I have fwupd running as a timer, so my firmware should be up-to-date, and I know I updated like a week or two ago.

I was working on getting lm_sensors/sensord to work, and I've mostly got it working, but I'm getting this error. Any ideas on a fix?

zsh: How to store the return code of a statement without triggering `set -e`?

Posted: 10 Aug 2021 08:55 AM PDT

Suppose I want to capture the return code of

(exit 56)  

If I use set -e or a zerr handler, I can no longer do:

(exit 56)  ret=$?  

If I use (exit 56) || true to avoid set -e, the return code would become zero and I can no longer get it.

So how do I get the return code?

How to display most common words from a file of text, with equally common words displayed alphabetically

Posted: 10 Aug 2021 09:26 AM PDT

I am quite close so far, the script will sort the words and display most common to least common however when the words are equally common they need to be sorted.

cat > file.txt  tr -c '[:alpha:]' '[\n*]' < file.txt |    sed -r '/^.{,5}$/d' | sort | uniq -c | sort -nr | head -20 | cut -c 9-  

Any ideas greatly appreciated!

Remove text between "<!-- text here -->" tags where "<!-- text here \n\n -->" may be on different lines

Posted: 10 Aug 2021 11:00 AM PDT

I have a text file td.txt which has this content

More here || <--field="data.com":CHK test text--> || test 2 test x @ --   ||<!-- more data   here --> ||  echo "||<!--field="data.com":CHK test text-->|| test 2 test x @ -- ||<--field="data.com":CHK more data here -->|| test data  

I wish to remove all instances of <!-- and all text inside the tags -->

I have this sed expression cat td.txt | sed 's/<!--[^P]*-->//g'

which does remove the tags and their contents as desired, but not when the <!-- tag starts on one line and ends on another line with -->.

The result using the above expression is

More here || <--field="data.com":CHK test text--> || test 2 test x @ --   ||<!-- more data   here --> ||  echo "|||| test data  

showing the

<!-- more data       here -->  

tag still present

How do I remove all instances of <!-- and all text inside the tags --> and
<!-- and all text
inside the tags -->

using sed or grep or any other tool ?

Splitting a line in a file into two columns

Posted: 10 Aug 2021 08:30 AM PDT

I want to split a line into two coloumns

./ABC/dce/app/config/fgh/pqr/app.properties:app.pass=*****  

I want the colon(:) in the above line as seperator and output like below

./ABC/dce/app/config/fgh/pqr/app.properties                        app.pass  

Can someone help me ?

Can you customise the UI / Icons used when running an app via sudo?

Posted: 10 Aug 2021 09:41 AM PDT

Is there a way in Linux to set the desired icon sets and themes used when running apps as sudo. At the moment if I, for example, type ...

sudo gedit /et/fstab  

Then if I click Save As then the file save dialog doesn't match my own desktop environment settings, it seems to use default icons and the default theme (Adwaita).

Is there anywhere this can be configured so that they match (or even better I'd like to make them largely the same but with different colours to indicate I'm running elevated).

I'm running Gnome on Manjaro if it's relevant.

I have tried a direct gsettings command line call:

sudo gsettings set org.gnome.desktop.interface icon-theme 'Tela-red-dark'  

but that doesn't work, it did point me to look at doing my next thing which explained kind of why this didn't work.

I have tried running dconf-editor under sudo but that only offers limited options, excluding the desktop settings required to configure such things.

Is this an OS limitation or is there somewhere deeper down that I can configure the 'default' settings?

As I was interested, I also ran this...

sudo gsettings get org.gnome.desktop.interface icon-theme  

To confuse my brain further, rather than returning Adwaita (which is what's used in the sudo run GUI windows) it returned Papirus-Dark-Maia which is the default icon theme that's used if you create a fresh new user in Manjaro.

LATER ON....

I logged on directly as root and set root up with the configuration that I want (similar to my main UI setup but with big glaring red danger colours) and that made no difference at all to what appears when sudo is used locally.

AND ALSO...

After being told that sudo shouldn't be used for such things I configured pkexec for my use case and enabled gedit following the instructions in this post: How do I run GUI applications as root by using pkexec?

I got exactly the same result as with using sudo from a UI perspective.

The elevated privilege apps seem to operate using their own default configurations for how to display which don't seem to honour the logged in user (which makes sense to me) or root which... doesn't.

My original question remains - How do I change the UI settings used by the elevated apps?

Sort images by aspect ratio then use MPV to browse

Posted: 10 Aug 2021 10:36 AM PDT

I want to sort images by aspect ratio, then use MPV to browse them, and I got some codes from Google:

identify * | gawk '{split($3,sizes,"x"); print $1,sizes[1]/sizes[2]}' | sed 's/\[.\]//' | sort -gk 2  

This is a output:

28.webp 0.698404  1.webp 0.699544  27.webp 0.706956  10.webp 0.707061  25.webp 0.707061  9.webp 0.707061  2.webp 0.707241  22.webp 1.41431  23.webp 1.41431  24.webp 1.41431  

Then I made some adaptations to fit my need:

identify * | gawk '{split($3,sizes,"x"); print $1,sizes[1]/sizes[2]}' | sed 's/\[.\]//' | sort -gk 2 | gawk '{print $1}' | mpv --no-resume-playback --really-quiet --playlist=-  

It works, but isn't perfect. It can't deal with filename with space and identify is too slower than exiftool especially when handling WebP format, besides, exiftool has a -r option, so I want to use exiftool to get this output instead, but I don't know how to deal with the output of exiftool -r -s -ImageSize, anyone could help me?

What can I do to fix occasional lagging of terminal emulator?

Posted: 10 Aug 2021 10:00 AM PDT

My terminal emulators are lagging occasionally. It's not heavy a lag. May be once in 20-30 mins( I think). The terminal becomes unresponsive and all the characters I typed during lag appears suddenly. It's not happening in any other app (even in SMPLAYER during 1080p video playback). The lag occurs even during low memory usage(nearly 1 GB free). I thought there might be a problem in xterm and switched to xfce4-terminal emulator. problem still persisted. Then thought there might be a bug in bash and switched to zsh . still no luck. What's happening ? How can I narrow the down problem?
system info : Arch + i3 + compton
Update1: I thought my history size(1000) might be causing the problem and changed it to 100. And this doesn't seem to work either.
Update2: My ~/.bashrc

  #  # ~/.bashrc  #    # If not running interactively, don't do anything  [[ $- != *i* ]] && return    alias ls='ls --color=auto'  alias grep='grep --color=auto'    PS1='\[\033[32m\]\u\[\033[33m\]@\[\033[36m\]\h \[\033[31m\]\W\[\033[33m\]\$\[\033[00m\]'      ## my settings  alias vi='vim'  alias vi_i3='vim ~/.config/i3/config'  alias pacs='sudo pacman -S'  alias pacss='pacman -Ss'  alias pacsyu='sudo pacman -Syu'  export TERMINAL='xfce4-terminal'  HISTSIZE=100  

Update3: But in zsh I used very simple Prompt string without any color. Still it was lagging.

Keep powerline prompt on ssh

Posted: 10 Aug 2021 09:35 AM PDT

I have a powerline bash prompt in iterm2 on my MacOS client and I want to keep the prompt when I ssh into different servers.

I regularly ssh into: a local headless vm, a server for school assignments, and a seedbox, and I'd rather not keep 4 different configurations synced, plus I can't install powerline on my school's server.

Is there some way to keep my prompt when I ssh to a different machine?

Routing traffic through VPN using Raspberry PI

Posted: 10 Aug 2021 09:02 AM PDT

I have a setup like this:
- Raspberry PI connected to router via LAN cable
- Created a bridged connection between eth0 and wlan0
- using hostapd for wifi hotstop
- configured l2tp/ipsec connection with one of my servers online

Issue I am having & goal:
- Goal is to have this raspberry pi as a wifi router that would route all traffic coming via WiFi through my VPN
- Issue I am having is that raspberry pi is using the VPN tunnel when I do curl, but all wifi guests connected do not get the VPN IP.

Interface example:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00      inet 127.0.0.1/8 scope host lo         valid_lft forever preferred_lft forever      inet6 ::1/128 scope host         valid_lft forever preferred_lft forever  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000      link/ether b8:27:eb:21:2b:9a brd ff:ff:ff:ff:ff:ff  3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000      link/ether b8:27:eb:21:2b:9a brd ff:ff:ff:ff:ff:ff      inet 192.168.1.7/24 brd 192.168.1.255 scope global br0         valid_lft forever preferred_lft forever      inet6 fe80::ba27:ebff:fe21:2b9a/64 scope link         valid_lft forever preferred_lft forever  4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000      link/ether b8:27:eb:74:7e:cf brd ff:ff:ff:ff:ff:ff  6: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc pfifo_fast state UNKNOWN group default qlen 3      link/ppp      inet 192.168.42.11 peer 192.168.42.1/32 scope global ppp0         valid_lft forever preferred_lft forever  

Routing table:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0  0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 br0  45.36.81.212    192.168.1.1     255.255.255.255 UGH   0      0        0 br0  63.126.53.74    192.168.1.1     255.255.255.255 UGH   0      0        0 br0  192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br0  192.168.42.1    0.0.0.0         255.255.255.255 UH    0      0        0 ppp0  

45.36.81.212 is my VPN
63.126.53.74 is my own local public IP
(ips have been slightly changed for obvious reasons).

OS: Raspbian

Would forwarding wlan0 to ppp0 do the trick or do I need to tamper with br0?

Evince: Hotkey for highlighting

Posted: 10 Aug 2021 08:35 AM PDT

I couldn't find a hotkey for activating the highlight feature.

Did I miss something or is there no such key combination?

Evince keyboard shortcut to highlight text

Posted: 10 Aug 2021 08:37 AM PDT

Is there a keyboard shortcut to highlight text in Evince? To place a note? Or a way to setup a custom keyboard shortcut?

Powerline and gdb

Posted: 10 Aug 2021 09:28 AM PDT

GDB in TUI-Mode shows strange behaviour. I'm using powerline and it seems that the font is the wrong one. Exist there a solution to have a pretty command line?

How can I invoke a program not using the powerline environment?

gdb invoked by a bash-shell using powerline

Unable to delete files from within smplayer

Posted: 10 Aug 2021 09:35 AM PDT

smplayer has an option that allows deleting the currently playing video. This worked well in windows 7, and even in debian 9 till about an year back. It brings up a confirmation dialog box, and if I click 'yes' it deletes the file and starts playing the next file in the playlist.

I tried it recently (now debian 10 buster, both kde & gnome. Both mplayer and mpv engine.) and it does not delete the file (When I click 'Delete File from Disk', nothing happens. Closing the app, also does not delete the file.). Tried files placed on both 'home' (ext4) and ntfs, same result.

Could you tell me why/how it can be solved?

If you have smplayer installed, could you please test it?

To get the delete button onto the toolbar (its not available by right clicking on the video, even last year when it was working well it was like that), you will need to:

Right click on the toolbar. Select "Edit Main Toolbar". Then find and select 'Delete File from Disk' from the 'Available Actions'. Now it will appear on the toolbar and can be used when a video is playing.


Another test:

I opened smplayer from the terminal, then opened a file using Ctrl+F and then tried to delete the file, hoping so get some error messages, but there was nothing!

u@p:~$ smplayer

QObject::connect: No such signal MyApplication::commitDataRequest(QSessionManager)

This is SMPlayer v. 17.11.2 (revision 8807) running on Linux

u@p:~$

urxvt powerline symbols

Posted: 10 Aug 2021 09:28 AM PDT

I use urxvt.

So i was playing with oh-my-zsh themes and found out that some of them have "The PowerLine Symbols".

(if you do not know what it is - take a look. https://gist.githubusercontent.com/agnoster/3712874/raw/screenshot.png )

So basically you have a set of patches to fonts, which add these extra characters. Or fonts can be downloaded, put info ~/.fonts && fc-cache -vf ~/.fonts && voila!.

If you do not have a fully powerline-awair font, you can chain fonts like that: URxvt*font: xft:Terminus:pixelsize=14:antialias=true,xft:Inconsolata\ for\ Powerline:pixelsize=14:antialias=true

In this case you use regular Mr.Terminus, and when it lacks characters, i guess, it goes to Ms.Inconsolata.

So, my problem looks like this: http://5cm.ru/code/i6/PUno.png

I have tried so far:

URxvt*font: xft:Terminess Powerline:pixelsize=15:antialias=true  URxvt*font: xft:Fantasque Sans Mono:style=Regular:antialias=true  URxvt*font: xft:Menlo:pixelsize=16:antialias=true  URxvt*font: xft:Terminus:pixelsize=14:antialias=true,xft:Inconsolata\ for\ Powerline:pixelsize=14:antialias=true  URxvt*font: xft:PowerlineSymbols:pixelsize=14:antialias=true,xft:Terminus:pixelsize=14:antialias=true  URxvt*font: xft:Terminus:pixelsize=14:antialias=true,xft:PowerlineSymbols:pixelsize=14:antialias=true  

The screenshot is of URxvt*font: xft:Terminess Powerline:pixelsize=15:antialias=true

My urxvt is definitely built with unicode support. I run gentoo and double checked the useflags - unicode3 -vanilla.

The fonts are downloaded to ~/.fonts. Here is a sample output:

    fc-list| grep Power      /home/rakul/.fonts/ter-powerline-x12n.bdf: Terminess Powerline:style=Regular      /home/rakul/.fonts/ter-powerline-x14n.pcf: Terminess Powerline:style=Regular      /home/rakul/.fonts/ter-powerline-x12n.pcf: Terminess Powerline:style=Regular      /home/rakul/.fonts/ter-powerline-x14b.pcf: Terminess Powerline:style=Bold      /home/rakul/.fonts/ter-powerline-x12b.pcf: Terminess Powerline:style=Bold      /home/rakul/.fonts/ter-powerline-x14b.bdf: Terminess Powerline:style=Bold      /home/rakul/.fonts/ter-powerline-x12b.bdf: Terminess Powerline:style=Bold      /usr/share/fonts/powerline-symbols/PowerlineSymbols.otf: PowerlineSymbols:style=Medium      /home/rakul/.fonts/Inconsolata for Powerline.otf: Inconsolata for Powerline:style=Medium  /home/rakul/.fonts/ter-powerline-x14n.bdf: Terminess Powerline:style=Regular  

Help appreciated!

Update 1: i forgot to mention one thing - the font actualy do work outside urxvt: konsole + urxvt: hxxp://img.5cm.ru/view/i6/Kqzo.png so the question is - what can be done to urxvt?

Here are my USE flags:

 equery u rxvt-unicode   [ Legend : U - final flag setting for installation]  [        : I - package is installed with flag     ]  [ Colors : set, unset                             ]   * Found these USE flags for x11-terms/rxvt-unicode-9999:   U I   + + 256-color            : Enable 256 color support   - + alt-font-width       : Calculate the font width using a different method   - - blink                : Enable blinking text   - - buffer-on-clear      : Store visible output to history buffer when clearing the screen with ctrl-l. Read https://bbs.archlinux.org/viewtopic.php?id=129302   - - fading-colors        : Enable colors fading when off focus   + + focused-urgency      : Enable the urgent flag when a terminal window is focused   + + font-styles          : Enable support for bold and italic fonts   - - iso14755             : Enable ISO-14755 support   + + mousewheel           : Enable scrolling via mouse wheel or buttons 4 and 5   + + perl                 : Enable perl script support. You can still disable this at runtime with -pe ""   - - pixbuf               : Enable transparency support using gtk's pixbuf   - - secondary-wheel      : Support for wheel scrolling on secondary screens (like mutt). Read http://lists.schmorp.de/pipermail/rxvt-unicode/2011q4/001491.html   + + startup-notification : Enable application startup event feedback mechanism   + + unicode3             : Use 21 instead of 16 bits to represent unicode characters   - - vanilla              : Do not add extra patches which change default behaviour; DO NOT USE THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically   - + wcwidth              : Enable wide char width support   + + xft                  : Build with support for XFT font renderer (x11-libs/libXft)  

Update 2: I managed to make another symbol appear :) i read, that the "modern" way of adding Powerline characters support is by adding the PowerlineSymbols.otf file to ~/.fonts and ~/.config/fontconfig/conf.d/10-powerline-symbols.conf

This way i not have this: hxxp://img.5cm.ru/view/i6/2TBR.png see, now there are 4 out of 7.

tmux and Powerline: working configuration

Posted: 10 Aug 2021 09:33 AM PDT

Background

I found very interesting the Powerline project. After several attempts, I managed to get it to work correctly for Vim. Then I did proceed with enabling it for tmux, by pasting the following line in my ~/.tmux.conf.

source '{repository_root}/powerline/bindings/tmux/powerline.conf'  

It doesn't work as expected. This is the way it looks at the moment (plus the line above I pasted in the configuration file).

tmux and Powerline

Question

How can I get it to work as expected?

Expectation: basically, date and time on the right side.

left side of tmux right side of tmux

These screenshots come from another project, tmux-powerline, which evolved to Powerline. Therefore I expect the new plugin to have a similar status line organisation. Furthermore, this "expectation" is supported by this configuration file for tmux.

Rewording the question

I'm trying to get Powerline work correctly for tmux. The left part (13 > 1 > bash > 2 > vim >) is fine, the right one (< Sat < 2012-06-16 < 18:51) is missing. About tmux's alternative status bars, I do have already mine, nicely polished ;) My question, here, is only about getting Powerline working properly, otherwise I believe vim-airline would do a better job as a even lighter plug-in.

Further information

Vim version: VIM - Vi IMproved 7.4
tmux version: tmux 1.8

How do I change which version of Qt is used for qmake?

Posted: 10 Aug 2021 09:41 AM PDT

I feel like there should be a simple way of doing this, but my googlefu is failing so I'd really appreciate some info on how to switch (or even permanently change) which version of Qt is used when doing qmake. If I ask which version I get the following:

~ $ qmake --version  QMake version 3.0  Using Qt version 5.0.1 in /usr/lib/x86_64-linux-gnu  

I've install QtCreator, but I'm not sure where to go from here.

Vim powerline with broken encoding

Posted: 10 Aug 2021 09:34 AM PDT

I trying to learn using vim, I am enjoining a lot, but I copied the vimrc from github and I would like to understand what is causing the break of powerline encoding.

.Snapshot of my vim

  1. In the vimrc file I have: set encoding=utf-8
  2. I cleared the PowerLine cache
  3. My vim version doesn't show the --with-features=big flag.

Could this be the problem and if yes, how can I fix it?

No comments:

Post a Comment