Categories
Linux

Ubuntu: reset monitor settings to default

If you want to reset your monitor settings to default through the terminal (your second screen is broken and the settings are ‘shown’ there and you don’t want to restart your laptop), you can use the following command:

xrandr -s 0
Categories
Linux Ubuntu

Ubuntu Server – CTRL-ALT-DEL

If you press CTRL-ALT-DEL on a Ubuntu Server the server will be shut down without asking any confirmation or password. This is of course not a good idea.

To disable this, enter the following commands as root:

systemctl mask ctrl-alt-del.target
systemctl daemon-reload
Categories
Databases DBeaver MySQL

DBeaver: refresh data not showing

If you try to refresh the data in a table while using DBeaver, and no changes are shown, it could be that you are in transactional mode.

To fix this, click on the menu ‘Database’ and select ‘Transaction mode’. Select ‘Auto-commit’ and ‘Serializable’.

Categories
Linux

Linux: removing commands from history

If you want to remove some commands from your bash history use the following command:

history -d 1001

where 1001 is the number of the history line. Of course this might add another problem: the command ‘history -d 1001’ is now added to your history.

How to avoid a command getting in your bash history?

If you want to execute a command and don’t want it to get in your history list (because it contains sensitive data, or you just don’t want to clutter your history), start the command with a space.

For this to work the environment variable $HISTCONTROL has to be set to ‘ignorespace’ or ‘ignoreboth’.

export HISTCONTROL=ignorespace
Categories
Linux

Ubuntu 20.04: annoying popup ‘Authentication is required to run gvfsd-admin daemon’

If you get the above popup, and it is impossible to get it to go away (cancel does nothing, authenticate hangs…), here is a quick solution to get rid of it:

Press ALT+F2, enter ‘r’ (without the quotes) in the command box and press enter. This will restart Gnome and the window will be gone. Your running apps keep running!

Categories
NextCloud

Nextcloud: my files view is empty???

After a serious upgrade of my NextCloud server, I had the strange phenomenon that my files view was completely empty. Tried everything, nothing worked. In the end the cause was proven to be an extra folder in de data directory of Nextcloud.

I had copied all data from a usb drive and put it in a __filesfrompreviousserver folder in the /var/snap/nextcloud/common/nextcloud/data folder, which is the folder where NextCloud stores its data.

I never thought that would cause problems, but apparently it does. Once I removed the folder everything was fine again.

Categories
Linux

Ubuntu: external screen goes black, but ubuntu is still using 2 screens

Today I had the problem that my external screen was only showing a nice shade of black. However, several programs were running on that screen, and I could not just reboot the laptop without losing much work.

To fix this (it did fix it for me, your mileage may vary), open a terminal window (Ctrl + Alt + t) and type the following command:

xrandr

After this, I had my second screen back.

Categories
Windows

Activate the Master Control Panel (AKA God Mode)

What is this? MCP adds an icon to your desktop that gives you near instant access to nearly every Windows setting available.

Activating this is really simple: just create a new folder on your desktop (right-click and select New -> Folder), and name it “GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}”

This will create a new folder with the following icon:

Double-clicking this icon will open a list of settings.

Categories
Linux Zentyal

Zentyal: how to change password expiry options

Zentyal is a great replacement for Windows domains, but in the webinterface there is currently (version 6) no option to change the password expiry settings.

To change them anyway, open a linux terminal on the Zentyal server and use the samba-tool utility


samba-tool domain passwordsettings set --max-pwd-age=0

This will turn off password aging. Change the 0 to the number of days you want to set it to expire to anything else than the default 365 days. Have look at the help page or manpage for samba-tool to see more options. If the command executes successfully, you will see the following text:

Maximum password age changed!
All changes applied successfully!

and you are done!
Categories
Linux

Linux: using tmux to start server processes

If you want to start a process or command on a linux server and want to return later to check if it ran ok, or if it is still running, then the tmux tool is very handy.

Tmux can do many more things (like split a terminal window in multiple panes), but that is outside the scope of this article.

To start a new session on your server (once you are connected to the server with ssh), type:

tmux new -s mysession

where ‘mysession’ is the name you want to use

Now start whatever command you want.

If you want to leave your session, but keep everything running so you can check back at a later time, press Ctrl-b d.

To list all detached sessions, use the following command:

tmux ls

No you can reattach to a session using the following command:

tmux attach -t mysession