Skip to main content

Posts

Showing posts with the label ubuntu

Installing VSCode Server Manually on Ubuntu

I've ever gotten stuck on updating the VSCode server on my remote server because of an unstable connection between my remote server and visualstudio.com that host the updated server source codes. The download and update process failed over and over so I couldn't remotely access my remote files through VSCode. The solution is by downloading the server source codes through a host with a stable connection which in my case I downloaded from a cloud VPS server. Then I transfer the downloaded source codes as a compressed file to my remote server through SCP. Once the file had been on my remote sever, I extracted them and align the configuration. The more detailed steps are as follows. First, we should get the commit ID of our current VSCode application by clicking on the About option on the Help menu. The commit ID is a hexadecimal number like  92da9481c0904c6adfe372c12da3b7748d74bdcb . Then we can download the compressed server source codes as a single file from the host. ...

Configuring Swap Memory on Ubuntu Using Ansible

If we maintain a Linux machine with a low memory capacity while we are required to run an application with high memory consumption, enabling swap memory is an option. Ansible can be utilized as a helper tool to automate the creation of swap memory. A swap file can be allocated in the available storage of the machine. The swap file then can be assigned as a swap memory. Firstly, we should prepare the inventory file. The following snippet is an example, you must provide your own configuration. [server] 192.168.1.2 [server:vars] ansible_user=root ansible_ssh_private_key_file=~/.ssh/id_rsa Secondly, we need to prepare the task file that contains not only the tasks but also some variables and connection information. For instance, we set /swapfile  as the name of our swap file. We also set the swap memory size to 2GB and the swappiness level to 60. - hosts: server become: true vars: swap_vars: size: 2G swappiness: 60 For simplicity, we only check the...

Several Useful Linux Tools

The following tools may have been installed in your Linux because some are basic tools. But, if we installed any Linux distribution from the Docker registry which is shipped with only minimal programs, these following tools may be not available by default. net-tools This tool provides tools for network-related tasks such as ifconfig . software-properties-common If you want to enable add-apt-repository command, this tool is required. nano This text editor is usually already available. ca-certificates A deb package that contains certificates provided by the Certificate Authorities. It also contains an updater tool that can be used as a cronjob if needed. gnupg2 GNU Privacy Guard is GNU's tool that can be used to encrypt data and to create digital signatures. GnuPG is a complete replacement for PGP. It includes an advanced key management facility and is compliant with the proposed OpenPGP Internet standard. openssh-client Tools for generating authentication keys and...

Installing Multiple Instances of Linux Distributions in WSL

By support of WSL (Windows Subsystem for Linux), you can install any Linux distros in a Windows machine. Recommended method from WSL documentation is by downloading the distribution from Microsoft Store or find .appx installation file available in Microsoft website. For running multiple instances of same Linux distribution, you can duplicate the data using export-import procedure, as I have mentioned in another post . Another method that might be more beneficial is by utilizing Docker. Currently, Docker has already had variety of images of Linux distributions in its registry. You can also store your own costumized distribution in Docker registry that can be distributed to any machines instantly. After you had WSL 2 and an installed Linux distribution from Microsoft Store, you are ready to have more Linux instances in your Windows. 1. List all installed distributions in your Windows. wsl --list -v 2. Run the distribution you desired from terminal, for example, you have insta...

Managing WSL Data Directory/Storage

WSL (Windows Subsystem for Linux) is a great tool provided by Windows 10 (OS build 20262 or higher) that enables developers to run Linux machines in Windows platform without third-party application like Virtual Box. With support of installed WSL, you can install any Linux distribution available in Microsoft Store . After installation of a Linux distribution, for example Ubuntu 18.04, WSL stored its machine data in %APPDATA%\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState . If you need to move the data to another directory/drive in your computer to free some spaces in your main drive, you can perform these following commands. 1. List all distributions in your computer. wsl --list --verbose 2. Export the distribution data. wsl --export <distribution-name> <any-file-name>.tar For example, distribution name is Ubuntu-18.04: wsl --export Ubuntu-18.04 exported-ubuntu-18-04.tar 3. Unregister the distribution. wsl --unregister Ubun...

Recommended Applications for Your Ubuntu Desktop

If you like to use Ubuntu Desktop for your daily works, I recommend some good applications to improve your productivity and convenience. Currently, I use Ubuntu Desktop 18.04. Adjust Brightness Icon . It is a simple application that add functionality to your Ubuntu to adjust brightness of your screen with four level of brightness by clicking its icon on the Taskbar. You can install this application through Ubuntu Software Center. Gnome Tweaks . This application provides several options to configure your desktop and system appearance such as applying dark theme, changing fonts, adding startup application, etc. To use this tools, you can follow this instruction: - In terminal run: > sudo apt install gnome-tweaks gnome-tweak-tool  - Then open the application by running: > gnome-tweaks  Pomodoro . It helps you to manage time according to the pomodoro technique. You can install this app through Ubuntu Software Center. VLC . It is open source multimedia player with plenty...