Lo-Fi Python

Mar 22, 2020

Easy Tune-ups For Your Windows Computer

This post covers 6 handy Windows tools:

  1. Windows Experience Index
  2. Disk Cleanup
  3. Windows Update Troubleshooter
  4. Windows Update
  5. Microsoft Support and Recovery Assistant
  6. Disk Defragmenter

First, get your baseline Windows Experience Index score.

These metrics are a way to monitor your system's performance over time.

  1. Go to "Control PanelSystem and SecuritySystem"
  2. Select "Your Windows Experience Index needs to be refreshed."
  3. Note the metrics you see and the last updated date. If you've never refreshed them, these are likely your computer's factory scores.
  4. Then click "Refresh Now" and note the results. These are your computer's current scores.
check_Windows_Experience_Index

Run Disk Cleanup

The name says it all. Go to the Start menu and search 'Disk Cleanup'. Running this freed up 40 GB of C: drive space for me.


Install OS patches and software updates with Windows Update.

First, troubleshoot Windows Update to fix any errors.

tdhotingtrpot2

The Windows Update Troubleshooteris supported by Windows and may help with updates that fail. I downloaded the troubleshooter for Windows Update and BITS, the Windows Background Intelligence Transfer System.

The troubleshooter analyzes Windows Update and tries to fix the errors it finds. After running, it provides a status update on the issues it finds.

Run Windows Update to upgrade your software.

Windows Update usually updates your software reliably. However, some updates may fail or are not triggered automatically. Installing updates, especially security patches for your operating system is typically a good idea.In my case, several Windows 7 OS security patches had not auto-updated, some from 6 months ago.

Checking for Software Updates

  • Go to your start menu and search for 'Windows Update'.
  • I clicked 'Check online for updates from Windows Update' also.
  • When you restart your computer, use a power cord for your laptop.
  • I found more new updates twice after installing new updates and restarting my system.  Some updates are required before another update may be installed.

Microsoft Support and Recovery Assistant

Got Microsoft Errors? Check out the Microsoft Support and Recovery Assistant. It may help you if you're having trouble with Microsoft Office, Skype or any other Windows tools.

options_recovery

Finally, defragment your C: drive.

Defragmentation is like spring cleaning for your computer's hard disk. It optimizes your drive's data for more efficient computing and frees up space for other activities.

  1. Go to your start menu and search for 'Disk Defragmenter'.
  2. Click 'Analyze disk' to check your C: Drive's fragmented rate.
  3. If the fragmented rate is above 10%, Windows recommends to defragment your C: Drive. As you can see below, mine had a whopping 48% fragmentation rate. 😨 My poor computer had never been defragged in 2.5 years of use.
defragment_results

46% Less Fragmented Disk Space After Two Defrags

Running the defragmenter once reduced my drive's fragmentation from 48% to 32%. Re-running the defragmenter dropped my C: drive to a 2% fragmented rate. That's more like it. 🤓

Fragmentation makes your hard disk do extra work that can slow down your computer. Removable storage devices such as USB flash drives can also become fragmented. Disk Defragmenter in Windows rearranges fragmented data so your disks and drives can work more efficiently.

My Windows 7 System Improvement Results

  • Raised Windows Experience Index base sub-score from 4.9 to 5.0/7.9.
  • Added 40 GB of hard drive space thanks to Disk Cleanup.
  • Patched operating system security vulnerabilities and all software is up to date.
  • Fixed any misbehaving Windows products.
  • Decreased fragmented drive space from 48% to 2%. Windows recommends keeping it under 10%.

On paper, that looks great. Hopefully it means less spinning lag wheels and programs not responding when you really shoulda saved that document...  We'll see.

Apr 25, 2019

Installing Debian 9 Stretch Linux OS on a Dell Inspiron Laptop and Configuring the Wifi Network

Yesterday, I converted an 11-year old Dell Inspiron E1505 from Windows XP to Debian 9 Stretch. I may have overwrote my Windows XP OS. I do not care if I lost it since it's a vulnerable and outdated OS, which is no longer supported by Microsoft. I encountered difficulty with getting the wifi to work on Debian, but was able to find a solution using Wicd. Here are the steps I followed to do it all.

Using The Debian Installer-Loader

  1. First, back up your Windows computer files. Then download the Debian-Installer Loader Windows executable from the Debian wiki.
  2. Click the downloaded executable and IMG_20190423_184816999follow instructions. I followed the default settings all the way through.
  3. You may need to choose your own partitioning settings to ensure Windows is preserved if desired.
  4. During installation, choose your Linux collection. I chose Xfce because it seems to be highest ranked among Linux users and "not just helpful for older computers where few system resources are available, but also simply for those who want to get the most out of their systems." Gnome and KDE are other popular options.
IMG_20190423_184023738

After completing installation, restart your computer and select your new OS on boot-up. The following error codes displayed for me while starting up, signaling missing wifi firmware.

ERROR Failed to load firmware!
b43ssb0:0: firmware: failed to load b43/ucode5.fw (-2)
b43ssb0:0: firmware: failed to load b43-open/ucode5.fw (-2)
b43-phy0 ERROR: You must go to https://wireless.wiki.kernel.org/en/users/drivers/b43#devicefirmware and download the correct firmware for this driver version.

It took me a few boot-ups before I realized what this error message meant. In the rest of this post I am trying to figure out and fix what is wrong before I saw the error message. I enjoyed learning how to introspect Linux networks, but if I were trying to fix this problem again, I'd go to directly to *`this page <http://linuxwireless.sipsolutions.net/en/users/Drivers/b43/>`__*, which is linked to from the link in the error message, and try the solution there first.

Post Installation Setup

Open up the terminal once you're into your new Desktop OS and enter the below commands.

su -
apt-get install sudo -y usermod -aG sudo yourusername

1) Enable yourself as root user.

2) Install sudo.

3) Give yourself sudo user permission.

Optional: Replacing Network-Manager With Wicd

This Debian 9 package ships with Network-Manager. After logging in, I wasn't sure why wifi was not working, so I decided to remove Network-Manager and install Wicd. (This was before I realized what the error code displayed on boot-up meant.) Wicd is a Linux network managing alternative and it's built with Python, by the way. I followed these instructions to execute the below commands.

uninstall nm
sudo apt-get install -d --reinstall network-manager network-manager-gnome
install wicd
sudo apt-get install wicd-gtk

After installing Wicd, my Ethernet connection was not working. This fixed it for me:

sudo ifconfig eth0 up

Troubleshooting Linux Wifi & Inspecting Your System

Now, let's check for enabled network interfaces. "wlan0" is usually the name of the wireless interface. Does wlan0 show when you enter this command? If not, then you may need to update your wifi firmware. This was the case for me. Below is an output where wlan0 is correctly configured.

sudo ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:25:a5:cf:38:7d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 17
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1 (Local Loopback)
RX packets 4 bytes 240 (240.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 240 (240.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 191.142.1.297 netmask 255.255.255.0 broadcast 182.138.5.255
inet6 2601:241:8c00:50ea:21a:92ff:fe0d:7531 prefixlen 64 scopeid 0x0
inet6 fe80::22a:42tf:fe0d:7531 prefixlen 64 scopeid 0x20 ether 00:2a:92:2d:45:51 txqueuelen 1000 (Ethernet)
RX packets 8509 bytes 4639778 (4.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6206 bytes 923792 (902.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Check wlan0 is not blocked on kill list.

sudo rfkill list all

Some computers have a "kill switch" for wifi. This command lists any blocked interfaces. If it is blocked, this thread might be useful. If nothing shows when you run this command, or if you see wlan0 is not blocked, carry on.

Check which wifi controller you have. This thread provides more info on what this means.

lspci -nn | grep -e 0200 -e 0280
03:00.0 Ethernet controller [0200]: Broadcom Limited BCM4401-B0 100Base-TX [14e4:170c] (rev 02)
0b:00.0 Network controller [0280]: Broadcom Limited BCM4311 802.11b/g WLAN [14e4:4311] (rev 01)

Find your system architecture. This determines which firmware you should download in the next step.

sudo dpkg --print-architecture

First, read here to determine the right packages for your Linux system. Then download the appropriate missing wifi firmware. For Debian, I downloaded the two packages below.

  1. b43-fwcutter 2) b43-installer

"cd" into the directory with .deb files. Run the below commands to install the new firmware, then reboot your computer. The last two commands are adapted from this thread.

sudo dpkg -i firmware-b43-installer_019-3_all.deb
sudo dpkg -i firmware-b43-fwcutter_019-3_i386.deb
sudo modprobe -r b43
sudo modprobe b43

Edit Wicd preferences to set wlan0 as the wireless interface if needed.

change_wicd_settings

Success! Wireless networks are now showing.

wicd_success

Wrapping Up

I'd like to thank the awesome people who contributed to the Debian Installer-loader and all the help in Linux forums that enabled me figure this out. I'm new to the world of Linux but already enjoying diving into this operating system. Its ability to do just about anything from the command line are a lot of fun. I am now running two Linux systems, one on my Dell and another running Ubuntu that I installed on a Chromebook with Crouton. Both have been relatively painless to set up. It this case, it turned a sluggish laptop into a very capable machine. They should call it Lit-nux :)

Full Disclosure

This worked on my computer for a few days before the keyboard stopped working correctly on my computer. Typing became impossible because the keys didn't work or entered the wrong letters when pressed. I'm not sure what the cause of it was, but consider that before attempting this on a machine. Be prepared to lose it. If you really need the machine to be functional, it may not be a great idea to try this. This was attempted on an old beat up computer. I would try this method of porting a Windows machine to Linux again as a salvage project or on a low-risk Windows machine if I had one lying around.