18.04 – How to create a startup command?

How do I create a startup command permanent on every cycle restart ?
As previously having brightness reset when set at power saving mode to turn off the monitor.

  • 18.04 64bits 5.4.0-42-generic
  • Desktop Nvidia 440 driver

I found out xset dpms 600 900 1800 works on turning off the monitor display but I wanted it to run at startup which i do no need to type manually on the terminal.

I tried adding xset dpms 600 900 1800 to the bottom of home/.profile but it didn’t work.

Further testing and by adding an extra line to run terminal by adding

xset dpms 600 900 1800
gnome-terminal

at the terminal startup checking the xset -q xset dpms was not set Standby: 0 Suspend: 0 Off: 0 while it should be Standby: 600 Suspend: 900 Off: 1800

The weird scenario is when manually launch a terminal without typing anything , the command of xset dpms 600 900 1800 active.

What would it be the reason ?
.profile with command ‘xset dpms 600 900 1800’
Not trigger on startup
but when I launch terminal manually it trigger the command.

If anyone could explain the reason ? or a better way to run the command on startup rather running on .profile ?

20.04 crashes on suspend after upgrade from 18.04

After upgrading from 18.04 to 20.04, suspend crashes during the suspend request, or, crashes on resume. This is a desktop not a laptop. It is the same bios and hardware as 18.04.

20.04 crashes several different ways.

  • on suspend, usb turns off, fans and system LEDs stay on, screen goes blank, crash.
  • on suspend, screen flashes random colors & characters, fans & usb stay on, crash.
  • on resume, usb & fans turn on, after a few seconds usb turns off, black screen has grayed out login prompt, crash.

Suspending from the power icon or from the command line always crashes with fans running. Letting the machine suspend on timeout, always crashes on resume.
Obviously 20.04 does not work with this hardware but why did 18.04 handle it?

To get out of the corrupted state I hold the power button down for 10 seconds. The reset button sometimes works, sometimes won’t. This is a very hard crash.

boot – HELP : Have a terminal screen after Grub and booting on Ubuntu 18.04

I have a dual boot Ubuntu 18.04 and Windows10.
Since 3 month, I use this configuration without any bug, but this morning, when I launch ubuntu from grub, no graphic interface appear just a terminal which ask me to type my login and my password.
After this, I can use the terminal like all of the terminal and acceeded to my file but I haven’t graphic interface.

Does someone have a solution for me ?

Thanks a lot for your help

Xorg + fbdev driver (/etc/X11/xorg.conf)dosen’t work in Ubuntu 18.04

I need to use fbdev driver(framebuffer) in Xorg to get better system latency.

So I use “Xorg :1 -configure” to get the default xorg.conf file. Then change the “Device” part, and copy xorg.conf to /etc/X11. Reboot Ubuntu.

    /etc/X11/xorg.conf
    Section "Device"
         ### Available Driver options are:-
         ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
         ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
         ### <percent>: "<f>%"
         ### (arg): arg optional
         #Option     "ShadowFB"             # (<bool>)
         #Option     "Rotate"               # <str>
         #Option     "fbdev"                # <str>
         #Option     "debug"                # (<bool>)
         Identifier  "Card0"
         #Driver     "vmware"
         Driver      "fbdev"
         BusID       "PCI:0:15:0"
    EndSection

In Ubuntu 16.04.6 , it works in this way. Sadly, in Ubuntu 18.04.4, it dosen’t.

//Ubuntu 16.04.6

hust@hust-pc:~$ inxi -G

       Graphics:  Card: VMware SVGA II Adapter
       Display Server: X.Org 1.19.6 driver: fbdev
       Resolution: 800x600@0.00hz
       GLX Renderer: llvmpipe (LLVM 6.0, 256 bits)
       GLX Version: 3.0 Mesa 18.0.5

//Ubuntu 18.04.4

hust@hust-virtual-machine:~$ inxi -G

       Graphics:  Card: VMware SVGA II Adapter
       Display Server: x11 (X.Org 1.20.5 ) drivers: vmware (unloaded: modesetting,fbdev,vesa)
       Resolution: 2880x1520@60.00hz
       OpenGL: renderer: SVGA3D; build version: 3.3 Mesa 19.2.8

I try to degrade the Xorg version in Ubuntu 18.04, but it causes the Xorg to hang sometimes.Then I try it in vmvare machine.

How can I change the Xorg driver to fbdev in Ubuntu 18.04?

iptables – Ubuntu 18.04: Communication to server on localhost stops working after setting a port forwarding rule

I have a Ubuntu 18.04 device with two network interfaces, ethernet and USB LTE modem. There is IP camera connected directly to the ethernet port and it has address 192.168.0.90. I use the LTE interface for everything else – internet, ssh, etc. – it has static IP address 172.10.0.10 (our company has its own APN).

My device has a Python app running that communicates with local Node.JS server on http://localhost/abc that communicates to my server via the LTE interface to https://myserver.com/app

The IP camera has its own web server for configuration purposes. In order to get to the camera’s config page I set a port forward rule so I can access the IP camera on 172.10.0.10:8888:

sudo sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A PREROUTING -p tcp --dport 8888 -j DNAT --to-destination 192.168.0.90:80
sudo iptables -t nat -A POSTROUTING -j MASQUERADE

It works fine and I can access the camera and shell all good. But the Python app stops communicating with the local Node.JS server with this error:

502 Server Error: Bad Gateway for url: http://localhost/abc My guess is that my port forward rule broke some ports that those two local apps were communicating trough. Any idea on how to fix that?

pulseaudio – New Pc Build have dual boot working ok 18.04 ubuntu and windows 10. No sound in Ubuntu via HDMI

Stack Exchange Network


Stack Exchange network consists of 177 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

18.04 – How to rollback a btrfs snapshot for root [ / ] after failed system update

I tried updating from 18.04 to 20.04 but something went wrong and the installer told me that my system could have ended up unusable. I think I know the cause (a bunch of third party repos).

Fortunately I have snapper configured to make snapshots for @ and @home so I can just rollback / and try again; but how do I do this, will I need to boot to an Ubuntu’s live USB and what commands shall I type?

I can still use my system, but I don’t know what will still work once I reboot.

(already downloaded and burned using Etcher to an USB the Ubuntu 20.04 image just in case)

Graphics bug after installing Cuda on Ubuntu 18.04 – colorful pixel on desktop

I have installed Cuda on Ubuntu 18.04 as shown here

But now every time I close and reopen my laptop, a graphical error occurs.
Does anyone know how to find out what happened or how to fix it?
Thanks

pixel bug

grub boot error : “symbol ‘grub calloc’ not found – Ubuntu Server 18.04 LTS

Having read a lot of the posts and responses I’m sorry to have to start a new thread on this topic – for reasons below.
I am currently running a physical server (HP ProLiant Gen 8) with 8GB RAM installed with Ubuntu Server 18.04 LTS on it. The server contains 4 physical HDDs (no RAID) with one physical drive (sda1) allocated where the OS resides.

I have tried a couple of the suggested workarounds without success. In particular I have tried the 64bit Boot Repair Disk from Sourceforge which I loaded onto an 8GB USB stick using Unetbootin and restarted my server. Having selected the option to repair in 64bit “safe mode” (the default and other options failed to work) I could see that the server was running the repair disk however it then stopped with the final line of text being

(initramfs) mount: mounting /dev/loop0 on //filesystem.squashfs failed: Invalid argument
Can not mount /dev/loop0 (cdrom/casper/filesystem.squashfs) on //filesystem.squashfs

Prior to that last line of text there was also an error message which reads

squashfs: SQUASHFS error: unable to read xattr id index table

After these lines appeared the system just hangs.

I’m at my wits end and would be grateful for a solution please.

Thanks in advance.