Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

-2

You use a better shutdown command. The van Smoorenburg, Upstart, and systemd shutdown commands do not allow a date specification. But the BSD shutdown command takes a date value in its specification of when to shut down, in the form yymmddhhmm. This has been the case ever since 4BSD, and remains so with FreeBSD and OpenBSD. NetBSD extended it to ...


0

A way to go about this would be by using a socket. Of course, this implies that you need to use network socket libraries in your processes, but this is the most common way of allowing two processes to communicate. Since the two processes are on the same machine, I suggest you configure a systemd unix socket. Then, Process A can connect to the socket to ...


1

Tried with below sed command combination and it worked fine for i in `sed -n '/^$/{n;p}' filename`; do sed -i "0,/^$/s/^$/$i/g" filename; done output apple banana banana big sig cake cake


1

With sed: sed -ne '/./!{n;p;}' -e p your-file /./! action runs the action (here retrieve the next line and print it) for the lines that do not (!) contain any single character (. is the regex operator that matches any single character). Some sed implementations also have a -i or -i '' option to edit the file in-place.


1

$ awk '/^$/ { ++r; next } { print; for (i=0; i<r; ++i) print; r=0 }' file apple banana banana big sig cake cake or awk '/^$/ { ++r; next } { print; while (r > 0) { print; --r } }' file which gives the same output. This prints each line 1 time, plus the number of times corresponding to the number of blank lines above it. The blank lines are counted ...


2

You can do this in awk with its getline() function. The command works by selecting the empty lines in the text file !NF i.e. which means those lines that are empty (number of fields within the line is 0). Using the getline() function we get the next immediate line from the empty line and store in the variable nxt. awk '!NF && ((getline nxt) >0){ ...


0

The fact that you see names like Ubuntu and Windows Boot Manager in your BIOS settings indicates your operating systems are configured to boot in UEFI native style. Prepare to unlearn everything you've learned from classic BIOS-style booting... Please boot into Ubuntu, ensure that a package named efibootmgr is installed (run sudo apt-get install efibootmgr ...


0

After posting the same question in Manjaro forums, it turned out that I needed to change the display of the VM from VMSVGA to VBoxVGA. It's worth noting that it didn't work on my existing machine, and I had to create a new VM with this setting.


1

To run the job only this year: 0 20 31 8 * test $(/bin/date +\%Y) = "2019" && /sbin/shutdown now To run the job every year: 0 20 31 8 * /sbin/shutdown now


7

The at command is for scheduling one off future executions. e.g. % at 8pm Aug 31 at> echo hello at> <EOT> job 161 at Sat Aug 31 20:00:00 2019 (the "<EOT>" was produced by pressing control-D) % atq 161 Sat Aug 31 20:00:00 2019 a sweh You can put your shutdown command here.


-2

There may be an option to input the year to the shutdown command, but cron is often used to run commands only once at a specific point in time. For your example, try 0 0 31 8 ? 2019 shutdown


2

Your line terminators in your resource.txt file are probably wrong. Please, run the following command: strings resource.txt >new_resource.txt and use the new_resource.txt file created.


1

Ok, after digging I realized this is correct operation. Only one of BTRFS array members will be listed as having UUID in /dev/disk/by-uuid Examining output of btrfs filesystem show will clearly indicate there are no member devices missing. In fact my two raid10 arrays are accessible. Therefore I have yet to find out what is causing Emergency Mode.


0

if you have multiple version of python in your system. You just need to update the symbolic link of python inside /usr/bin/ root@irshad:/usr/bin# ls -lrth python* lrwxrwxrwx 1 root root 9 Apr 16 2018 python -> python2.7 -rwxr-xr-x 1 root root 3.6M Nov 12 2018 python2.7 -rwxr-xr-x 2 root root 4.4M May 7 14:58 python3.6 In above example if you see ...


0

The env vars are environment variables. These are a list of variables that executed applications have access to. An application may be executed with different env vars values, and this may change its behaviour. In a shell script, these are easily accessible. Eg. in Bash an env var is called the same as any other variable - simply by its name. In this ...


2

I have uninstalled xbacklight. Things are fine now. In the past, after upgrading my OS from Ubuntu 18.10 to 19.04, I had to install xbacklight in order to make my brightness button working. My guess is, later Ubuntu update fixed this, so I don't need xbacklight anymore. If u want to keep xbacklight and have this issue, you can try this solution: Go to /...


1

Those are colour codes. Your tool for viewing the file is converting the colour codes to a form that can be read by a human. If you use less, then add option -R. Also consider using the last read date, of the file-system.


0

Welcome to the StackExchange! First of all, you would need to format or add at least one partition to the newly added hard drives. This can be accomplished by either using the terminal with fdisk type this to select the first hard drive you mentioned: $ fdisk /dev/sdb Type ‘n’ to create a new partition. Specify where you would like the partition to end ...


3

You could accomplish this with a single redirection using echo/printf along with command substitution: printf '%s\n' "$(whoami)" "$(date)" > /home/user/folder/file IMO this is not a good solution, it is not very readable/manageable...especially if more commands are added. In order to prevent having to type the path multiple times you could just save it ...


5

Use a subshell (whoami; date) > ~user/directory/file


0

A lot of suggestions to resolve such an issue hint at changing permissions of the ~/.ssh directory and the files it contains. More on this : https://gist.github.com/grenade/6318301 Some even suggest ssh-add which may not solve the issue and might be redundant. Having tried both of the above, did not solve this problem for me. Instead, the problem was ...


4

You don't need live boot utilities or boot-repair for this. Boot into kali, then run sudo efibootmgr (or just efibootmgr as root). It should display a list that should look something like this: BootCurrent: 0001 Timeout: 1 seconds BootOrder: 0000,0001 <there may be other 4-digit numbers on this line> Boot0000* Ubuntu Boot0001* Kali <... possibly ...


0

There are many ways to do this. I did something below convenient to me and always works fine. On your remote server, make sure to install xorg-x11-xauth, xorg-x11-font-utils, xorg-x11-fonts. Run the Xming Server on you local desktop On putty, before ssh to the server, enable the X11 forwarding and set the display location to localhost:0.0 On the server, ....


0

Use a live boot utility like YannuBuntu's Boot-Repair-Disk or add boot-repair to your OS to find the old GRUB2 and remove it.


0

~$ man hostname […] You cannot change the FQDN with hostname or dnsdomainname. The recommended method of setting the FQDN is to make the hostname be an alias for the fully qualified name using /etc/hosts, DNS, or NIS. For example, if the hostname was "ursula", one might have a line in /etc/hosts which reads 127.0.1....


1

We ran into the same problem as you did and could only find this thread on the subject. I guess this message won't add to your particular solution as you already solved it, but it might help other people running into similar problems. So, we bought a Netstor PCIe extension, which we wanted to use to upgrade our HP system (with one Quadro P4000) by adding ...


7

I think that your confusion stems from the fact you don't understand what ! does. Encrypted passwords are stored in /etc/shadow. For example, after creating a new user named new-user and giving it 12345678 password we get this entry: $ sudo cat /etc/shadow (...) new-user:$6$zVbJcpZE$Bqnxr5cDkwjKOE06iAZu7/qIuH9UGXex28TU/aD0osft9DfdPVzcVwq2j410YxoPlZR310....


1

Looks like you misunderstood what's going on when there is a * or ! as the "password value" in /etc/shadow. You can't achieve this by actually changing your password to a single-character * or !. Such single-character values are the result of locking the user account with commands such as usermod -L. If you want to know more, please read : Exclamation marks ...


0

You're looking for usermod --lock.


2

This looks like the PATH is being overwritten by sudo. You should check to see if /etc/sudoers contains a secure_path=... setting and ads your java path to this. Be wary of simple tests. To confirm your path you should: sudo bash -c 'echo $PATH' The simpler form sudo echo $PATH does not work because PATH is expanded before sudo is invoked.


0

You SSH package/daemon/service is not installed. For installing the SSH service on Ubuntu, you run: sudo apt-get install openssh-server see Packages - openssh-server - xenial


1

The ssh binary, the SSH client, is provided by the openssh-client package, which is installed on your system. The ssh service runs the SSH server, provided by the openssh-server package, which isn’t installed on your system. The ssh package is a meta-package which installs both the client and the server.


0

X2Go is crashing because the system is configured to use an NVidia video driver. This is the reason why connecting to an almost identical VM works - as the VM is of course using a different video driver. Solution: Go to the Linux machine running the X2Go server. Click on K Start Menu >> System Settings (in Computer tab) >> Driver Manager Select "Using X....


0

Resolved on 22.05.19 I've looked into this question that my post was marked as a possible duplicated and it did not help my cause. I managed to fix the issue following these steps and resources: My disk was encrypted so after I decrypted it, I was encountering an error while trying to mount it: mount: unknown file system type LVM2_member I followed this ...


0

It should work with double quotes like smbclient //10.10.101.29/it -W WORKGROUP -U user --password pass -c "put file_$(date +%Y_%m_%d).file" or date=$(date +%Y_%m_%d) smbclient //10.10.101.29/it -W WORKGROUP -U user --password pass -c "put file_${date}.file"


0

Since this is actually performed by iBus, suggest you check to make sure ibus-daemon is running. If it is not, run ibus-daemon to start ibus daemon: $ ps -ef | grep ibus $ /usr/bin/ibus-daemon --xim & After ibus-daemon is invoked, Run ibus-setup to change your preference to obviate Alt-Shift from changing your input language.


0

Considering you have over-written your Ubuntu partition with a Windows reinstallation, chances of recovering files are pretty low. With : A LOT of time a pretty large storage space on another drive another PC where you can plug your hard drive (stop writing on your Windows/Ubuntu drive NOW!!!) an indecent amount of luck (sorry) you may recover some files ...


0

You can change the simbolic link by ln -sf python3.6 python3 inside /usr/bin. With this when you call python3 it will execute python3.6


0

the first check do you python3.6 folder ls /usr/bin/python3.6 if you have folder like python3.6 good to go then update-alternatives sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 now update new config for python3 sudo update-alternatives --config python3 check python version python3 --version


1

Requirement for pam auto-keyring unlock. Check that user password is the same as the keyring password Pam module does not distinguish default keyring from other or renamed/additional keyring Open seahorse and make sure the default keyring is named "default" and is set to default Also you should have a login keyring named Login containing Unlock ...


0

You can use a different theme or a different stylesheet to setup the theme in per application basis, try one of the following commands and check what's working: VirtualBox --style "Adwaita" env QT_STYLE_OVERRIDE=Adwaita VirtualBox --style "Adwaita" env QT_QPA_PLATFORMTHEME=gtk3 VirtualBox VirtualBox -style Adwaita -stylesheet /Path-to-custom/color-scheme-qt/...


2

The Gui is loaded by systemd, when the init system is systemd, this is the case of Ubuntu Here is a nice answer about the subject systemctl get-default permit to see what target is set for the startup either multi-user.target or graphical.target To enable x at startup time you can use: sudo systemctl enable graphical.target --force sudo systemctl set-...


2

You will need to set up a "jail." From here: Step 1: Set up the jail space Make a new directory: mkdir -p /home/test Find the files that you need to support a session. Ideally you only want the bare minimum since the goal is to hide the rest of the system: ls -l /dev/{null,zero,stdin,stdout,stderr,random,tty} Now you can make the necessary /dev files. ...


1

You've run squid with the wrong user, which created files with wrong permissions. squid: ERROR: Could not read pid file You need to run with sudo: sudo squid. fatal: ipc::mem::segment::create failed to shm_open(/squid-cf__metadata.shm): 13 permission denied You need to remove Squid's .shm files from /dev/shm or assign the right permissions. $ sudo ...


4

This happens when /tmp is mounted with the noexec flag, which is probably the case on your system — see the output of mount. This prevents any executable stored under /tmp from running, regardless of the file’s permissions. The idea behind mounting /tmp, and other world-writable directories, with this setting is to make it harder to drop binaries on your ...


0

You don't have a problem configuring iptables, you have a problem loading the required module. Are you running the command as root? The error Operation not permitted indicates that the module is not missing, you seem to lack the permission to load the module. If you are running as root, it is also possible that additional restrictions prevent you from ...


0

Quoting an answer by user613363 posted here: https://askubuntu.com/questions/726972/dual-boot-windows-10-and-linux-ubuntu-on-separate-hard-drives This should work for most systems that use UEFI and which have two HDD. Specification used for the tutorial below: Dell Inspiron E5440: Main HDD – 256 GB Samsung SSD (Windows 10 installed) Secondary HDD – 64GB ...


3

If you remove APT using sudo apt remove apt, following packages are affected in a standard installation (at least in bionic (18.04)): apt apt-utils ubuntu-minimal ubuntu-release-upgrader-gtk ubuntu-desktop update-manager update-notifier update-notifier-common To reinstall APT: Download the .deb file of APT. wget http://mirrors.edge.kernel.org/ubuntu/pool/...


0

If you are like me & just don't want to deal with this issue at all, read on. This error just popped up one fine day for me. I didn't mess with any drivers. My guess is that it auto updated the previous night and got messed up. Guessing that you are on Ubuntu 16 or higher, in the grub screen on boot up select the Ubuntu Options and select a lower ...


Top 50 recent answers are included