Skip to main content

Posts

Showing posts from January, 2018

Overheating Intel Nehalem/Westmere Laptop

If you are using Intel {Nehalem} processor running Samsung motherboard, you may face overheating problem and 'catastrophic shutdown': a term which is scary and in reality, it can be. Loss of data and corrupted filesystems or (hopefully you have backed up last week) corrupted hard drive. There maybe a easy solution such as disabling turbo boost in the Bios. (Unfortunately, Samsung RF410 doesn't have such easy solution.) *Digression* If you are booting Windows 10, you can change the 'power options' setting to 'power saver' or 'balanced' mode. Further tweaks include going to 'change advanced power settings' > 'Processor power management': 1) set 'Maximum processor frequency' to a value such as 2000 Mhz (or any value that is lower than your maximum frequency) and, NB: Do ensure your 'Minimum processor state' is set at 50% or higher if you are running heavy duty program. 2) under 'System cooling policy'

Changing Username on Debian sysvinit or systemd

Sometimes we feel there is a need to change our username on the GNU/Linux for many different reason. It may be easy or difficult depending on your approach. The easy way out is to boot into recovery as a 'admin priviledged' user and use 'usermod' and 'groupmod' command: 1) usermod -l newusername oldusername 2) groupmod -n newusername oldusername 3) usermod -d /home/newusername  -m newusername The difficult way (or rather more tedious approach) is to use 'vipw' command: 1) vipw -p (replace "oldusername" with "newusername" and "/home/oldusername" with "/home/newusername") 2) vipw -s (replace "oldusername" with "newusername") 3) vigr -g (replace all entries "oldusername" with "newusername") 4) vigr -s (replace all entries "oldusername" with "newusername")

Fixing time on sysvinit and systemd

If you have a system that boot using different GNU/Linux init systems such as sysvinit (aka System 5) and systemd (aka System 500) in addition to proprietary Windows system, you may face incorrect time display on one of the aforementioned system. The difference in time display is dependent on the time difference of your location and the UTC time. Further complication may result from concept like Daylight Saving Time (DST). If the Bios is set to localtime, you may fix it in systemd boot system using 'timedatectl' command like: sudo timedatectl set-local-rtc 1 However, if you are using sysvinit and Bios is using localtime, you can set inform the system that local time is being used using 'hwclock' command like: sudo hwclock --localtime or to synchronize the hardware clock with system time and inform the system using: sudo hwclock --systohc --localtime If Bios is using UTC time, you may revert the change with 'timedatectl' like: sudo timedatectl set-lo

Unifi Webgui Repair

Chances are if you run the following setup to harden the Ubiquiti Unifi setup after following instructions at Ubiquiti forum, you are likely to run into problem after each update. The forum article to harden Unifi setup is here "Linux  Unifi Controller default Debian setup is grossly insecure: https://community.ubnt.com/t5/UniFi-Feature-Requests/Linux-Unifi-Controller-default-Debian-setup-is-grossly-insecure/idi-p/1752863  The steps include the following: 1) systemctl stop unifi 2) groupadd unifi 3) useradd -g unifi -s /bin/false -d /dev/null unifi 4) chown -R unifi:unifi /var/log/unifi /var/lib/unifi 5) rm -rf /var/run/unifi 6) cat > /etc/systemd/system/unifi.service.d/security.conf <<EOF [Service] RuntimeDirectory=unifi User=unifi Group=unifi PrivateTmp=true PrivateDevices=true ProtectSystem=full ProtectHome=true NoNewPrivileges=true EOF 7) systemctl daemon-reload 8) systemctl start unifi If you run Fail2ban, it probably shows an error and yo

Repairing Fedora Grub using Fedora Live USB

First, Prepare the Fedora Workstation Live CD using Fedora Media Writer. Next, run the Workstation Live CD and run the console. Then, enter the following commands if you are running the separate boot and root partition: 1) sudo mount /dev/sdaX /mnt Note: sdaX is the root partition 2) sudo mount /dev/sdaW /mnt/boot Note: sdaW is the boot partition The following files are essential for running the essential processes for repairing grub and shall be mounted: 3) sudo mount --bind /dev /mnt/dev 4) sudo mount --bind /proc /mnt/proc 5) sudo mount --bind /sys /mnt/sys 6) sudo mount --bind /var/run /mnt/var/run Now, you are ready to go into the Fedora partitions to repair the grub files. The path should be changed to root user from liveuser> to root>: 7) sudo chroot /mnt If you are running dual boot Windows and Fedora system, the following command will replace the Metro Interface: 8) grub2-install /dev/sda With a dual-boot or multi-boot systems, the follow