How to resolve suspend/wake issues on Dell XPS with Ubuntu

Just append this to your kernel boot params:

mem_sleep_default=deep

Reboot, Enjoy!

Source: https://gist.github.com/greigdp/bb70fbc331a0aaf447c2d38eacb85b8f

Posted in Linux | Tagged , , , , | Leave a comment

Create an alias for microk8s.kubectl as kubectl on Ubuntu

sudo snap alias microk8s.kubectl kubectl

Sources:

https://github.com/ubuntu/microk8s/issues/20

Posted in Linux | Tagged , , | Leave a comment

bc: A command-line calculator for Ubuntu

It’s simple, but effective for command line addicts

If it’s not already installed, install it by using:

sudo apt install bc

then run bc and type any calculations you want. I wrote for example

$ bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
3.65*549
2003.85

That’s it, Enjoy!

Source: https://fedoramagazine.org/bc-command-line-calculator/

Posted in Linux | Tagged , , | Leave a comment

Set fractional display scaling on Ubuntu 18.10 (XORG)

I am using an LG 5K monitor, and the display scaling options are very limited in gnome-shell, only increments of 100%.

To have fractional scaling, I tried this script:

#!/bin/bash 

gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gdk/WindowScalingFactor': <2>}"
xrandr --output DP-1 --scale $1x$1

I added that in a script inside /usr/bin/scale_me_please.sh and make it executable:

sudo chmod +x /usr/bin/scale_me_please.sh

Now, whenever I am at work and need to scale it, I just run:

scale_me_please.sh 1.4

Just perfect!

Update: This change has introduced some screen tearing for me on Intel graphics. The solution was to add the following:

Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
EndSection

To /etc/X11/xorg.conf.d/20-intel.conf

For some reason, this changed my display from DP-1 to DP1, so I modified my script replacing the former with the latter.

Enjoy!

Sources:

https://wiki.archlinux.org/index.php/Intel_graphics#Tearing

https://askubuntu.com/questions/1029436/enable-fractional-scaling-for-ubuntu-18-04

Posted in Ubuntu | Tagged , , , , | Leave a comment