Tagged: my_notes

Exploring with Gentoo Linux (Part 2)

Part 2 - Configuring Other Applications

Git:

Git is distributed revision control and source code management software. I need to install git first because I have dotfiles and config files for the applications I need. # emerge --ask dev-vcs/git

After the installation, following config settings need to be done at least.$ git config --global user.name "my_username" $ git config --global user.email "my_email"

Then, download the dotfiles from Github.$ cd ~/ $ git clone https://github.com/ubyt3m3/dotfiles.git ... $ ls dotfiles

st:

st is a simpke terminal for X. I use this terminal until I finish setting up urxvt. savedconfig USE flag lets you save a customized configuration file to /etc/portage/savedconfig/x11-terms/st.# echo "x11-terms/st savedconfig" > /etc/portage/package.use/st # emerge --ask x11-terms/st

Rxvt-unicode:

Rxvt-unicode (urxvt) is THE terminal emulator that I must have in my work environment since OpenBox days. It's fast, lean, highly customizable and can display different fonts. I have another post regarding how I customize it.

Gentoo Linux allows you to choose what options to enable or disable using the USE flags. The options I wanted to enable were the followings:

  • 256-color: Enable 256 color support
  • unicode3: Use 21 instead of 16 bits to represent unicode characters
  • xft: Build with support for XFT font renderer (x11-libs/libXft)
  • gdk-pixbuf: Build with support for image loading and manipulation. Need this for image previewing in ranger

There are a few ways to do this in Gentoo. Since I wanted to do per package base, I set it in the /etc/portage/package.use/ directory:# echo "x11-terms/rxvt-unicode 256-color unicode3 xft gdk-pixbuf" > /etc/portage/package.use/rxvt-unicode # emerge --ask x11-terms/rxvt-unicode or set it during the installation:# USE="256-color unicode3 xft gdk-pixbuf" emerge --ask x11-terms/rxvt-unicode

Its config file is ~/.Xresources.

Updated: Updated article about Xresources

Neovim:

Neovim is a fork of Vim that promised to fix issues with Vim and provide a better out-of-the-box experience for Vim users. It also includs a built in terminal emulator.

Installation is simple.# emerge --ask app-editors/neovim

Its configuration file is in ~/.config/nvim/init.vim and I use vim-plug plug-in to handle installation of other plug-ins. Once my init.vim is copied to its config directory, run nvim. It should install defined plug-ins automatically. If it doesn't, go into the Normal/Command mode by hitting Esc. Then type :PlugInstall. This should trigger installation of plug-ins.

PCManFM:

PCManFM is a GUI file manager. It's light weight and has features like displaying mounted drives and dual panes. I don't usually use it but it's good to have as a backup.# emerge --ask x11-misc/pcmanfm

Faenza Icons and gtk2 theme:

Faenza is an icon theme for Gnome. I've looked around and liked it the most. It can be installed from Portage. # emerge --ask x11-themes/faenza-icon-theme

Icons and GTK2 theme can be applied from lxappearance, but it needs to be installed first. # emerge --ask lxde-base/lxappearance

My customized Morning Glory needs to be extracted to ~/.themes/.$ tar -xzvf MorningGlory.tar.gz -C ~/.themes/

Once the icons and theme have been prep'ed, run lxappearance to apply them.

For the theme, click on the Widget tab. Morning Glory should be listed in the left pane.

Icons

For the icon theme, click on the Icon Theme tab, and choose Faenza from the list in the left pane.

Ranger:

Ranger is a text-based file manager. The best feature for me is the vi-style keybinding. # emerge --ask app-misc/ranger

The default directory is ~/.config/ranger/ and you can copy the default configuration files to this directory.$ ranger --copy-config=all

Copied files are the followings:

  • rc.conf - startup commands and key bindings
  • commands.py - commands which are launched with :
  • rifle.conf - applications used when a given type of file is launched.

For image preview, w3m needs to be installed.# emerge --ask www-client/w3m

Then, enable image preview in ranger's config file, ~/.config/ranger/rc.conf.$ nvim ~/.config/ranger/rc.conf ================================== ... set preview_image true ... set preview_images_method urxvt

Cmus:

Cmus is a small, fast and powerful console music player. # emerge --ask media-sound/cmus

TO DOs: set ups

Scrot:

Scrot is a command line screen capture utility.# emerge --ask media-gfx/scrot

Neofetch:

Neofetch is a bash script that displays the system information such as installed OS, kernel version, CPU, memory, etc... next to an ASCII operating system logo.# emerge --ask app-misc/neofetch

Chromium

Chromium is a free and open-source web browser from Google. It features a minimal user interface, powerful web development tools, and a built in task manager. There is a proprietary version of browser called Google Chrome

with more features than Chromium.# emerge --ask www-client/chromium

Be warned: Compiling Chromium can take a significant amount of CPU time and system memory, and it took nearly 7 hours to complete compiling.

Fonts:

I use following fonts for urxvt and i3.

  • Inconsolata
  • Kochi (for Japanese)
  • Font Awesome (for font icons)
  • Deja Vu
# emerge --ask media-fonts/inconsolata # emerge --ask media-fonts/kochi-substitute # emerge --ask media-fonts/fontawesome # emerge --ask media-fonts/dejavu

That's all!
-gibb

Forced Reboot/Shutdown on Linux

In my previous post, I mentioned my old PC that had Slackware Linux on it went haywire because of hardware issues, and I installed Gentoo Linux for experimemts. At the last part of the installation, I couldn't reboot the system with the following error message:# reboot bash: /sbin/shutdown: Input/output error

I searched the Net and they said the error was due to bad blocks or something hard drive related issues. But it's a brand new hard disk and I most likely messed up the installation somewhere. Another quick research showed me ways to reboot/shutdown without the commands or pressing tje button.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

To force reboot or shutdown, follow below steps.

Reboot:# echo 1 > /proc/sys/kernel/sysrq # echo b > /proc/sysrq-trigger Forced Shutdown:# echo 1 > /proc/sys/kernel/sysrq # echo o > /proc/sysrq-trigger

That's all!
-gibb

System Info

Model number: HP Pavilion Elite HPE-360z
Product number: WX520AV
MOBO mfr: Foxconn H-RS880-uATX
Aloe-GL8E
Chipset: AMD 785G
Processor: AMD Phenom II X6 1090T Black Edition, 125W, AM3, 9MB Cache, 3200MHz
Memory: 4096MB DDR3-1333 PC3-10600 SDRAM x 4
Hard disk1:
Hard disk2: WDC WD10EZEX-08WN4A0
Graphic Card: NVIDIA Corporation GF106 [GeForce GTS 450]
Ethernet Card: RTL8111/8168/8411 PCI Exp Gigabit Ethernet Controller (r8169)
Realtek Semiconductor Co., Ltd.

That's all!
-gibb

HPE-360z Became Unstable…

Sometime toward the end of 2019, my 10-year-old pc (HP Pavilion Elite HPE-360z), started acting up. Its fan noise went really high time to time, and the system randomly froze up or rebooted automatically. First thing I suspected was the health of hard disks because I noticed that I started seeing a bunch of what looks like kernel messages or kernel panic.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Checking the Hard Disks

First, I ran e2fsck on the suspected device:# e2fsck -p -y -f -v /dev/sda1

It returned with no errors. I also ran the command to check bad blocks on a device:# badblocks -v /dev/sda1 > badsectors.txt

This passed with no bad blocks... Then, I learned about S.M.A.R.T.(Self-Monitoring, Analysis and Reporting Technology). It helps to detect, report and possibly log their health status and works better than the badblocks command on SATA and SCSI devices.

When the smarctrl command was run to view its log, there were errors reported.# smartctl -l error /dev/sda smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.19.97-gentoo] (local build) Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Error Log Version: 1 Warning: ATA error count 1800 inconsistent with error log pointer 1 ATA Error Count: 1800 (device log contains only the most recent five errors) CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after 49.710 days. Error 1800 occurred at disk power-on lifetime: 56133 hours (2338 days + 21 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 04 51 fd 81 f4 2c a0 Error: ABRT Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- b0 d4 fd 81 4f c2 a0 00 00:04:40.097 SMART EXECUTE OFF-LINE IMMEDIATE b0 d0 fe 00 4f c2 a0 00 00:04:39.810 SMART READ DATA b0 d8 fe 00 4f c2 a0 00 00:04:39.497 SMART ENABLE OPERATIONS b0 d0 ff 00 4f c2 a0 00 00:04:38.150 SMART READ DATA b0 d8 ff 00 4f c2 a0 00 00:04:37.834 SMART ENABLE OPERATIONS

So, I replaced the bad disk with another one that was laying around, thinking this would solve the issue for the time being. I was wrong...

Issues Not Resolved...

While I was installing Debian 10 on this new disk, the installation still froze up. Uh, oh. That disk certainly had issues but that didn't seem to be the only problem.

Next, I suspected memory modules. I reseated all 4 modules but that didn't help. I then installed memtest86+ and ran it. While it was being executed, I yet noticed that the cpu temperature was sky rocketing. It went as high as over 100F degrees!!! I should have known that the CPU fan was complaining for a while with loud noise.

Really, Really Dusty CPU fan

In the past, I opened HPE-360z time to time and blew dust with compressed air bottle, but I never cleaned the CPU heatsink/fan. Oh boy, I was so surprised to see chunks of dust stuck in the fan and between plates. I couldn't believe how much dust it has collected over the years (the fan on GPU was as dusty as CPU fan as well). I also noticed that CPU was stuck onto its heatsink and I was unable to separate them. During its process, I damaged some pins from CPU... so I decided to upgrade its CPU.

It's Time To Upgrade

Yeah, upgrading 10-year-old PC wasn't that easy to find parts for it. You might think that it's better to buy a new, better system but I felt that I've been with this one for 10 years and maxed out the memory size and all. I couldn't really bring myself to toss it out, just like that.

The highest kind of CPU that my MOBO can take was AMD Phenom II X6 1090T Black Edition according to the HP website and others. Since the old CPU was stuck on its heatsink and couldn't boot it up anymore, I wasn't sure if getting this CPU was an upgrade. Nevertheless, I decided to get this one and another heatsink and fan.

After Upgrading the CPU

I was a bit worried that it wouldn't boot up due to needing the BIOS update, but the system booted up successfully with new CPU and heatsink/fan. Maybe the old CPU was AMD Phenom II 1090T after all.

Now, my PC is working and better than before. No complaining from CPU fan anymore. I still have that bad hard disk and need to do something about it, but that's something to deal with later.

That's all!
-gibb

Resetting MariaDB “root” Password on Termux

I just started learning Laravel framework for my self-interest and wanted to play with it on my Galaxy Note 8 since I already had Termux installed on it. A tutorial I found from Google search uses mySQL so I installed MariaDB with the following command:$ pkg install mariadb

The installation was successful, but when I tried to log in as root with no password, it failed with ERROR 1698 (28000): Access denied for user 'root'@'localhost'. I tried various passwords but none was successful. So, I searched for a solution.

Disclaimer: The information described here is from Termux Wiki. This information below is solely used for my purpose and may not be suitable for others.

Post Installation Tasks:

After the first login attempt, I realized that it was not connecting to mysql server because of the following error message:$ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/data/com.termux/files/usr/tmp/mysqld.sock' (2)

Was mysql server not running...? $ ps -aux | grep mysql xxx 8451 0.2 1.4 560836 79496 ? S

It looks to me, it's running fine. Is mysqld.sock file missing from the directory?:$ ls ../usr/tmp/ $

Ok, the directory was empty. So, I manually started mysql daemon with the following command:$ mysqld_safe -u root & [1] 8379 191029 20:48:14 mysqld_safe Logging to '/data/data/com.termux/files/usr/var/lib/mysql/localhost.err'. 191029 20:48:14 mysqld_safe Starting mysqld daemon with databases from /data/data/com.termux/files/usr/var/lib/mysql

After this, mysqld.sock was created.$ ls ../usr/tmp mysqld.sock $

Resetting root Password:

According to the wiki, the mariadb installation initializes the database with 2 all-privilege accounts, root and my Termux local user. With this local user, I can reset the root password. (But is there a point of resetting the root password at this point since my local user also has all privileges?)$ mysql -u $(whoami) Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 8 Server version: 10.4.6-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use mysql; MariaDB [(mysql)]> set password for 'root'@'localhost' = password('YOUR_ROOT_PASSWORD_HERE'); MariaDB [(mysql)]> flush privileges; MariaDB [(mysql)]> quit;

Now, I can log in as root.$ mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 8 Server version: 10.4.6-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>

That's all!
-gibb