Sunday, July 18, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How can I fix etckeeper or uninstall it so apt will install / remove new packages?

Posted: 18 Jul 2021 10:01 AM PDT

OS: Debian Buster 10.10

I am attempting to install a new package (I tried different packages) and apt (and DPkg) is complaining with the following error message(s):

/etc/etckeeper/pre-install.d/README: 1: /etc/etckeeper/pre-install.d/README: Files: not found  /etc/etckeeper/pre-install.d/README: 2: /etc/etckeeper/pre-install.d/README: etc.: not found  /etc/etckeeper/pre-install.d/README: 3: /etc/etckeeper/pre-install.d/README: uncommitted: not found  E: Problem executing scripts DPkg::Pre-Invoke 'if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi'  E: Sub-process returned an error code  

I decided to unstall etckeeper and got the exact same error message.

My googling / searching seems to be lacking. My reasoning is the problem lies with etckeeper, although I could be wrong.

Mounting issues with mount point

Posted: 18 Jul 2021 09:26 AM PDT

I have this weird problem:

...@debian:/$ sudo mount /dev/sdX1 /tmp/div  mount: /tmp/div: mount point does not exist.  ...@debian:/$ mkdir /tmp/div  mkdir: cannot create directory '/tmp/div': File exists  ...@debian:/$ sudo mount /dev/sdX1 /tmp/div  mount: /tmp/div: mount point does not exist.  

...

What is going on?

Why cant I share my screen on ubuntu?

Posted: 18 Jul 2021 09:08 AM PDT

recently I set up ubuntu, but the problem is I cant share my screen. It shaws black screen. others only can see my cursor.

Ownership, disk drives and permissions

Posted: 18 Jul 2021 09:00 AM PDT

I encountered an issue with a disk drive which I already posted on. (For the curious: Issue with device after formatting)

In short, one of my disks stopped allowing me to copy files by drag and drop using Dolphin (Debian), and allowed me only if I was doing it from the terminal using sudo.

I researched about my issue and noticed something:

  • This has already happened to me with another disk drive.

  • That disk drive and this one were erased with dd if=/dev/zero of=/dev/sdX where sdX is the drive in question

  • It did not happen with other disk drives which were not erased with dd but only formatted (with mkfs) and/or partitioned (e.g. gpt partition created with multiple primary partitions).

  • In that disk and this one, the owner was changed to root, and no longer user.

So my questions are:

  • Why did this happen with fully erased disks and not with formatted or partitioned disks?

  • How do permissions work exactly? Are they written into the disks? Or is ownership written into the disk?

  • Is it possible to change the owner of the disk so that the change is persistent across Linux distributions?

String compatibility for bash and shell script

Posted: 18 Jul 2021 09:54 AM PDT

I have a script that is going to execute in shell and bash on Debian linx.

  1. When it is called executing shell following echo command works perfectly, which replaces \t with 3 spaces, however, it fails when executed in #/bin/bash
    #/bin/sh  echo "Hello\tworld"  
    Output
    Hello   world  
  2. When it is called executing bash following echo command works perfectly, which replaces \t with 3 spaces, however, it fails when executed in #/bin/sh
    #/bin/bash  echo -e "Hello\tworld"  
    Output
    Hello   world  

Is there any way where the same line command to replace \t with 3 spaces irrespective of the script will get executed in shell or bash?

Use of rsync for fast and complete transfer

Posted: 18 Jul 2021 08:56 AM PDT

I want to use rsync for fast transfer. Is -z, --compress (compress file data during the transfer) secure, and how can I check that each file is transferred completely.

Have done rsync --info=help to get

Use OPT or OPT1 for level 1 output, OPT2 for level 2, etc.; OPT0 silences.    BACKUP     Mention files backed up  COPY       Mention files copied locally on the receiving side  DEL        Mention deletions on the receiving side  FLIST      Mention file-list receiving/sending (levels 1-2)  MISC       Mention miscellaneous information (levels 1-2)  MOUNT      Mention mounts that were found or skipped  NAME       Mention 1) updated file/dir names, 2) unchanged names  PROGRESS   Mention 1) per-file progress or 2) total transfer progress  REMOVE     Mention files removed on the sending side  SKIP       Mention files that are skipped due to options used  STATS      Mention statistics at end of run (levels 1-3)  SYMSAFE    Mention symlinks that are unsafe    ALL        Set all --info options (e.g. all4)  NONE       Silence all --info options (same as all0)  HELP       Output this help message    Options added for each increase in verbose level:  1) COPY,DEL,FLIST,MISC,NAME,STATS,SYMSAFE  2) BACKUP,MISC2,MOUNT,NAME2,REMOVE,SKIP  

After doing the transfer, I really want to perform a transfer check, ideally with a list of files where complete transfer failed.

Non-complete transfer is not a rare occurrance in my experience, particularly during routine backups which happen quite frequently.

Would output to a log file from rsync be good enough to scan through and make a summary?

I also need some opinions on the --backup option. Is it worth using it for backups, or should I just use rsync commands that just transfer files without the use of --backup option?

-b, --backup      make backups (see --suffix & --backup-dir)  --backup-dir=DIR  make backups into hierarchy based in DIR  --suffix=SUFFIX   backup suffix (default ~ w/o --backup-dir)  

Paste text into sam editor from an external application

Posted: 18 Jul 2021 07:50 AM PDT

I am running the editor sam as a standalone application on Linux. I am using this version:

git clone https://github.com/9fans/plan9port plan9  

So far I have not been able to figure out a way to paste text into the bitmap display from an external Linux application. Is there a way to achieve this?

Linux (Zorin OS) , how to bind two keys to type a symbol

Posted: 18 Jul 2021 07:44 AM PDT

hello i am new to Linux , using Zorin OS (i don't know if it matters or not) , i am using a laptop who's "shift key" + "." // shift + period// is not working , the key works when i use a external keyboard so i guess its the keyboard problem so i want to bind two keys like lets say Ctrl + period to perform the right right arrow symbol , how can i?

i tried to use the same key on the terminal (Ctrl + Alt + F4) but it dose not work there thats why i know that it might be a keyboard problem , i also tried to check the settings of keyboard but there was no sortcut i found to be using the keybind to form the symbol,

i tired to do some google search on how to bind a key but cant find a better answer

How to confirm I'm connected with WPA3 (on Linux Mint 20.2)?

Posted: 18 Jul 2021 09:54 AM PDT

In my TP-Link router, I have set WPA version 2/3:

router WPA 2&3

I am on Linux Mint 20.2 and I have explicitly set WPA3 for my connection:

mint WPA 3 explicit


sudo wpa_cli status wlp60s0  

outputs:

Selected interface 'p2p-dev-wlp60s0'  wpa_state=DISCONNECTED  ...  

and

sudo iwlist wlp60s0 scanning  

outputs:

wlp60s0   Scan completed :            Cell 01 - Address: [mac-censored]                      Channel:48                      Frequency:5.24 GHz (Channel 48)                      Quality=58/70  Signal level=-52 dBm                        Encryption key:on                      ESSID:"[ssid-censored]"                      Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s                                36 Mb/s; 48 Mb/s; 54 Mb/s                      Mode:Master                      Extra:tsf=00000009e5fb8041                      Extra: Last beacon: 652ms ago                      ...                      IE: IEEE 802.11i/WPA2 Version 1                          Group Cipher : CCMP                          Pairwise Ciphers (1) : CCMP                          Authentication Suites (2) : PSK unknown (8)  

Question:

I am testing WPA3, so far only Steam has had some crashes due to WPA3 that I know of, a quote:

... Fixed crashes when on a WPA3 wireless network ...

How to confirm I'm connected with WPA3 (on Linux Mint 20.2)?


The furthest I managed to get was to verify the connected (as for searching for yes) network is WPA3-capable or more precisely WPA2/WPA3 as set in the router using nmcli:

sudo nmcli -f all -s dev wifi | grep -e yes -e SSID  

which outputs:

NAME   SSID                SSID-HEX                              BSSID              MODE   CHAN  FREQ      RATE        SIGNAL  BARS  SECURITY   WPA-FLAGS                 RSN-FLAGS                     DEVICE   ACTIVE  IN-USE  DBUS-PATH                                        AP[2]  [censored]          [censored]                            [censored]         Infra  48    5240 MHz  270 Mbit/s  79      ▂▄▆_  WPA2 WPA3  (none)                    pair_ccmp group_ccmp psk sae  wlp60s0  yes     *       /org/freedesktop/NetworkManager/AccessPoint/1    

XMonad crops dialog windows and their buttons - how to fix this?

Posted: 18 Jul 2021 06:03 AM PDT

For example, when I try to download something, I get the following:

  • the top of a dialog window: enter image description here

  • the bottom where the buttons are cropped:
    enter image description here

Shell script to search multiple pattern from file and match with more than 3 condition with patterns

Posted: 18 Jul 2021 08:54 AM PDT

I have done with some conditions but not able to use exact syntax to check more than 3 condition from file.

I am able to do multiple grep from file but not able to add 3 pattern with conditions. like below.

you can provide CASE/Loop/if-else(ladder syntax. I just want print user friendly msg to user when the user runs this script instead pattern which are found in startup.log file. and those user friendly msg should depend on what pattern found in startup.log

Suppose I found pid already exists when I fire above command in startup.log then I want to print echo "DB services already running" like this

pg_ctl -D $PGDATA start > startup.log    if [$? -eq 0]    then  #if db services is stopped priviously, then it will start and grep below msg to user   ls -t postgresql*.log | head -n1 | args grep "Database for read only connections"    else       elif  grep 'word1\|word2\|word3' startup.log     then    #if above word1 exists in file it should print below msg    echo "hello"    else     #if word2 is present in file it shhould print below msg                 echo " world"    #   and one more contion i want to add like below    #if word3 is exists in the file it should below msg       echo "postgresql"    

If you could provide 1 simple example, I really appreciate for that because, I have tried syntax but not able to resolve the issue.

data recovery on ext4 partition

Posted: 18 Jul 2021 06:07 AM PDT

this isn't a duplicate of previous similar questions. Hear me out ...alright. Thought the platform is android . The specific question pertains to ext4 data recovery.

Background
Just y'day ( aka < 24 hrs ) some process on my Android phone ( admittedly I lost my AT&T phone & till I could find another similar one - I used someone else's spare - turned out to be Xiaomi running MIUI. Previous morning woke up to find /data/data/com.whatsapp/databases ( & I am magiskcally rooted ) folder truncated by some crapware ( like cleaner ? still trying to figure out ) that Xiaomi runs. The way I always have it - I have all my Imp apps write their stuff on 2nd partition of SD card which is Ext4.

/data/data/<selected app Name> ---> /data/sdext2/data/<selected app Name>   /data/app/<selected app Name> ----> /data/sdext2/apk/<selected app Name>  

Soon as I realized - not too much time later - I unmounted my card and stuck it in my PC running live Linux. I used extundelete ext4magic testdisk and R-studio so I could locate that 1 msgstore.db file ( 1+ gb )

snippets of what I did

# tried various other ops including changing the `superblock`. Time based recovery and tinkered with various Util ops given      ext4magic -a $t  -s 4096 -n $n -R -c -f data/com.whatsapp/databases -d `pwd` /dev/sdd2     extundelete  --restore-directory data/com.whatsapp/databases --log ./extundelete.log /dev/sdd2  

from both the above I could't get that earlier instance of /data/data/com.whatsapp/databases/msgstore.db I was looking for . Other smaller though useless files could be recovered. R-studio p'much gave me the same stuff. Testdisk a 4k directory.


ref to this link right here - pretty much everything has been tried. No Luck. Deep Scans etc.
How do I get back my database file. I strongly suspect an uninvited 'cleaner' app hosed my WhatsApp database file. And I dont have recent backups. The one I have is a tad old. You'll say always backup. For some reason my Drive was full and I wasnt aware the nighty backup had'nt happened.

Questions

What else should I try. Given that the above supposedly powerful utilities have dont squat - any luck with other Utils. I read about scalpel -would that do any a better ?


How do I get the exact time-stamp audit when the delete happened and the `inodes` involved and `sector / block numbers` . Is it poss to retrieve that way ?
My understanding was that amongst all `filesystems` out there `ext4` being `journal`ed is best when it comes to digging out deleted data - now I am banking on this .

Sysstat Time Options and Command Differences

Posted: 18 Jul 2021 09:17 AM PDT

I would like to track total CPU and memory use on an Ubuntu 20.04 machine. For that purpose, I am about to install the sysstat library. I read the manuals of and posts on sar and related functions, but am still confused about the syntax.

What I would like to do: Record total CPU and memory use every five seconds. Export the data once a day as CSV and delete the binary data.

What confuses me: 1. There are multiple settings specifying time intervals. sar -u %system -r %memused 5 records CPU and memory use every five seconds. On top of that, the package generates "activity reports" every ten minutes as defined by 5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1 in /etc/cron.d/sysstat. I am confused about what happens every five seconds and what happens every ten minutes. Does the program first cache the data every five seconds and then writes it to a file every ten minutes? 2. Multiple functions write to disk. Which of them do I need? sar -u %system -r %memused -o 5, sadc -u %system -r %memused 5 -, or sa1? 3. Do I need to execute the code that generates a daily CSV file (sadf -d /var/log/sysstat/sa$(date +%d -d yesterday) > /home/some_user/sar_data.csv) as a chron job?

As a side note: if anyone knows of a solution that would be computationally more efficient than this sysstat approach, feel free to suggest it.

How to install gtk 1.2 on new system?

Posted: 18 Jul 2021 07:54 AM PDT

I try to install gtk 1.2 on Ubuntu 21.04 to run old c program.

After succesfull installing glib 1.2 ( with help of experts )

I have installed gtk 1.2 using modified files provided by Knud

sudo apt install ./libgtk1.2-common_1.2.10-18_i386.deb  [sudo] hasło użytkownika a:   Czytanie list pakietów... Gotowe  Budowanie drzewa zależności... Gotowe  Odczyt informacji o stanie... Gotowe     Uwaga, wybieranie "libgtk1.2-common:i386" zamiast "./libgtk1.2-common_1.2.10-18_i386.deb"  libgtk1.2-common:i386 is already the newest version (1.2.10-18).  0 aktualizowanych, 0 nowo instalowanych, 0 usuwanych i 0 nieaktualizowanych.    sudo apt install ./libgtk1.2_1.2.10-18_i386.deb  Czytanie list pakietów... Gotowe  Budowanie drzewa zależności... Gotowe  Odczyt informacji o stanie... Gotowe     Uwaga, wybieranie "libgtk1.2:i386" zamiast "./libgtk1.2_1.2.10-18_i386.deb"  Następujące pakiety zostały zainstalowane automatycznie i nie są już więcej wymagane:    libpthread-stubs0-dev:i386 libx11-dev:i386 libxau-dev:i386 libxcb1-dev:i386    libxdmcp-dev:i386 libxext-dev:i386 libxfixes-dev:i386 libxi-dev:i386    x11proto-input-dev  Aby je usunąć należy użyć "sudo apt autoremove".  Następujące pakiety zostaną USUNIĘTE:    libgtk1.2-dev:i386  Następujące pakiety zostaną zaktualizowane:    libgtk1.2:i386  1 aktualizowanych, 0 nowo instalowanych, 1 usuwanych i 0 nieaktualizowanych.  Konieczne pobranie 0 B/837 kB archiwów.  Po tej operacji zostanie zwolnione 3 822 kB miejsca na dysku.  Kontynuować? [T/n] t  Pobieranie:1 /home/a/Pobrane/gtk/knud/libgtk1.2_1.2.10-18_i386.deb libgtk1.2 i386 1.2.10-18 [837 kB]  (Odczytywanie bazy danych ... 216199 plików i katalogów obecnie zainstalowanych.  )  Usuwanie pakietu libgtk1.2-dev:i386 (1.2.10-17build1) ...  (Odczytywanie bazy danych ... 215939 plików i katalogów obecnie zainstalowanych.  )  Przygotowywanie do rozpakowania pakietu .../libgtk1.2_1.2.10-18_i386.deb ...  Rozpakowywanie pakietu libgtk1.2:i386 (1.2.10-18) nad (1.2.10-17build1) ...  Konfigurowanie pakietu libgtk1.2:i386 (1.2.10-18) ...  Przetwarzanie wyzwalaczy pakietu man-db (2.9.4-2)...  Przetwarzanie wyzwalaczy pakietu libc-bin (2.33-0ubuntu5)...  N: Download is performed unsandboxed as root as file '/home/a/Pobrane/gtk/knud/libgtk1.2_1.2.10-18_i386.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Brak dostępu)  a@zalman:~/Pobrane/gtk/knud$ sudo apt install ./libgtk1.2_1.2.10-18_i386.deb  Czytanie list pakietów... Gotowe  Budowanie drzewa zależności... Gotowe  Odczyt informacji o stanie... Gotowe     Uwaga, wybieranie "libgtk1.2:i386" zamiast "./libgtk1.2_1.2.10-18_i386.deb"  libgtk1.2:i386 is already the newest version (1.2.10-18).  Następujące pakiety zostały zainstalowane automatycznie i nie są już więcej wymagane:    libpthread-stubs0-dev:i386 libx11-dev:i386 libxau-dev:i386 libxcb1-dev:i386 libxdmcp-dev:i386 libxext-dev:i386 libxfixes-dev:i386    libxi-dev:i386 x11proto-input-dev  Aby je usunąć należy użyć "sudo apt autoremove".  0 aktualizowanych, 0 nowo instalowanych, 0 usuwanych i 0 nieaktualizowanych.  

Check :

ldconfig -p    libgtksourceview-4.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgtksourceview-4.so.0      libgtkmm-3.0.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1      libgtk-3.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgtk-3.so.0      libgtk-1.2.so.0 (libc6) => /lib/libgtk-1.2.so.0      libgtk-x11-2.0.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0  

So now I can compile the program

make  /usr/bin/gcc -std=gnu89 -Wall -g -I /usr/include/glib-1.2 -I /usr/include/gtk-1.2 -I /usr/lib/glib/include  -o julia2 complex.o imagearea.o zero.o cpoly.o julia2.o `gtk-config --cflags` `gtk-config --libs` -lgthread  /bin/sh: 1: gtk-config: not found  /bin/sh: 1: gtk-config: not found  / usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libgthread.a when looking for -lgthread  / usr / bin / ld: leave incompatible /lib/../lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /lib/../lib/libgthread.a when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/../lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/../lib/libgthread.a when looking for -lgthread  / usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../libgthread.a when -lgthread is searched  / usr / bin / ld: leave incompatible /lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /lib/libgthread.a when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/libgthread.a when -lgthread is searched  / usr / bin / ld: cannot find -lgthread  / usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /lib/../lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/../lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/gcc/x86_64-linux-gnu/10/../../../libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /lib/libgthread.so when -lgthread is searched  / usr / bin / ld: leave incompatible /usr/lib/libgthread.so when -lgthread is searched  collect2: error: ld returned 1 exit status  make: *** [makefile:13: julia2] Błąd 1  

Manual check shows that ther is no "/usr/include/gtk-1.2" directory

Should I install dev package ?

============ edit =====================

Installing dev package :

sudo apt install ./libgtk1.2-dev_1.2.10-18_i386.deb  Czytanie list pakietów... Gotowe  Budowanie drzewa zależności... Gotowe  Odczyt informacji o stanie... Gotowe     Uwaga, wybieranie "libgtk1.2-dev:i386" zamiast "./libgtk1.2-dev_1.2.10-18_i386.deb"  libgtk1.2-dev:i386 is already the newest version (1.2.10-18).  0 aktualizowanych, 0 nowo instalowanych, 0 usuwanych i 0 nieaktualizowanych.    

Issue with device after formatting

Posted: 18 Jul 2021 06:37 AM PDT

I need some help with an SSD disk drive that I am using, or trying to.

I encrypted the SSD with cryptsetup, then I forgot about it (there were some files). I rewrote the disk drive completely (using dd if=/dev/zero of=/dev/sdX, with sdX the disk drive in question). I formatted it (mkfs.ext4 /dev/sdX). The process worked fine.

Then, I tried to copy files to my drive, by drag and drop (Dolphin). It would not work. It would only work through terminal with sudo.

Restarted the computer. I tried to mount the device and copy some files. It apparently worked (drag and drop). But the files were not copied to the device, only to the mount point (which apparently did not sync to the device). However, there is a lost+found file, which would not open using dolphin.

I tried to run sync in the terminal. After 30 min, it was still running and unresponsive. Shutdown the computer.

I then used another Linux. It told me that the drive was unreadable (through terminal).

I then reformatted the device: mkfs.ext3 /dev/sdX.

After doing this, I still see the lost+found file. I cannot access it through Dolphin, cannot delete it through Dolphin. I can only access it through the terminal with su. It is empty.

How come the lost+found file is still on the device although I reformatted it? What can I do? Should I just leave it?

I still cannot write anything to the device without being su. What can I do? where is the issue? Is this an issue with permissions? Or something else?

I use Debian.

Edit1: fsck says the device is clean.

Edit2: I tried to use mkdir to create a directory in /media/user/DRIVEPATH/direc. The result was: Permission denied. Why? I should not need sudo for this.

is there some tool to manage ssh port forward

Posted: 18 Jul 2021 09:48 AM PDT

Now I am using ssh port forward to access remote redis or other service through 22 port. When I want to connect redis on remote public domain server, I will open the ssh port forward in the terminal like this:

ssh -L 6479:127.0.0.1:6379 -N -f root@8.8.8.8  

then I could using GUI tool connect to local 6479 port to access remote redis server. But every time I would run the ssh port forward in terminal and I have to remember the long command. Is there any tool to manage the port forward so I could open close the port or add remove the port forward easily? I found the Mobaxterm but it only works on windows, I am using macOS and Fedora.

Grep String that contains only two number

Posted: 18 Jul 2021 07:55 AM PDT

I have a Sample file which contains strings as

GABCDF64V3  HABDDF61WE  KABSDF6WER  HAADYF6WE2  

I need only values which strings contain two numbers only(Anywhere in the string), Means output should be HABDDF61WE and HAADYF6WE2 only.

I tried this expression

grep -E '.*[0-9]{1,}.*[0-9]{1,}.*'  

But the output is different

Reduce AMD GPU Wattage

Posted: 18 Jul 2021 08:04 AM PDT

How would I reduce the Wattage (is that a word?), of a somewhat recent open source AMDGPU supported GPU on Linux?

The objective here is to reduce power consumption and get closer to the Performace/Watt sweet spot, that is at a lower power consumption than what cards ship with.

Ideally this would be with software packaged in debian. Thanks!

Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24) ,Network is unreachable) [IP: 91.189.88.142 80

Posted: 18 Jul 2021 09:19 AM PDT

So I just now did a fresh install to Linux Mint 20, but this problem was also present in Linux Mint 19.3. Every time I try to do a apt-get update or apt-get upgrade or even download software from the software manager I get an error. The same thing happened when I tried to update what the update manager recommended.

I found that I can upgrade or update if I keep running the command sudo apt-get update/upgrade after every failed attempt. As each update/upgrade stops at a certain percentage, when I run the command again it continues from that same percentage and by doing the update/upgrade a few times it finally completes.

This is the error I get when I tried downloading VLC from the software manager. It first says:

Failed to download package files  Check your Internet connection.  

And the details are :

Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/s/sdl-image1.2/libsdl-image1.2_1.2.12-12_amd64.deb Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out [IP: 91.189.88.142 80]  Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/s/sidplay-libs/libsidplay2_2.1.1-15ubuntu2_amd64.deb Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 91.189.88.142 80]  Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/libs/libspatialaudio/libspatialaudio0_0.3.0+git20180730+dfsg1-2build1_amd64.deb Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 91.189.88.142 80]  Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/s/srt/libsrt1_1.4.0-1build1_amd64.deb Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 91.189.88.142 80]  Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/libs/libssh2/libssh2-1_1.8.0-2.1build1_amd64.deb Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 91.189.88.142 80]  Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/p/pupnp-1.8/libupnp13_1.8.4-2ubuntu2_amd64.deb Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 91.189.88.142 80]  

...and so on.

The two specific error values of error which appear everywhere are 2001:67c:1360:8001::23 and 91.189.88.152. The software sources my machines uses right now are:

(Main) http://packages.linuxmint.com  (Focal) http://archive.ubuntu.com/ubuntu  

I tried changing the Focal sources to many different ones but no success. And I even messed up with the source.list files present in /etc/apt/source.list.d before and had to fresh install Linux due to many problems. So I really do not know what to do here and have found many others with the same problem.

xrdp disconnects immediately after connection from Windows10/Centos to Centos7

Posted: 18 Jul 2021 06:11 AM PDT

This is my xrdp config:

[Globals]  ini_version=1  fork=true  port=3389  use_vsock=false  tcp_nodelay=true  tcp_keepalive=true  security_layer=negotiate  crypt_level=high  certificate=  key_file=  ssl_protocols=TLSv1.2, TLSv1.3  autorun=  allow_channels=true  allow_multimon=true  bitmap_cache=true  bitmap_compression=true  bulk_compression=true  max_bpp=128  use_compression=yes  new_cursors=true  use_fastpath=both  blue=009cb5  grey=dedede  ls_top_window_bg_color=009cb5  ls_width=350  ls_height=430  ls_bg_color=dedede  ls_logo_filename=  ls_logo_x_pos=55  ls_logo_y_pos=50  ls_label_x_pos=30  ls_label_width=65  ls_input_x_pos=110  ls_input_width=210  ls_input_y_pos=220  ls_btn_ok_x_pos=142  ls_btn_ok_y_pos=370  ls_btn_ok_width=85  ls_btn_ok_height=30  ls_btn_cancel_x_pos=237  ls_btn_cancel_y_pos=370  ls_btn_cancel_width=85  ls_btn_cancel_height=30  [Logging]  LogFile=xrdp.log  LogLevel=DEBUG  EnableSyslog=true  SyslogLevel=DEBUG  [Channels]  rdpdr=true  rdpsnd=true  drdynvc=true  cliprdr=true  rail=true  xrdpvr=true  tcutils=true  [Xvnc]  name=Xvnc  lib=libvnc.so  username=ask  password=ask  ip=127.0.0.1  port=-1  [Xorg]  name=Xorg  lib=libxup.so  username=ask  password=ask  ip=127.0.0.1  port=-1  code=20  

I am trying to connect with mstsc to this machine (this is after fresh pc restart, noone has logged in):

enter image description here

while in this login box, no disconnect happens:

enter image description here

after I put there correct login/password, I get black screen first and then mstsc window closes. I tried to connect from KDE remote connection application, but it also failed same way. xrdp.log doesn't seem to contain anything interesting:

[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350  [20190606-04:14:36] [INFO ] xrdp_wm_log_msg: sesman connect ok  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...  [20190606-04:14:36] [DEBUG] return value from xrdp_mm_connect 0  [20190606-04:14:36] [INFO ] xrdp_wm_log_msg: login successful for display 10  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC started connecting  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC connecting to 127.0.0.1 5910  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC tcp connected  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC security level is 2 (1 = none, 2 = standard)  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC password ok  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending share flag  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving server init  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving pixel format  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving name length  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving name  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending pixel format  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending encodings  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending framebuffer update request  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending cursor  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC connection complete, connected ok  [20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: connected ok  [20190606-04:14:36] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful  [20190606-04:14:36] [DEBUG] Closed socket 18 (AF_INET 127.0.0.1:47744)  [20190606-04:14:37] [DEBUG] Closed socket 20 (AF_UNIX)  [20190606-04:14:37] [DEBUG] Closed socket 12 (AF_INET 127.0.0.1:3389)  [20190606-04:14:37] [DEBUG] xrdp_mm_module_cleanup  [20190606-04:14:37] [DEBUG] VNC mod_exit  [20190606-04:14:37] [DEBUG] Closed socket 19 (AF_INET 127.0.0.1:40224)  

How can I fix that?

Why doesn't dig myip.opendns.com @resolver1.opendns.com use sshuttle's proxy?

Posted: 18 Jul 2021 07:05 AM PDT

I am using the great technique from How can I get my external IP address in a shell script? to find my public IP address:

dig +short myip.opendns.com @resolver1.opendns.com  

I'm also using sshuttle as a proxy over ssh tunnel. It is started to forward traffic on all ports and IPs (including DNS requests) using the following command:

sshuttle --dns -vr usr@sshserver 0/0  

After the proxy has started I visit https://canihazip.com/s to verify that my external IP has changed. It has, but when I run the dig command again, it reports the same external IP reported as before the proxy was started.

From the verbose output, sshuttle seems to be forwarding on other dig commands, and checking https://dnsleaktest.com only reveals the IP on the other end on my proxy, as expected. As far as I can tell sshuttle seems to be working.

Can anyone explain why the dig command reports my external IP before the proxy? My aim is make it seem to the opendns servers that the request is originating from my ssh server.

It's a bit over my head, but I had a quick look in Wireshark and when filtering for DNS traffic Wireshark doesn't see any DNS requests apart from the above DIG command. The command is bypassing the proxy.

I'm happy to use any of the other (less elegant) ways to find my external IP, but this makes me ask the question: what else is bypassing sshuttle?

create variables from CSV with varying number of fields

Posted: 18 Jul 2021 10:02 AM PDT

Looking for some help turning a CSV into variables. I tried using IFS, but seems you need to define the number of fields. I need something that can handle varying number of fields.

*I am modifying my original question with the current code I'm using (taken from the answer provided by hschou) which includes updated variable names using type instead of row, section etc.

I'm sure you can tell by my code, but I am pretty green with scripting, so I am looking for help to determine if and how I should add another loop or take a different approach to parsing the typeC data because although they follow the same format, there is only one entry for each of the typeA and typeB data, and there can be between 1-15 entries for the typeC data. The goal being only 3 files, one for each of the data types.

Data format:

Container: PL[1-100]      TypeA: [1-20].[1-100].[1-1000].[1-100]-[1-100]                        TypeB: [1-20].[1-100].[1-1000].[1-100]-[1-100]                            TypeC (1 to 15 entries):  [1-20].[1-100].[1-1000].[1-100]-[1-100]   

*There is no header in the CSV, but if there were it would look like this (Container, typeA, and typeB data always being in position 1,2,3, and typeC data being all that follow): Container,typeA,typeB,typeC,tycpeC,typeC,typeC,typeC,..

CSV:

PL3,12.1.4.5-77,13.6.4.5-20,17.3.577.9-29,17.3.779.12-33,17.3.802.12-60,17.3.917.12-45,17.3.956.12-63,17.3.993.12-42  PL4,12.1.4.5-78,13.6.4.5-21,17.3.577.9-30,17.3.779.12-34  PL5,12.1.4.5-79,13.6.4.5-22,17.3.577.9-31,17.3.779.12-35,17.3.802.12-62,17.3.917.12-47  PL6,12.1.4.5-80,13.6.4.5-23,17.3.577.9-32,17.3.779.12-36,17.3.802.12-63,17.3.917.12-48,17.3.956.12-66  PL7,12.1.4.5-81,13.6.4.5-24,17.3.577.9-33,17.3.779.12-37,17.3.802.12-64,17.3.917.12-49,17.3.956.12-67,17.3.993.12-46  PL8,12.1.4.5-82,13.6.4.5-25,17.3.577.9-34  

Code:

#!/bin/bash  #Set input file  _input="input.csv"  #  Pull variables in from csv  # read file using while loop  while read; do      declare -a COL=( ${REPLY//,/ } )      echo -e "containerID=${COL[0]}\ntypeA=${COL[1]}\ntypeB=${COL[2]}" >/tmp/typelist.txt      idx=1      while [ $idx -lt 10 ]; do          echo "typeC$idx=${COL[$((idx+2))]}" >>/tmp/typelist.txt          let idx=idx+1  #whack off empty variables  sed '/\=$/d' /tmp/typelist.txt > /tmp/typelist2.txt && mv /tmp/typelist2.txt /tmp/typelist.txt  #set variables from temp file  . /tmp/typelist.txt  done  sleep 1    #Parse data in this loop.#  echo -e "\n"  echo "Begin Processing for $container"  #echo $typeA  #echo $typeB  #echo $typeC  #echo -e "\n"    #Strip - from sub data for extra parsing    typeAsub="$(echo "$typeA" | sed 's/\-.*$//')"  typeBsub="$(echo "$typeB" | sed 's/\-.*$//')"  typeCsub1="$(echo "$typeC1" | sed 's/\-.*$//')"    #strip out first two decimils for extra parsing  typeAprefix="$(echo "$typeA" | cut -d "." -f1-2)"  typeBprefix="$(echo "$typeB" | cut -d "." -f1-2)"  typeCprefix1="$(echo "$typeC1" | cut -d "." -f1-2)"    #echo $typeAsub  #echo $typeBsub  #echo $typeCsub1  #echo -e "\n"    #echo $typeAprefix  #echo $typeBprefix  #echo $typeCprefix1  #echo -e "\n"    echo "Getting typeA dataset for $typeA"  #call api script to pull data ; echo out for test  echo "API-gather -option -b "$typeAsub" -g all > "$container"typeA-dataset"  sleep 1        echo "Getting typeB dataset for $typeB"  #call api script to pull data ; echo out for test  echo "API-gather -option -b "$typeBsub" -g all > "$container"typeB-dataset"  sleep 1      echo "Getting typeC dataset for $typeC1"  #call api script to pull data ; echo out for test  echo "API-gather -option -b "$typeCsub" -g all > "$container"typeC-dataset"  sleep 1      echo "Getting additional typeC datasets for $typeC2-15"  #call api script to pull data ; echo out for test  echo "API-gather -option -b "$typeCsub2-15" -g all >> "$container"typeC-dataset"  sleep 1      echo -e "\n"  done < "$_input"    exit 0  

Speed isnt a concern, but if I've done anything really stupid up there, feel free to slap me in the right direction. :)

ssh-keyscan has no output

Posted: 18 Jul 2021 09:58 AM PDT

I have server script that automatically pulls down and installs a github repository. As part of the script, I'm running ssh-keyscan -H github.com >> ~/.ssh/known_hosts as the git user to automatically accept github's RSA key prior to checking out the repo.

I have successfully used this same script in a local vagrant instance, as well as on several servers. However, on one of the servers this doesn't work, because ssh-keyscan -H github.com doesn't return any output (I've tried this as the git user, my personal user, and as root, and the command acts the same). I can ping github.com, so it's not a connection issue; I can also run ssh-keyscan successfully on another server in the same network. I've tried upgrading SSH to see if that might be the issue, but it is already on the latest version for my distribution (CentOS 7).

Where would be a good place to start in troubleshooting this? I've tried searching StackExchange for issues related to 'ssh-keyscan', but I haven't yet found anything that fits this particular problem.

How to add a line break inside a bash string? [duplicate]

Posted: 18 Jul 2021 08:20 AM PDT

I have the following bash string and I need to add a line break to it, before the 'Hello' string:

bash -c "echo 'Hello' > /location/file"  

I already tried adding it with different variations of the \n syntax; Before the double quotes, inside the range of the double quotes, and with different variations of escaping.

How could I add a line break just before the 'Hello' string, so to make it appear in the second row?

localhost not working when using wi-fi hotspot on Iphone 4

Posted: 18 Jul 2021 06:03 AM PDT

I've just moved out of an office where localhost would load a web application I am working on (apache2). I used the buildings wi-fi when at the office.

Now I am using a wi-fi hotspot on iPhone 4 in another building and typing localhost in both Chrome and Firefox loads a page of google search results, rather than the web application.

Is this a "known issue" that localhost operates differently when connected to an iPhone hotspot via wi-fi?

And if so, how do I get localhost to work as per usual?

System Info

Operating System: Linux Mint 17.2 Cinnamon 64-bit

Cinnamon Version: 2.6.13

Linux Kernel: 3.16.0-29-generic

iPhone: 4

iOS: 7.1.2 (11D257)

Update/Solution

Sorry, I think the addition of detail distorted my presentation of what the issue actually was.

I rephrased the issue as:

"Why can't I access localhost without an internet connection".

And found this solution, which worked:

https://askubuntu.com/a/2983

Check that you have this line in /etc/hosts:    127.0.0.1       localhost    If it is not there, add it.  

Thanks for your efforts in providing a solution though, I'm sure I and others will be able use the information in the future.

Read "/proc" to know if a process has opened a port

Posted: 18 Jul 2021 09:43 AM PDT

I need to know if a process with a given PID has opened a port without using external commands. I must then use the /proc filesystem. I can read the /proc/$PID/net/tcp file for example and get information about TCP ports opened by the process. However, on a multithreaded process, the /proc/$PID/task/$TID directory will also contains a net/tcp file. My question is :

do I need to go over all the threads net/tcp files, or will the port opened by threads be written into the process net/tcp file.

Why does renaming a file with mv command alter an inode's "change" date & time?

Posted: 18 Jul 2021 06:49 AM PDT

A file hello.c is renamed to hi.c. As the output of stat command shows, [change] time stamp has been changed. usually it is changed when inode of file got modified. Why renaming with mv command changes the content of inode and actually which attribute is modified?

xyz@linuxPC:~/Documents$ stat hello.c   File: 'hello.c'   Size: 568          Blocks: 8          IO Block: 4096   regular file  Device: 809h/2057d  Inode: 261889      Links: 1  Access: (0664/-rw-rw-r--)  Uid: ( 1000/ xyz)   Gid: ( 1000/ xyz)  Access: 2015-04-22 19:54:34.889330399 +0530  Modify: 2015-04-22 19:54:34.241330427 +0530  Change: 2015-06-21 15:46:45.365465523 +0530  Birth: -  xyz@linuxPC:~/Documents$ mv hello.c hi.c  xyz@linuxPC:~/Documents$ stat hi.c    File: 'hi.c'   Size: 568          Blocks: 8          IO Block: 4096   regular file  Device: 809h/2057d  Inode: 261889      Links: 1  Access: (0664/-rw-rw-r--)  Uid: ( 1000/ xyz)   Gid: ( 1000/ xyz)  Access: 2015-04-22 19:54:34.889330399 +0530  Modify: 2015-04-22 19:54:34.241330427 +0530  Change: 2015-06-21 15:48:23.361469822 +0530  Birth: -  

specify mount option in /etc/fstab (mode=1777)

Posted: 18 Jul 2021 09:00 AM PDT

I have following line in my /etc/fstab:

/dev/mapper/tmp /tmp    ext4    noexec,nodev,nosuid,mode=1777    0    0  

When I try to mount /tmp, I get following error in dmesg:

 EXT4-fs (dm-1): Unrecognized mount option "mode=1777" or missing value  

How can I specify that /tmp will have permissions 1777 ? I am recreating (formatting) the filesystem on /dev/mapper/tmp every time I boot, so the permissions do not survive reboot.

From what I googled, mode=1777 should do the job. But it does not work for me.

UPDATE:

To make the situation more illustrative, here is the script that I am using:

cryptsetup --key-file /dev/urandom create tmp /dev/sda2    mkfs.ext4 /dev/mapper/tmp > /dev/null 2>&1  

This script is run during the boot sequence, after checkroot. Then, later when bootall wants to mount /tmp, it sees the entry in fstab and mounts /dev/mapper/tmp as /tmp.

Since I am creating the LUKS device during every boot, I have to format the partition every time as well. Contrary to what some people have commented here, the permissions DO NOT survive the formatting. Obviously.

Change confirm-box default positions

Posted: 18 Jul 2021 09:22 AM PDT

I would like to change default position of confirm boxes.

For example:

When I clicking on Shutdown button, the confirm box position is located on Top-Left by default.

How do I change default position ?

Shot :

I'm Using Arch + XFCE

enter image description here

How to get the GNOME version?

Posted: 18 Jul 2021 07:37 AM PDT

Is there an authoritative way to get the GNOME version, as long as I have a working GNOME desktop (any version) running? Several of these suggestions don't work on my system, either because the executables and/or packages simply don't exist or the menu item isn't available.

No comments:

Post a Comment