Wednesday, June 2, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Who decided the bc math library will define sine cosine and arctangent?

Posted: 02 Jun 2021 09:42 AM PDT

If you load the bc math library you get the trig functions s() and c() and a() which are sine, cosine, and arctangent respectively. Why these three functions?

I know why it's those three: it's because those are the three you need to convert directly between Cartesian and polar coordinates. I'm a math teacher, and this is unfortunately the only place I've seen sine/cosine/arctangent established as the primitive trigonometric functions, so I was hoping someone could tell me why in a more historical context. Idk I mostly need ammo when talking with math educators about why it's not a blasphemous idea to introduce arctangent to students before tangent.

How to assign several characters to one key-stroke in xkb?

Posted: 02 Jun 2021 09:38 AM PDT

We are using a custom written (by me) xkb Symbols file for a minority language. This has worked fine for over ten years and we roughly know how the system works. I am presently re-working the keyboard as the language is evolving.

Now I noticed we have a few positions left on our layout (Marked NoSymbol) and would like to assign very frequently needed "strings" of several characters. I would like to do this at the level of xkb so that we have consistent behaviour in our entire office, and can help other users, whatever the Linux distributions and versions, and different hardware keyboards.

I have searched through many posts here and outside StackExchange and it seems nobody ever covered this need or I am using bad key words. I have also once custom-written an Android keyboard for the same minority language and could easily assign text-strings to the "leftover keys".

I have tried guessing the syntax for our Symbols file, with "quotes" and without quotes and got no joy. I also tried whether I could assign this in our keysymdef.h but noticed that it is absent from the old, known location at /usr/include/x11/keysymdef.h and cannot find any new location in OpenSuse Leap 15.2.

This is an example line, where I would like to add the string "it works" in the third position (to facilitate communication):

key <KPDL>  { [   comma,  period, NoSymbol, NoSymbol  ] };                                       

Thank you for any hints.

From proxy server. Can we identify public IP address?

Posted: 02 Jun 2021 09:32 AM PDT

I would like to enquiry about proxy server. From proxy server can we identify public IP address buy run the following command:

host myip.opendns.com resolver1.opendns.com | grep "myip.opendns.com has" | awk '{print $4}'

Kindly advised. Many thanks.

What is a good way to deal with vagrant box CentOS/7 partition scheme which comes with xfs file system full size 40GB which cannot shrink size?

Posted: 02 Jun 2021 09:23 AM PDT

こんにちは、I install vagrant box CentOS/7 that default disk size is 40GB https://app.vagrantup.com/centos/boxes/7 on VM Virtual box and then I resize the disk to 80GB so I have unallocated space 40GB to use. I want to make /dev/sda1 partition for /boot with small size but CentOS/7 vagrant box comes with standard partition /dev/sda1 xfs file system with full size 40GB mounted on root which cannot shrink size.

The question is What is a good way to deal with vagrant box Centos7 to have good partition scheme for this case?

And Is it ok if I create new ext4 lvm partition with my free space 40GB and mounted on root with different file system xfs /dev/sda1 also mounted like below? (Now /dev/sda2 is not mounted)

My purpose is to install Postgresql on it with large database size.

[vagrant@localhost ~]$ df -Th  Filesystem     Type      Size  Used Avail Use% Mounted on  devtmpfs       devtmpfs  237M     0  237M   0% /dev  tmpfs          tmpfs     244M     0  244M   0% /dev/shm  tmpfs          tmpfs     244M  4.5M  240M   2% /run  tmpfs          tmpfs     244M     0  244M   0% /sys/fs/cgroup  /dev/sda1      xfs        40G  4.7G   36G  12% /  tmpfs          tmpfs      49M     0   49M   0% /run/user/1000  [vagrant@localhost ~]$ lsblk  NAME                 MAJ:MIN RM SIZE RO TYPE MOUNTPOINT  sda                    8:0    0  80G  0 disk  ├─sda1                 8:1    0  40G  0 part /  └─sda2                 8:2    0  40G  0 part    └─VolGroup-lv_root 253:0    0  40G  0 lvm  

Ansible jumphost config

Posted: 02 Jun 2021 09:06 AM PDT

I've added a new host k8s in an existing inventory hosts.yml

...  k8s:    hosts:      <address>  ...  

And the thing that bugs me is that, when I try to test if I can reach the host:

ansible k8s -m ping -i hosts.yml   

it tries to use a jumphost , and I don't want to use the jump server, because I have access directly to the k8s machine . Any idea from where ansible takes automatically the jumphost ?

Unable to start logstash using /etc/init.d/logstash start

Posted: 02 Jun 2021 08:49 AM PDT

I'm trying to start the logstash service using below playbook. Output says starting but when I checked the status its in stopped state. But the same service I'm able to start it manually.

---   - hosts: test     gather_facts: False     remote_user: test     become: yes     become_user: root     become_method: sudo     tasks:       - name: starting /etc/init.d/logstash start         shell: /etc/init.d/logstash start                - name: status /etc/init.d/logstash status         shell: /etc/init.d/logstash status         register: logstash_status          - name: output         debug:           msg: "{{logstash_status}}"  

Output:

PLAY [test] ************************************************************************************************************************************************************         TASK [starting /etc/init.d/logstash start] *****************************************************************************************************************************  changed: [192.168.1.10]         TASK [status /etc/init.d/logstash status] ******************************************************************************************************************************  fatal: [192.168.1.10]: FAILED! => {"changed": true, "cmd": "/etc/init.d/logstash status", "delta": "0:00:00.021383", "end": "2021-06-02 20:31:17.701169", "msg": "non-zero return code", "rc": 1, "start": "2021-06-02 20:31:17.679786", "stderr": "", "stderr_lines": [], "stdout": "Stopped", "stdout_lines": ["Stopped"]}          to retry, use: --limit @/home/test/logstat-config/new.retry         PLAY RECAP *************************************************************************************************************************************************************  192.168.1.10               : ok=1    changed=1    unreachable=0    failed=1  

Manual start :

 [test@test-server ~]$ /etc/init.d/logstash status   Stopped   [test@test-server ~]$ sudo /etc/init.d/logstash start   Starting logstash   [test@test-server ~]$ /etc/init.d/logstash status   Running   [test@test-server ~]$  

Cannot connect to wired ethernet switch

Posted: 02 Jun 2021 08:47 AM PDT

I am trying to connect my computer running Ubuntu 20.04.1 to an Ethernet switch. When I plug in the cable, then Settings->Network shows Connected-100 Mb/s. From the ifconifg and elsewhere I am able to see that Ethernet interface eno1 has now an IP address, default route and DNS address which are obtained through DHCP. However, it is still unable to browse. When I boot the same computer using a Linux live USB (not Ubuntu), it is connected fine to the same device using the same Ethernet cable. I have tried static IP assignment as well without any success. I am unable to figure out what is missing. I have collected log details using journalctl and are appended below. One thing which seems to be missing from the logs is CONNECTED_GLOBAL, which I have seen with other connections. However, I am not sure if it has any effect. I will much appreciate any help to resolve this.

Here are the log details. From the logs also, you can see that it is unable to connect to daisy.ubuntu.com.

Jun 02 19:20:22 River kernel: e1000e 0000:00:19.0 eno1: NIC Link is Up 100 Mbps Full Duplex, Flow Control: Rx/Tx  Jun 02 19:20:23 River kernel: e1000e 0000:00:19.0 eno1: 10/100 speed: disabling TSO  Jun 02 19:20:23 River kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eno1: link becomes ready  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9876] device (eno1): carrier: link connected  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9886] device (eno1): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9909] policy: auto-activating connection 'Wired connection 1' (cdd9a516-d7a6-3705-97cd-1dd266f40234)  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9927] device (eno1): Activation: starting connection 'Wired connection 1' (cdd9a516-d7a6-3705-97cd-1dd266f40234)  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9930] device (eno1): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9945] manager: NetworkManager state is now CONNECTING  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9951] device (eno1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9961] device (eno1): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')  Jun 02 19:20:22 River NetworkManager[577]: <info>  [1622643622.9965] dhcp4 (eno1): activation: beginning transaction (timeout in 45 seconds)  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0583] dhcp4 (eno1): option dhcp_lease_time      => '86400'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0584] dhcp4 (eno1): option domain_name_servers  => '192.168.1.1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0584] dhcp4 (eno1): option expiry               => '1622730022'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0584] dhcp4 (eno1): option ip_address           => '192.168.1.107'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0584] dhcp4 (eno1): option requested_broadcast_address => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0584] dhcp4 (eno1): option requested_domain_name => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0584] dhcp4 (eno1): option requested_domain_name_servers => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0584] dhcp4 (eno1): option requested_domain_search => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0584] dhcp4 (eno1): option requested_host_name  => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_interface_mtu => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_ms_classless_static_routes => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_nis_domain => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_nis_servers => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_ntp_servers => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_rfc3442_classless_static_routes => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_root_path  => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_routers    => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0585] dhcp4 (eno1): option requested_static_routes => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0586] dhcp4 (eno1): option requested_subnet_mask => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0586] dhcp4 (eno1): option requested_time_offset => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0586] dhcp4 (eno1): option requested_wpad       => '1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0586] dhcp4 (eno1): option routers              => '192.168.1.1'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0586] dhcp4 (eno1): option subnet_mask          => '255.255.255.0'  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0586] dhcp4 (eno1): state changed unknown -> bound  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0631] device (eno1): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')  Jun 02 19:20:23 River dbus-daemon[576]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.13' (uid=0 pid=577 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")  Jun 02 19:20:23 River systemd[1]: Starting Network Manager Script Dispatcher Service...  Jun 02 19:20:23 River dbus-daemon[576]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'  Jun 02 19:20:23 River audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=unconfined msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'  Jun 02 19:20:23 River systemd[1]: Started Network Manager Script Dispatcher Service.  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0769] device (eno1): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0772] device (eno1): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0779] manager: NetworkManager state is now CONNECTED_LOCAL  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0803] manager: NetworkManager state is now CONNECTED_SITE  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0804] policy: set 'Wired connection 1' (eno1) as default for IPv4 routing and DNS  Jun 02 19:20:23 River NetworkManager[577]: <info>  [1622643623.0811] device (eno1): Activation: successful, device activated.  Jun 02 19:20:33 River whoopsie[736]: [19:20:33] Cannot reach: https://daisy.ubuntu.com  Jun 02 19:20:33 River systemd[1]: NetworkManager-dispatcher.service: Succeeded.  Jun 02 19:20:33 River audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=unconfined msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'  Jun 02 19:20:43 River whoopsie[736]: [19:20:43] Cannot reach: https://daisy.ubuntu.com  Jun 02 19:20:53 River whoopsie[736]: [19:20:53] Cannot reach: https://daisy.ubuntu.com  Jun 02 19:20:58 River dbus-daemon[576]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.13' (uid=0 pid=577 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")  Jun 02 19:20:58 River systemd[1]: Starting Network Manager Script Dispatcher Service...  Jun 02 19:20:58 River audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=unconfined msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'  Jun 02 19:20:58 River dbus-daemon[576]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'  Jun 02 19:20:58 River systemd[1]: Started Network Manager Script Dispatcher Service.  Jun 02 19:21:08 River systemd[1]: NetworkManager-dispatcher.service: Succeeded.  Jun 02 19:21:08 River audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=unconfined msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'  

Special characters in root password in emergency mode

Posted: 02 Jun 2021 08:07 AM PDT

My debian is not starting well and go to emergency mode (with no possibility to avoid it :-(). In order to login, I need to be able to type my root password which contains special characters like é. How can I obtain these characters? I tried to go on grub console to try to type but I was not able to obtain the right characters...

Why does NetworkManager pushes .in-addr.arpa domains to dnsmasq when connecting to a VPN?

Posted: 02 Jun 2021 06:44 AM PDT

I'm trying to setup NetworkManager/dnsmasq combo on an ArchLinux box and connect to a VPN (OpenVPN). It seems to work as expected, except a bunch of weird entries in the log related to dnsmasq, e.g.

using nameserver 10.1.0.1#53 for domain 0.8.10.in-addr.arpa  using nameserver 10.1.0.1#53 for domain 0.1.10.in-addr.arpa  using nameserver 10.1.0.1#53 for domain 1.1.10.in-addr.arpa  using nameserver 10.1.0.1#53 for domain 2.1.10.in-addr.arpa  using nameserver 10.1.0.1#53 for domain 3.1.10.in-addr.arpa  using nameserver 10.1.0.1#53 for domain 4.1.10.in-addr.arpa  using nameserver 10.1.0.1#53 for domain 5.1.10.in-addr.arpa  using nameserver 10.1.0.1#53 for domain 6.1.10.in-addr.arpa  ...   

There're some 50 domains like these. Why does NetworkManager push such domains to dnsmasq and how are they supposed to be used?

Is parameter expansion in test expression possible?

Posted: 02 Jun 2021 09:10 AM PDT

When I try the following expression in bash I get a strange error message:

[: -lt: unary operator expected  

First the function definition

some_func () {    (( 3 + 5 ))  }  

And the expression

[ $(some_func) -lt 10 ] && true  

I guess the problem is mixing operators like -lt with command substitution and/or arithmetic expansion?

The exit code $? is 2 and the message is an unary op was expected.

basic diferences between root and real_root boot arg

Posted: 02 Jun 2021 07:47 AM PDT

I notice that we have set root=, but deeper there are real_root too. Also why the real_root is rarely used? I mean why it more common to use root rather the real_root?

Extract a specific key's value from a JSON file

Posted: 02 Jun 2021 08:08 AM PDT

I've got a huge JSON that looks like this. Sample

{    "Key": "4fa21496-3534-4480-8405-a0f7699a915e",    "FirstName": "XX",    "XX": "Liggins",    "City": "Dallas",    "RegionCode": "TX",    "RegionName": "Texas",    "Country": "United States",    "Latitude": "32.783060",    "Longitude": "-96.806670",    "TimeZone": "America/Chicago",    "IsCASL": false,    "Updated": "2018-02-28T07:32:28",    "HQCompanyName": "IHOP",    "Position": "Server",    "Level": "General",    "Department1": "General",    "DecisionMaker": false,    "EmailAddress": "YYY@gmail.com",    "EmailValidationStatus": "AcceptAll",    "EmailValidationDate": "2018-02-10T03:02:07.1692141+00:00",    "HQCompanyId": "XX2f37e171e26112cb",    "Experience": [      {        "HQCompanyId": "XX2f37e171e26112cb",        "Title": "Server",        "Level": "General",        "Department1": "General",        "DecisionMaker": false,        "Start": "2014",        "End": "2015",        "EmailAddress": "XXX@gmail.com",        "SecondaryCompanyId": "10407780-c062-40c9-8783-110aa931a9c5",        "Updated": "2018-08-31T23:52:31.663147Z"      },      {        "HQCompanyId": "128ce753-6a72-4028-8a17-d76a1c53b22e",        "Title": "XX",        "Level": "General",        "Department1": "General",        "DecisionMaker": false,        "Start": "May 2015",        "End": "December 2015",        "Duration": "7 months",        "Updated": "2018-08-31T23:52:31.663147Z"      }    ],    "Education": [      {        "Name": "XX",        "Degree": "XX or equivalent",        "Start": "2004",        "End": "2008"      }    ],    "SearchUrl": "https://www.google.com/#newwindow=1&q=XX+X",    "SourceList": []  }  

I want to retrieve all email addresses from a json file, basically the user@domain in EmailAddress: "user@domain" so it looks like this,

YYY@gmail.com  XXX@gmail.com  

Can I avoid re-installing Software in case of OS failure by having a separate "/usr" partition?

Posted: 02 Jun 2021 07:04 AM PDT

I am using Ubuntu 20.04. I have read that if my /home partition is separate from the root then in case of reinstalling Ubuntu, I still can keep my personal files. This is like having a separate drive in Windows other than C:\ to keep my files on. In case of a re-installation, I only format the OS drive/partition.

Suppose I have a separate /usr partition, can I keep using the software installed in /usr after I reinstall Ubuntu on the root partition? This won't work in Windows, for example. The software installed in another drive won't be usable if I reinstall Windows on drive C:\. I am wondering if the same is true with Ubuntu.

Is there any sosreport data available if reinstall sosreport?

Posted: 02 Jun 2021 08:02 AM PDT

The current rhel node02 (cluster) is down. Any previous sosreport data available if reinstall back sosreport?

btrfs merge data from two subvolumes and send with clone option

Posted: 02 Jun 2021 09:03 AM PDT

I'm explaining shortly. I have two separate subvolumes for movies and music, that I'm backing up on another disk with send/receive. I would like to merge the two subvolumes in one (with cp --reflink) and send this to the backup drive cloning reflinked files from existing snapshots.

I've tried to create new_volume, then cp -rx --reflink "music" "movies" into it, then:

btrfs send \      -c music-snapshot \      -c movies-snapshot \      new_volume-snapshot | btrfs receive /path/to/backup  

but i complains that can't determine parent for new_volume (identified by id):

ERROR: parent determination failed for <id_number>  

Of course music-snapshot and movies-snapshot exist on backup. I've also tried to snapshot movies to new_volume, then cp -rx --reflink "music" into it, then snapshot and send it with btrfs send -c music-snapshot -p movies-snapshot new_volume-snapshot, but it seems that -c music-snapshot has no effects, data is sent anyway.

Is what I want to do even possible?

EDIT: I also tried to do this:

btrfs sub snap -r movies movies-A  btrfs sub snap -r music music-A   btrfs sub snap movies new_volume  btrfs sub snap -r new_volume new_volume-A  

At this point I have:

movies-A  music-A  new_volume-A (exact clone of movies-A)  

Then:

cp -rx --reflink music/* new_volume/  btrfs sub snap -r new_volume new_volume-B  

In the end, with both movies-A and music-A existing in destination, I can do:

btrfs send \      -p movies-A \      new_volume-A | btrfs receive /backup/  

and this is always perfectly working (near to zero data sent). But...

btrfs send \      -p new_volume-A \      -c music-A \      new_volume-B | btrfs receive /backup/  

I don't know how to explain: with "some files" from music it works, while with others, it keeps sending data as it was ignoring the source. I think that this way SHOULD definitely work, but I can't reproduce reliably neither the "work" nor the "don't work" behavior. I'm oriented to think that there's a bug somewhere. Could somebody try this?

Forwarding the local service ports through wireguard and back for the local service

Posted: 02 Jun 2021 09:28 AM PDT

My System:

Local: Arch Linux  VPS: Linode uubuntu 20.04.1  Standard Wireguard Package on both ends  

So I am using airdcppd, a file sharing program which uses 3 ports on my local machine to transfer traffic info.

They are:

23288/tcp  21500/udp  13875/tcp  

What I want to do is to forward these ports to the VPS wireguard so it will appear as if the ports on running on the server side and are opened to the public.

To achieve this I modified my wireguard interface config according to these guides:

Guide 1

Guide 2

So my config now looks like so:

local:

[Interface]  PrivateKey = <my key>  Address = 10.66.66.2/32,fd42:42:42::2/128  DNS = 1.1.1.1,94.140.15.15    # packet forwarding  PreUp = sysctl -w net.ipv4.ip_forward=1    # port forwarding  PreUp = iptables -t nat -A PREROUTING -d local.ip.address -p tcp --dport 23288 -j DNAT --to-destination 10.66.66.1  PreUp = iptables -t nat -A PREROUTING -d local.ip.address -p udp --dport 21500 -j DNAT --to-destination 10.66.66.1  PreUp = iptables -t nat -A PREROUTING -d local.ip.address -p tcp --dport 13875 -j DNAT --to-destination 10.66.66.1  PostDown = iptables -t nat -D PREROUTING -d local.ip.address -p tcp --dport 23288 -j DNAT --to-destination 10.66.66.1  PostDown = iptables -t nat -D PREROUTING -d local.ip.address -p udp --dport 21500 -j DNAT --to-destination 10.66.66.1  PostDown = iptables -t nat -D PREROUTING -d local.ip.address -p tcp --dport 13875 -j DNAT --to-destination 10.66.66.1    [Peer]  PublicKey = <my key>  PresharedKey = <my key>  Endpoint = vps.ip.address:49503  AllowedIPs = 0.0.0.0/0,::/0  

server:

[Interface]  Address = 10.66.66.1/24,fd42:42:42::1/64  ListenPort = 49503  PrivateKey = <my key>    PreUp = iptables -t nat -A PREROUTING -d vps.ip.address -p tcp --dport 23288 -j DNAT --to-destination 10.66.66.2  PreUp = iptables -t nat -A PREROUTING -d vps.ip.address -p udp --dport 21500 -j DNAT --to-destination 10.66.66.2  PreUp = iptables -t nat -A PREROUTING -d vps.ip.address -p tcp --dport 13875 -j DNAT --to-destination 10.66.66.2  PostDown = iptables -t nat -D PREROUTING -d vps.ip.address -p tcp --dport 23288 -j DNAT --to-destination 10.66.66.2  PostDown = iptables -t nat -D PREROUTING -d vps.ip.address -p udp --dport 21500 -j DNAT --to-destination 10.66.66.2  PostDown = iptables -t nat -D PREROUTING -d vps.ip.address -p tcp --dport 13875 -j DNAT --to-destination 10.66.66.2    ### Client name  [Peer]  PublicKey = <my key>  PresharedKey = <my key>  AllowedIPs = 10.66.66.2/32,fd42:42:42::2/128  

So as you can probably see, my wireguard internal address for local is: 10.66.66.2 and for the server is 10.66.66.1

What happens now is that the local port 23288 on local machine, which appears as open without being vpn-ed is also shown as open after checking with a port checker. The other three ports are still closed but that is not too much of a concern since the main port used is open and that is good enough for my purposes. The other ports are also shown as closed even without being vpn-ed.

No firewalls are used as of now, I am going to allow all the ports invovled after I get this working.

The problem arises is what happens after the packages are sent through the vpn, it doesn't seem to come back to local. As you can I see, I did set up the rules to send back all the packages on those 3 ports back to local machine. But for some reason I am not getting them, as in the app airdc is not displaying what it should.

Did I do something wrong in trying to "forward" back the traffic of those ports to the local machine? Is it the correct way for my local app to receive back the packges? If it is not, what should be the correct way of setting up the VPS wireguard config so that whatever is forwarded on those three ports are returned properly?

Thank you for looking!

EDIT: The local port I use to use to access the service is http://localhost:5960 , and I would like to use that with the vpn so I can access it from the web too, so like this: https://vps.ip.address:5960 , but even if I added a line to forward local port 5960 to the server with the same syntax above it is still not working, maybe this is the key to get the whole thing working too?

AIX create directory when copying

Posted: 02 Jun 2021 07:52 AM PDT

What is the best way to create a directory that does not exist when copying files in AIX? Something like this:

ssh server1 'cp -R ~user1/bin/log ~user2/bin/log'  cp: /u/user2/bin/log: No such file or directory  ssh server1 'cp -r ~user1/bin/log ~user2/bin/log'  cp: /u/user2/bin/log: No such file or directory  

The ~user2/ directory exists, but not the ~user2/bin directory.

Changing Python's default version breaks Ubuntu 20.04

Posted: 02 Jun 2021 08:26 AM PDT

I'm creating an AMI of Ubuntu 20.04 (Focal Fossa), and I want the default Python version to be 3.6.

I installed Python 3.6, also the right pip, and then set the alternative like so:

update-alternatives --install \    /usr/bin/python3 \    python3 \    /usr/bin/python3.6 \    10  

But then I'm running into many issues related to CPython packages, such as python3-apt (apt_pkg, apt_inst), netifaces, and probably many more I didn't catch yet.

They are all located on /usr/lib/python3/dist-packages and the package names are in this format:

{name}.cpython-38-x86_64-linux-gnu.so  

Which makes sense, since the default Python version of Ubuntu 20.04 is Python 3.8.

The immediate solution from googling is linking the name like so:

ln -s {name}.cpython-38-x86_64-linux-gnu.so {name}.so  

I.e.:

ln -s apt_pkg.cpython-38-x86_64-linux-gnu.so apt_pkg.so  ln -s netifaces.cpython-38-x86_64-linux-gnu.so netifaces.so  

I tried reinstalling the relevant packages (apt install --reinstall python3-apt) when the default Python version is 3.6, but it didn't work, and this solution of linking the *.so files is not scalable!

Is there a way to make Python 3.6 work with the system's default CPython packages?

Ubuntu 20.04: File explorer takes very long to open

Posted: 02 Jun 2021 07:28 AM PDT

For about one month now I have the problem that all tasks related to opening the file explorer in Ubuntu 20.04 (Gnome) take very long. Whether I directly try to use the file explorer or via a menu (e.g. upload a file through a browser file picker). I usually takes around 10 seconds. This makes using Ubuntu impossible and I really consider switching back to windows to get stuff done.

I have since twice reinstalled Ubuntu after formatting the hard drive but the problem remains. I would be glad if someone could help me debug this problem.

One thing to note: Once I opened the file explorer and keep the window open, a second window opens with the regular speed.

If I run nautilus from the command line I get the following output (in German)

Error creating proxy: Fehler beim Aufruf von StartServiceByName für org.gtk.vfs.GPhoto2VolumeMonitor: Zeitüberschreitung wurde erreicht (g-io-error-quark, 24)  Nautilus-Share-Message: 08:22:40.932: Called "net usershare info" but it failed: Kindprozess »net« konnte nicht ausgeführt werden (No such file or directory)  

Internet speed very slow on Fedora 34 running on a VM with Host on Windows

Posted: 02 Jun 2021 09:42 AM PDT

I recently installed Fedora 34 on a Oracle VirtualBox VM with my host running on Windows 10. I noticed that even to open a single website it takes a long time or when I use sudo dnf update or when I try to install a software. I am connecting the VM to the internet via Local LAN (Bridged Adapter).

When I try to test the Internet Speed using www.speedtest.net, it gets stuck on Finding Optimal Server.

On Windows, the internet speed works well and as expected.

Output of ifconfig

        [rajiviyer@fedora ~]$ ifconfig            enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500            inet 192.168.1.7  netmask 255.255.255.0  broadcast 192.168.1.255            inet6 fe80::2ecf:6dbe:e340:a3f6  prefixlen 64  scopeid 0x20<link>            ether 08:00:27:dc:f4:0c  txqueuelen 1000  (Ethernet)            RX packets 4883  bytes 5631694 (5.3 MiB)            RX errors 0  dropped 0  overruns 0  frame 0            TX packets 4223  bytes 446036 (435.5 KiB)            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0    

Please advice on how to resolve to match the download speed with my Windows host machine?

Thanks!

Is there any guide how to write bash scripts compatible with both CentOS and Ubuntu

Posted: 02 Jun 2021 07:33 AM PDT

I am simplifying my scenario here.

I've built a series of bash scripts and tested them under Ubuntu.

I want to make sure my scripts (bash syntax) work the same under CentOs.

Is there any guide how to write bash scripts compatible with both CentOS and Ubuntu ?

Or even better: is there any guide explains how create cross-linux-platform bash scripts?

Update and Clarification

In reference to @C.M. comment, I am not asking how bash works. I am asking if the bash interpreter code base is different among Linux distributions?

For example, Most of the Python 3's code base is the same among many many platform and behaves the same. To my experience Python code is very potable. The same apply to node.js code many other interpreters.

However, I am not sure if Bash benefits from the same portability. I might be wrong, but to me it seems that Bash is internally integrated inside Linux distributions. Am I correct? Do most linux distributions use the same source code repository to compile and distribute Bash?

mail: Can't send message: process exited with a non-zero status

Posted: 02 Jun 2021 10:01 AM PDT

Any idea why it is not sending mail for me? Am I missing something? I tried a few articles and it seems like I have done everything correctly; so I am a bit stuck on this?

sudo apt-get update  sudo apt-get install ssmtp  

And in /etc/ssmtp/ssmtp.conf I have:

root=hidennBecausePrivate@gmail.com  mailhub=smtp.gmail.com:587  FromLineOverride=YES  AuthUser=hidennBecausePrivate@gmail.com  AuthPass=password  UseTLS=YES  

I get this message when I enter this command:

echo "Hello world email body" | mail -s "Test Subject" hostname@gmail.com  mail: cannot send message: Process exited with a non-zero status  

Comfortable offline speech recognition software for Linux?

Posted: 02 Jun 2021 08:05 AM PDT

I'm looking for an offline speech recognition software for Linux which can handle also German language and which is easy to use and configure.

I already tried CMU Sphinx and a few more others, but all of them had one in common: they have been way too complicated to install/use, mainly because of lack of a good manual and also because of a very crude concept (I try to avoid the word "usability" in this context).

So...is there a speech recognition software out there which can be set-up and configured in finite time, is able to execute scripts on recognised commands and works fully offline, means does not need a cloud service or remote server to analyse spoken words? I'm also willing to pay money for a working and usable solution!

Every hint and idea is welcome!

Thanks!

PS: I'm aware of the thread Is there any decent speech recognition software for Linux? - but the answers given there do NOT point to offline solutions!

How to avoid mac-adress spoofing auto reset on connecting

Posted: 02 Jun 2021 08:03 AM PDT

Everytime I spoof my mac-adress on Ubuntu using different approaches including macchanger it auto resets as soon as I actually try to reconnect to the network.

This is what my problem looks like:
TERMINAL ENTRY before reconnection

root@M-Linux:~# macchanger -s wlp2s0  Current MAC:   XY (changed, obviously) (Hon Hai Precision Ind. Co.,Ltd.)  Permanent MAC: XY (Hon Hai Precision Ind. Co.,Ltd.)  root@M-Linux:~# ifconfig wlp2s0 down  root@M-Linux:~# macchanger -rb wlp2s0  Current MAC:   XY (Hon Hai Precision Ind. Co.,Ltd.)  Permanent MAC: XY (Hon Hai Precision Ind. Co.,Ltd.)  New MAC:       AB (unknown)  root@M-Linux:~# ifconfig wlp2s0 up  root@M-Linux:~# macchanger -s wlp2s0  Current MAC:   AB (unknown)  Permanent MAC: XY (Hon Hai Precision Ind. Co.,Ltd.)  

Then I reconnect to the WIFI and then this happens

root@M-Linux:~# macchanger -s wlp2s0  Current MAC:   XY (Hon Hai Precision Ind. Co.,Ltd.)  Permanent MAC: XY (Hon Hai Precision Ind. Co.,Ltd.)  

So the mac is back to normal.

I tried this on kubuntu 16.04.3 and another debian-based distro.

I tried it on my home and a public network. I tried it on two different machines: HP and Acer Notebooks.

Exact same results every time and NO information about the issue on the web.

What should I do?

Fedora 24: increase disk space on /dev/mapper/fedora-var

Posted: 02 Jun 2021 09:03 AM PDT

Here is my disk space usage:

Filesystem               Size  Used Avail Use% Mounted on  devtmpfs                 1.9G     0  1.9G   0% /dev  tmpfs                    1.9G  296K  1.9G   1% /dev/shm  tmpfs                    1.9G  1.6M  1.9G   1% /run  tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup  /dev/mapper/fedora-root   46G  6.0G   38G  14% /  tmpfs                    1.9G   76K  1.9G   1% /tmp  /dev/mapper/fedora-var   9.1G  8.2G  444M  95% /var  /dev/mapper/fedora-home  138G   16G  115G  12% /home  tmpfs                    387M   12K  387M   1% /run/user/42  tmpfs                    387M   16K  387M   1% /run/user/1000  

I got a 95% usage on /dev/mapper/fedora-var. I don't have much stuff to be cleaned and I am not sure whether cleaning the stuff would help in this issue. I would like to expand the disk space on /var, how could I do that? thanks

Installing GTK+3.22

Posted: 02 Jun 2021 07:14 AM PDT

I am having issues with installing GTK+ 3.22 on my laptop.

At first I tried downloading GTK and all its dependencies from here.

I ran ./configure && make && sudo make install to install the libraries above, but that did not work. I had a lot of undefined references and icons were missing so I uninstalled all the libraries.

After that I tried installing GTK again and made sure that I have every dependency installed correctly (even sub-dependencies). This time however I ran ./configure --prefix=/usr && make && sudo make install to install the libraries because I was following this guide.

The above broke my system completely, I couldn't do anything so I had to resort to safe-mode and reinstall the old GTK available on the apt repositories.

My question is, how can I install GTK+ 3.22 and make sure it works properly?

I am using Debian 8.

Fish-Shell Will Not Save my Aliases

Posted: 02 Jun 2021 07:34 AM PDT

I do not know why, but after making a whole bunch of fish aliases. I'm assuming I have neglected one simple step after assigning them all but I cannot seem find the solution myself.

Can anyone lend me a hand?

Thank you very much!

~Ev

How can I investigate what other users are currently logged in?

Posted: 02 Jun 2021 07:01 AM PDT

Since the last few days I get an error message when I try to shut my laptop down:

System policy prevents stopping the system when other users are logged in

This error message includes a prompt for administrator password.

I don't think that there should be other users logged in.

How can I find out what the problem is?

What I've tried

$ w   08:00:47 up  1:50,  2 users,  load average: 0,74, 0,95, 0,70  USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT  moose    tty8     :0               07:57    1:49m  4.88s  0.11s x-session-manager  moose    pts/0    :0.0             08:00    2.00s  0.11s  0.00s w      $ loginctl     SESSION        UID USER             SEAT                      c1        117 couchdb                                    c2       1000 moose            seat0             

2 sessions listed.

I'm not sure: is that already the problem?

$ sudo shutdown -h now worked as expected.

How I shut the computer down

By clicking on System > Shut Down... > Shut Down:

enter image description here

System information

I have Linux Mint MATE:

$ uname -a  Linux pc08 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux  $ cat /etc/issue  Linux Mint 16 Petra \n \l  

Magazine publishing software with RTL support

Posted: 02 Jun 2021 09:30 AM PDT

We want to publish an electronic magazine about to free software applications such as Gimp, Inkscape, GNU/Linux and so on. We need a magazine or book design application similar to InDesign of the Windows world. We found Scribus, but our language is written right-to-left and Scribus doesn't support RTL. What can we use?

No comments:

Post a Comment