Tuesday, May 25, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Create new directories with Python on Linux

Posted: 25 May 2021 09:53 AM PDT

I'm running a Python script on a fresh installation of Ubuntu 20.04.2. The script checks if a directory exists and creates it if not. The code is:

os.makedirs(f'..{os.sep}logs{os.sep}')  

I get the following error:

PermissionError: [Errno 13] Permission denied: '../logs/'  

In the command prompt, I would just add a sudo but I need my Python script to be able to make these directories so, my question is how can I allow Python to make new directories?

Not being able to run appimages?

Posted: 25 May 2021 09:25 AM PDT

So, i have a problem with even a new and fresh partition of Pop!_OS (still applies to ubuntu because Pop!_OS is a fork of it), and it is not letting me run appimages, even though it seems like it should. I tried right clicking, going into preferences, permissions, then enabling the file to run as an executable, but when i try to run the thing again, it does nothing. This same exact problem happened to me on a different partition which is Manjaro, Although I mainly need help with running appimages on Pop!_OS. Any ideas as of why this is happening? Thanks for the help, appreciate it

Replace the header of a given column with the filename

Posted: 25 May 2021 09:45 AM PDT

I have many vcf files

HR001.vcf  HR002.vcf  HR003.vcf  HR004.vcf  HR005.vcf  HR006.vcf  HR007.vcf  HR008.vcf  .  .  

in the 10th column of EACH file the colum header is $i. In each file, I would like to replace $i with the basename of the files.

For example for file HR001.vcf, $i=HR001, for HR002.vcf $i=HR002 etc... is there a simple way to do this in unix. I own a macbook pro but I am new to this.

How could I make a partition of my ssd boot to linux without harming the rest of the data?

Posted: 25 May 2021 08:51 AM PDT

I recently installed openSUSE on my laptop. The installation appears to work fine, until you turn it off, and find that the laptop doesn't recognize that the OS is bootable. However, if I plug in the USB installation drive again, it does recognize the OS, and I can boot to it just fine. I have seen several users have the same problem, and as far as I can tell, none of them solved it. My best solution I have come up with involves putting the ISO on a partition of the ssd, and just booting from that every time. The main problem, though, is that I don't even know if that's possible without wiping the rest of the drive.

tl;dr (if you do that here), I need to make a partition of my drive bootable without wiping the whole thing.

sed command to replace last occurrence of a word in a file with the content of another another file

Posted: 25 May 2021 09:32 AM PDT

  1. OSX sed command to replace last occurrence of a word in a file
  2. Replace with the content from another file
  3. Replace only the last occurrence, means only once.
  4. The word can be a substring abchello or helloabc
  5. There can be trailing whitespace or newline after the word

sample.txt:

hello  hi  hello  ok  

sample1.txt:

I  am   doing  great  

Expected output (sample.txt):

hello  hi  I  am   doing  great  ok  

dot sourcing doesn't work within shell script [duplicate]

Posted: 25 May 2021 08:48 AM PDT

I am using WSL and try to automate a build process via shell script. The process starts with sourcing some exported variables from a file, say /asdf/2.3.4./test, containing a single line of exports:

export VAR1="test"  

Now I try to source this from a shell script build_lib.sh:

#!/bin/sh  . /asdf/2.3.4/test  

Executing this results in an error:

me@here:path/to/build$ ./build_lib.sh  : not found.sh: 2:  ./build_lib.sh: 3: .: Can't open /asdf/2.3.4/test  

However, sourcing from the shell directly works just fine:

me@here:path/to/build$ env | grep VAR1  me@here:path/to/build$ . /asdf/2.3.4/test  me@here:path/to/build$ env | grep VAR1  VAR1=test  me@here:path/to/build$  

What am I doing wrong with the script?

How should I cope with the 16TiB limit on linux software RAID (md)?

Posted: 25 May 2021 08:29 AM PDT

I have used a RAID6 based on partitions on 2TB disks for around 10 years, now. Which I have extended multiple times up to around 12TB by adding disks a few times.

With the time, I have progressively replaced my failing disks with 4TB ones in order to extend it to 3.5TiB partitions and then remove the disks in excess ('t would be sooo nice to be able to close this computer case at some time ;-p X-D)

However, it appears to be a 16TiB limit on md RAIDs. When I tried grow it to --size=max, mdadm and /proc/mdstat reported having grown my units to 3663892.5MiB and my whole RAID space to 21983355MiB. However, trying to read from the disk only allowed me to access 5206139MiB = 21983355MiB - 16TiB

Searching for information about this limit told me that you can create a new RAID Volume of any size but you can't expand an existing Volume past 16TiB, which is a bit short :

  • It would mean that there is a difference between smaller and larger disks. Isn't there a way to configure this at creation ?
  • what if you create a RAID larger than 16 TiB and then shrink it under this value ?

I haven't found much accurate information about this. Do you know more about how to manage this problem ?

EDIT: This problem is NOT about filesystem size, but about the bare unpartitionned RAID space (and btw, my raid version is 1.2)

Delete and merge all windows partition from arch linux installation

Posted: 25 May 2021 08:56 AM PDT

Newbie here. I tried to install arch linux to my laptop which has 2 partitions and windows 10 installation. I could not delete and merge partitions with fdisk, so googled and ran the following command.

dd if=/dev/zero of=/dev/sda bs=512 count=1 conv=notrunc  

as per the this question.

Now I don't see my partitions, all I see with fdisk -l is

/dev/sdb1, /dev/sdb2 and /dev/sdb3 partitions only.

/dev/sdb is the installation medium. I don't want to do anything it to that.

How do I make /dev/sda visible again in fdisk and delete all the partitions then merge them into one so I can install arch linux into one single partition with swap and efi?

How can you change ./configure to use a specific binary over /usr/bin?

Posted: 25 May 2021 09:16 AM PDT

Running macOS Catalina 10.15.6. My question is more related to compilation with GNU tools, so it may be more suited for a different SE site — I'll be happy to close and ask somewhere else if that's the case.

I'm trying to compile software (namely wine-6.0) and the compilation requires bison, for which there's already an executable in /usr/bin. However, bison needs to be version >3.0 to compile the program and the binary in /usr/bin is version 2.7.6. I compiled bison 3.7.6 and I was gonna just move the new bison 3.7 binary into /usr/bin but due to the filesystem protection of macOS, I can't just replace /usr/bin/bison. I'd have to restart my mac in recovery mode to disable the filesystem lock, but I have something open that can't stop running at the moment.

Using ./configure --enable-win64 gives the following error:

checking for bison... bison  checking whether bison is recent enough... no  configure: error: Your bison version is too old. Please install bison version 3.0 or newer.  

To fix it, I thought modifying PATH would work; I moved the bison 3.7.6 binary to /usr/local/bin/bison and did export PATH=/usr/local/bin:$PATH before ./configure but it doesn't work; it still just errors about not having bison >3.0 (the same error as before I tried to mess with bison):

checking for bison... bison  checking whether bison is recent enough... no  configure: error: Your bison version is too old. Please install bison version 3.0 or newer.  

The weird thing is, just trying to run bison uses the right binary.

$ bison -V  bison (GNU Bison) 3.7.6  Written by Robert Corbett and Richard Stallman.  ...    $ which bison  /usr/local/bin/bison  

I also tried messing with the configure.ac file a little, but the problem is I don't really know what I'm doing there. Editing the config file and rerunning autoconf and using ./configure then still doesn't work. Ultimately, my question is: how do I ensure ./configure uses the correct bison binary?

CamelCase-aware backward-kill-word in readline

Posted: 25 May 2021 09:15 AM PDT

backward-kill-word is a readline action that deletes the previous alphanumeric word. For example, applying this action in the following scenario ( indicates the position of the cursor)

echo hello-friend▯  

results in

echo hello-▯  

backward-kill-word is typically bound to <Alt-Esc>, although this can be customized in readline's config file ~/.inputrc.

My question is: is it possible to customize backward-kill-word so that it deletes back up to the first non-alphanumeric character, or the first capital letter? This way, it could be used to delete CamelCase words. For example, if I start with

echo HelloFriend▯  

upon pressing <Alt-Esc> I would like to obtain

echo Hello▯  

Compare two files based on first column

Posted: 25 May 2021 09:09 AM PDT

I have two files, and I would like to get a new file with only the lines that we have in the first file, but not in the second one. Example:

file1:

ID      firstname        lastname  1       John             Wilkens  2       Andrea           Smith  3       Matthew          Freberg  4       Brenda           Something  

file2:

ID      firstname        lastname  1       John             Wilkens  2       Andrea           Willems  3       Jay              Freberg  5       Mike             Hart  

Output:

ID      firstname        lastname  4       Brenda           Something  

I tried using comm, but that also gives the rows where something was changed, so for example the ID 2 and 3.

Can you please help me with this?

Low resolution in GRUB and tty

Posted: 25 May 2021 09:47 AM PDT

After upgrading from Fedora 33 to 34, the resolution in GRUB and ttys is low resolution and the wrong aspect ratio, seemingly 1024x768, instead of the native 1920x1080.

Tried adding nvidia-drm.modeset=1 in grub's linux command line, and while that fixes plymouth's resolution partway into the booting process (after entering the LUKS passphrase), the grub menu, early part of booting, and tty (after booting is completed) are all still stuck with the low resolution.

  • motherboard is set to UEFI mode with CSM and fastboot disabled
  • system uses LUKS encryption
  • proprietary nvidia drivers and akmod installed from negativo17's repo

sudo hwinfo --framebuffer produces no output.

fbset -i strangely shows only one resolution at 1024x768:

# fbset -i    mode "1024x768-76"      # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz      geometry 1024 768 1024 768 32      timings 12714 128 32 16 4 128 4      rgba 8/16,8/8,8/0,8/24  endmode    Frame buffer device information:      Name        : EFI VGA      Address     : 0xe0000000      Size        : 3145728      Type        : PACKED PIXELS      Visual      : TRUECOLOR      XPanStep    : 0      YPanStep    : 0      YWrapStep   : 0      LineLength  : 4096      Accelerator : No  

At grub's command prompt, the often suggested vbeinfo does not work:

grub> vbeinfo  error: ../../grub-core/script/function.c:119:can't find command `vbeinfo`.  

Original /etc/default/grub contents which used to provide native resolution in tty with Fedora 33:

GRUB_TIMEOUT=5  GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"  GRUB_DEFAULT=saved  GRUB_DISABLE_SUBMENU=true  GRUB_CMDLINE_LINUX="rd.lvm.lv=[...]/root rd.luks.uuid=luks-[...] rhgb quiet rd.driver.blacklist=nouveau"  GRUB_DISABLE_RECOVERY="true"  GRUB_TERMINAL_INPUT="console"  GRUB_TERMINAL_OUTPUT="gfxterm"  GRUB_GFXMODE="1920x1080x32"  GRUB_GFXPAYLOAD_LINUX="keep"  GRUB_ENABLE_BLSCFG=true  

Any suggestions of what to try?

Cursor moving erratically on its own (not a duplicated)

Posted: 25 May 2021 09:20 AM PDT

I've read this post that is very similar to mine, but the difference is that I have the touchpad disabled and my xinput show as if I have more than one mouse installed when I only have just one wireless Genius mouse since a long time.

I have an Asus K501U, intel core i7, nvidia Geforce 940MX, with 12GB of RAM and SSD drive of 512 GB. I'm using Ubuntu Focal Fossa. It's the development brunch (I tried to install the latest stable version, but by mistake I installed this one). Anyway, the Ubuntu installation occurred about a year ago, and I've installed the latest security updates since then.

⎡ Virtual core pointer                      id=2    [master pointer  (3)]  ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]  ⎜   ↳ Genius Wireless Device                    id=11   [slave  pointer  (2)]  ⎜   ↳ Genius Wireless Device Consumer Control   id=13   [slave  pointer  (2)]  ⎜   ↳ Elan Touchpad                             id=16   [slave  pointer  (2)]  ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]      ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]      ↳ Power Button                              id=6    [slave  keyboard (3)]      ↳ Asus Wireless Radio Control               id=7    [slave  keyboard (3)]      ↳ Video Bus                                 id=8    [slave  keyboard (3)]      ↳ Video Bus                                 id=9    [slave  keyboard (3)]      ↳ Sleep Button                              id=10   [slave  keyboard (3)]      ↳ Genius Wireless Device System Control     id=12   [slave  keyboard (3)]      ↳ Genius Wireless Device                    id=14   [slave  keyboard (3)]      ↳ USB2.0 VGA UVC WebCam: USB2.0 V           id=15   [slave  keyboard (3)]      ↳ Asus WMI hotkeys                          id=17   [slave  keyboard (3)]      ↳ AT Translated Set 2 keyboard              id=18   [slave  keyboard (3)]      ↳ Genius Wireless Device Consumer Control   id=19   [slave  keyboard (3)]  

If I try xinput disable 16, and xinput disable 13, and nothing happens... I try xinput again after that and the list remains exactly the same.

What can I do??

Cannot change ownership/permissions of disk

Posted: 25 May 2021 09:17 AM PDT

I have an EXT4 disk mounted on /mnt/external I have also tried mounting it on ~/EXTERNALMNT. The disk is not an NFS share. It is an external USB drive. I can read from the disk but cannot write, unless I am root. This is in tune with the permissions: rwxr-xr-x and ownership root:root.

However, I need to be able to write to it without being root. Running sudo chmod -R 777 on the mountpoint completes after a few seconds but does not actually change the permissions. sudo chown -R murrax2:murrax2 results in the message Operation not permitted for every file/folder. Running sudo chattr -a and -i results in Operation not supported while reading flags.

I have tried accessing it via a Windows laptop via a program that allows EXT4 access, and I can write data and it persists (including when plugged back into my Arch PC). Why can't I change permissions/ownership, and how do I fix it?

awk script to prepare csv file

Posted: 25 May 2021 09:56 AM PDT

I'm stuck creating an awk script that prepares a csv file before analysis. I need to create an output file with columns 1-2, 10, 13-15, 19-21. Also I need to replace the numbers on column 2 to the days of the week (so, 1 = Monday, 2 = Tuesday...) and convert the 21th column from nautical miles to km; and delete ""of columns 10, 13 and 14.

Input:

"DAY_OF_MONTH","DAY_OF_WEEK","OP_UNIQUE_CARRIER","OP_CARRIER_AIRLINE_ID","OP_CARRIER","TAIL_NUM","OP_CARRIER_FL_NUM","ORIGIN_AIRPORT_ID","ORIGIN_AIRPORT_SEQ_ID","ORIGIN","DEST_AIRPORT_ID","DEST_AIRPORT_SEQ_ID","DEST","DEP_TIME","DEP_DEL15","DEP_TIME_BLK","ARR_TIME","ARR_DEL15","CANCELLED","DIVERTED","DISTANCE",  1,2,"EV",20366,"EV","N48901","4397",13930,1393007,"ORD",11977,1197705,"GRB","1003",0.00,"1000-1059","1117",0.00,0.00,0.00,174.00,  1,2,"EV",20366,"EV","N16976","4401",15370,1537002,"TUL",13930,1393007,"ORD","1027",0.00,"1000-1059","1216",0.00,0.00,0.00,585.00,  1,2,"EV",20366,"EV","N12167","4404",11618,1161802,"EWR",15412,1541205,"TYS","1848",0.00,"1800-1859","2120",0.00,0.00,0.00,631.00,  

Output:

"DAY_OF_MONTH","DAY_OF_WEEK","ORIGIN","DEST","DEP_TIME","DEP_DEL15","CANCELLED","DIVERTED","DISTANCE"  1,Tuesday,ORD,GRB,1003,0.00,0.00,0.00,322.248  1,Tuesday,TUL,ORD,1027,0.00,0.00,0.00,1083.42  1,Tuesday,EWR,TYS,1848,0.00,0.00,0.00,1168.61  

So far, I've got the command to take the columns needed:

cut -d "," -f1-2,10,13-15,19-21 'Jan_2020_ontime.csv' > 'flights_jan_20.csv'  

And also the code to replace the numbers in column 2 with their respective days of the week:

awk 'BEGIN {FS = OFS = ","}        $2 == 1 {$2 = "Monday"}        $2 == 2 {$2 = "Tuesday"}        $2 == 3 {$2 = "Wednesday"}        $2 == 4 {$2 = "Thursday"}        $2 == 5 {$2 = "Friday"}        $2 == 6 {$2 = "Saturday"}        $2 == 7 {$2 = "Sunday"}        {print}'   file.csv  

I am also missing a way to wrap all the code into the script to execute it later.

Raspberry Pi remote desktop gateway tunnel

Posted: 25 May 2021 09:40 AM PDT

For a university project, I have to remotely work on a raspberry pi. Currently, I connect to it via ssh in the terminal:

Win Home PC --ssh--> uni-gateway-domain.com --ssh--> Pi.

Now, I want to use remote desktop to work more efficiently. I followed this tutorial (german). These are the settings I set:

Session

Tunnel

On both the gateway and the pi, xrdp is installed. When I try to open the session putty just timeouts. What am I missing?

chromium: change scrollbar color

Posted: 25 May 2021 09:36 AM PDT

Is it possible to change color of the scrollbar in Chromium browser, without having to install yet another extension?

Perhaps by modifying some css file somewhere?

I am using chromium 83 on Debian 10.

I know how to achieve this in Firefox. I just added following lines to userContent.css

html,body{      scrollbar-color: #B63C29 #555555 !important;  }  

Is there something similar I can do to achieve same for Chromium?

Why is the headphone audio not working on Fedora 34?

Posted: 25 May 2021 09:39 AM PDT

Even though my headphones are a valid device, it does not output any sound. It is listed as one of the "Items" in Alsamixer, but toggling it in Pavucontrol does not work.

When I disconnect the headphones, the sound comes out of the speaker without any issues. Using the headphones on Windows seems to be working without a problem either(no hardware problems).

Is there a bug in the new version of Fedora and is there a way to fix it?

Should I change the "etc_t" SELinux context for a custom application?

Posted: 25 May 2021 09:49 AM PDT

I'm using SELinux (targeted mode) to confine a custom application . I used the command sepolicy generate --init to automatically generate the contexts and rules, and everything went surprisingly well: all the resources are tagged with custom contexts, the applications works well.

However, I'm surprised that the configuration files under /etc/customApplication are still tagged with the etc_t context.

Is there a reason why sepolicy generate --init doesn't create a new etc_t_customApplication context for these files?

Why does my USB flash disk continue heating while it is unmounted?

Posted: 25 May 2021 09:40 AM PDT

I am using Debian-Buster Linux. I use a USB flash disk and mount it when it is needed. Then I unmount it without unplugging. However, it continues to heat up (like it is being used) while it is unmounted. Why does it contiune to heat up? How can I prevent this problem?

How can the move command cause data loss?

Posted: 25 May 2021 09:38 AM PDT

I tried to move a large (40 GB) folder between locations on my computer using mv, but I don't think it worked normally and now I don't know where the file is.

This is what I did:

user@computer:~$ cd directory/subdirectory  user@computer:~/directory/subdirectory$ mv location/of/folder .  

This should move the file from location/of/folder to the current directory (which, from the root, is ~/directory/subdirectory). But, when I check both the source and destination folders, the folder (ad all its content) has disappeared. Does anyone know how this might have happened, and how I can recover the file?

Match curly brace with new line

Posted: 25 May 2021 09:44 AM PDT

Trying to match a string + line break + left curly brace using sed.

sub feature_get_web_php_mode  {  my ($d) = @_;  my $server = &find_domain_server($d);  

to become this

sub feature_get_web_php_mode  {  return 'fcgid';  my ($d) = @_;  my $server = &find_domain_server($d);  

My expression regex looks like this:s|sub feature_get_web_php_mode\n{|CHANGE_CODE| but it doesn't work.

Tried to find the reason why open curly brace doesn't match at the beginning but no clues.

Thank you in advance.

How do I configure a network interface bridge from WiFi to Ethernet with Debian?

Posted: 25 May 2021 09:53 AM PDT

I am using Raspberry Pi using Raspbian which is just Debian.

I would like to bridge from the primary WiFi network router that connects to Cox Cable to my cabled router here for my subnet to have reliable internet access.

It needs to be a WiFi-to-Ethernet bridge.

I have set /etc/networks for a static address for the USB wlan1 with the external adapter and hi-gain antenna. wpa_supplicant is configured to log in to the master router properly.

So right now it is set up so I can login to the proper network with the password, on external wlan1. Static address is set in /etc/networks. Gateway and nameserver are OK. I can browse web pages, etc.

The missing link is to bridge this to the eth0 port so my router can connect also, to provide service to my subnet.

No need for any extra network services like routing or nat or dhcp, etc. Just a simple bridge.

Can anyone please point me in the right direction to make this happen?

keyserver receive failed (on every keyserver available)

Posted: 25 May 2021 09:14 AM PDT

I recently installed Ubuntu 17.04 and I'm not able to add any ppa.
I tried to manually add keys using different keyservers but on every attempt I'm getting keyserver received error:

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0F164EEB  

Error Received:

Executing: /tmp/apt-key-gpghome.qm2WNA0lTK/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0F164EEB  gpg: keyserver receive failed: No keyserver available    $ sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 0F164EEB  

Error Received:

Executing: /tmp/apt-key-gpghome.O681PzEx7r/gpg.1.sh --keyserver keys.gnupg.net --recv-keys 0F164EEB  gpg: keyserver receive failed: Connection refused  

It is the same case with other keys. I'm not able to add any PPA.

actual usage of 'grub-mkimage --config= '

Posted: 25 May 2021 09:53 AM PDT

On Linux, with GRUB 2 Bootloader, I try to figure out the actual usage of the --config= option in grub-mkimage. The man 1 grub-mkimage on this topic:

-c, --config=FILE
embed FILE as an early config

My first guess would be /boot/grub/grub.cfg -> but then there's a separate command to build this file, which leads me away from this guess. Another guess is /boot/config-3.16.0-4-686-pae (file's output: "Linux make config build file, ASCII text"). The other files I found were not ASCII but binary files, which also isn't much likely to be meant, I guess.

Question: What file, or kind of file, could be meant?


UPDATE: Found this one in the gnu.org documentation for GRUB 2, among commands for the GRUB prompt:

configfile file
Load FILE as a configuration file. If FILE defines any menu entries, then show a menu containing them immediately.

Probably the same file? Funny sidenot: The online manual seemingly doesn't mention this option.


UPDATE 2: Found the following line in the output of grub-mkrescue --output grub.iso --verbose

grub-mkrescue: info: grub-mkimage --directory '/usr/lib/grub/i386-pc' --prefix '/boot/grub' --output '/tmp/grub.ZiXwO6/boot/grub/i386-pc/eltorito.img' --format 'i386-pc-eltorito' --compression 'auto' --config '/tmp/grub.UtCj8W' 'biosdisk' 'iso9660'`

So --config '/tmp/grub.UtCj8W' rules out /boot/grub/grub.cfg .. somehow? And no, I didn't find anything mentioned about configuration when executing grub-install with verbose output activated


UPDATE 3: man 1 grub2-mkstandalone opens man 3 grub2-mkstandalone, but issuing man 3 grub2-mkstandalone leads to an error message. Also: grub-mkimage --config= seems to appear in the man page only but neither in --help nor in --usage output.

How can I make my user services wait till the network is online?

Posted: 25 May 2021 09:29 AM PDT

I have written a couple of systemd user service files which I want users to enable and which need a working network connection. I thought that would be as easy as:

Wants=network-online.target  After=network-online.target  

However, the services seem to start too early, and in journalctl I see:

network-online.target: Cannot add dependency job, ignoring: Unit network-online.target failed to load: No such file or directory.  

Then I searched more and tried

Wants=network.target  After=network.target  

and did sudo systemctl enable systemd-networkd-wait-online.service.

Now I have in journalctl:

network.target: Cannot add dependency job, ignoring: Unit network.target failed to load: No such file or directory.  

And again the service starts too early.

Is that message supposed to be there? How can I debug my problem?


EDIT: the reason is simple and specifically stated in the Arch Wiki:

systemd --user runs as a separate process from the systemd --system process. User units can not reference or depend on system units.

This forum post seems to suggest a simple solution: I should link the necessary system unit as a user, thus creating a symlink to it available on the unit search path.

After doing that, I don't see any No such file or directory messages, however, I still can't make the services actually run after the network is online. I have tried linking network.target, network-online.target and systemd-networkd-wait-online.service, setting my units to depend on each of them, with no success. When I check the linked unit's status in user mode, they are all some of them are dead, e.g.:

$ systemctl --user status network.target  ● network.target - Network     Loaded: loaded (/usr/lib/systemd/system/network.target; linked; vendor preset: enabled)     Active: inactive (dead)       Docs: man:systemd.special(7)             http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget  $ systemctl status network.target  ● network.target - Network     Loaded: loaded (/usr/lib/systemd/system/network.target; static; vendor preset: disabled)     Active: active since Sat 2015-07-18 19:20:11 MSK; 3h 35min ago       Docs: man:systemd.special(7)             http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget    Jul 18 19:20:11 calc-server systemd[1]: Reached target Network.  Jul 18 19:20:11 calc-server systemd[1]: Starting Network.  

However, I can see network-online.target active in user mode after linking it:

$ systemctl --user status network-online.target  ● network-online.target - Network is Online     Loaded: loaded (/usr/lib/systemd/system/network-online.target; linked; vendor preset: enabled)     Active: active since Sun 2015-07-19 00:35:38 MSK; 2min 48s ago       Docs: man:systemd.special(7)             http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget    Jul 19 00:35:38 calc-server systemd[469]: Reached target Network is Online.  Jul 19 00:35:38 calc-server systemd[469]: Starting Network is Online.  

Mint 17.1 - installation reverts to Grub - UUI

Posted: 25 May 2021 09:00 AM PDT

I'm attempting to install Mint 17.1 and have succesfully used Universal USB Installer to create a bootable USB stick. When booting up Mint the pleasing loading screen fails to make an appearance and instead the Grub menu is shown.

How should I proceed to install Linux Mint on this machine?

I have attempted the same proces using YUMI but in this case the machine reverts to the BIOS settings instead of loading Mint / Grub from the USB stick.

To clarify, I'm not intent on dual booting with Windows 8 but replacing the Windows installation with Mint.

Can we install puppet without touching the servers?

Posted: 25 May 2021 09:51 AM PDT

I heard that puppet need to be installed on server side, not just desktop side, from where we want to launch commands on the servers.

My question: Are there any other methods for using puppet? I mean we don't want to install it on server side, just run scripts from our Desktop on the servers..

How to SSH from host to guest using QEMU?

Posted: 25 May 2021 09:30 AM PDT

How do I setup ssh from the host to the guest using qemu? I am able to use port redirection when I boot the VM without any special parameters, as follows:

/usr/bin/qemu-system-x86_64 -hda ubuntu1204 -m 512 -redir tcp:7777::8001  

But when I try to boot using the following:

/usr/bin/qemu-system-x86_64 \  -m 1024 \  -name vserialtest \  -hda ubuntu1204 \  -chardev socket,host=localhost,port=7777,server,nowait,id=port1-char \  -device virtio-serial \  -device virtserialport,id=port1,chardev=port1-char,name=org.fedoraproject.port.0 \  -net user,hostfwd=tcp:7777::8001  

I get the following error and the VM does not boot:

qemu-system-x86_64: -net user,hostfwd=tcp:7777::8001: invalid host  forwarding rule 'tcp:7777::8001'  qemu-system-x86_64: -net user,hostfwd=tcp:7777::8001: Device 'user'  could not be initialized  

Please note that I am able to boot the VM without the -net parameter without any issues, however, I want to setup ssh from the host to the guest. ssh from guest to host works fine as expected.

Edit

I have tried using

-net user,hostfwd=tcp::7777-:8001  

as well as

-net user,hostfwd=tcp::7777:8001  

but still the error persists and the VM does not boot.

Changing a file's "Date Created" and "Last Modified" attributes to another file's

Posted: 25 May 2021 09:06 AM PDT

I'm using merge cap to create a merge pcap file from 15 files. For the merged file, I have changed the name to that of the first of the 15 files. But I would also like to change the merged file's attributes like "Date Created" and "Last Modified" to that of the first one. Is there anyway to do this?

FILES_dcn=($(find  $dir_dcn -maxdepth 1 -type f -name "*.pcap"  -print0 | xargs -0 ls -lt | tail -15 | awk '{print $9}'))  TAG1_dcn=$(basename "${FILES_dcn[14]}" | sed 's/.pcap//')  mergecap -w  "${dir_dcn}"/merge_dcn.pcap "${FILES_dcn[@]}"  mv  "${dir_dcn}"/merge_dcn.pcap  "${dir_dcn}"/"${TAG1_dcn}".pcap  

I try to access the merged files over a samba server (Ubuntu). So that an extractor function can access auto extract the files to D folder. But as the created date will be changed for the merged file the extraction fails. Is there anyway to fix this?

No comments:

Post a Comment