luk3yx
  • Member for 6 years
  • Last seen this week
How to auto-replace content of .desktop-file depending on current state of a script
Accepted answer
4 votes

Try overwriting the file instead. #!/bin/bash DESKT=/home/user/program.desktop if [ $(systemctl --user status program | grep -c running) = 0 ]; then systemctl --user start program icon=...

View answer
Share Ethernet connection with second NIC (SmartTV)
Accepted answer
3 votes

If you are using a GUI: (Only works for IPv4) Go in to the Network Connections setting Click Add Select Ethernet then click create Use the drop-down list by the device option to enp6s0, or the ...

View answer
Bash Script: How to Use Double-Digits as in "p10=$10" or Specify ALL (for File-Roller Script)
Accepted answer
2 votes

You can use "$@" to get all parameters and shift N to remove N arguments. #!/bin/bash p1="$1" p2="$2" shift 2 if [[ $p2 == *"notify"* ]]; then p2="&...

View answer
Ubuntu 18 Server with 2FA for SSH
1 votes

Those guides should work with other 2FA applications (such as FreeOTP) as well. Google Authenticator uses TOTP, and most 2FA applications such as the open-source FreeOTP use the same standard and you ...

View answer
Change the owership of files inside a Minetest snap from root to me
1 votes

The path you have specified is read-only, even to superuser, as shown at https://snapcraft.io/docs/reference/confinement. You should use a different path. The correct location to store your data for ...

View answer
Run my bash script on login and SEE terminal
Accepted answer
1 votes

Try changing the startup entry to this: x-terminal-emulator -e "bash -c '~/Desktop/Elaborati/script1.sh'" However, if you don't want the terminal to close once the script has finished executing, use ...

View answer
All I want to do is edit a file, but
0 votes

You are not running your GUI text editor as a superuser. You could try pressing Alt + F2, and typing in: pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit /etc/apache2/apache2.conf This will ...

View answer
Why su didn't work?
0 votes

By default, for security reasons, Ubuntu disables root login. If, for some reason, sudo does not do what you want it to, or you would like to directly login as root on a TTY, open a terminal and ...

View answer
Making an iso backup of my system
0 votes

If you want to back up the whole drive, replace /dev/sdX with the drive location (e.g. /dev/sda). If you want to back up just one partition, replace /dev/sdX with the partition location (e.g. /dev/...

View answer