Skip to main content

5 - Apps Tuning Tutorials

5.1 - How To Clean The Bash Commands History File?

Step 1 - Clean The ZSH History:

truncate -s 0 ~/.zhistory; truncate -s 0 ~/.bash_history

Step 2 - Bash Commands History Backup:

sudo ./manager-linux-x64.run
npm install --save @easyops-cn/docusaurus-search-local
xnpm-doc
xnpm-bs
xnpm-du
exa --tree --list
ncu -u
npm run build
npm run dev
pdftoppm -png out.pdf out
marp Chess\ Tactics\ Crash\ Course\ -\ Part\ 2.md -o out.pdf --allow-local-files
xupdate
xclean

5.2 – How To Configure Sublime?

  • Step 1 - Go to (Tools → Command Palette → Install Package Control).
  • Step 2 - Go to (Tools → Command Palette) then type: “Install Package”.
  • Step 3 - Install (Color Highlight), (HTML-CSS-JS Prettify), (JSPrettier), (PHPCS), and (Anaconda).
  • Step 4 - Go to (Preferences → Settings), remove everything then type:
{
"color_scheme": "Packages/Color Scheme - Default/Mariana.sublime-color-scheme",
"font_size": 12,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"theme": "Default.sublime-theme",
"trim_trailing_white_space_on_save": true,
"word_wrap": "auto",
"ui_scale": 2.0,
}
  • Step 5: Go to (Preferences → Key Bindings), remove everything then type:
[
{ "keys": ["f8"], "command": "permute_lines", "args": {"operation": "unique"} },
{ "keys": ["ctrl+b"], "command": "insert_snippet", "args": {"contents": "**${0:$SELECTION}**"} },
]
  • Step 5 - Remember the below Sublime shortcuts:
  • Find : Ctrl + F
  • Replace : Ctrl + H
  • Find in files : Ctrl + Shift + F
  • Find next : F3
  • Add Prefix/Suffix : Ctrl + Shift + L then click (Home) or (End) keys
  • Convert To Title Case : Edit → Convert Case → Title Case

5.3 – How To Run C# Console Scripts With Visual Studio Code?

Step 1 – Install The Following:

yay -S --needed --noconfirm dotnet-sdk dotnet-runtime net-tools mono msbuild

Note: Make sure to configure Visual Studio Code from (Step 5.3).

Step 2 - Download & Install VS Code

https://code.visualstudio.com/Download

Step 3 - Create a new Console App:

Navigate to the directory of the script, then open your terminal and type:

dotnet new console

Step 3 - Fix CSharp Code Runner

  1. Click Ctrl + Shift + P then search for settings.json then click on it.
  2. Find "script-cs" and replace it with "dotnet run".
  3. Repeat (Step 1) then find "code-runner: Run In Terminal" and check it.

Step 4 - Open The Project Folder

Open the project folder using Visual Studio Code then compile and run the Console app.


5.4 – How To Install & Configure Unity?

Step 1 – Install UnityHub from the official website:

https://unity.com/download

Step 2 – Open your terminal and type the following:

yay -S --needed --noconfirm visual-studio-code-bin; yay -S --needed --noconfirm dotnet-sdk dotnet-runtime net-tools mono msbuild

Step 3 – Tune VSCode with Unity:

Change your code editor preference in Unity by doing the following: Edit -> Preferences -> External Tools: /usr/bin/code

Step 4 - Tune C# Extension of VSCode:

Go to the settings of the C# Extension of VSCode then locate the Omnisharp: Use Global Mono. Set this one to "always".

Note 1: If the code completion is still not working, then downgrade the VSCode from Unity to a lower version then try again. You can do so from >> Window > Package Manager > Visual Studio Code Editor. Choose a lower version then click the button of "Update to X.X.X" from the lower right corner.

Note 2: When trying again, make sure to restart both Unity and VSCode. Then go to Unity > Assets > Reimport All.


5.5 - How To Adjust Scaling For Flatpak Applications

Step 1 - Locate your application in the following directory:

/var/lib/flatpak/exports/share/applications/

Step 2 - Edit the .desktop file using a text editor program.

Step 3 - Locate the Exec option and edit it by adding env GDK_SCALE=2.0 and --force-device-scale-factor=2.0.

Check the example below that covers the "Unity" app for reference:

Exec=env GDK_SCALE=2.0 /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=start-unityhub --file-forwarding com.unity.UnityHub --force-device-scale-factor=2.0 @@u %U @@

5.6 – How To Mount Hard Disks?

Step 1 – Make a mount point, call it anything you like:

sudo mkdir /media/2tb

Step 2 – Mount the right partition:

sudo mount -o ro /dev/sda1 /media/2tb

Step 3 – Un-mount the disk when you are done:

sudo umount /media/2tb

5.7 – How To Edit The Hosts File?

Open the terminal then type the following command:

kate "/etc/hosts"

5.8 – How To Create A Bash Script?

Step 1 – Create a new file and name it anything you want, then use the extension of “.sh”. Then open the newly created file and type the following at the top of it:

#!/bin/bash

Step 2 – Write any command you want inside the file then save it. Step 3 – Edit the properties and define its access permissions and mark it as executable.


5.9 - How To Scale Up Wine Applications?

  1. Open your terminal: (Ctrl + Alt + T)
  2. In the shell, Enter the command
    winecfg
  3. A configuration window would open.
  4. Switch to the Graphics tab in the window.
  5. Under the screen resolution section.
  6. Use the slider to set the DPI settings for your wine applications.
  7. Click on "OK".

For Reference: https://toolspond.com/wine-scaling/


5.10 – How To Crack FontAwesome Pro Icons?

  1. Get the latest version number from: https://github.com/FortAwesome/Font-Awesome/releases
  2. Copy: https://kit-pro.fontawesome.com/releases/v6.7.2/css/pro.min.css
  3. Replace the version with the latest version number.
  4. Download the files below:
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-light-300.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-light-300.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-regular-400.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-regular-400.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-solid-900.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-solid-900.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-thin-100.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-thin-100.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-duotone-light-300.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-duotone-light-300.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-duotone-regular-400.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-duotone-regular-400.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-duotone-solid-900.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-duotone-solid-900.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-duotone-thin-100.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-duotone-thin-100.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-light-300.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-light-300.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-regular-400.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-regular-400.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-solid-900.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-solid-900.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-thin-100.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-thin-100.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-duotone-light-300.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-duotone-light-300.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-duotone-regular-400.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-duotone-regular-400.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-duotone-solid-900.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-duotone-solid-900.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-duotone-thin-100.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-sharp-duotone-thin-100.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-brands-400.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-brands-400.woff2
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-v4compatibility.ttf
https://site-assets.fontawesome.com/releases/v6.7.2/webfonts/fa-v4compatibility.woff2
  1. If required, you can also download specific CSS files depending on your needs:
https://site-assets.fontawesome.com/releases/v6.7.2/css/all.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/light.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/regular.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/solid.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/thin.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/duotone-light.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/duotone-regular.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/duotone-thin.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/duotone.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/sharp-light.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/sharp-regular.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/sharp-solid.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/sharp-thin.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/sharp-duotone-light.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/sharp-duotone-regular.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/sharp-duotone-solid.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/sharp-duotone-thin.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/brands.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/fontawesome.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/svg-with-js.css
https://site-assets.fontawesome.com/releases/v6.7.2/css/v4-shims.css
  1. Upload everything to the cloud.

5.11 - Guide to Using ESLint and Prettier on Local Projects

Prerequisites

  • Node.js and npm should be installed. If not, follow these steps:
yay -Syu; yay -S --needed --noconfirm nodejs npm nvm

Step 1: Initialize Your Project

  1. Create a new project directory (or navigate to your existing project directory):
mkdir my-project
cd my-project
  1. Initialize the project with a package.json file:
npm init -y

Step 2: Install ESLint and Prettier Locally

  1. Install ESLint:
npm install --save-dev eslint
  1. Install Prettier:
npm install --save-dev prettier
  1. Install ESLint Prettier Plugin and Configurations:
npm install --save-dev eslint-config-prettier eslint-plugin-prettier

Step 3: Configure ESLint

  1. Create an ESLint configuration file:
npx eslint --init
  • Choose "To check syntax, find problems, and enforce code style."
  • Select "JavaScript modules (import/export)".
  • Choose your project framework (e.g., "React" if applicable, otherwise "None of these").
  • Select "Does your project use TypeScript?" (Choose according to your project setup).
  • Choose "Where does your code run?" (Node, Browser, etc.).
  • Choose a popular style guide (e.g., "Airbnb", "Standard", or "Google").
  • Select "JavaScript" for the format of your configuration file.
  • Allow the installation of necessary dependencies.
  1. Modify .eslintrc.json to integrate Prettier:
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint",
"prettier"
],
"rules": {
"prettier/prettier": "error"
}
}

Step 4: Configure Prettier

  1. Create a Prettier configuration file (.prettierrc):
{
"semi": true,
"singleQuote": true,
"printWidth": 80
}
  1. Create a .prettierignore file to specify files and directories to ignore:

    node_modules
    dist

Step 5: Add Scripts to package.json

  1. Update the scripts section in package.json to include linting and formatting commands:
{
"scripts": {
"lint": "eslint .",
"format": "prettier --write ."
}
}

Step 6: Running ESLint and Prettier

  1. Lint your project:
npm run lint
  1. Format your project:
npm run format

Example Configuration Files

.eslintrc.json:

{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint",
"prettier"
],
"rules": {
"prettier/prettier": "error"
}
}

.prettierrc:

{
"semi": true,
"singleQuote": true,
"printWidth": 80
}

.prettierignore:

node_modules
dist

package.json (scripts section):

{
"scripts": {
"lint": "eslint .",
"format": "prettier --write ."
}
}