Linux

SystemD Notes Tips and Tricks

A nice little guide: https://tecadmin.net/run-shell-script-as-systemd-service/

Shut down or suspend at a specific time

shutdown -h hh:mm schedules a halt, for example shutdown -h 22:35. The reply is "Shutdown scheduled for ... use 'shutdown -c' to cancel", so shutdown -c cancels it; shutdown --help has the rest.

Suspend at a given time instead: sudo echo 'sudo pm-suspend' | at 22:35

Tags

Ubuntu Select Touch Device

Quick note: xinput map-to-output 11 eDP

I have a thinkpad laptop with a touchscreen. When I connect my external screen, then the touch sensor on my laptop screen moves the cursor on the external screen, which is not what I want. I want to keep my touch on my laptop screen.

I followed the instructions here: https://askubuntu.com/questions/51445/how-do-i-calibrate-a-touchscreen-…

First run:

xinput

Output:

Run process in the background Linux

To detach a process started in the terminal, you can always add & at the end. For example: npm run evaluation &

Or: nohup bash script.bash &

After that you can run "jobs", to see the running jobs for that user.

Otherwise you can use "htop" or "ps -ef |grep bash" to find all bash jobs for instance.

References:

https://www.dev2qa.com/how-to-run-node-js-server-in-background/

Tags