Saturday, October 9, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to disable a particular dbus system service under an openrc system

Posted: 09 Oct 2021 09:59 AM PDT

I know that one can override dbus session services in ~/.local/share/dbus-1/services

But it necessarily won't work for system services.

Under openrc, I don't get systemd's systemctl command therfore :

Is the quick and dirty (because service will be restored on next update) way consisting in renaming the associated service file in /usr/share/dbus-1/system-services, the only way to proceed ?

Bash print command with number

Posted: 09 Oct 2021 09:46 AM PDT

Good Day! I'm just a beginner and I want to dive into bash scripting. I want to create a script that do a command, and in this command I want to try multiple numbers from 001-999 in each time | e.g. python3 tool.py -n 12345 -e <numbers from 001-999 in each time> thanks

Error when running ls "exa: error while loading shared libraries: libgit2.so.1.1: cannot open shared object file: No such file or directory"

Posted: 09 Oct 2021 09:14 AM PDT

I'm running Manjaro Linux and upon running the ls command or any variation of it with flags I get the error:

exa: error while loading shared libraries: libgit2.so.1.1: cannot open shared object file: No such file or directory  

I haven't been able to find any one with this issue online, or any solutions. Let me know if you need anymore information. Thanks.

-Linkio

Fedora 34 Pipewire 0.3.38-1.fc34 microphone detected but no sound input

Posted: 09 Oct 2021 09:25 AM PDT

What is happening

I recently installed fedora 34 on my laptop, before I was using Ubuntu 18.04 and my mic was working fine, them I decided to change to fedora 34 and everything was ok until I try to use my microphone and I figured that it just refuses to record any input, after little search I found that fedora 34 is using pipewire, I tried several possible fixes but none worked.

System info

Ideapad 320 15ikb

I5-8250u

8gb ddr4

Intel uhd 620 / MX150

Audio device info:

$ pw-record --list-targets  Available targets ("*" denotes default):   *   44: description="Built-in Audio Analog Stereo" prio=2009  
$ lspci | grep Audio                                                     00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)  
$ arecord -l                                                             **** List of CAPTURE Hardware Devices ****  card 0: PCH [HDA Intel PCH], device 0: ALC236 Analog [ALC236 Analog]    Subdevices: 1/1    Subdevice #0: subdevice #0    

Already tested fix

Alternatives found on the internet and that didn't work (after each possibility above I restarted the computer):

  1. sudo dnf swap --allowerasing pipewire-pulseaudio pulseaudio
  2. sudo dnf install --allowerasing pipewire-pulseaudio pipewire-libjack
  3. systemctl --user restart pipewire
  4. systemctl --user restart pipewire*
  5. sudo nano /usr/share/pipewire/media-session.d/alsa-monitor.conf (changed => api.alsa.use-acp from true to false)
  6. Tried to remove pipewire and install pulse audio, but when I try to: sudo dnf remove pipewire it said that gnome-shell will be removed

Observations

  1. External microphones connected throw usb work just fine

How to download portion of video with ffmpeg.js in web

Posted: 09 Oct 2021 08:52 AM PDT

I want to download 10 sec of video without downloading the complete video in web using ffmpeg but it fetch the complete video and then trim the video. I'm using this let { createFFmpeg, fetchFile } = FFmpeg; let ffmpeg = createFFmpeg(); await ffmpeg.load(); ffmpeg.FS('writeFile', 'video.mp4', await fetchFile(video)); await ffmpeg.run('-ss', '00:00:10.00', '-i', 'video.mp4','-t', '00:00:20.00', '-c', 'copy', 'output.mp4'); let data = await ffmpeg.FS('readFile', 'output.mp4'); return new Blob([new Uint8Array(data.buffer)]);

I'm using the direct link of youtube video http://redirector.googlevideo.com/videoplayback?expire=1633813923&ei=Q7FhYbTqFdCkgQeKt6XwCQ&ip=168.119.239.75&id=o-AO0N1Lwv-oMZnMyrAmUNrRPRxmrJR5aMyZXIRZJW1xiF&itag=22&source=youtube&mh=Mh&mm=31%2C26&mn=sn-4g5edn6r%2Csn-h0jeened&ms=au%2Conr&mv=u&mvi=3&pl=26&vprv=1&mime=video%2Fmp4&ns=hKuOjVh9-nzLliVDIG6uhZcG&cnr=14&ratebypass=yes&dur=1870.158&lmt=1633746853727731&mt=1633791710&fvip=3&fexp=24001373%2C24007246&c=MWEB&txp=6211224&n=pLAN0qjI56_fLMtMoBr&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Cvprv%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIgOEMCw-gW-F0DimwgLUzlAjTr39AZb4JH_GbYOHxWz_8CIQC_CSeibz8bKnO6nHh3m4SrI5J-fm0E7RNtWDSn86hnfw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AG3C_xAwRAIgDEnuS7GtrC37pPkaDYg2o26PvpSNPtlRs_v2K526TqACIFPlE2NaQ_XeK31tpZVoyH065aldNamexEawyMEcUC7G&utmg=ytap1_5B1_1ECmxW0

Is there any possible way to download a portion in web in js?

How to apply multiple commands to a css file without undoing the previous command?

Posted: 09 Oct 2021 08:41 AM PDT

I'm super new to using command line so sorry if this seems like a silly question! I'm trying to edit a CSV file in terminal with these set of commands:

(head -n 1 canine_genes_v2.csv && tail -n +2 canine_genes_v2.csv | sort -t, -k2,2n)

sed 's/plus/+/g' canine_genes_v2.csv

sed 's/minus/-/g' canine_genes_v2.csv

cut -d, -f 1,2,3,4,5,6 canine_genes_v2.csv

perl -p -e 's/,/\t/g' canine_genes_v2.csv

My problem is that every time I apply a command it undoes the previous command, I have figured out if I run each command separately and save the output to a different file I'm able to see the change using the md5sum command. But my problem is I want to apply all these commands at the same time to the same file.

Source code of Netscape Navigator 7.2

Posted: 09 Oct 2021 08:39 AM PDT

due to some specific reason I need to use Netscape 7.2

and lately it started crashing on startup on my Windows 7 machine, and I have no idea why (I do not know what I did to my machine that Netscape started to crash, because firefox and all the other mozilla browsers (like Basilisk web browser) work completly normal, but netscape crashes before even starting, crash is related with msvcrt.dll (at least windows crash dialog tells me that)

as due to obscurity of the browser I didn't find any help online, so I figured out, maybe if I run it in a debugger it would tell me on which function it crashed and I could fix that, but there is a problem, I cannot seem to find the source code for Netscape 7.2 (I know it should be open source)

so if anyone knows where to find the source code for Netscape 7.2 please let me know, because if I find the source code it would maybe lead me closer to figuring out why the browser crashes

cp: cannot stat permission denied

Posted: 09 Oct 2021 09:15 AM PDT

I have a file called fileArc.c and I was given instructions for an assignment that if I do the command

cp fileArc.c /pc

that this file would then be accessible in a created folder on my desktop. However when I try using the command I get

cp: cannot stat '/pc/fileArc.c': Permission denied

I am not sure what to do to fix this.

netcat broadcast understanding

Posted: 09 Oct 2021 08:28 AM PDT

I'm using macOS with gnu netcat. I want to understand how can I broadcast message using netcat.

I have a netcat listening on 4555

netcat -l -p 4555 192.168.0.101

but as I attempt to send a broadcast message

netcat 192.168.0.255 4555 but I keep getting following err

Error: Couldn't create connection (err=-5): Permission denied

I'm getting the following error

Error: Couldn't create connection (err=-5): Permission denied

The following post says it is possible to do so using netcat-traditional but I'm running GNU netcat does that matter over here.

Why does the sshd command’s behavior vary depending on the network?

Posted: 09 Oct 2021 08:47 AM PDT

I'd like to ssh into Termux using OpenSSH. I have found so far that what is output from logcat -s 'sshd:*' depends on the network I'm connected to from the phone I'm running Termux on. Once, I got "Listening on Port 8022", and ssh'ing in worked. Other times, I've gotten some output, but not that it's listening on a port, and the ssh didn't work. When I do sshd and my phone is connected via cellular data, the logcat commands returns nothing.

So, why does sshd depend on the network you're connected to? Do you have to configure your network to allow the sshd connection or something?

This is the output of logcat when I'm on my office WiFi network: 10-09 16:03:41.341 13392 13392 W ssh : type=1400 audit(0.0:10087): avc: granted { execute } for path="/data/data/com.Termux/files/usr/bin/ssh" dev="mmcblk0p80" ino=46315 scontext=u:r:untrusted_app_27:s0:c1,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c1,c257,c512,c768 tclass=file app=com.termux

This is the output of ifconfig on that network:

Warning: cannot open /proc/net/dev (Permission denied). Limited output.  lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536      inet 127.0.0.1 netmask 255.0.0.0      unspec 00-...-00 txqueuelen 1000 (UNSPEC)    wlan0:  flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500      inet 192.168.83.23 netmask 255.255.255.0 broadcast 192.168.83.255      unspec 00-...-00 txqueuelen 3000 (UNSPEC)  

And this is the output of ifconfig on my cellular data network:

Warning: cannot open /proc/net/dev (Permission denied). Limited output.  lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536          inet 127.0.0.1 netmask 255.0.0.0          unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)    rmnet_data2: flags=65<UP,RUNNING> mtu 1500          inet 10.45.55.16 netmask 255.255.255.224          unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500          inet 192.168.13.194 netmask 255.255.255.0 broadcast 192.168.13.255          unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 3000 (UNSPEC)  

How to confirm something in Linux command-line prompt

Posted: 09 Oct 2021 08:57 AM PDT

In order to install Composer on my OVH web hosting service, I need to pass some SSH commands.

To pass them, OVH wants me to install some CLI using commands (guide here)

To connect using certificate-based authentication, install the Web PaaS CLI.  

PaaS CLI is supposedly installed with this command

The command doesn't work on the Windows Terminal enter image description here

So I tried from the Linux prompt from my Hive OS mining machine

attempting the installation command from my mining machine

So I pasted

curl -sfS https://eu.cli.webpaas.ovhcloud.com/installer | php  

in the Command prompt, and I got served with

Command 'php' not nound, but can be installed with ...

so I then tried

curl -sfS https://eu.cli.webpaas.ovhcloud.com/installer | apt install php7.2-cli  

and from there, it asked me to confirm.

Do you want to continue? [Y/n] Abort.

I tried to type "Y" and enter, but that doesn't do it.

How do you confirm this at this point?

Is it generally a good practice to combine drivers in Linux distributions

Posted: 09 Oct 2021 07:09 AM PDT

I'm running Arch on old laptop with hybrid (Integrated + discrete GPU) graphics so I installed a couple of ATI drivers, but I noticed a couple of defects with video and font rendering. Previously I ran on Pop!_OS and it worked really nice, so I would try both ATI and System76 packages.

I also tried to install AMD Catalyst proprietary driver from their website, but it just won't run on latest X.Org Server.

So my question is it a good practice to install as much as possible packages hoping it covers my pretty old hardware or maybe I'm lacking some knowledge how to do it properly?

I've read Arch wiki, but I'm really not sure I understood at least something

Which directories should be on the same filesystem as the root "/" filesystem?

Posted: 09 Oct 2021 07:19 AM PDT

I read an article and it states that "bin" "dev" "etc" "lib" "root" "sbin" directories should be in the same filesystem as the root directory, that is, they should not be mounted as a separate filesystem.

I'm a little confused, for example, in many distributions now the "sbin" "bin" and "lib" directories are symbolic linked to the "usr" directory.

lrwxrwxrwx   1 root root     7 Apr 30 18:19 bin -> usr/bin  ...  lrwxrwxrwx   1 root root     7 Apr 30 18:19 lib -> usr/lib  lrwxrwxrwx   1 root root     9 Apr 30 18:19 lib32 -> usr/lib32  lrwxrwxrwx   1 root root     9 Apr 30 18:19 lib64 -> usr/lib64  lrwxrwxrwx   1 root root    10 Apr 30 18:19 libx32 -> usr/libx32  ...  lrwxrwxrwx   1 root root     8 Apr 30 18:19 sbin -> usr/sbin  

However, the article does not specify that the "/" directory and the usr directory must be on the same filesystem. I've also looked at the previous questions, but I'm still confused. Which directories must be in the same filesystem and which should we keep in separate filesystems?

Can I install Linux on these AmLogic single-board computer?

Posted: 09 Oct 2021 06:41 AM PDT

A company called MECOOL offers several "TV box" devices, based on AmLogic single-board computers (SBC's). Examples: KM2 KM6, KM6 Deluxe. They sport quad-core ARM Cortex CPUs (A55, A35), have 2 or 4 GB of RAM, and ship with Android 10 or Android 11.

I would like to replace their OS with a Linux distribution. It would be nice if it could just be generic, but something oriented to this kind of boxes (like Raspbian for the Raspberry Pi) would also be fine.

Is this possible? And if not - is it impossible for all AmLogic-based SBCs, or just for this specific series?

How can I redirect the output of a exec call in php ( and its stderr) to the calling program?

Posted: 09 Oct 2021 09:44 AM PDT

I have find this solution but it is not 100% ok for me. output of child-prc

I have following php file:

    <?php      printf("$argv[1]: ". date("H:m:s")."\n");      if ($argv[1]=='1') {exec('/usr/bin/php -f t.php 2 2&>1');}      ?>  

Now I do a call on the prompt and want to redirect all output (also from the exec) to on log file.

php -f t.php 1 > t.log

The result should be:

    1: 15:10:52      2: 15:10:53  

the line

    2: 15:10:53   

is from the exec child process.

But I get only line one.

Please notify that the name of the log file t.log should be not hard-wired defined.

What make I wrong? THANKS

SSH to a private VM with key authentication

Posted: 09 Oct 2021 08:38 AM PDT

I am new to Linux and this is my first time connecting to a private VM. I was given a private address(no public since the file not does not have ".pud")

I am not sure how to use the given private key located on my desktop.

I think public and private keys were already configured on the server side. The user of the server only gave me the private key to access their server and I'm not sure how to use the private key I tried using ssh -i (location public file) user@x.x.x.x but then it says Permission denied (publickey).

I am using UBUNTU 21.04

Using awk to calculate average of each row with different number of columns

Posted: 09 Oct 2021 09:47 AM PDT

Is it possible to use awk to calculate the average of each row (with different columns in each row). I have a file like the following, the first column is the names, and I like to calculate the average of each row and print the result in the last column of the input file:

Input-file (data1.csv):

EMPLOYEE1,0.395314,0.384513,,  EMPLOYEE2,5.4908,5.2921,,  EMPLOYEE3,0.0002323,0.00022945,0.00023238,0.00022931  EMPLOYEE4,0.00335516,0.00328432,0.00340309,0.00327163  EMPLOYEE5,1.4816,1.4367,1.4854,1.4353  EMPLOYEE6,7.89E-06,7.93E-06,7.95E-06,7.87E-06  EMPLOYEE7,3.724E-06,3.8745E-06,3.9428E-06,3.7227E-06  EMPLOYEE8,0.699498,0.688892,0.704256,0.683486  EMPLOYEE9,33.5195,31.9736,33.6779,31.742  

Desired output:

EMPLOYEE1,0.395314,0.384513,,,0.3899135  EMPLOYEE2,5.4908,5.2921,,,5.39145  EMPLOYEE3,0.0002323,0.00022945,0.00023238,0.00022931,0.00023086  EMPLOYEE4,0.00335516,0.00328432,0.00340309,0.00327163,0.00332855  EMPLOYEE5,1.4816,1.4367,1.4854,1.4353,1.45975  EMPLOYEE6,7.89E-06,7.93E-06,7.95E-06,7.87E-06,7.91E-06  EMPLOYEE7,3.72E-06,3.87E-06,3.94E-06,3.72E-06,3.82E-06  EMPLOYEE8,0.699498,0.688892,0.704256,0.683486,0.694033  EMPLOYEE9,33.5195,31.9736,33.6779,31.742,32.7282  

I tried awk like the following, but it doesn't calculate average for rows with columns less than maximum NF.

awk  -F',' '{ s = 0; for (i = 2; i <= NF; i++) s += $i; print $1, (NF > 1) ? s / (NF - 1) : 0; }'  data1.csv  

and

 awk -F','  '{sum=0; for (i=2;i<=NF;i++)sum+=$i; print $0,sum/(NF-1)}'  data1.csv  

But my code doesn't change NF row. is it possible to change NF for each row and get desired output?

Implementing basic features for Bourne shell

Posted: 09 Oct 2021 06:36 AM PDT

I'm amazed by sh simplicity, my little effort research showed me that there is no:

  • Command history
  • Tab completion
  • Emacs-like shortcuts or even vim mode

I'm fine with that, because there is no bloat by default.

My question is, can I implement those features?

Would they be hard to script?

How to "run 'dmesg' using only the 'find' command"?

Posted: 09 Oct 2021 07:31 AM PDT

For one of my lab assignments, I need to "run dmesg using only the find command".

I have been trying to look and can't find anything probably because its not the way it's supposed to be used.

Run a command with a shortcut key

Posted: 09 Oct 2021 10:01 AM PDT

Is there any way to run a program/commnad with a shortcut keys?

I could then have a script that cd's one folder up. Then I could hold down Ctrl and every time I would hit a button, that script/command would run or even clear the screen each time and run ls or do whatever with just a single shortcut while in the shell.

I'm using bash and my terminal emulator is Linux Mint, Xfce's default.

I ran “sudo rm -rf /*” and now my PC won't boot

Posted: 09 Oct 2021 07:36 AM PDT

I ran

sudo rm -rf /*  

on Zorin OS because my friend dared me to and now I can't even boot to my motherboard BIOS. How should I go about fixing this? Or am I hopelessly doomed?

I have tried power cycling many times with no luck. I have tried booting to GParted. I've even removed all my drives with no success. Everything I try won't work.

Bash: Using 'if' and 'find' together to check folders for files

Posted: 09 Oct 2021 10:10 AM PDT

I've got a parent folder with a series of 'histogram_0000_0000' folders inside it. I'm trying to make a bash script that searches for the file 'out.txt' in each folder, and returns for each time it finds the file in a folder (to check that the file exists in all folders). The script I've got is;

#!/bin/bash  joblist='job_list.txt'  njobs=`wc ${joblist} | awk '{print $1}'`    cwd=`pwd`  for ((i=1 ; i <= ${njobs} ; i++ )); do          folder=`awk '(NR=='${i}'){print}' ${joblist}`          echo $folder          cd ${folder}          if [ find -name "out.txt" ]          then                  echo out.txt found in $folder          fi          cd ${cwd}  done  

But every time it runs I get an error;

./checkrun.sh: line 10: [: -name: binary operator expected

I've had a look around, tried using '[[' and ']]', but still don't know why I'm having any luck! Any help would be great. Thanks, -Jake

Trouble installing libc-dev

Posted: 09 Oct 2021 10:07 AM PDT

I am getting this error when I try to compile a C program on Ubuntu:

$ gcc aa.c  aa.c:1:9: fatal error: stdio.h: No such file or directory   #include<stdio.h>           ^--------  compilation terminated.  

I tried to install libc6-dev and got this:

$ sudo apt-get install libc6-dev  ...  The following packages have unmet dependencies:   libc6-dev : Depends: libc6 (= 2.27-3ubuntu1) but 2.29-10 is to be installed               Depends: libc-dev-bin (= 2.27-3ubuntu1)  E: Unable to correct problelms, you have held broken packages.  

I have tried: sudo dpkg --configure -a, and I got no output.

and

sudo apt-get install -f  

and

sudo apt-get clean && sudo apt-get update  

and

sudo apt-get upgrade  

and

sudo apt-get dist-upgrade  

above four codes got the same output:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.  

After using all those commands I get the same fatal error when compiling.

apt policy libc6-dev libc6  

o/p:

libc6-dev:    Installed: (none)    Candidate: 2.27-3ubuntu1    Version table:       2.27-3ubuntu1 500          500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages  libc6:    Installed: 2.29-10    Candidate: 2.29-10    Version table:   *** 2.29-10 100          100 /var/lib/dpkg/status       2.27-3ubuntu1 500          500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages  

Apache resource failed to start in Pacemaker

Posted: 09 Oct 2021 09:02 AM PDT

I am using Pacemaker with Corosync to set up a basic Apache HA cluster with 3 nodes running CentOS7. For some reasons, I cannot get the apache resource started in pcs.

Cluster IP: 192.168.200.40

# pcs resource show ClusterIP       Resource: ClusterIP (class=ocf provider=heartbeat type=IPaddr2)        Attributes: cidr_netmask=24 ip=192.168.200.40        Operations: monitor interval=20s (ClusterIP-monitor-interval-20s)                    start interval=0s timeout=20s (ClusterIP-start-interval-0s)                    stop interval=0s timeout=20s (ClusterIP-stop-interval-0s)        # pcs resource show WebServer   Resource: WebServer (class=ocf provider=heartbeat type=apache)    Attributes: configfile=/etc/httpd/conf/httpd.conf statusurl=http://localhost/server-status    Operations: monitor interval=1min (WebServer-monitor-interval-1min)                start interval=0s timeout=40s (WebServer-start-interval-0s)                stop interval=0s timeout=60s (WebServer-stop-interval-0s)        # pcs status  Cluster name:   WARNING: corosync and pacemaker node names do not match (IPs used in setup?)  Stack: corosync  Current DC: server3.example.com (version 1.1.18-11.el7_5.2-2b07d5c5a9) - partition with quorum  Last updated: Thu Jun  7 21:59:09 2018  Last change: Thu Jun  7 21:45:23 2018 by root via cibadmin on server1.example.com    3 nodes configured  2 resources configured    Online: [ server1.example.com server2.example.com server3.example.com ]    Full list of resources:     ClusterIP  (ocf::heartbeat:IPaddr2):   Started server2.example.com   WebServer  (ocf::heartbeat:apache):    Stopped    Failed Actions:  * WebServer_start_0 on server3.example.com 'unknown error' (1): call=49, status=Timed Out, exitreason='',      last-rc-change='Thu Jun  7 21:46:03 2018', queued=0ms, exec=40002ms  * WebServer_start_0 on server1.example.com 'unknown error' (1): call=53, status=Timed Out, exitreason='',      last-rc-change='Thu Jun  7 21:45:23 2018', queued=0ms, exec=40003ms  * WebServer_start_0 on server2.example.com 'unknown error' (1): call=47, status=Timed Out, exitreason='',      last-rc-change='Thu Jun  7 21:46:43 2018', queued=1ms, exec=40002ms      Daemon Status:    corosync: active/enabled    pacemaker: active/enabled    pcsd: active/enabled  

The httpd instance is enabled and running on all three nodes. The cluster IP and individual node IPs are able to access the web page. The ClusterIP resource also works well for failover. What may go wrong for the apache resource in this case?

Thank you very much!

Update:

Here is more information from the debug output. It seems the Apache is unable to bind to the port, but there is no error from the apache log, and systemctl status httpd gave all green on all nodes. I can open web pages via the cluster IP and each every node IP. The ClusterIP resource failover works fine, too. Any idea on why Apache resource doesn't work with pacemaker?

# pcs resource debug-start WebServer --full  Operation start for WebServer (ocf:heartbeat:apache) failed: 'Timed Out' (2)   >  stderr: ERROR: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs   >  stderr: INFO: apache not running   >  stderr: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up   >  stderr: INFO: apache not running   >  stderr: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up   >  stderr: INFO: apache not running   >  stderr: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up   >  stderr: INFO: apache not running  

Add space before uppercase letter

Posted: 09 Oct 2021 07:07 AM PDT

I have a strings:

AddData  TestSomething  TellMeWhoYouAre  

and so on. I want to add space before uppercase letters. How can I do it?

SSH Tunneling to VNCServer

Posted: 09 Oct 2021 07:04 AM PDT

I have a dedicated server. There's a VNC Server and I can connect to VNC Server with a VNC Client with port 5901 so it takes me to display :1 when I connect there with a VNC Client.

I've read pretty many documents about ssh -L and ssh -R command-line commands, but it's pretty weird, because they have servers and such on their own machines and on their remote machines so I get confused about that where are they even trying to connect and what etc.

  1. I have dedicated server with VNC Server, Web Server, Game Server and Firewall.
  2. VNC Server is running and TCP/UDP connection has been enabled only to ports of Web Server, SSH, Game Server.
  3. I want connect to my VNC Server with my VNC Client (from my own pc), but using a tunneled connection, because people are trying my password too many times or something, because sometimes it says "Too many authentication failures" what a tards they are, because they will never guess the password. Anyways. I have tried similar:

ssh root@DEDICATEDIP -L 5901:DEDICATEDIP:5901 ssh root@DEDICATEDIP -R 5901:DEDICATEDIP:5901

I also tried this one (found from this site): ssh -L 5901:localhost:5901 -p 22 root@DEDICATEDIP

If I write "su" in SSH and I write my root password I can get in with root account, but when it asks my root password on ssh after trying to fill any of these tunneling commands it says the password is wrong and permission denied?

Edit:

  • My PC: PuTTy (SSH Client), VNC Viewer (VNC Client)
  • Dedibox: VNC Server, GameServer, Web Server, SSH Server

ufw status

  • 22 - ALLOW - Anywhere
  • 22 - ALLOW OUT - Anywhere

VNC Server is running and I can confirm that. If I add 5901 to ALLOW and ALLOW OUT I can simply connect there without a tunneling.

  1. (My PC) Open PuTTY
  2. (My PC) PuTTY Configuration -> Connection -> SSH -> Tunnels

    • Source port [5902]
    • Destination [163.xxx.xxx.xxx:5901]
    • [ADD]
  3. Now PuTTY shows "Forwarded ports: " -> "L5902 163.xxx.xxx.xxx:5901"

  4. I connect to server with SSH including the Tunnel settings I've configured now.
  5. I type "su" and I submit my root password.
  6. root@MyBox: /home/sysadmin# (sysadmin is normal user for my box)
  7. I type: "ssh root@IP_OF_DEDI -L 127.0.0.1:5902:127.0.0.1:5901"
  8. VNC Client keeps connecting for a while. Like (15 seconds) and says: "The connection was refused by the computer"

libvirt-bin error on a VM when I try to list VM

Posted: 09 Oct 2021 08:07 AM PDT

I'm using Virtualbox 4.3.18 on my Arch Linux Host machine and libvirt-bin 1.2.9 on my Ubuntu Server Cloud guest machine. Everytime I try to follow this tutorial I receive the following error when I run virsh:

Command:

virsh -c vbox+ssh://leandro@10.0.3.15/system list --all  

Error:

error: failed to connect to the hypervisor  error: internal error: unable to initialize VirtualBox driver API  

Someone know how to fix this?

How can I make xrandr changes persist?

Posted: 09 Oct 2021 09:09 AM PDT

I run this command to allow me to move windows between screens:

xrandr --auto

This magic command fixes my screen for me (before I run this my 2nd monitor is just an empty space where I can move my mouse). How can I make whatever this command does stick when I reboot? I'm more interested in fixing my configuration than just re-running this command, but I'm clueless as to how to make this happen.

I have 2 monitors, DFP 5 and DFP 6. Running xrandr results in this:

DFP1 disconnected (normal left inverted right x axis y axis)  DFP2 disconnected (normal left inverted right x axis y axis)  DFP3 disconnected (normal left inverted right x axis y axis)  DFP4 disconnected (normal left inverted right x axis y axis)  DFP5 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 474mm x 296mm     1680x1050      60.0*+     1400x1050      60.0       1280x1024      75.0     60.0       1440x900       60.0       1280x960       75.0     60.0       1280x800       75.0     60.0       1152x864       60.0     75.0       1280x768       75.0     60.0       1280x720       75.0     60.0       1024x768       75.0     60.0       800x600        75.0     60.3       640x480        75.0     59.9    DFP6 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm     1680x1050      60.0*+     1400x1050      60.0       1280x1024      75.0     60.0       1440x900       60.0       1280x960       75.0     60.0       1280x800       75.0     60.0       1152x864       60.0     75.0       1280x768       75.0     60.0       1280x720       75.0     60.0       1024x768       75.0     60.0       800x600        75.0     60.3       640x480        75.0     59.9    CRT1 disconnected (normal left inverted right x axis y axis)  

I have already set up DFP 6 to be right of DFP 5 using the Displays menu in debian. Here is my xorg.conf file:

Section "ServerLayout"          Identifier     "aticonfig Layout"          Screen      0  "aticonfig-Screen[0]-0" 0 0  EndSection    Section "Module"  EndSection    Section "Monitor"          Identifier   "aticonfig-Monitor[0]-0"          Option      "VendorName" "ATI Proprietary Driver"          Option      "ModelName" "Generic Autodetecting Monitor"          Option      "DPMS" "true"  EndSection    Section "Device"          Identifier  "aticonfig-Device[0]-0"          Driver      "fglrx"          BusID       "PCI:4:0:0"  EndSection    Section "Screen"          Identifier "aticonfig-Screen[0]-0"          Device     "aticonfig-Device[0]-0"          Monitor    "aticonfig-Monitor[0]-0"          DefaultDepth     24          SubSection "Display"                  Viewport   0 0                  Depth     24                  virtual 3360 1050          EndSubSection  EndSection  

It seems to be configured for everything to be one screen, and xrandr --auto somehow fixes it. Is there some way of taking a peek at what this command is doing to save the result to xorg.conf? How do you normally use xrandr to get the results to persist?

If I search for this I either get told to modify my xorg.conf file (which I don't know how to do because I don't know what xrandr --auto is actually doing) or instructions on how to run xrandr on startup, which I'm guessing isn't necessary, but I may be wrong.

No comments:

Post a Comment