Ubuntu
How to Stop Ubuntu From Collecting Data About Your PC
Opt Out of System Information Reports
$ ubuntu-report -f send no
Opt Out of the Package Popularity Contest
$ sudo apt remove popularity-contest
Opt Out of Automatic Bug Reports
Settings -> Privacy -> Problem Reporting -> OFF
How to run 32 bits applications
$ sudo dpkg --add-architecture i386$ sudo apt-get update$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
Dominions 3
In addition, in order to run Dominions 3 you must install libxi6:i386
$ sudo apt install libxi6:i386
Ubuntu minimal installation + DWM
Download the Network Installer image of your architecture below:
https://ubuntu.com/download/alternative-downloads#network-installer
In my computer, I have to unplug the graphic card in order for the installation pendrive to boot the installer. Otherwise it freezes.
Installation
- Unplug the graphic card from the motherboard
- Insert the installation media and follow installation
Post installation
- Reboot system
- Sign in as user
- Assign a password to root user:
$ sudo passwd root - Edit
/etc/NetworkManager/NetworkManager.confand add this line under[main]:
auth-polkit=false
- Edit
/etc/systemd/journald.confand uncomment this line:
SystemMaxFiles=1
If you don't edit the two files as explained above, you'll get huge logs files:
- /var/log/syslog
- /var/log/journal/
Install basic programs and libraries
sudo apt updatesudo apt install vim xserver-xorg xinit lynx zathura ranger feh -ysudo apt install network-manager -ysudo apt install git make libx11-dev libxft-dev libxinerama-dev -ysudo apt install apt-transport-https curl -y
DWM installation
After performing a Ubuntu minimal installation, follow DWM installation instructions here: https://linuxdocs.netlify.app/i3wm#dwm
Once you have installed DWM and the other suckless programs, edit your .profile file and append these lines at the end:
feh --bg-scale .wallpaper/ubuntu.jpg.config/dwm/dwm-bar/./dwm_bar.sh &
Now create/edit your .xinitrc and add:
dwm
You can automate the installation by running these commands:
wget https://raw.githubusercontent.com/cheomanigua/config/master/suckless/ubuntu/ubuntu_autoinstall_dwmsudo chmod +x ubuntu_autoinstall_dwmsudo ./ubuntu_autoinstall_dwm
Install CUDA driver
Note: There must be NO nvidia driver installed, nor nvidia card inserted in the PC prior to following the installation process below
sudo apt install gccwget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pinsudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda-repo-ubuntu2004-11-1-local_11.1.0-455.23.05-1_amd64.debsudo dpkg -i cuda-repo-ubuntu2004-11-1-local_11.1.0-455.23.05-1_amd64.debsudo apt-key add /var/cuda-repo-ubuntu2004-11-1-local/7fa2af80.pubsudo apt-get updatesudo apt-get -y install cudanvidia-smi
The original instructions are in this page.
You can now poweroff the computer, insert the graphic card, plug the hdmi cable in the graphic card, and start the computer.
Install DaVinci Resolve Studio
- Download the Linux version of Davinci Resolve from https://www.blackmagicdesign.com/products/davinciresolve/
- Go to the directory where you downloaded Davinci Resolve
- Unzip:
$ unzip DaVinci_Resolve_16.0b7_Linux.zip - Install:
$ sudo ./DaVinci_Resolve_16.0b7_Linux.run -i - Launch: Activities -> Search box -> Type "Davinci"
Note: The first time that Davinci Resolve 16 is launched, the welcome screen will get stuck (it will remain white). Launch "System Monitor" and end the process "DaVinci_Resolve_Welcome". Davinci Resolve 16 will get "unstuck" and open up normally.
Debian minimal installation + Openbox
Download the Small CDs or USB sticks image of your architecture below:
https://www.debian.org/distrib/netinst
In my computer, I have to unplug the graphic card in order for the installation pendrive to boot the installer. Otherwise it freezes.
Installation
- Unplug the graphic card from the motherboard
- Insert the installation media and follow installation
Post installation
- Reboot system
- Sign in as user
- Assign a password to root user:
$ sudo passwd root - Edit
/etc/NetworkManager/NetworkManager.confand add this line under[main]:
auth-polkit=false
- Edit
/etc/systemd/journald.confand uncomment this line:
SystemMaxFiles=1
If you don't edit the two files as explained above, you'll get huge logs files:
- /var/log/syslog
- /var/log/journal/
Install Openbox
Note: You can skip the manual instructions below by running the script at GitHub. Follow the instructions on the README file.
# apt install openbox lxdm obconf obmenu qterminal featherpad pcmanfm tint2 gsimplecal feh numlockx lxappearance# apt install firefox vlc# wget -qO- https://git.io/papirus-icon-theme-install | sh# apt install build-essential
build-essential is only necessary if you are a developer as npm will need it in order to install packages.
Configure Openbox
Wallpaper and Tint2 panel
- Create file
~/.config/openbox/autostart.shand add:
feh --bg-scale ~/.wallpaper/image1.png &(sleep 2s && tint2) &
Calendar
We installed gsimplecal in the installations steps above. To make it show when clicking on the clock of the panel, edit ~/.config/tint2/tint2rc and change this line to this:
clock_lclick_command = gsimplecal
Icon Themes
We can select an icon theme launching lxappearence. We downloaded and installed the papirus icon theme with the command wget on the step above Installing Openbox.
Mouse cursor Themes
- Install one of the cursor theme packages:
sudo install dmz-cursor-theme
Launch LXappearance and select 'Mouse Cursor' tab and 'DMZ (White')' theme.
Edit
~/.icons/default/index.theme:
[Icon Theme]Name=DefaultComment=Default Cursor ThemeInherits=DMZ-White
- Create a symlink:
ln -s /usr/share/icons/DMZ-White/cursors ~/.icons/default/cursors
- Check that symlink was created successfully:
$ ls -l ~/.icons/default/cursors/home/cheo/.icons/default/cursors -> /usr/share/icons/DMZ-White/cursors
- Reboot
Extra: If for whatever reason you want to delete the symlink in the future:
rm ~/.icons/default/cursors
Disk Management
Automount an external disk
- Check where the external disk is:
$ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 111.8G 0 disk├─sda1 8:1 0 499M 0 part└─sda2 8:2 0 111.3G 0 part /sdb 8:16 0 223.6G 0 disk├─sdb1 8:17 0 16M 0 part└─sdb2 8:18 0 223.6G 0 part
- In this example, the disk we want to automount is the partition
/sdb/sdb2. We need to find out the UUID and TYPE of/dev/sdb2:
$ sudo blkid /dev/sdb2/dev/sdb2: LABEL="Datos" UUID="368A7A9A8A7A5679" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="670e8067-f3d4-44db-a493-d69e4c9e2e9e"
- We now create a directory to accomodate
/dev/sdb2when it automounts:
$ sudo mkdir /media/datos
- We can now edit
/etc/fstaband add:
UUID=368A7A9A8A7A5679 /media/datos ntfs rw,exec 0 0
rw,exec gives write, read and execute permission to all users.
Remove Snap from the system
snap listsudo systemctl stop snapdsudo systemctl disable snapdsudo apt purge snapdrm -rf ~/snapsudo rm -rf /snap /var/snap /var/lib/snapd /var/cache/snapd /usr/lib/snapdsnap list
Leafpad from source
The reason to compile from source instead of using the package manager is because Leafpad has the tab width hard coded and cannot be changed from the application menus. I want to use a tab width of 2 instead of the default tab width of 8.
Download and unpack the tarball file
$ wget http://savannah.nongnu.org/download/leafpad/leafpad-0.8.17.tar.gz$ tar xzvf leafpad-x.x.x.tar.gz # unpack the sources$ cd leafpad-x.x.x # change to the toplevel directory
Change the tab_width
Edit src/indent.c and find the following lines and change the values as below:
static gint default_tab_width = 2;static gint current_tab_width = 2;
if (default_tab_width == 2)current_tab_width = 1;elsecurrent_tab_width = 2;
Compile
Note that you will first need to installthe GTK+-2.x.x libraries if you don't have them installed already:
$ sudo apt install libgtk2.0-dev
Then you can compile:
$ ./configure # run the `configure' script$ make # build Leafpad$ sudo make install-strip
Wine
Installation
Note: These commands are targeted to Ubuntu Bionic release. Change at your own discretion for your OS and release version.
$ sudo dpkg --add-architecture i386$ wget -nc https://dl.winehq.org/wine-builds/winehq.key$ sudo apt-key add winehq.key$ sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'$ sudo apt update$ sudo apt install libsdl2-2.0-0$ sudo apt --fix-broken install$ wget https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/amd64/libfaudio0_19.07-0~bionic_amd64.deb$ wget https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/i386/libfaudio0_19.07-0~bionic_i386.deb$ sudo dpkg -i libfaudio0_19.07-0~bionic_amd64.deb libfaudio0_19.07-0~bionic_i386.deb$ sudo apt install --install-recommends winehq-stable$ sudo apt autoremove
Usage
- To install .exe files, run:
wine file.exe - To install .msi files, run:
wine msiexec /i file.msi - To launch wine explorer, run:
winefile - To check wine configuration, run:
winecfg
MetaTrader 5 (MT5)
Installation
- Download the Windows version MT5 installation executable from MetaTrader website or any broker's website that uses MT5. In this example we are going to downloaded the MT5 executable from JDF Bank broker website. Note that you have to open an account (real or demo) in JDF Bank in order to obtain the login credentials to connect MT5 to the market.
- Run the wine installer againts the JDF Bank MT5 executable. Note that when you run
winefor the first time in your system, three dialogs will appears to ask you if you want to install wine-mono and Gecko. Confirm by pressing the install button to the three dialogs.
$ wine jfd5setup.exe
Launching MT5
You can launch MT5 in two ways:
- Run the command:
$ winefile
Then click on C: drive > Program Files > JDF MetaTrader 5 > terminal64.exe
- Alternatively, you can launch MT5 by running the following command:
$ wine /home/cheo/.wine/drive_c/'Program Files'/'JFD MetaTrader 5'/terminal64.exe
Installing Volume Profile + Range v6.0
- Download the indicator files from https://www.mql5.com/en/code/15440
- Copy the files to Wine file system:
$ cp Downloads/VP-* .wine/drive_c/Program\ Files/JDF\ MetaTrader\ 5/MQL5/Indicators
- Launch winefile:
$ winefile
Then click on C: drive > Program Files > JDF MetaTrader 5 > MQL5 > Indicators
- Double click on one of the
mq5files in order to launch MetaEditor - In MetaEditor, select the window with the source code to edit and from the main menu Search > Replace or press Ctrl + H. Then replace the following:
iTimetomiTimeiBarShifttomiBarShift
- Save the file and compile the file
- Repeat with the other file
Now, when launching MT5, you can use the indicators VP-v6 and VP-Ranger-v6.