Friday, May 13, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Change OS disk location

Posted: 13 May 2022 04:21 PM PDT

I have a lenovo laptop with a 1TB HDD disk, I've installed another 240GB SDD drive, I want to translate my currently installed OS (POP_OS) from the HDD to the SDD to keep the OS on the fastest drive for a faster boot and let files, media and other programs in the HDD, is that even possible?. Doesn't matter if I have to format the drive but I would rather not.

Create flatpak runtime with specified /usr and similar dirs

Posted: 13 May 2022 03:53 PM PDT

What I'm trying to build is a flatpak runtime that will use /usr as symlink to say /my/usr or the host /usr. That way existing containers and host runtime can be used for apps that are either not maintained well as flatpaks or the flatpak runtimes it depends on are just too huge and probably not needed (two copies of same libs, say). 1

As building runtimes is "discouraged", there are little documentation and only tools to build for certain environments (fedora, apertis). So where can I find a relevant doc for this? Does a similar project already exist?

PS: using flatpak for these cases has nothing to do with portability, but the sandbox is a great advantage here.

On dist-upgrade: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages

Posted: 13 May 2022 03:45 PM PDT

During a dist-upgrade operation I am encountering an issue with apt packages.

When running any of the following commands I encounter the same error:

$ sudo apt dist-upgrade  $ sudo apt --fix-broken install  $ sudo apt-get autoremove  

Error:

Reading package lists... Done  Building dependency tree... Done  Reading state information... Done  Correcting dependencies... failed.  The following packages have unmet dependencies:   gdm3 : Depends: gir1.2-gdm-1.0 (= 41~rc-0ubuntu2pop0~1634915133~21.10~cf40258) but 42.0-1ubuntu6pop1~1650301427~22.04~2055533 is installed          Depends: libgdm1 (= 41~rc-0ubuntu2pop0~1634915133~21.10~cf40258) but 42.0-1ubuntu6pop1~1650301427~22.04~2055533 is installed   gnome-settings-daemon : Depends: gnome-settings-daemon-common (= 40.0.1-1ubuntu3pop0~1639691325~21.10~3bcd31b) but 42.1-1ubuntu3pop0~1651657687~22.04~0386384 is installed  E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.  E: Unable to correct dependencies  

I found 3 related articles, none of the solutions in them solved my problem:

In the questions above they appear to be focused on specific packages, not a dist-upgrade, so I don't know how to simply identify and remove an offending package.

If I try to remove an offending package I get what looks like it will be a chain of dependencies that reach into the dist-upgrade, something I guess I don't want to mess with.

$ sudo apt-get remove gdm3  Reading package lists... Done  Building dependency tree... Done  Reading state information... Done  You might want to run 'apt --fix-broken install' to correct these.  The following packages have unmet dependencies:   gnome-settings-daemon : Depends: gnome-settings-daemon-common (= 40.0.1-1ubuntu3pop0~1639691325~21.10~3bcd31b) but 42.1-1ubuntu3pop0~1651657687~22.04~0386384 is to be installed   pop-desktop : Depends: gdm3 but it is not going to be installed                 Recommends: io.elementary.sideload but it is not installable  E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).  

How to create a shared folder between Linux and Windows?

Posted: 13 May 2022 03:48 PM PDT

How to create a shared folder between Linux and Windows? If possible, do not use additional applications. If it's not possible, please tell me the app that can be used.

These are my previous steps:

  1. My Windows has a folder in \\IP\Data_Folder\01_share_folder and the status of this folder is already shared.

  2. My Linux has a folder in /home/user_name/01_share_folder/ where the owner is root.

  3. In the Linux terminal, I log in as root and type the following command:

    mount -t cifs //IP/Data_Folder/01_share_folder /home/user_name/01_share_folder/ -o username='username',password='password'  
  4. Linux successfully reads the folder and files on Windows, but when I create or upload a file from Linux, I get a "permission denied" error.

  5. Then I checked the permission code, and it turned out to be 775, then I tried to change it:

    chmod -R 777 /home/username/01_share_folder/  
  6. But not working and it's still 775.

I Use MobaXterm to access Linux.

Linux Version:

NAME="Red Hat Enterprise Linux Server"  VERSION="7.9 (Maipo)"  

My Windows Version :

Windows Server 2019.  

two modules for WM8962

Posted: 13 May 2022 03:21 PM PDT

As can be seen on https://www.kernelconfig.io/search?q=wm8962&kernelversion=4.19.165&arch=arm64 there are seemingly two different kernel modules for the audio codec WM8962 and they have entirely different dependencies as well. Is there a good way to determine which one should be utilized? I understand that one of them is for i.MX boards but what exactly is the difference? Does one need to dive into the code to find out about the variations?

How to run input (x|grep y) in command

Posted: 13 May 2022 01:48 PM PDT

lets say when I execute command and then grep it for a specific output.

for example: man cat|grep "Written"

This gives the name of the authors.

My problem is I want to do this via read.

here is an example of my script:

#!/bin/bash    read variable #lets say input is: man cat|grep "Written"    $variable  

It does not seem to work. I need this to work as I am doing a larger script and this part got me stuck. Any tips are appreciated.

iterating though files in extracted directories and running an exe against the file with parameters

Posted: 13 May 2022 02:28 PM PDT

Ok, so here is what I am trying to do - I have a bunch of archives that are named:

newnslog.0.tar.gz  newnslog.1.tar.gz  newnslog.2.tar.gz   newnslog.3.tar.gz  newnslog.4.tar.gz  .  .  .  

once each is extracted, I want to iterate through all the files in that directory and run an exe against the data in the file.

#extract:  tar -xzf newnslog.58.tar.gz  #cd:  cd newnslog.59 < yes the filename in the archive may be 1 more or less or the same as it is a continuation  #ls:  newnslog.ppe.0  newnslog.ppe.1  newnslog.ppe.2  #execute nsc2e with parameters against each file:  # ../nsc2e -c /netscaler/nsconmsg -K newnslog.ppe.0 -f ../nsc2e.conf  

I am trying a for - do loop but I must be doing something wrong:

root@VPX-13# for f in *; do '../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf'; done  -bash: ../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf: No such file or directory  -bash: ../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf: No such file or directory  -bash: ../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf: No such file or directory  

I also know there must be a streamlined way to do everything including the extraction - something like:

find newnslog* -prune -type d | while IFS= read -r d; do       cd "$d"      for f in *; do '../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf'; done  done  

Figuring out which user is best to start pm2

Posted: 13 May 2022 01:12 PM PDT

I'm about to deploy a highly secure production server, which is running an nginx reverse proxy, which points to the backend server on nodeJS. When a user starts the server by typing in the "pm2 start server.js" command, whichever user ran this command, becomes the owner of the pm2 server. I don't want to run it on my account (which has sudo privileges with no password), incase If somehow a hostile party compromises the code, they would be able to run commands as root.

Which user should start pm2 to ensure that if there is compromised code, the attacker won't have full control of the system?

The default user for apache & nginx is www-data, why is there no default user for pm2?

Replace digits and then characters pattern with sed

Posted: 13 May 2022 02:26 PM PDT

I have a file like below:

some  arbitrary number of  leading  lines  a prefix followed by wmd v0.0.0-20220406135915-ce5e3ee6c6bf  some  trailing  lines  

This is only an example of what the file could look like. The unvarying parts are that, for the line I am interested in:

  • There is always wmd v0.0.0-, followed by
  • 14 digits, followed by
  • a hyphen, followed by
  • 12 alphanumeric characters

How can I write a sed command that will allow me to replace the 20220406135915-ce5e3ee6c6bf portion with the value in a shell variable new_text?

In other words, if new_text had the value 99999999999999-aaaaaaaaaaaa, I want to find the <whatever goes here> part of the sed command that would produce the following output:

$ sed -e "s/wmd v0.0.0-<whatever goes here>/wmd v0.0.0-$new_text/" my-file.txt  some  arbitrary number of  leading  lines  a prefix followed by wmd v0.0.0-99999999999999-aaaaaaaaaaaa  some  trailing  lines  

fedora 36 encrypted drive password prompt

Posted: 13 May 2022 04:23 PM PDT

when i open firefox I get prompted for a password. I have tried looking it up and cant find any answers or similar problems.

screenshot

I have encrypted a folder on my Laptop and want to recover the previous version of it

Posted: 13 May 2022 12:16 PM PDT

I have a folder with many files lets say /home/ibadski/Downloads/Mobiledata/ and mobiledata contains txt file and another folder structures. I have now encrypted all the files in the folder and subfolder of Mobiledata. and have forgotten the password. all of the files are now encrypted. It is not possible to decrypt them due to computational reasons but can I get the PREVIOUS decrypted version of the files using data recovery? if yes what would you propose?

System Details: Ubuntu 20.04.1 LTS filesystem: ext-4

In order words lets say I have a file names foo.txt and then i encrypted it and it became foo.txt.locked.

Is there any way to get the previous version of the file?

awk filter rows that only consist a single letter

Posted: 13 May 2022 12:50 PM PDT

I have a file (file1) that looks like this:

ROW 1 AA 120 APFGHKDESFNNJFHGRIHJASFGNSKDHFIXXXXXX  ROW 2 AA 234 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ROW 3 AA 122 XXXXXXXXXXXXXXXXXXXXX  ROW 4 AA 89  WUAHGLIHGUNGBGDSYUXXXXXXXXXXXXXXFGOAYGIGWEIWIGFUEGFHUIWGEFU  ROW 5 AA 186 XXWANFJHOUNGRIGNO  ROW 6 AA 156 WANLHRIOGRNINGIJOHONJPHHYGKHDY  ...  

there are multiple rows that contain different numbers of X. however, the result should not contains the rows which only consist of X, it should be:

ROW 1 AA 120 APFGHKDESFNNJFHGRIHJASFGNSKDHFIXXXXXX  ROW 4 AA 89  WUAHGLIHGUNGBGDSYUXXXXXXXXXXXXXXFGOAYGIGWEIWIGFUEGFHUIWGEFU  ROW 5 AA 186 XXWANFJHOUNGRIGNO  ROW 6 AA 156 WANLHRIOGRNINGIJOHONJPHHYGKHDY  ...  

Thank you for the help!

Find number of lines between a pattern inside specific filetype

Posted: 13 May 2022 02:10 PM PDT

I have a notes.json file inside each directory. The following command counts length of each notes.json file and returns a sorted output by each file's number of lines.

find . -name notes.json | xargs wc -l | sort -nr  

It returns

789 ./D/notes.json  789 ./F/notes.json  574 ./A/notes.json  519 ./G/notes.json  

Now I would like to include a search pattern for contents inside notes.json and would like to return the sorted number of lines for each notes.json file.

I tried find . -name notes.json | xargs cat | jq '."text1[]"' | wc -l. However, I receive only one value i.e. The total number of lines between text1[ ] in all notes.json. Of course, this is because cat outputs the pattern match of all files together. Is there a way to output the line lengths (return from matching pattern) for each notes.json file - sorted?

How to display a prompt and prevent execution against basic but dangerous commands like mv or rm

Posted: 13 May 2022 11:56 AM PDT

Objective

Whenever I use mv (or commands of similar nature) I want my shell to prompt me something like "Hey, you used mv. Sorry but do it again using mv -i". I'd like to know the reasonable method to accomplish such interaction. The purpose is to develop muscle memory to avoid using mv.

If this sounds like a stupid idea in the first place I'd like to know why and better solutions.

Background

In the past I have used mv and mistakenly overwrote files. While this comment recommends to alias mv in a way it actually works as mv -i, I agree with this comment about consequences of such customization. Instead of getting used to typing mv, I'd rather make it a habit to type mv -i so I won't mess up on other machines.

Concerns

I'm worried about such modifications affecting other scripts or programs which invokes mv. Is there a clever way to abort and show prompt only when mv is executed by myself through typing and pressing Enter?

Notes

  • I take backup of files, not that it's relevant
  • I know I can paste post-its on my desk or posters on my wall to raise awareness
  • Environment: Debian, XFCE, xfce4-terminal, Bash

How do I update R CRAN packages when updating from Debian buster to bullseye?

Posted: 13 May 2022 01:05 PM PDT

I need to update a server, which has the R statistics system installed from the CRAN repo, from Debian 10 (buster) to Debian 11 (bullseye).

The "repo line" for the buster CRAN repo is stored in /etc/apt/sources.list.d/buster-cran40.list.

To use the bullseye CRAN repo, do I just need to replace this file and its contents with the corresponding version for bullseye-cran40, and then (after editing the Debian repo settings in the main sources.list file) run apt update, etc, or is it a more complicated process than this (eg, might I perhaps have to uninstall the existing CRAN packages first?).

Swap lines in a file

Posted: 13 May 2022 01:31 PM PDT

I've a file like this:

DelegatedAdmin: cn=fb6190f7-4a33-4502-a2d5-dce8dc434570,ou=Named,ou=Identities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  dn: cn=311999,ou=Entities,ou=Active,ou=Vault<br />    DelegatedAdmin: cn=fb6190f7-4a33-4502-a2d5-dce8dc434570,ou=Named,ou=Identities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  dn: cn=948089,ou=Entities,ou=Active,ou=Vault<br />    DelegatedAdmin: cn=fb6190f7-4a33-4502-a2d5-dce8dc434570,ou=Named,ou=Identities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  dn: cn=947458,ou=Entities,ou=Active,ou=Vault<br />    DelegatedAdmin: cn=9776c3f8-f2ee-4b6c-a9a9-32d87b45f7c5,ou=Named,ou=Identities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  dn: cn=10717,ou=Entities,ou=Active,ou=Vault<br />    DelegatedAdmin: cn=e0a838f0-3d53-42e8-8dad-bd1d774381de,ou=Named,ou=Identities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  dn: cn=1500,ou=Entities,ou=Active,ou=Vault<br />  

And it should be changed to this (switching line 1 and line 4)

dn: cn=311999,ou=Entities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  DelegatedAdmin: cn=fb6190f7-4a33-4502-a2d5-dce8dc434570,ou=Named,ou=Identities,ou=Active,ou=Vault<br />    dn: cn=948089,ou=Entities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  DelegatedAdmin: cn=fb6190f7-4a33-4502-a2d5-dce8dc434570,ou=Named,ou=Identities,ou=Active,ou=Vault<br />    dn: cn=947458,ou=Entities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  DelegatedAdmin: cn=fb6190f7-4a33-4502-a2d5-dce8dc434570,ou=Named,ou=Identities,ou=Active,ou=Vault<br />    dn: cn=10717,ou=Entities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  DelegatedAdmin: cn=9776c3f8-f2ee-4b6c-a9a9-32d87b45f7c5,ou=Named,ou=Identities,ou=Active,ou=Vault<br />    dn: cn=1500,ou=Entities,ou=Active,ou=Vault<br />  changetype: modify<br />  delete: DelegatedAdmin<br />  DelegatedAdmin: cn=e0a838f0-3d53-42e8-8dad-bd1d774381de,ou=Named,ou=Identities,ou=Active,ou=Vault<br />  

How to do this?

how to compare all files inside ONE directory in bash?

Posted: 13 May 2022 02:06 PM PDT

example given:

dir1/   file1   file2   file3   file4  
  • how do you compare file1-file2, file1-file3, file1-file4 then file2->file3, file2->file4 and so on. In this case the name is file_number, but could be any name.
  • basically make a diff but NOT ony one file to others, but compare all to all.

i have been trying with:

for f in $(find ./ -type f | sort | uniq); do        compare=$(diff -rq "$f" "$1" &>/dev/null)      if [[ $compare -eq $? ]]; then          echo "$(basename "$f") yes equal $1"      else          echo "$(basename "$f") no equal $1"      fi  done  

returns

./file1 yes equal ./file1  ./file2 no equal ./file1  ./file3 yes equal ./file1  ./script no equal ./file1  ./sd no equal ./file1  
  • is only comparing any file number with file1
  • I'm thinking needs another loop, but now I'm stock[like bubble sort algo]
  • how to make another IF STATEMENT for stop comparing file1 yes equal file1 [same file]

on reboot, Debian 11 always open /run/systemd folder

Posted: 13 May 2022 04:30 PM PDT

on reboot, Debian 11 always open /run/systemd folder, whereas before, Debian did not open any specific folder after restart. This doesn't cause any problems, but nevertheless.

Edit: grep search

~$ grep -r /run/systemd $HOME/.??*  /home/lunar/.bash_history:/run/systemd/resolve/stub-resolv.conf  /home/lunar/.bash_history:cd /run/systemd/resolve/stub-resolv.conf  /home/lunar/.bash_history:/run/systemd/resolve/stub-resolv.conf  /home/lunar/.cache/sessions/Thunar-24a92edbf-804a-4cab-b0ec-cc7b5d660023:URI=file:///run/systemd  grep: /home/lunar/.mozilla/firefox/3allhj9p.Default-User/places.sqlite-wal: binary file matches  grep: /home/lunar/.mozilla/firefox/3allhj9p.Default-User/places.sqlite: binary file matches  

~/.cache/sessions$ cat Thunar-24a92edbf-804a-4cab-b0ec-cc7b5d660023  [Thunar-1651872231-2573164324]  PAGE=0  URI=file:///run/systemd  

How can I revert changes to my keymap on the shell level?

Posted: 13 May 2022 01:08 PM PDT

I'm running Xubuntu 20.04 (Focal), and somehow I have remapped Spacebar on my keyboard to Backspace at the shell level.

This behaviour only occurs when X11 is not running in the tty. When I log into my window manager, xkb takes over and re-remaps Spacebar so that it works as expected.

No resource that I've found has given me any leads on how I managed to make this change, or how to revert it. Any rescouces or insights that you can provide will be greatly appreciated.

How to set `$CHROME_EXECUTABLE` in WSL2 for windows chrome

Posted: 13 May 2022 02:28 PM PDT

I'm trying to use the Windows chrome executable through WSL2 (for reference, Flutter looks at $CHROME_EXECUTABLE to launch web apps in chrome).

In my bashrc I have the following:

export CHROME_EXECUTABLE="/mnt/c/program\ files/google/chrome/application/chrome.exe"  

With this, flutter doctor complains that $CHROME_EXECUTABLE doesn't point to a chrome executable. If I execute $CHROME_EXECUTABLE in bash, I get:

bash: /mnt/c/program\: No such file or directory  

If however, I execute /mnt/c/program\ files/google/chrome/application/chrome.exe, It works and opens a chrome instance inside windows.

It seems like there's some escaping issue here, but I'm not sure what's going on, I thought \ would escape the space in "program files" ?

Why pavucontrol does not save the recording device permanently?

Posted: 13 May 2022 02:16 PM PDT

I'm doing recording tests for my streaming, I have enabled and as default "Monitor of Built-in Audio Analog Stereo", in old versions of chrome it works perfect, but in the new ones I have to change from "Built-in Audio Analog Stereo" to "Monitor of Built-in Audio Analog Stereo" to work, the problem is that I have to do this every time, when i open a new tab or every time if restart the browser, is there a way not to have to do this repeatedly and save this permanent change?

from this:

enter image description here

to this:

enter image description here

Any way to make "Monitor of Built-in Audio Analog Stereo" as default in Recording tab for any application, Completely permanent?

Bash script to sort files into alphabetical folders

Posted: 13 May 2022 12:27 PM PDT

I try to organize my files and my folders by a script. It creates the folder with the first letter of my file and moves it there.

For the very first time, the script does the job, but if I create new files and execute the script again, it creates a new subfolder in the folder, and so on.

It creates, for example, T/T/toto.txt.

My script:

for first in $(ls -1 | sed 's/^\(.\).*$/\1/' | tr '[a-z0-9]' '[A-Z0-9]' | uniq)  do      mkdir tmp      mv "$first"* tmp/      lower=$(echo $first | tr '[A-Z]' '[a-z]')      mv "$lower"* tmp/      mv tmp/ "$first";  done  

system policy prevents control of network connections

Posted: 13 May 2022 02:03 PM PDT

When we log into a KDE seesion using X2Go client, the user is greeted with a dialog asking for a sudo password. I do not want the user to have a sudo password and I would like to prevent the dialog from appearing. The user should not be bothered with this.

The dialog title is: Authentication Required PolicyKit1 KDE Agent

The message is:

**System policy prevents control of network connections**    An application is attempting to perform an action that requires privileges. Authentication is required to perform this action.    Password:    Action: Allow control of network connections    ID: org.freedesktop.NetworkManager.network-control    Vendor: NetworkManager    polkit.subject-pid: 20440    polkit.caller-pid: 708      - process 708 is /usr/bin/NetworkManager --no-daemon  - process 20440 is kded5 [kdeinit5]    pkaction version 0.116  (that's the policykit version)  

The related policy is already defined so that authentication should not be requested / required:

<action id="org.freedesktop.NetworkManager.network-control">  <_description>Allow control of network connections</_description>  <_message>System policy prevents control of network connections</_message>  <defaults>    <allow_inactive>yes</allow_inactive>    <allow_active>yes</allow_active>  </defaults>  </action>  

Relevant log lines are:

Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: "Password: "  Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: Request:  "Password: "  Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: REQUEST  Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: Trying again    Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: Action description has been found  Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: Message of action:  "System policy prevents control of network connections"  Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: Initiating authentication  Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: polkit_qt_listener_initiate_authentication callback for  0x55df1e7190a0  Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: GSimpleAsyncResult:   Aug 07 21:50:54 desktop polkit-kde-authentication-agent-1[26611]: Listener adapter polkit_qt_listener_initiate_authentication    Aug 07 21:50:43 desktop polkit-kde-authentication-agent-1[26611]: Authentication agent result: true  Aug 07 21:50:43 desktop polkitd[838]: Registered Authentication Agent for unix-session:19 (system bus name :1.5274 [/usr/lib/polkit-kde-authentication-agent-1], object path /org/kde/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)  Aug 07 21:50:43 desktop polkit-kde-authentication-agent-1[26611]: Listener online  Aug 07 21:50:43 desktop polkit-kde-authentication-agent-1[26611]: Adding new listener  PolkitQt1::Agent::Listener  Aug 07 21:50:43 desktop polkit-kde-authentication-agent-1[26611]: New PolkitAgentListener    Aug 07 21:50:42 desktop ksmserver[26587]: org.kde.kf5.ksmserver: Starting autostart service  "/etc/xdg/autostart/polkit-kde-authentication-agent-1.desktop" ("/usr/lib/polkit-kde-authentication-agent-1")  

What I have tried so far is creating this polkit rule:

/etc/polkit-1/rules.d/00-networkmanager.rules

polkit.addRule(function(action, subject) {  if (action.id == "org.freedesktop.NetworkManager.settings.modify.system")  {          polkit.log("NetworkManager.settings.modify.system: rule called");      return polkit.Result.YES;  }  });    polkit.addRule(function(action, subject) {  if (action.id == "org.freedesktop.NetworkManager.network-control")  {          polkit.log("NetworkManager.network-control: rule called");      return polkit.Result.YES;  }  });  

The rule is owned by root and has 644 permissions.

Cannot install Linux because keyboard/mouse not working

Posted: 13 May 2022 02:02 PM PDT

EDIT: I should mention that my mouse and keyboard are wireless devices. I assume that doesn't matter since a Live version of Windows 7 had no problems with it, and the most basic part of my system (BIOS?) allows me to use my peripherals no problem.

EDIT2: It turns out all of my devices work from my USB 3.0 ports, in case this helps anyone. I'll post as I find more.

My very, very novice understanding of Linux is that I need to create a bootable .iso with some software that allows me to boot into a no-changes-saved, low memory version of the desired OS that loads and operates purely off RAM, known as a "Live version." Only from there can I do a full install, maybe b/c Windows can't format storage partitions to the whimsical, wonderful, phantasmagorical "Ext 4" filesystem? Welp, I can't do ANYTHING b/c once I manage to boot my Live OS from either my flash drive or external HDD, my keyboard and mouse no longer respond. I have to cut the power to turn off the computer (which I'm sure is not great).

I've never used a Linux OS, but I've been trying to for the last week. No matter what bootable USB software I use to set up my device (Rufus, unetbootin, YUMI), I always run into the same problems, starting with a black screen. Monitors turned off automatically, receiving no signal once I got past the boot screen. Eventually I awkwardly found my way past the black screen problem via the "Grub" commands with Google results and found to either select "nomodeset" or edit whatever line of text ends with "splash --", inserting nomodeset in before the double-hash. My computer has an NVIDIA graphics card; I'm assuming that was the problem?

Either way, now I just cannot interact with these OS's without a keyboard or mouse, even though I can see their swell-looking desktops. I really thought these community-based OS's caught up to the big-company ones. Am I doing shit wrong? :(

enter image description hereenter image description hereThis is basically what I see for a few seconds before the every OS loads its desktop.

How can I make apache to start up automatically on linux mint?

Posted: 13 May 2022 03:04 PM PDT

I have installed Linux Mint 18.1 Serena and I have XAMPP 5.6.28-1 on my computer. After I turn on my computer, I must run the XAMPP control panel and I must start Apache and MySQL manually.

Does anyone know how this can be done automatically? I don't want to turn on Apache and MySql every time when I start / restart my computer.

DEFROUTE usage in RHEL 7

Posted: 13 May 2022 01:01 PM PDT

I am stuck with this configuration here after commenting the DEFRROUTE line I get the ip r output like this. Does it really works with DEFRROUTE=no when uncommented.

[root@vm1 ~]# ip r  default via 192.168.5.1 dev eth0  proto static  metric 100  default via 192.168.1.1 dev eth2  proto static  metric 101      169.24.0.0/17 dev eth1  proto kernel  scope link  src 169.24.0.5  metric 100  192.168.1.0/24 dev eth2  proto kernel  scope link  src 192.168.1.3  metric 100  192.168.5.0/28 dev eth0  proto kernel  scope link  src 192.168.5.10  metric 100      [root@vm1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2  DEVICE=eth2  BOOTPROTO=static  ONBOOT=yes  USERCTL=no  TYPE=Ethernet  IPADDR=192.168.1.3  NETMASK=255.255.255.0  GATEWAY=192.168.1.1  #DEFRROUTE=no    [root@vm1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0  DEVICE=eth0  BOOTPROTO=static  ONBOOT=yes  USERCTL=no  TYPE=Ethernet  IPADDR=192.168.5.10  NETMASK=255.255.255.240  GATEWAY=192.168.5.1  #DEFRROUTE=yes    [root@vm1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1  DEVICE=eth1  BOOTPROTO=static  ONBOOT=yes  USERCTL=no  TYPE=Ethernet  IPADDR=169.24.0.5  NETMASK=255.255.128.0  #DEFRROUTE=no  

When I uncomment the DEFRROUTE I get this below output without route

[root@vm1 ~]# ip r  169.24.0.0/17 dev eth1  proto kernel  scope link  src 169.24.0.5  metric 100  192.168.1.0/24 dev eth2  proto kernel  scope link  src 192.168.1.3  metric 100  192.168.5.0/28 dev eth0  proto kernel  scope link  src 192.168.5.10  metric 100  

As @artem suggested via the link, below is the screenshot.

enter image description here

How to get thumbnail of a file?

Posted: 13 May 2022 12:06 PM PDT

I have a xcf file which is corrupted and can't be recovered but it still has thumbnail which is large enough for me. I checked ~/.thumbnails to get it to my home folder but there are 9900 files (I guess they are named with md5) and I can't check them all.

I'm using Xubuntu 14.04. How can I get the corresponding thumbnail.png of a file?

can't launch android emulator while logged in over vnc?

Posted: 13 May 2022 04:07 PM PDT

i have a headless box running bbqlinux that i'm trying to use as an android-studio development box. when i go to launch an .avd in the emulator, i receive this error:

Cannot launch AVD in emulator  Output: emulator: ERROR: x86 emulation currently requires hardware acceleration!  Please ensure KVM is properly installed and usable.  CPU acceleration status: This user doesn't have permissions to use KVM (/dev/kvm).  

this was freaking me out and i spent a good amount of time trying to sure that everything was enabled, installed correctly, permissions set, etc... then: i plugged a screen in and logged directly into the box and bam! it works fine.

so my problem is maybe the vncserver? i'm using tigervnc that i set up according to this page: https://wiki.archlinux.org/index.php/Vncserver

just in case it helps, my xstartup file is

unset SESSION_MANAGER  unset DBUS_SESSION_BUS_ADDRESS  [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup  [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources  vncconfig -iconic &  startxfce4 &  

other than that, i've not changed the default environment hardly at all except to add lighttable, ssh, & vnc. so my question is really

  • should i not be doing it this way? is there a better workflow or vnc server program for what i'm trying to do?
  • is there a command switch or option that i missed that maybe enables the hardware acceleration over vnc?

thanks!

Curl. Check redirect

Posted: 13 May 2022 03:48 PM PDT

Lets suppose that we have 3 links: link1, link2, link3. link1 redirects to link2 and link2 redirects to link3. So how to see that with curl?

Addition with 'sed'

Posted: 13 May 2022 12:05 PM PDT

I am trying to perform a mathematical operation with sed, but it continues to treat my variables as strings. The input is of this kind:

$ echo 12 | sed 's/[0-9]*/&+3/'  $ 12+3  

I'd like to have 15 as output. I need to do the operation and replace its mathematical result in only one passage, because I am running the program as a Python daemon, and I want to avoid passages like redirecting stdout on files, open those files, perform operations, extract the result, do the replacement. To me, sed seems the best to perform all in one line.

I've tried to cast both input and output in various ways like

$ echo 12 | sed 's/[0-9]*/int(&+3)/'  $ echo 12 | sed 's/[0-9]*/\int(&+3)/'  $ echo 12 | sed 's/[0-9]*/\int(&+3)/'  

but the result was always a printing of the second field.

No comments:

Post a Comment