Friday, October 8, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How does the trash directory work?

Posted: 08 Oct 2021 09:59 AM PDT

So, I am busy writing myself a program to move and restore items from my trash (recycle bin), currently I can move it to the trash, but if I try to restore it from the trash using a file manager, it fails.

The trash directory is located at ~/.local/share/Trash and it has 2 folders inside it, files/ to store the files you want to delete and info/, to store the data about the files. I got the file naming correct in the application, so that is not the problem, and I got the details that gets stored in the info/ folder correct as well. Yet, if I delete something with my file manager and then recover it from the trash, there is no problem, but when I move it to the trash with my code, it can only be recovered by manually moving it...

Here are some examples of my application:

$ nrash todelete.txt  > Moved to trash  

The above creates this: (inside Trash/files)

todelete.txt  

(inside Trash/info)

todelete.txt.trashinfo  

Inside the .trashinfo file, the following resides:

[Trash Info]  Path=/home/netsu/Documents/todelete.txt  DeletionDate=2021-10-08T18:24:04  

In a .trashinfo for a file deleted from the filemanager instead, you would find this:

[Trash Info]  Path=/home/netsu/Documents/pp.txt  DeletionDate=2021-10-08T18:25:02  

The two are exactly the same, yet don't work the same... Is there something I'm missing about moving things to the trash? Why can the file that was placed there by the file manager be restored, but the one I placed there can not? Is this the universal way the trash works on Linux distros, or does it change depending on distro/desktop environment?

Note: My file does appear inside Trash when I open it in the file manager, but I can't restore it.

  • Distro: Solus
  • DE: MATE
  • File Manager: Caja

How to automatically check and record DSL connectivity?

Posted: 08 Oct 2021 10:17 AM PDT

I suffer from frequent (daily) internet connection losses. When I have a connection, the DSL speed is what my contract says it should be. I want to create a record of these losses. The Bundesntzagentur provides a tool for these situations - Breitbandmessung - however this requires me to manually initiate every measurement. I don't want to babysit the process. AFAICT the breitbandmessung software has no command line interface.

My first idea is to ping -i 300 google.com and pipe the output into a textfile, however so far I don't know how to add a date and time. Also there may be a tool specifically for this purpose, which I could trigger via a cron job or so. Or better command line fu.

Error when installing Apache2 in Ubuntu

Posted: 08 Oct 2021 09:55 AM PDT

So I am trying to create a LAMP server, I am trying to install Apache2 and it says it is already installed. I have used the command below and the server says is already installed and shows this(picture below).

sudo apt-get install apache2  

after trying the command

Now when I want to check Apache2 is working correctly by using my IP address, it doesn't show the Apache2 default page and doesn't load. I have already tried to uninstall it and install it again but it hasn't fixed this. I would appreciate some feedback on how to fix this. Thank you.

Fedora: How do I boot into the LiveOS from the .iso?

Posted: 08 Oct 2021 09:49 AM PDT

I have a custom USB stick with maybe around ~10 Linux Distros, and 3 versions of Windows for some reason. I just drop the .iso files into /Linux, and then use GRUB to boot into those .isos. Some example entries:

menuentry "ubuntu 20.04" --class ubuntu {      set isofile="/Linux/ubuntu.iso"      loopback loop ($BOOT)$isofile      linux (loop)/casper/vmlinuz iso-scan/filename=$isofile boot=casper ro quiet splash      initrd (loop)/casper/initrd  }  menuentry "Manjaro 18.0.4" --class manjaro {      set isofile="/Linux/manjaro.iso"      set imgdevpath="/dev/disk/by-uuid/$UUID"          loopback loop ($BOOT)$isofile      linux (loop)/boot/vmlinuz-x86_64 img_dev=$imgdevpath img_loop=$isofile ro quiet splash      initrd (loop)/boot/initramfs-x86_64.img  }  menuentry "Silverblue 34 (Install only)" --class silverblue {      set isofile="/Linux/silverblue.iso"      loopback loop ($BOOT)$isofile      linux (loop)/isolinux/vmlinuz inst.stage2=hd:UUID=$UUID:$isofile ro quiet splash      initrd (loop)/isolinux/initrd.img  }  

Now, I can take that Silverblue entry, and point it to the Fedora.iso file. It'll boot just fine, but it only goes straight to the installer. While Silverblue doesn't have the LiveOS folder in it's .iso, Fedora does.

How would I adjust the boot entry to get it into boot into the Live environment?

move file into folder automatically created from process name

Posted: 08 Oct 2021 08:52 AM PDT

Is it possible to automatically create a folder during move file from the process name of the process making the move? Can this be set as property of the parent folder i.e. all files being moved to parent folder automatically get move to a subfolder named after the process?

In Gnome, why does starting a favorited sandboxed application create a new icon on the dash?

Posted: 08 Oct 2021 09:52 AM PDT

I think this is something that's easier to show than tell.

New Icon

So you see in this image of my dash, I clicked on the Tor icon with the gradient background, but it actually opened the application using a new icon on the dash. Kind of annoying.

This happens when altering the .desktop file on the application to open it with Firejail, Bubblewrap, or another sandboxing application like this:

Exec=/usr/bin/firejail /usr/lib/firefox/firefox

So why does this happen and how can I prevent it?

Combining recursive find, numbered backup, & copy for multiple files with the same name in subdirectories and subdirectories of those subdirectories

Posted: 08 Oct 2021 09:09 AM PDT

r.xml are the files, and s is output directory. What I want is the s directory to contain r1.xml, r2.xml, etc..

$ ls -R  s   temp   temp3    ./s:    ./temp: r.xml  temp2    ./temp/temp2: r.xml    ./temp3: r.xml  

The command I've tried using is this, I'm not very familiar with linux.

find . -name 'r.xml' -exec cp --backup=numbered '{}' 's' \;  

This is what s subdirectory is currently ending up with

./s: r.xml r.xml.~1~ r.xml.~2~ r.xml.~3~ r.xml.~4~

How to substitute a block of lines inside a file?

Posted: 08 Oct 2021 10:26 AM PDT

I want to change the multi-line contain foo2 to be like desired output
foo2 is like an array in multiline, how to change it to be in one line

  • FROM:
$ cat file.txt  foo1=bar1  foo2=('bar10: some text here'        'bar11: anther text here'         ...        'bar: final text here')  foo3=('bar3')  foo=1.2.33    
  • TO:
foo1=bar1  foo2="bar10 bar11 .. bar"  foo3=('bar3')  foo=1.2.33  

Script doesn't work with shebang "/usr/bin/env sh", but does with "/usr/bin/env bash" though sh points to bash?

Posted: 08 Oct 2021 09:57 AM PDT

I have a shell script which logs the performance of various programs passed to it as arguments, to help me choose the most performant one. The relevant snippet:

#!/usr/bin/env sh  function cal_perf () {          real_t=0          user_t=0          sys_t=0          for (( trial=1 ; trial<=$3 ; ++trial )) ; do                  shopt -s lastpipe                  /usr/bin/time -f '%e:%S:%U' $1 $2 |& IFS=":" read real sys user                  real_t=$(echo "$real + $real_t" | bc)                  user_t=$(echo "$user + $user_t" | bc)                  sys_t=$(echo "$sys + $sys_t" | bc)          done          real_t=$(echo "scale=2 ; $real_t / $3" | bc)          user_t=$(echo "scale=2 ; $user_t / $3" | bc)          sys_t=$(echo "scale=2 ; $sys_t / $3" | bc)          printf "%s\t%d\t%.2f\t%.2f\t%.2f\n" $2 $3 $real_t $user_t $sys_t >> timings_$(date '+%Y%m%d')  }    # main  printf "program\t#trials\treal_time_am\tuser_time_am\tsys time_am\n" > timings_$(date '+%Y%m%d')  translator=$1  shift  while [ $# -gt 1 ] ; do cal_perf $translator $1 ${!#} ; shift ; done  

It's supposed to be run on the command line as follows:

perf <translator_progam> <list_of_programs_to_compare> <number_of_trials>  

...for instance: suppose I want to compare the performances of xip.py, foo.py, bar.py, bas.py, qux.py--the net content of the working directory--and run them each for 50 times before generating the stats; i'd invoke the script as:

perf python *py 50  

I think I am missing something obvious here, but when I invoke this script as bash $HOME/bin/perf ... everything works as intended. However, the following two invocations fail (error attached):

  1. perf ...
  2. or even placing it in the working directory and invoking as ./perf ...

enter image description here

changing the shebang to /usr/bin/env bash solves this problem, but /usr/bin/sh points to /usr/bin/bash on my system.

Can grub modules be embedded in the grub binary?

Posted: 08 Oct 2021 08:16 AM PDT

Grub has similar concept of modules like the Linux kernel. They are a bunch of precompiled files which usually live at boot/grub/x86_64-efi/<module_name>.mod on the rootfs.

The module needs to be loaded before it can be used. "used" means that you can you can run a particular new command in grub.cfg. A way you install a module is having a insmod <module_name>.

Is it possible to embed a grub module withing the grub binary instead of having the modules living on the rootfs?

When is a @reboot cron job executed?

Posted: 08 Oct 2021 08:49 AM PDT

I have several cron jobs that are executed every minute, and I'm thinking on putting @reboot jobs. They are put and executed with root privileges.

So here's what I want to know. Will these cron jobs run when system gets to the login screen after rebooting? Will @reboot entries run after reboot without me getting logged into root?

Is it correct that the signature type of a ssh key is unchangable?

Posted: 08 Oct 2021 08:05 AM PDT

When generating key pairs using ssh-keygen, one can specify the desired signature type by -t, like ssh-keygen -t ssh-rsa. I wonder, is the signature type of a ssh private key unchangable, once the key pairs are created?

If it's changeable, which tool can I utilize to change the signature type? and How?

I am asking this question because one of my old keys uses ssh-rsa signature type and now the ssh-rsa signature algorithm got deprecated.

How to forward output of split to sftp?

Posted: 08 Oct 2021 08:39 AM PDT

I have a server that is running out of disk space. I want to move some TB sized directories into a long term archive. This is a tape robot with preferred file size of 16GB. Therefore I want to split the tar archive into 16GB parts.

tar -czpv mydir | split -d - a 4 -b $SplitBlockSize - mydir.gz.tar

The access to LT archive server is via sftp. Is it possible to forward the output of split to sftp without storing it locally?

QEMU Harddisk no devices, no file system but files still accessible

Posted: 08 Oct 2021 07:52 AM PDT

I'm running a Proxmox as my Hypervisor, where I set up my 6 TB disk as a ZFS pool. Then I created a virtual disk and attach it to VM running Ubuntu Server 20.04 where it shows up as a QEMU Harddisk. I believe all this information it's not all that relevant as the problem is within the VM and has nothing to do with the Host machine nor the type of storage used, although, I might be mistaken.

So, once inside the VM, back in the day, I created an ext4 partition and mounted normally. I allocated about 2 o 3 TB since I thought I could easily expand the Virtual Disk and enlarge the partition. Well, that was the case for a while, but suddenly I might had messed something up the device /dev/sdc1 disappeared with its file system. Although, the drive could still be mounted and all files where there.

These are the outputs I get after running "fdisk -l", "parted" and "partprobe". The disk shows up as having a loop partition and no devices (/dev/sdcX)

As you can see, the disk /dev/sdb of 931.51 GiB have a "Disklabel type" and "Disk indentifier", as well as a partition labeled as /dev/sdb1 with a file system of "Linux" (ext4). This is not the case for the disk /dev/sdc of 3.93 TiB. Is missing the Disklabel type", "Disk indentifier" and fdisk doesn't show any partitions. Although, parted does shows a partition table of type "Loop" and one partition with ext4.

This has been running for a long while like that, the only thing I'm noticing is pretty poor performance. At tops 20 MB/s even on sequential writes and even less If it's serving files over Plex or Torrents, when the drive was capable of at least 140 MB/s. I guess this performance might be due to the "lack" of a file system or whatever is going on in the partition table.

Anyway, I was wondering If there's any way to fix this without reformatting the whole, since I don't have any spare HDD large enough to store all the files. By "fix" I mean to create a partition with its file system. Or to change the current partition table from "Loop" to GPT or MRB/DOS and then create a partition and a file system.

If that's not possible, just let me know, and I will just back up the essential files and try to find somewhere to store the rest.

What is the difference between echo 0>file.txt and echo 0 > file.txt?

Posted: 08 Oct 2021 07:35 AM PDT

I see that this has the behavior:

[root@divinity test]# echo 0 > file.txt  [root@divinity test]# cat file.txt  0  [root@divinity test]# echo 0> file.txt    [root@divinity test]# cat file.txt    

I also noticed that if I include "" then it works as expected:

[root@divinity test]# echo 0""> file.txt  [root@divinity test]# cat file.txt  0  

I imagine this is all just part of IO redirection, but I do not quite understand what echo 0> is doing.

Kali Linux & Metasploitable VirtualBox VMs not getting IP addresses with Bridged adapter

Posted: 08 Oct 2021 10:16 AM PDT

enter image description hereenter image description hereI'm making a hackers lab, so I downloaded Kali Linux and Metasploitable and set them on VirtualBox running on a Windows 10 host machine. The host system is using a wired connection, which both guests also must use. The host has full internet access.

When I configure the VM network interfaces in NAT mode, they get IP addresses and access to the internet, but the lab requires using a Bridged network. When I configure them as bridged adapters, For Bridged connection I select "Realtek PCIe GbE Family Controller" with promiscuous mode set to "deny" and "Cable connected" ticked. In both systems ifconfig shows eth0 doesn't even get an IP address.

Metasploitable doesn't have a GUI. Kali does not change to wired network and show me the available networks because I also use a WIFI adapter, it says wired connection 1, but does not work and the network symbol is spinning and it cannot connect to the internet.

I tried changing the adapter types to all the types there are with promiscous mode: allow VMs, but still nothing worked.

How can I execute recipe iff a file exists?

Posted: 08 Oct 2021 08:41 AM PDT

I'm writing a Makefile recipe that needs to execute IF AND ONLY IF a certain file exists...

Here's what I have:

clean:      $(if $(shell test -s ${MFN_LSTF}), \          $(foreach mfn, $(shell cat ${MFN_LSTF}), \              $(MAKE) -f mfd/${mfn} clean;), )  .PHONY: clean  

${MFN_LSTF} holds a filename that contains a one column list of makefile names that are assumed to be at the same local directory as this makefile recipe.

The problem that I've encountered with is that, the foreach statement executes always. I want it to execute ONLY IF the filename ${MFN_LSTF} exists.

I've tried this also:

clean:      [ test -s ${MFN_LSTF} ] &&          for mfn in $(shell cat ${MFN_LSTF}); do              $(MAKE) -f mfd/${mfn} clean          done  .PHONY: clean  

Unable to install Parrot OS in VM

Posted: 08 Oct 2021 09:08 AM PDT

I keep getting this error when I install Parrot OS in Virtual Box.

External command failed to finish. Command /usr/sbin/bootloader-config failed to finish in 600 seconds. There was no output from the command

record a short screencast in solus

Posted: 08 Oct 2021 10:11 AM PDT

enter image description here

I had tried to start screencast by the shortcut Ctrl+Alt+Shift+R. Although it didn't start. Why this is happening? It was working fine when I was using Mint, Ubuntu, Fedora.

What is the procedure to update mime type associations in KDE?

Posted: 08 Oct 2021 07:46 AM PDT

I would like to revert to the default mime definitions at the system level, and also rebuild my local mime database. I am running Arch Linux KDE.

The Arch Wiki says,

If you use a desktop environment you should first check if it provides its own utility. That should be preferred over these alternatives.

Does KDE provide such a utility or should I use the generic xdg-utils?

The Arch Wiki mentions several mimeapps.list files, but I have never had those. Does KDE not use them?

The only mimeapps.list file I have had is ~/.config/mimeapps.list.

What is the procedure to put KDE's house in order in regard to mime types (for local user and system-wide)?

Unit jenkins.service could not be found

Posted: 08 Oct 2021 08:58 AM PDT

I am trying to start Jenkins in a Centos 7 machine. I am trying to copy the Jenkins folder from another machine to this machine and start it here instead of downloading. I copy the entire Jenkins files to /var/lib/jenkins folder in the new machine. I run the following command:

java -jar jenkins.war  

I get the following log:

Running from: /var/lib/jenkins/jenkins.war  webroot: $user.home/.jenkins  2019-12-23 19:50:24.875+0000 [id=1]     INFO    org.eclipse.jetty.util.log.Log#initialized: Logging initialized @510ms to org.eclipse.jetty.util.log.JavaUtilLog  2019-12-23 19:50:25.019+0000 [id=1]     INFO    winstone.Logger#logInternal: Beginning extraction from war file  2019-12-23 19:50:26.607+0000 [id=1]     WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath  2019-12-23 19:50:26.676+0000 [id=1]     INFO    org.eclipse.jetty.server.Server#doStart: jetty-9.4.z-SNAPSHOT; built: 2019-05-02T00:04:53.875Z; git: e1bc35120a6617ee3df052294e433f3a25ce7097; jvm 1.8.0_232-b09  2019-12-23 19:50:27.038+0000 [id=1]     INFO    o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet  2019-12-23 19:50:27.111+0000 [id=1]     INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0  2019-12-23 19:50:27.111+0000 [id=1]     INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults  2019-12-23 19:50:27.116+0000 [id=1]     INFO    o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 660000ms  Jenkins home directory: /root/.jenkins found at: $user.home/.jenkins  2019-12-23 19:50:27.795+0000 [id=1]     INFO    o.e.j.s.handler.ContextHandler#doStart: Started w.@782a4fff{Jenkins v2.190.1,/,file:///root/.jenkins/war/,AVAILABLE}{/root/.jenkins/war}  2019-12-23 19:50:27.818+0000 [id=1]     INFO    o.e.j.server.AbstractConnector#doStart: Started ServerConnector@1040be71{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}  2019-12-23 19:50:27.818+0000 [id=1]     INFO    org.eclipse.jetty.server.Server#doStart: Started @3454ms  2019-12-23 19:50:27.819+0000 [id=21]    INFO    winstone.Logger#logInternal: Winstone Servlet Engine v4.0 running: controlPort=disabled  2019-12-23 19:50:29.635+0000 [id=28]    INFO    jenkins.InitReactorRunner$1#onAttained: Started initialization  2019-12-23 19:50:29.674+0000 [id=28]    INFO    jenkins.InitReactorRunner$1#onAttained: Listed all plugins  2019-12-23 19:50:31.654+0000 [id=29]    INFO    jenkins.InitReactorRunner$1#onAttained: Prepared all plugins  2019-12-23 19:50:31.666+0000 [id=29]    INFO    jenkins.InitReactorRunner$1#onAttained: Started all plugins  2019-12-23 19:50:31.684+0000 [id=29]    INFO    jenkins.InitReactorRunner$1#onAttained: Augmented all extensions  2019-12-23 19:50:32.651+0000 [id=31]    INFO    jenkins.InitReactorRunner$1#onAttained: Loaded all jobs  2019-12-23 19:50:32.691+0000 [id=46]    INFO    hudson.model.AsyncPeriodicWork$1#run: Started Download metadata  2019-12-23 19:50:32.708+0000 [id=46]    INFO    hudson.util.Retrier#start: Attempt #1 to do the action check updates server  2019-12-23 19:50:33.763+0000 [id=32]    INFO    o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@3a900fc3: display name [Root WebApplicationContext]; startup date [Mon Dec 23 14:50:33 EST 2019]; root of context hierarchy  2019-12-23 19:50:33.764+0000 [id=32]    INFO    o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@3a900fc3]: org.springframework.beans.factory.support.DefaultListableBeanFactory@44b26de3  2019-12-23 19:50:33.777+0000 [id=32]    INFO    o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@44b26de3: defining beans [authenticationManager]; root of factory hierarchy  2019-12-23 19:50:33.986+0000 [id=32]    INFO    o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@16d60366: display name [Root WebApplicationContext]; startup date [Mon Dec 23 14:50:33 EST 2019]; root of context hierarchy  2019-12-23 19:50:33.987+0000 [id=32]    INFO    o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@16d60366]: org.springframework.beans.factory.support.DefaultListableBeanFactory@53d5b029  2019-12-23 19:50:33.987+0000 [id=32]    INFO    o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@53d5b029: defining beans [filter,legacy]; root of factory hierarchy  2019-12-23 19:50:34.237+0000 [id=32]    INFO    jenkins.install.SetupWizard#init:    *************************************************************  *************************************************************  *************************************************************    Jenkins initial setup is required. An admin user has been created and a password generated.  Please use the following password to proceed to installation:        This may also be found at: /root/.jenkins/secrets/initialAdminPassword    *************************************************************  *************************************************************  *************************************************************    2019-12-23 19:50:53.162+0000 [id=46]    INFO    hudson.util.Retrier#start: The attempt #1 to do the action check updates server failed with an allowed exception:  java.net.SocketTimeoutException: connect timed out          at java.net.PlainSocketImpl.socketConnect(Native Method)          at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)          at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)          at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)          at java.net.Socket.connect(Socket.java:607)          at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)          at sun.net.NetworkClient.doConnect(NetworkClient.java:175)          at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)          at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)          at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)          at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)          at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)          at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162)          at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)          at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)          at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570)          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)          at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)          at hudson.model.DownloadService.loadJSON(DownloadService.java:167)          at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:189)          at hudson.PluginManager.checkUpdatesServer(PluginManager.java:1762)          at hudson.util.Retrier.start(Retrier.java:62)          at hudson.PluginManager.doCheckUpdatesServer(PluginManager.java:1733)          at jenkins.model.DownloadSettings$DailyCheck.execute(DownloadSettings.java:130)          at hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:101)          at java.lang.Thread.run(Thread.java:748)  2019-12-23 19:50:53.163+0000 [id=46]    INFO    hudson.util.Retrier#start: Calling the listener of the allowed exception 'connect timed out' at the attempt #1 to do the action check updates server  2019-12-23 19:50:53.165+0000 [id=46]    INFO    hudson.util.Retrier#start: Attempted the action check updates server for 1 time(s) with no success  2019-12-23 19:50:53.166+0000 [id=46]    SEVERE  hudson.PluginManager#doCheckUpdatesServer: Error checking update sites for 1 attempt(s). Last exception was: SocketTimeoutException: connect timed out  2019-12-23 19:50:53.170+0000 [id=46]    INFO    hudson.model.AsyncPeriodicWork$1#run: Finished Download metadata. 20,477 ms  2019-12-23 19:50:54.258+0000 [id=32]    WARNING hudson.model.UpdateCenter#updateDefaultSite: Upgrading Jenkins. Failed to update the default Update Site 'default'. Plugin upgrades may fail.  java.net.SocketTimeoutException: connect timed out          at java.net.PlainSocketImpl.socketConnect(Native Method)          at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)          at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)          at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)          at java.net.Socket.connect(Socket.java:607)          at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)          at sun.net.NetworkClient.doConnect(NetworkClient.java:175)          at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)          at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)          at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)          at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)          at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)          at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162)          at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)          at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)          at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570)          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)          at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)          at hudson.model.DownloadService.loadJSON(DownloadService.java:167)          at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:189)          at hudson.model.UpdateCenter.updateDefaultSite(UpdateCenter.java:2456)          at jenkins.install.SetupWizard.init(SetupWizard.java:168)          at jenkins.install.InstallState$InitialSecuritySetup.initializeState(InstallState.java:166)          at jenkins.model.Jenkins.setInstallState(Jenkins.java:1089)          at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:96)          at jenkins.install.InstallState$Unknown.initializeState(InstallState.java:84)          at jenkins.model.Jenkins$16.run(Jenkins.java:3277)          at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)          at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)          at jenkins.model.Jenkins$5.runTask(Jenkins.java:1118)          at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)          at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)          at java.lang.Thread.run(Thread.java:748)  2019-12-23 19:50:54.273+0000 [id=32]    INFO    jenkins.InitReactorRunner$1#onAttained: Completed initialization  2019-12-23 19:50:54.302+0000 [id=20]    INFO    hudson.WebAppMain$3#run: Jenkins is fully up and running  

The log clearly says that Jenkins is up and running. But when I try to check status, sudo service jenkins status, I get the following error:

Unit jenkins.service could not be found.  

I am not sure what I am missing

How do you get audio working in a Windows 10 guest in VirtualBox (Ubuntu host)?

Posted: 08 Oct 2021 10:07 AM PDT

I'm trying to get audio working in a Windows 10 machine running inside VirtualBox on Ubuntu, so I can use dictation software. Based on Googling, I've installed PulseAudio, and inside pavucontrol I have

Recording: VirtualBox: Windows (in) from [bar that moves right to the max when I talk loudly]

When I go into Windows, Sound control panel, Recording tab, I see a single 'Microphone'. The volume indicator next to it doesn't move at all.

If I use Configure/Set up Microphone from the Sound control panel/Recording tab, I get a dialog with 'Adjust the volume of Microphone (High Definition Audio Device)' and that does detect when I speak, and is in the green region... so audio is reaching some bit of Windows. But when I go back into the Recording tab, the volume indicator still doesn't move.

I'd be v. grateful for any help ... even typing out this much is rather painful without dictation software.

-bash: sudo: command not found

Posted: 08 Oct 2021 09:40 AM PDT

I am trying to deploy django app. When I print apt-get update I see

W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (13: Permission denied)  W: Unable to read /etc/apt/sources.list.d/ - DirectoryExists (13: Permission denied)  W: Unable to read /etc/apt/sources.list - RealFileExists (13: Permission denied)  E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)  E: Unable to read /var/cache/apt/ - opendir (13: Permission denied)  E: Unable to read /var/cache/apt/ - opendir (13: Permission denied)  E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)  E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?  

When I print sudo apt-get update I see

-bash: sudo: command not found  

I tried to use su instead of sudo. But it is strange. For example I print su apt-get update And nothing happens I just see a new line,

(uiserver):u78600811:~$ su apt-get update  (uiserver):u78600811:~$  

The same if I try to install some packages. What do I do?

If it is useful info - I am using Debian

(uiserver):u87600811:~$ uname -a  Linux infong1559 3.14.0-ui16294-uiabi1-infong-amd64 #1 SMP Debian 3.14.79-2~ui80+4 (2016-10-20) x86_64 GNU/Linux  

How to float a window which has WM_NAME but no WM_CLASS

Posted: 08 Oct 2021 08:05 AM PDT

Configuration

Debian Linux 8.2, 64bit, Xmonad 0.11

When it started

I recently upgraded my system (to debian8), so I had to make some adjustments to my xmonad.hs configuration - namely changing managehooks for GStreamer'sgst-launch windows from:

, title     =? "gst-launch-0.10" --> doFloat  

to:

, title     =? "gst-launch-1.0" --> doFloat  

I'm using title instead of className because gst-launch-1.0 windows have only this properties:

$ xprop  _NET_WM_DESKTOP(CARDINAL) = 6  WM_NAME(STRING) = "gst-launch-1.0"  WM_STATE(WM_STATE):                  window state: Normal                  icon window: 0x0  _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x1, 0x0, 0x0  WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW  

What it does

I'm encountering very strange behaviour, which I haven't seen with the old gst-launch-0.10 windows. When gst-launch-1.0 window (usually quite small - 400x300) starts it is one of following cases with decreasing probability:

  • adds the window as another tile (no floating at all) and stretches its content to fill this tile (keeping aspect ratio), the rest of the tile is black
  • adds the window as another tile (no floating at all) but draws only in the top left corner of this tile (no stretching), the rest of the tile shows X-Window background
  • with less than 10% probability it floats the window properly

What I've tried

doFullFloat and doCenterFloat do exactly the same thing (except it's centered or full in the last case)

What I suspect

I'm pretty sure the problem is in using only WM_NAME/title instead of WM_CLASS/className/appName, because the title can be changed during the lifetime of the window. I think the gst-launch-1.0 window starts with some other (or none) title and after some time it switches to gst-launch-1.0. Then it's only matter of luck if xmonad catches the original title or the final gst-launch-1.0.

Question

Is there some way to "wait a while" in manageHook so I could be sure to catch the final window WM_NAME/title ?

Or any other idea?

Additional info:

Apparently this has been fixed in gstreamer - https://bugzilla.gnome.org/show_bug.cgi?id=750455 - but unfortunately I need to use gstreamer which comes with debian.

Use network-manager in different netns

Posted: 08 Oct 2021 09:04 AM PDT

In continuation of my last question about using netns as a relugar user, I'm now looking for a way to open VPN tunnels as a regular user.

So I naturally thought about network-manager. Any user can use it for any VPN.

I could just allow opening VPN tunnels by editing the sudoer file, but I really would rather not do that.

So I'm wondering how to use it in different network namespaces. According to this source, network-manager might support netns, if I understand correctly the sentence :

The interface must be configured manually because ifupdown does not support namespaces yet, and it would use the same /run/network/ifstate file which tracks the interfaces of the main namespace (this is also a good argument in favour of something persistent like Network Manager...).

Thanks.

EDIT: At the moment I didn't figured out how to tells to network-manager to manage several namespaces. My idea is now to launch several instances of network-manager (as root) in each namespace. The fact is that I cannot lauch several instances of network-manager. From syslog:

<error> [1443615747.550129] [nm-dbus-manager.c:808] nm_dbus_manager_start_service(): Could not acquire the NetworkManager service as it is already taken.  

How to make svn save credentials when --non-interactive

Posted: 08 Oct 2021 07:56 AM PDT

I'm trying to get svn to save my https username+password to ~/.subversion from within an automated script. I can pass creds on the command-line but I do not want to be prompted about whether to save the password unencrypted. Unfortunately this does not create ~/.subversion/:

svn --non-interactive --trust-server-cert --username myusername --password secret co https://private.example.com/src/repo/  

FYI I'm trying to do this for a Dockerfile that invokes a bower install with a bower.json that references a password-protected svn repo. Unfortunately there's no way to pass the svn credentials to bower via command-line or environment.

I am currently working around it by running svn interactively and letting it create ~/.subversion, then zipping up that entire directory and ADDing it in the Dockerfile. I guess I could look at the file formats in ~/.subversion and create it with a script, but would rather let svn do it.

How can I rsync without prompt for password, without using public key authentication?

Posted: 08 Oct 2021 09:10 AM PDT

I need to execute rsync, without it prompting me for password.

I've seen in rsync manpage that it doesn't allow specifying the password as command line argument.
But I noticed that it allows specifying the password via the variable RSYNC_PASSWORD.

So I've tried exporting the variable, but rsync keeps asking me for password.

export RSYNC_PASSWORD="abcdef"  rsync root@1.2.3.4:/abc /def  

What am I doing wrong?

Please consider:

In other words, I need to have the RSYNC_PASSWORD approach working! :-)

Is it possible to see cp speed and percent copied?

Posted: 08 Oct 2021 08:04 AM PDT

I'm having problems when copying large files using nautilus (it gets stuck). I need to copy, using cp. I would like to know if there are any parameters that shows the % copied and also the transfer speed.

No comments:

Post a Comment