Tuesday, March 30, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Why is git bash so slow to give me a command prompt and how can I fix it?

Posted: 30 Mar 2021 10:47 AM PDT

I used tcsh for decades on cygwin and just started using git-bash on my new Windows PC. It's generally a step up but the time from when the last command finishes until I receive the next command prompt is abysmal, like almost one second. I did a slo-mo video of hitting Enter five times and found that it was 950 ms to show each command prompt. Yikes! For comparison, cmd and cygwin+tcsh+mintty are well under 50 ms.

So what is causing this? Is there anything I can do about it?

This is a little bit jarring at times and knocks me out of my groove. But the bigger issue is that it seems to screw up my typing ahead. If I can finish typing the whole next command and press enter before it finishes making the command prompt then it seems to capture it all correctly, but if it finishes prompting while I'm in the middle of typing then it often discards everything I've typed so far. That is super annoying. Are others seeing that?

$ bash --version GNU bash, version 4.4.23(1)-release (x86_64-pc-msys) $ git --version git version 2.30.1.windows.1

Restrict xRDP access to multiple groups

Posted: 30 Mar 2021 10:41 AM PDT

I administrate an LDAP-managed network of Linux servers.

My groups is currently setting up xrdp for remote desktop access, and we want to limit access to multiple groups. However, This GitHub issue points us to only be able to restrict access to a singular group.

Is it possible to add multiple groups to access xrdp? What workarounds exist?

Path not found by non-root service

Posted: 30 Mar 2021 10:30 AM PDT

I have a Centos 7 VPS where I have published a .NET Core application. The solution is ran as a service.

It is published in the path:

*/var/opt/MyApp/(All app's files)*  

At startup it registers a location to log all the info that I need to be logged. The log path is fixed:

*/var/log/opt/MyApp/(rotated log file)*  

I have created a service file under

*/etc/systemd/system/MyApp.service*  

as follows

[Unit]  Description=Service MyApp    [Service]  WorkingDirectory=/var/opt/MyApp  ExecStart=/usr/bin/dotnet /var/opt/MyApp/MyApp.dll  Restart=always  # Restart service after 10 seconds if dotnet service crashes  RestartSec=10  SyslogIdentifier=MyApp  User=myappbe  Group=myappbe  Environment=ASPNETCORE_ENVIRONMENT=Production     [Install]  WantedBy=multi-user.target  

The myappbe user and group are created with nologin with the following commands:

*useradd -l -r -s /sbin/nologin myappbe*  *usermod -a -G myappbe myappbe*  

The working directory and the log location are both owned by myappbe user and group with 0775 permission. Running the service configured like this I can see from journalctl an error:

*Unhandled exception. System.IO.DirectoryNotFoundException: Requested trace logging directory   '/var/log/opt/MyApp/' does not exist*   

even though that location exists and myappbe is owner.

Changing the User and Group lines in the service to:

User=root  Group=root  

runs the service as root with no errors. And the path is found and i can see the logs being written .

Why is the path not found when running the service as non-root?

How to batch process a storing all folder names in a file

Posted: 30 Mar 2021 10:48 AM PDT

I am looking to store all the folder names in a text file.

I use this commands

  1. ssh login@servername.com
  2. cd /folder
  3. ls > /folder/output.txt or ls | ssh ssh login@servername2.com "cat>/folder/output.txt"(Common output location)

I repeat this on another server

Essentially i want to create a script that can run from one server and store the outputs from all servers in one location.

Migrating from turnkey Linux appliance to Debian 10 VM

Posted: 30 Mar 2021 08:25 AM PDT

I have a turnkey Linux appliance that's based on Debian 8.6 and I have a new Debian 10.9 Gen 2 VM I'm running on Hyper-v since Turnkey Linux still does not support UEFI. What simple approaches are there to move everything over without having to manually rebuild it all? Is there a way to convert a base Debian install to Turnkey Linux and just use TLKBAM to migrate or do I just have to do everything manually?

Java systemd service without specifying java -jar

Posted: 30 Mar 2021 10:47 AM PDT

I'm struggling to make a SpringBootApp to run as a service at the moment. The biggest issue is that Devops doesn't allow us to make changes on the Ansible scripts that deploys the artifact and creates the service (sample shown below).

[Unit]  Description=A Spring Boot application  After=syslog.target    [Service]  User=rating-gateway  ExecStart=/opt/rating-gateway/rating-gateway-0.0.1-SNAPSHOT.jar  SuccessExitStatus=143  Restart=always  RestartSec=5  

Technically, If I were to add java -jar on the ExecStart it will run correctly, but as we cannot edit the Ansible scripts I need to find a workaround. I've read a few guides where the service does not use java -jar instruction, but not sure what would be missing for this to run correctly.

I've added java to the PATH as I thought that would help me. But it didn't.

PATH=/home/rating-gateway/.local/bin:/home/rating-gateway/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.275.b01-1.el8_3.x86_64/bin  

Any other ideas? to workaround this issue?

Thanks in advanced.

PS. I'm a Dev, but got root access to the server, so any help is pretty welcome.


(edit extra info) When I don't have java -jar on the ExecStart command. I get the following error in the /var/log/messages

Mar 30 08:44:44 systemd[134389]: rating-gateway.service: Failed at step EXEC spawning /opt/rating-gateway/rating-gateway-0.0.1-SNAPSHOT.jar: Exec format error  

But I've already confirmed the architecture of both platform where jar is built and server that is deployed. Both are x84_64

Two processes mapped in the same address space

Posted: 30 Mar 2021 08:22 AM PDT

I have noticed that when I open two processes with GDB for debugging, /proc/PID/maps indicate the same address regions for the two :

cat /proc/4170/maps  555555554000-555555555000 r--p 00000000 08:01 655807                     /home/user/1  555555555000-555555556000 r-xp 00001000 08:01 655807                     /home/user/1  555555556000-555555557000 r--p 00002000 08:01 655807                     /home/user/1  555555557000-555555558000 r--p 00002000 08:01 655807                     /home/user/1  555555558000-555555559000 rw-p 00003000 08:01 655807                     /home/user/1    cat /proc/4177/maps  555555554000-555555555000 r--p 00000000 08:01 664427                     /home/user/2  555555555000-555555556000 r-xp 00001000 08:01 664427                     /home/user/2  555555556000-555555557000 r--p 00002000 08:01 664427                     /home/user/2  555555557000-555555558000 r--p 00002000 08:01 664427                     /home/user/2  555555558000-555555559000 rw-p 00003000 08:01 664427                     /home/user/2  

I don't understand how this is handled, I thought each process should have its own page table ?

Sorry mime the second (mate-control-center vs. firefox)

Posted: 30 Mar 2021 09:02 AM PDT

My OS is Debian stretch (mate Desktop) Since about 2 years I have a problem with default setting for application browser(in mate-control-center) and firefox. whenever I let firefox set itselfs as default browser in (about:preferences) my prefered application settings in mate-control-center changed from firefox-esr to thunderbird for default browser. And the other way around.

Both seemed somehow registert

 alex@Taomon:~$ gvfs-mime  --query x-scheme-handler/http       Default application for 'x-scheme-handler/http': firefox-esr.desktop      Registered applications:          thunderbird.desktop          firefox-esr.desktop      Recommended applications:          thunderbird.desktop          firefox-esr.desktop      alex@Taomon:~$   

alex@Taomon:~$ gio mime x-scheme-handler/https  Default application for 'x-scheme-handler/https': firefox-esr.desktop  Registered applications:      thunderbird.desktop      firefox-esr.desktop  Recommended applications:      thunderbird.desktop      firefox-esr.desktop  alex@Taomon:~$   

How can I remove thunderbird as registered application for x-scheme-handler/http and x-scheme-handler/https. I hope then my Error will be gone for good.

mdadm 10 far raid uneven read speed

Posted: 30 Mar 2021 08:59 AM PDT

Why sequential read speed from raid 10 growth only with very huge bs(>100MB, dd parameter). Having raid:

/dev/md127:  Version : 1.2  Raid Level : raid10          Array Size : 46875009024 (44703.49 GiB 48000.01 GB)       Used Dev Size : 11718752256 (11175.87 GiB 12000.00 GB)        Raid Devices : 8       Total Devices : 8         Persistence : Superblock is persistent         Intent Bitmap : Internal                 State : clean      Active Devices : 8     Working Devices : 8      Failed Devices : 0       Spare Devices : 0                Layout : far=2          Chunk Size : 1024K    Consistency Policy : bitmap  

I expect sequential read speed at least 100MB*n_drives=800+MB/sec. But:

dd if=/dev/md127 of=/dev/null bs=10240k count=1000 iflag=direct  1000+0 records in  1000+0 records out  10485760000 bytes (10 GB, 9.8 GiB) copied, 14.2918 s, 734 MB/s    iostat -zxs 1  Device             tps      kB/s    rqm/s   await  areq-sz  aqu-sz  %util  md127          2880.00 737280.00     0.00    0.00   256.00    0.00   0.00  sda             360.00  92160.00     0.00    5.21   256.00    1.24  70.80  sdb             360.00  92160.00     0.00    5.05   256.00    1.14  74.80  sdc             367.00  93952.00     0.00    5.25   256.00    1.26  76.80  sdd             368.00  94208.00     0.00    6.46   256.00    1.70  80.80  sde             360.00  92160.00     0.00    5.53   256.00    1.31  75.60  sdf             362.00  92672.00     0.00    6.15   256.00    1.54  72.40  sdg             364.00  93184.00     0.00    5.18   256.00    1.24  73.20  sdh             364.00  93184.00     0.00    5.73   256.00    1.40  70.40  

If I test single drive:

dd if=/dev/sda of=/dev/null bs=1024k count=1000 iflag=direct  1000+0 records in  1000+0 records out  1048576000 bytes (1.0 GB, 1000 MiB) copied, 4.25743 s, 246 MB/s    iostat -xs /dev/sda 1  Device             tps      kB/s    rqm/s   await  areq-sz  aqu-sz  %util  sda             868.00 222208.00     0.00    2.79   256.00    0.70 100.00  

Only when I set bs very huge - I can gain read speed similar to single speed * n_drives:

dd if=/dev/md127 of=/dev/null bs=1024000k count=30 iflag=direct  30+0 records in  30+0 records out  31457280000 bytes (31 GB, 29 GiB) copied, 16.2737 s, 1.9 GB/s    iostat -dxs 1  Device             tps      kB/s    rqm/s   await  areq-sz  aqu-sz  %util  md127         10115.00 2341348.00     0.00    0.00   231.47    0.00   0.00  sda            1077.00 259848.00   187.00  153.82   241.27  163.51  95.20  sdb            1077.00 260612.00   197.00  162.94   241.98  173.33  99.20  sdc            1083.00 262412.00   197.00  160.82   242.30  171.96  98.40  sdd            1067.00 258568.00   195.00  170.78   242.33  180.09 100.00  sde            1086.00 262416.00   195.00  159.38   241.64  170.90  98.40  sdf            1077.00 260360.00   189.00  155.88   241.75  165.71  96.40  sdg            1073.00 259076.00   197.00  160.96   241.45  170.56  98.00  sdh            1085.00 260872.00   191.00  163.61   240.44  175.34  99.60  

My workload contains mostly sequential reads, but I'm not sure that app will issue IO reads with such huge sizes.

Since test is performed on block device directly - this mean that problem is not in FS. areq-sq in all cases near the same, but %util is lower for raid, does this mean that raid has the problems with generating requests(but aqu-sz is very huge for raid, also why?)? How to find the reason?

DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS" Linux 5.4.0-67-generic #75-Ubuntu SMP Fri Feb 19 18:03:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

cat /sys/block/md127/queue/scheduler  none  

EDIT I was wrong about >100MB in my first row. I've made some experiments with different bs(to check aligned reads variants):

dd if=/dev/md127 of=/dev/null bs=8M count=3000 iflag=direct  25165824000 bytes (25 GB, 23 GiB) copied, 33.1877 s, 758 MB/s    dd if=/dev/md127 of=/dev/null bs=16M count=300 iflag=direct  5033164800 bytes (5.0 GB, 4.7 GiB) copied, 4.71832 s, 1.1 GB/s    dd if=/dev/md127 of=/dev/null bs=18M count=1000 iflag=direct  18874368000 bytes (19 GB, 18 GiB) copied, 18.4601 s, 1.0 GB/s    dd if=/dev/md127 of=/dev/null bs=20M count=500 iflag=direct  10485760000 bytes (10 GB, 9.8 GiB) copied, 10.0867 s, 1.0 GB/s    dd if=/dev/md127 of=/dev/null bs=32M count=300 iflag=direct  10066329600 bytes (10 GB, 9.4 GiB) copied, 7.29756 s, 1.4 GB/s    dd if=/dev/md127 of=/dev/null bs=128M count=100 iflag=direct  13421772800 bytes (13 GB, 12 GiB) copied, 8.27345 s, 1.6 GB/s    dd if=/dev/md127 of=/dev/null bs=256M count=100 iflag=direct  26843545600 bytes (27 GB, 25 GiB) copied, 15.5701 s, 1.7 GB/s    dd if=/dev/md127 of=/dev/null bs=512M count=100 iflag=direct  53687091200 bytes (54 GB, 50 GiB) copied, 28.9437 s, 1.9 GB/s    dd if=/dev/md127 of=/dev/null bs=1G count=32 iflag=direct  34359738368 bytes (34 GB, 32 GiB) copied, 18.36 s, 1.9 GB/s  

Despite it is still hard to understand why speed grows with bs growing(for example from 256M to 512M), it shows not bad read speed starting from bs=32M.

I had two grubs but not anymore, and I want both back

Posted: 30 Mar 2021 10:09 AM PDT

I have Ubuntu Linux 20.04 and Kali 2021 installed, and before reinstalling both, I had two grubs, the main one showed up when I started the pc, it was the Ubuntu one, and the second one showing up when I selected the Kali option in the Ubuntu Linux's grub. The grub on which the pc started was the Ubuntu one, and if I chose to start Kali, it would start again and show me a Kali grub menu. How can I get both back to what they were ? Thanks for your replies, but please, do not say "It is not possible", as I did have both of them fine and working. Thanks

what timedate value is always greater than any timedate?

Posted: 30 Mar 2021 08:44 AM PDT

What timedate value is always greater than any timedate?

In a script, I want to provide an argument to variable duration so that the loop will run forever until I kill the process:

# `duration` has a value in seconds  end=$(($(date +%s) + duration))      while true; do      # ...      [ $(date +%s) -ge $end ] && break      # ...  done  

What's the point of naming Iptables' tables as "tables"?

Posted: 30 Mar 2021 09:29 AM PDT

After reading some guides (e.g. this one) and playing with Iptables tuning I found that I see no reason for naming Iptables' tables as tables.
I mean that there practically are no tables.
E.g. having "table" nat there are basically three chains in it - PREROUTING, OUTPUT and POSTROUTING, but these chains in this table have no intersections and do not follow each other directly. So from the packet flow's point of view highlighting the concept of tables doesn't make any sense at all.
The name of "table" (raw, filter, nat, mangle, security, ...) just represents a priority of groups of rules inside chains.

Thus it should be not "table contains several chains" but something like "chain contains groups of rules with specific global priority (and some other common properties)". Doesn't it?

Or do I misunderstand something?

Escaping UTF-8 encoded URLs

Posted: 30 Mar 2021 08:27 AM PDT

I want to replace a variable expansion with a URL --- directly inside a file.
The URL I want to replace the variable expansion with is UTF-8 encoded due to the language of its webpage name being Right-To-Left (RTL) [Hebrew].


Here is a replaced-replacement pattern I work with (currently without escaping):

sed -i 's/$contact_form_success_webpage/https://example.com/index.php?title=%D7%99%D7%A6%D7%99%D7%A8%D7%AA_%D7%A7%D7%A9%D7%A8:%D7%94%D7%A6%D7%9C%D7%97%D7%94/g' FILE  

I could add a backslash before the $ of $contact_form_success_webpage so to make it \$contact_form_success_webpage which is processable by sed but to start adding backslashes to needs-to-be-esacped parts of "long" encoded URLs is something I'd rather not do totally by myself and would prefer some automation for that.

The above URL pattern is quite "light" or "easy" but some URLs might have lots of forward slashes (/) and perhaps lots of other needs-to-be-escaped parts also.


How would you do suggest to escape UTF-8 encoded URLs?
(What pattern will you use for generally all use cases?)

How to identify the python, pip and installed modules location on linux?

Posted: 30 Mar 2021 08:19 AM PDT

I started learning python but I am finding it difficult to understand on linux.

uname -a  Linux machine-name 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux    which python  /usr/local/bin/python    which pip  /usr/local/bin/pip    pip --version  /usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a release (2.7.7+) that supports hmac.compare_digest as soon as possible.    utils.PersistentlyDeprecated2018,  pip 18.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)    python  Python 2.7.16 (default, May  6 2020, 13:05:58)   [GCC 4.8.4] on linux2  Type "help", "copyright", "credits" or "license" for more information.  >>> import os  >>> import urllib2  >>> os.path.abspath(urllib2.__file__)  '/usr/local/lib/python2.7/urllib2.pyc'    pip install requests  /usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a release (2.7.7+) that supports hmac.compare_digest as soon as possible.    utils.PersistentlyDeprecated2018,  Requirement already satisfied: requests in ./dist-packages (2.22.0)  Requirement already satisfied: idna<2.9,>=2.5 in ./dist-packages (from requests) (2.8)  Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./dist-packages (from requests) (3.0.4)  Requirement already satisfied: certifi>=2017.4.17 in ./dist-packages (from requests) (2020.4.5.1)  Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./dist-packages (from requests) (1.25.9)    Python 2.7.16 (default, May  6 2020, 13:05:58)   [GCC 4.8.4] on linux2  Type "help", "copyright", "credits" or "license" for more information.  >>> import os  >>> import requests  Traceback (most recent call last):    File "<stdin>", line 1, in <module>  ImportError: No module named requests  >>>   

pip install requests, says as installed. But when checked in interactive mode, errors out as no module name requests. Can you please help me to understand from which locations these modules are being used (where this path has been set ?) and how to install modules at that particular location ?

Can you please help me ?

Connect namespace to internet using Second public ip address

Posted: 30 Mar 2021 08:50 AM PDT

I have an ubuntu18 server with Two public addresses

How can i create a namespace and connect to the internet through the second public ip?

(need to launch a program and force it to use the second ip to connect to the internet)

ip a :

    root@vm8950217476:~# ip a  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00      inet 127.0.0.1/8 scope host lo         valid_lft forever preferred_lft forever      inet6 ::1/128 scope host         valid_lft forever preferred_lft forever  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000      link/ether 9a:40:ef:c5:bb:62 brd ff:ff:ff:ff:ff:ff      inet 130.185.76.181/24 brd 130.185.76.255 scope global eth0         valid_lft forever preferred_lft forever      inet 130.185.76.18/24 brd 130.185.76.255 scope global secondary eth0         valid_lft forever preferred_lft forever      inet6 fe80::9840:efff:fec5:bb62/64 scope link         valid_lft forever preferred_lft forever  

ip route :

root@vm8950217476:~# ip route  default via 130.185.76.254 dev eth0 proto static  130.185.76.0/24 dev eth0 proto kernel scope link src 130.185.76.181  

I have reached some solutions stated here:

But after days of testing , still couldn't make this work. The process looks confusing to me specially that I'm not sure which addresses I need to use in netns commands (ip addr , route , gw ,...)

latest steps I tried:

ip netns add test  ip netns exec test ip link set lo up  ip link add link eth0 name test0 type macvlan  ip link set test0 netns test  ip netns exec test ip addr add 130.185.76.18/24 brd + dev test0  ip netns exec test ip link set test0 up    root@vm8950217476:~# ip netns exec test ping 8.8.8.8  connect: Network is unreachable    

How to copy target files using symlinks and a list of file names

Posted: 30 Mar 2021 10:05 AM PDT

I would like to copy many files. I have their location as a set of symbolic links whose names are stored as lines in a txt file. So I am using cp and need to combine the readlink and cat/pipe functions. I haven't seen other questions deal with this combination.

The command:

cp $(readlink < /path/list.txt) -t /path/targetdir

A simpler example works where the symlink names are used explicitly in the argument of the readlink (but I have too many file names to do this manually), e.g.:

cp $(readlink symlink1 symlink2) -t /path/targetdir

The issue is in how I am combining the 'readlink' and the pipe, but I can't figure out what.

EDIT: here's an example of what's in the first lines of the list.txt file:

symlink_13243

symlink_39184

symlink_83204

each row is a unique symlink name.

It's possibile to delete some file with a range af number in a name? [duplicate]

Posted: 30 Mar 2021 08:42 AM PDT

I have many images captured from my webcam and their name are:

2021-03-29_06-00  2021-03-29_06-02  2021-03-29_06-04  2021-03-29_06-06    2021-03-29_07-00    2021-03-29_08-00    2021-03-29_09-00  etc..  

I want to delete images shooted by night.

I found script to obtain sunrise (and sunset) times, now I have to filter my files and delete.

I start to try with ls command.

If I use:

ls *_{00..06}*.jpg   

the result is correct.

By if I insert a variable with the time of sunrise, encounter of problems.

SUNRISE="06"  ls *_{00..$SUNRISE}*.jpg   

But the result are:

ls: cannot access '*_{00..06}.jpg': File or directory does not exist  

How can I get the count of specific characters using vim in a file

Posted: 30 Mar 2021 08:46 AM PDT

My question is similar to this one: How can I count the number of words in a file whilst editing the file in vim

But with a different task where I have to count characters with the search function in vim and write them at the of the file.

For example, if I have to count how many numeric characters are there, I would need something like this: :%s/[0-9]/{g} and after that a command that counts how many characters I have selected with that search.

Edit:

I'm trying a method where I first select all the characters that I want to count with /[0-9] and trying to use '<,'> like this: '<,'> !wc -m

Why I am asked for the password of a different account when trying to mount a disk?

Posted: 30 Mar 2021 09:57 AM PDT

I am on Debian 10 Buster.

When using Nautilus (aka Files), I am always asked for my password when trying to mount another HDD. All normal.

A few days ago, I am not asked for my account password anymore, but for another account password.

So, my main account is in the sudo group. I also have a second account named 'guest'. I am not sure what happened so now every time I try to mount a secondary HDD I am asked for the 'Guest' password instead of my main account password (where I am logged in).

Any help?

Thanks

Edit: If anyone want to know more about this, you can also read the answers on this question: question

Bightness Issue, Lenovo, Fedora 33

Posted: 30 Mar 2021 08:49 AM PDT

I'm having the brightness issue, where screen brightness doesn't change, on a Lenovo Legion Y740 with Fedora 33 that I haven't been able to solve yet.

Here's the output of lspci | grep VGA:

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)  01:00.0 VGA compatible controller: NVIDIA Corporation TU106BM [GeForce RTX 2070 Mobile / Max-Q] (rev a1)  

It defaults to the Intel graphics card.

Here's what my /etc/default/grub file looks like:

GRUB_TIMEOUT=5  GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"  GRUB_DEFAULT=saved  GRUB_DISABLE_SUBMENU=true  GRUB_TERMINAL_OUTPUT="console"  GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet acpi_backlight=video rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 intel.modeset=1"  GRUB_DISABLE_RECOVERY="true"  GRUB_ENABLE_BLSCFG=true  

Here's some information that may be helpful.

I tried the suggestion the modify the grub file to change the acpi_backlight option. Before, the keyboard brightness keys didn't work at all. After changing to video, Fn + F6 or Fn + F7 make the window pop up that shows the bar for decreasing/increasing brightness, and the values change in the appropriate brightness file. However, brightness still does not change, this only turns the backlight off when I set brightness to 0.

I've also installed xbacklight, which doesn't work. I haven't debugged this yet, but when running xbacklight -dec 10, I get No outputs have backlight property, but I don't think this is the main issue.

I think the following two paragraphs may be indicative of the main issue.

When I find the file that holds the numerical value for brightness, in my case, this is /sys/class/backlight/acpi_video0/brightness/ when the Intel card is active, and I modify the value in place, the brightness doesn't change unless set to 0.

Next, on install I noticed that there are settings for /etc/X11/xorg.conf.d/ for the keyboard, in the file 00-keyboard.conf, but no settings for the backlight. What's the file I should put here? Is there any package I can install that would put the proper config file here?

I've installed appropriate intel and nvidia drivers.

Does any one have any idea what might be the issue?

Thank you in advance for any links, suggestions, or consideration.

Intel Graphics driver install Ubuntu

Posted: 30 Mar 2021 09:53 AM PDT

I'm using an Intel UHD Graphics 605.

That's part of the output of lspci -v:

00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 605 [8086:3185] (rev 03)      Subsystem: ASUSTeK Computer Inc. Device [1043:1201]      Kernel driver in use: i915  

What do I need to install so that Ubuntu sees it? The computer is extremely laggy and hangs up or locks up with multiple windows open.

I looked at Intel's support page and I was unable to find a Linux download.

How do I source in "/Users/<usr>/.ghcup/env" to $PATH in .zshrc after installing Haskell?

Posted: 30 Mar 2021 09:38 AM PDT

I cannot seem to get the $PATH variable sourced in via /Users/chris/.ghcup/env so that I can directly use the ghc or ghci binary in zsh.

I installed ghc & cabal-install via ghcup: curl https://get-ghcup.haskell.org -sSf | sh as described on https://www.haskell.org/platform/mac.html / https://www.haskell.org/ghcup/

Hint during installation process:

It will add the 'cabal', 'ghc', and 'ghcup' executables to bin directory located at:

/Users/chris/.ghcup/bin

and create the environment file /Users/chris/.ghcup/env which you should source in your ~/.bashrc or similar to get the required PATH components.

...

In order to run ghc and cabal, you need to adjust your PATH variable. You may want to source '/Users/chris/.ghcup/env' in your shell configuration to do so (e.g. ~/.bashrc).

I can get the binaries to run after adding export PATH=/Users/chris/.ghcup/bin:$PATH to ~/.zshrc. However, from the hints during installation I am assuming that I should rather use the $PATH information automatically provided in /Users/chris/.ghcup/env.

Content of cat /Users/chris/.ghcup/env:

export PATH="$HOME/.cabal/bin:${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/bin:$PATH"

How do I incorporate that into my .zshrc?

NVIDIA drivers installed, but nvidia-smi not working on CentOS

Posted: 30 Mar 2021 10:18 AM PDT

I have an NVIDIA driver installed, verified by the output of cat /proc/driver/nvidia/version:

NVRM version: NVIDIA UNIX x86_64 Kernel Module 390.30 Wed Jan 31 22:08:49 PST 2018 GCC version: gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)

However, running nvidia-smi gives the following error: bash: nvidia-smi: command not found...

More info: I am running CentOS 7, and trying to a) get nvidia-smi working and b) then install CUDA.

webp animation to gif animation (cli)

Posted: 30 Mar 2021 09:25 AM PDT

I was surprised today to find apparently how difficult it is to go from a webp animation to gif animation. My GIMP 2.8.22 and ImageMagick 7.0.7-21 on linux 4.14.13-1-ARCH don't seem to support the format, and the only tool available in repos seem to be libwebp 0.4.1 which includes a decode tool that lets you extract individual frames to some image formats, none of them being gif (It's a licensing problem maybe?)

Anyway, I used the following script:

#!/bin/bash    DELAY=${DELAY:-10}  LOOP=${LOOP:-0}  r=`realpath $1`  d=`dirname $r`  pushd $d > /dev/null  f=`basename $r`  n=`webpinfo -summary $f | grep frames | sed -e 's/.* \([0-9]*\)$/\1/'`  pfx=`echo -n $f | sed -e 's/^\(.*\).webp$/\1/'`  if [ -z $pfx ]; then      pfx=$f  fi    echo "converting $n frames from $f   working dir $d  file stem '$pfx'"    for ((i=0; i<$n; i++)); do      webpmux -get frame $i $f -o $pfx.$i.webp      dwebp $pfx.$i.webp -o $pfx.$i.png  done    convert $pfx.*.png -delay $DELAY -loop $LOOP $pfx.gif  rm $pfx.[0-9]*.png $pfx.[0-9]*.webp  popd > /dev/null  

Which creates a gif animation from the extracted frames of the file supplied in the first argument.

I tried it on this file and the resulting file was kind of artifacty. Is it proper form to post in this forum for suggestions of improvement of the procedure/invocations?

And: If there are custom tools for this conversion, please share your knowledge! :)

automatic change wallpaper automatically by day,night

Posted: 30 Mar 2021 10:11 AM PDT

I am having 2 wallpaper and i want to change them day and night. If it day change it to wallpaper1.png or if it night change it to wallpaper2.png. How can i do that? I am running parrot OS 3.8 on Mate desktop enviroment 1.18.0.

How do I change the modules directory that the kernel searches

Posted: 30 Mar 2021 08:03 AM PDT

I am new to rebuilding the kernel and kernel modules and such, so I apologize if this is a poor question.

I am running Centos 6.8 , 2.6.32.642.el6.x86_64. I am trying learn about device drivers and such, and my reference text starts with rebuilding the kernel. It's instructions seem kinda dated, so I've also been googling.

I rebuilt the kernel, with a minor change to main.c I then moved the resulting bzImage into the boot directory:

cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.32-custom.el6.x86_64  

I then added an entry to etc/grub.conf, that is identical to the one already there, but with the different kernel name.

I then reboot, and on reboot, I get a kernel panic, which indicates that it can't find modules.dep in /lib/modules/2.6.32

But everything I've read indicates that the modules should be located at /lib/modules/2.6.32-custom.el6.x86_64,

So to try that, I softlinked /lib/modules/2.6.32-642.el6.x86_64 to /lib/modules/2.6.32-custom.el6.x86_64:

ln -s /lib/modules/2.6.32-642.el6.x86_64 /lib/modules/2.6.32-642.el6.x86_64   

but as expected it didn't fix the error, because it (the kernel?) is looking in /lib/modules/2.6.32/ instead of /lib/modules/2.6.32-custom.el6_x86_64

My question is, where SHOULD the kernel be looking for modules and/or how do I change it, and/or what is driving it to look where it is looking?

how to restart pam.d service after changing of common-account-pc or common-auth-pc

Posted: 30 Mar 2021 08:44 AM PDT

I am having trouble with a configuration line in common-account-pc and common-auth-pc that denies also root access:

account  required  pam_tally2.so  deny=10 onerr=fail unlock_time=600 even_deny_root root_unlock_time=5 file=/home/log/faillog  

It seems that this line causes some problem when trying to access multiple times the SUT and i assume that it things that it is an attack via ssh. But it is actually a test tool that tries to send several times commands via ssh root@ to the SUT (100.100.100.100) from server (10.10.10.13).

Apr 25 05:51:56 SUT sshd[31570]: pam_tally2(sshd:auth): user root (0) tally 83, deny 10  Apr 25 05:52:16 SUT sshd[31598]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.10.10.13  user=root  Apr 25 05:52:21 SUT sshd[31568]: error: PAM: Authentication failure for root from 10.10.10.13  Apr 25 05:52:21 SUT sshd[31568]: Connection closed by 10.10.10.13 [preauth]  

Since the password is always correct, but still after some time it starts to through exception (pexpect) Account locked.

version: 2.3 ($Revision: 399 $)  command: /usr/bin/ssh  args: ['/usr/bin/ssh', 'root@100.100.100.100']  searcher: searcher_re:      0: re.compile(".*:~ #")  buffer (last 100 chars): :  Account locked due to 757 failed logins    Password:  before (last 100 chars): :  Account locked due to 757 failed logins    Password:  after: <class 'pexpect.TIMEOUT'>  ...  

But according to passwd root is not LK labeled:

SUT:~ # passwd -S root  root P 04/24/2017 -1 -1 -1 -1  

Manually it is always possible to access the SUT via ssh root@!!!

So, for the moment the only that can cause this is the pam configuration. But how do i restart or activate the changes?

Does someone else have any other idea?

Thanks in adv.

How can I change the IP and gateway addresses permanently?

Posted: 30 Mar 2021 08:44 AM PDT

I recently installed Linux Ubuntu 14.04 to my computer. To enable internet connection I needed to change my IP and Gateway address. I did the following as a root user

# ifconfig eth0 "my ip address here" netmask 255.255.255.0 up  # route add default gw " gw address here"  

It works fine for a couple of minutes but then goes back to the previous settings every time. So, How can I change the IP and the gw addresses permanently?

Move position of an application window from the command line on OSX

Posted: 30 Mar 2021 08:27 AM PDT

An application — iA Writer — somehow got stuck off screen with only the corner showing. I can't grab it or use other means to move it from that position.

All new windows open in that position, regardless of if I open/close the application.

Is there a terminal command for moving a specific window's position?

No comments:

Post a Comment