Tuesday, June 28, 2022

Install a custom font on Ubuntu Linux

Install a custom font

sudo mkdir /usr/share/fonts/myfonts && cd /usr/share/fonts/myfonts

sudo unzip -d . ~/Downloads/font.zip

sudo fc-cache -fv

fc-match FontName


Install Microsoft font

sudo apt install ttf-mscorefonts-installer

Font supported list:

  • Times New Roman
  • Arial Black
  • Arial
  • Comic Sans MS
  • Courier New
  • Impact
  • Verdana

Friday, June 17, 2022

Install wireguard on Ubuntu Linux 22.04 LTS

Installing the WireGuard Client

sudo apt update && sudo apt upgrade

sudo apt install openresolv

sudo apt install wireguard


Generating Private and Public Keys

wg genkey | tee private.key | wg pubkey > public.key

sudo nano /etc/wireguard/wg0.conf


In the file type:

[Interface]

PrivateKey = <contents-of-client-privatekey>

Address = 10.0.0.1/24

PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

ListenPort = 51820

[Peer]

PublicKey = <contents-of-server-publickey>

AllowedIPs = 10.0.0.2/32


WireGuard Startup

sudo wg-quick up wg0


Check connection status

sudo wg show


Thursday, June 16, 2022

[Dev] Dart 2.17, now you can declare enums with members.

What else can you do with this?

- Define multiple properties

- Add named or positional arguments to the constructor (as long as it's a "const" constructor)

- Define custom methods and getters


Friday, June 10, 2022

[Linux] Install the Nvidia driver and power saving on the dual Nvidia - Intel gpu laptop on Ubuntu

 

The purpose of this tutorial is to install the NVIDIA drivers on Ubuntu Linux on optimus system ( Intel + Nvidia) and switch from a opensource Nouveau driver to the proprietary Nvidia driver. Follow along with our step by step instructions below to install NVIDIA drivers on Ubuntu.

1. Nvidia Graphic Install

Go to Activities >> Software & Updates >> Additional Drivers.

Apply changes and reboot the system post the installation and then validate the driver installation by going again to the Additional Drivers tab. 

2. Install Nvidia Prime

sudo apt-get install nvidia-prime


Then you will have Nvidia X Server Settings in Dash. And there you can find PRIME profiles.

Everytime you wanna switch to Intel vga, just type using this command sudo prime-select intel Switch back to nvidia sudo prime-select nvidia