Main Page
Welcome to TheBestLinux.com Wiki!
TheBestLinux.com is now co-located in multiple data-centers globally!
New Servers Added in Amsterdam & Singapore!
The VM servers making up TheBestLinux.com and it's accompanying sites and services are physically located in data centers in Los Angeles, Amsterdam, Singapore & Western Oregon. If you are interested in any of these types of setups, let me know!
TheBestLinux.com is your source for Linux Operating System Solutions & Information,
and embraces "Open Source" sharing and collaborative development of useful solutions.
TheBestLinux.com not only specializes with Linux based systems, with over 25 years of specializing in Linux based solutions, but also has over 40 years of experience with all things related to computers and computing, both hardware and software, as well as IoT - "The Internet of Things", embracing Internet based technology!
Ansible Information & How-To's
Here is the Ansible info.
New Docker & Kubernetes Information Section Created!
Check out my new Container section with info on Docker & Kubernetes and more Right Here!!!
New Website Development & Programming Section Created
Learn HTML5, CSS & Javascript to create killer websites! - Check it out here!
New PHP Info Micro How-To Right Here!
Newest Linux Info, Tips & Tricks!
Hardware Specific Information
This section is about computer hardware, both finding out what hardware is in a running Linux computer as well as getting specific types of hardware to work in a Linux environment.
One of my favorite commands for finding out exactly what hardware devices are part of a running Linux computer is "dmesg"! I have used this command for over 30 years now, and find it's really useful regardless of the actual Linux distribution a system is running.
The "dmesg" command(without the quotes) shows the kernel messages as they relate to the hardware the Linux kernel finds when booting up. You can go through the output of the command one page at a time by piping it into the "more" command.
Here's an example of running the "dmesg" command and piping it into the "more" command. Note that the "pipe" is the straight vertical line, usually above the ENTER key on your keyboard, as a shifted backslash(\). The pipe looks like this: | Here's the example:
[jamie@server.dawgland.com:~]$ dmesg | more
To exit viewing the "dmesg" output while piping it's output into the "more" command, use the "Q" key to Quit the "more" utility.
You can also narrow down the output of the "dmesg" command to search for specific items in the "dmesg" output, by piping the "dmesg" output into the "grep" command(grep stands for "Get Regular ExPression") and using a keyword to search for something specific. I like to give the "grep" command the -i switch, to allow it to find both upper and lower case results.
Here's an example of piping the output of the "dmesg" command into the "grep" command using the -i switch:
[jamie@server.dawgland.com:~]$ dmesg | grep -i bios [10785680.025014] Hardware name: LENOVO ThinkServer TS140/ThinkServer TS140, BIOS FBKT48AUS 08/26/2013
Here's another example, this time from one of my virtual DNS servers running on my personal VM server:
[jamie@ns1.dawgland.com:~]$ dmesg | grep -i bios [ 0.000000] BIOS-provided physical RAM map: [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable [ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001ffeffff] usable [ 0.000000] BIOS-e820: [mem 0x000000001fff0000-0x000000001fffffff] ACPI data [ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved [ 0.000000] SMBIOS 2.5 present. [ 0.000000] DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 0.000000] ACPI: DSDT 0x000000001FFF0470 002325 (v02 VBOX VBOXBIOS 00000002 INTL 20190509) [2883115.739886] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
As you can see from the above command output, it shows that machine is actually a "VM", a "Virtual Machine". I run a bunch of "virtual machines" on my big main servers, allowing me to have servers that perform specific tasks in my network.
Here's the same command, run on an old 32-bit Dell machine:
root@oldslack:~# dmesg | grep -i bios [ 0.000000] e820: BIOS-provided physical RAM map: [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000027f76fff] usable [ 0.000000] BIOS-e820: [mem 0x0000000027f77000-0x0000000027f78fff] ACPI NVS [ 0.000000] BIOS-e820: [mem 0x0000000027f79000-0x0000000027ffffff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec0ffff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee0ffff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000ffb00000-0x00000000ffffffff] reserved [ 0.000000] SMBIOS 2.3 present. [ 0.000000] DMI: Dell Computer Corporation OptiPlex GX240 /OptiPlex GX240 , BIOS A05 07/19/2002 [ 0.154804] PCI: PCI BIOS revision 2.10 entry at 0xfbe2e, last bus=2
One of the great things about using this command is it usually shows you the actual brand name and model number of the computer it's being run on!
Another handy command I use often to find out if a running Linux computer has a 32 bit architecture/CPU or a 64-bit one is the "getconf" command and specifying the system variable "LONG_BIT". Here's an example:
[jamie@server.dawgland.com:~]$ getconf LONG_BIT 64
The "uname" command is also a very handy tool, as one of it's switches, the -m switch, also will show you if a running system is a 32-bit or 64-bit architecture. If a system is 32-bit, the output of the "uname -m" command will show either "i386" or "i686". With a 64-bit system, the output will be "x86_64".
Here's an example of the output of the "uname -m" command on a 32-bit system:
jamie@oldslack:~$ uname -m i686
And here's the same command, running on a 64-bit system:
[jamie@server.dawgland.com:~]$ uname -m x86_64
CentOS Specific Info
Grub - GRand Unified Bootloader
Grub has been around for a long time, taking over the bootup role on most Linux installations from the "OLD" Lilo tool. Lilo stands for "LInux Loader", in case anyone is interested.
The configuration files for Grub are usually in /boot/grub2/grub.cfg, /etc/grub2.cfg with additional configuration settings in /etc/grub.d/. After a change has been made to any of the grub configuration files, you must re-apply those changes using the grub2-mkconfig command as the root superuser. Here is an example of the usage of grub2-mkconfig:
[root@cos8vm54.dawgland.com:/boot/grub2]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... done [root@cos8vm54.dawgland.com:/boot/grub2]#
Scripts & Other Automation Tools
Shell/Bash Scripts
Display IP version 4 address of first network interface on a Linux machine one-liner:
ip -4 addr show `ip -4 addr | grep -m 1 '2:' | awk '{ print $2; }' | sed 's/\:.*$//'` | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
Conditional Statements
Conditional statements are the basic building blocks of creating scripts that test for certain conditions, and then do something or don't do something, depending on what you want to end results to be.
One of the most common and most useful statements are the "if ... else", to test for a condition to be true or false, or equal to something else, and so on.
Here's a basic example of how "if... else" works. Note that the "if" statements always end with "fi", as seen in this example which tests to see if the MySQL database server is running. This is just the basic begging of the script I am creating, so doesn't do anything other than print statements to the screen as to the results of the test within the "if... else" statement:
#!/usr/bin/bash chksql=`ps ax | grep -v grep | grep mysqld_safe` if [[ -z $chksql ]] then echo "The Database Server is NOT RUNNING!!!" echo "MUST FIX NOW!!!" else echo "All Good!" fi
I will then add code to send an email to me if the DB server is down. Or I can just have the script start the database server back up, or do both! The choice is up to you!
Now, we need to have the script actually fix the issue, if it finds the issue is occuring, as this particular issue is intermittant, so I never know when it will occur, causing one of my websites to break. Here is the final version of the script where we remove the "echo" informational statements and have it fix the MariaDB database server is it happens to be down when the script is run. Here is the final version of the script using the standard systemctl tool:
!/usr/bin/bash chksql=`ps ax | grep -v grep | grep mysqld_safe` if [[ -z $chksql ]] then /usr/bin/systemctl start mariadb & fi
The last step is to automate the running of the script. Since this issue is critical, causing the entire website to be down, I want to run this script at intervals that are not too far apart. I chose to have it run every 5 minutes, and I use the standard Linux/UNIX scheduling tool "CRON".
Cron has a ton of options and will already be configured to your particular Linux distribution to run many maintenance tools, so I will not get into the detail of how Cron works, and what each cron "job", as they are referred to, are actually doing. This is how I created the new cron job. The first step is to edit the crontab as the root superuser:
[root@mail:~]# crontab -e
Then, I add the following line:
*/5 * * * * /usr/local/sbin/ChkMySQL
Use the Vi commands :x to exit saving the file.
You can confirm it created the new cron job by typing "crontab -l", without the quotes. That's an L, for list in this command.
Hard Drives & Other Storage Devices
Hard drives have come a VERY LONG WAY, and are still, in my opinion, the most common and most certain common point of most computer hardware failures. It's not about if a hard drive will die, but WHEN it WILL DIE, because ALL hard drives eventually DIE!!!
That being said, there are many things you can do to help alleviate the horrors of losing a hard drive or other type of storage devices. Some are as simple as following simple basic backup procedures regularly, but that is easier said than done, especially if it needs to be done manually. Automating backups is something EVERYONE should do!!!
Other things you can do is use redundancy, either manually saving copies of important or critical files in more than one location, on more than one device, preferably in different physical locations, so that even disaster recovery is possible! I once read a book titled that about 30-some years ago!
One of the things I really also like to do, on top of backups, is using RAID arrays, such as simple I mirroring, so that every bit of every byte of data is redundantly stored on two mirrored identical hard drives, which is exactly what I do on my main production servers! I use both hardware and software based RAID, and both are rock-hard solid stable and reliable within the Linux operating system! If one hard drive dies, which one always will, the other takes over and when the failed drive is replaced, a mirror image of the other drive is automatically created and synchronized into the mirror RAID array! Suffice it to say, I LOVE RAID!!!
On to actually useful information, instead of my personal long-time experience with thousands upon thousand of hard drives in my lifetime! Here are some very useful hard drive and other storage devices useful commands, in no particular order.
There are many more and I will add them as they come to mind, but off the top of my head, these are the most useful on a day-to-day basis. Each of these command has multitudes of options, arguments, and the like, so I will detail them as I have time. Most require elevated root superuser privileges, so be VERY VERY CAREFUL, and DO NOT HIT the ENTER key until you are certain you have typed the command exactly as you intended and then double and triple check again before you hit the ENTER key!!! There is no going back if you make a mistake as the root superuser, most often, so again, I can't stress enough the important of double and triple checking your commands before committing them!!! Commands run as the root superuser will NOT warn you, or say "Are you sure...", so you MUST BE SURE! Enough on that. You have been warned!
Accessing Data on Windows and Other File Systems on Other Partitions
Coming soon - Detailed step-by-step instructions with screenshots detailing how to access your data on other partitions, such as Windows partitions on dual-boot/multi-boot machines.
XFS Recommended FSTAB settings
Here is an example of my recommended "/etc/fstab" mount option settings for XFS filesystems:
/dev/sda5 /mnt/data xfs rw,seclabel,noatime,attr2,discard,inode64,logbufs=8,logbsize=32k,noquota 0 0
Add Windows Partitions to FSTAB with Correct Read/Write Permissions Using FMASK & DMASK
Although it's easy enough to simply add the partition and mount point of your Windows installation to your /etc/fstab file, so as to allow it to be auto-mounted when the machine is booted up, having the "CORRECT" permissions is another major concern!
In the "old" days, we used to use "UMASK" with a value of 022 as the "standard" way of setting up Windows partitions to be mounted with correct read/write permissions. These days, the "preferred" method is using FMASK and DMASK.
When I first purchased the laptop I am typing on right now, it only had Windows 10 on it, so I used the Linux "parted" tool to shrink down the Windows partition, allowing me to then create Linux partitions on which I then installed my favorite desktop Linux distro, Fedora Linux. My example below assumes your UID & GID are 1000. Adjust as appropriate. If you don't know what a UID is, use Google to look it up. Basically, as it's name implies, UID(User ID), this is the unique number assigned to your user account. UID number 1000 is usually the first normal user created on a Linux system. GID is basically the same thing, but on a group level. On most Linux systems, your main group and group ID is the same as your username and user ID. For instance, in my case on this laptop I am currently using, my username is "jamie", case sensitive without the quotes, and my main group membership is also "jamie". My UID is 1000 and the GID of the "jamie" group is also 1000.
Here is the /etc/fstab contents of this laptop:
# /etc/fstab # Created by anaconda on Tue Mar 9 00:57:29 2021 # # Accessible filesystems, by reference, are maintained under '/dev/disk/'. # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. # # After editing this file, run 'systemctl daemon-reload' to update systemd # units generated from this file. # UUID=dca7d381-2784-4839-8c55-141702999d41 / xfs defaults 0 0 UUID=68e3c043-0b5d-40a6-af84-a39527756962 /boot ext4 defaults 1 2 UUID=c9db933c-2101-4032-ae0d-b359c523c3be /home xfs defaults 0 0 UUID=ec82d8bd-8bcd-4c8e-9a95-217baeb8b004 none swap defaults 0 0 # Added 04-05-2021 by Jamie to correctly auto-mount the Windows partition: UUID=5C2C252E2C25049C /windows ntfs rw,auto,user,fmask=133,dmask=022,uid=1000,gid=1000 0 0
GNOME Desktop Sharing Not Accessable from Windows --> Finally Fixed!!!
After many years of not being able to log into my Linux desktops from work laptops that of course have Windows installed on them, even within my own home network, gsettings comes to the rescure to resolve this long standing issue that's been a major inconveneice for me being a Linux guy working in the corporate world! The solution fixing the terminal menu below got me thinking that gsettings must be able to re-configure the default behavior of modern GNOME desktop's desktop shareing feature, which uses VNC, Virtual Network Computing, and specificially "x11vnc", it's default configuration is a security model not supported by most WIndows VNC clients. Therefore, the easy fix for me is to disable the security when using VNC on my local network(LAN). I actually do use VNC on through the internet as well, but always through an SSH tunnel, so it's highly encrypted!
Anyways, on to the fix. Within a terminal, as your normal user, type this gsettings command and hit the ENTER key:
[jamie@server.dawgland.com:~]$ gsettings set org.gnome.desktop.remote-desktop.vnc encryption "['none']"
If your system uses Vino, as many do, you may also have to type this command and hit ENTER:
[jamie@server.dawgland.com:~]$ gsettings set org.gnome.Vino require-encryption false
You can verify the above command worked and made the desired change by typing this command and hitting the ENTER key:
[jamie@server.dawgland.com:~]$ gsettings list-recursively org.gnome.Vino
You will have to scroll back up through all the data that the above command will provide to find the section you are looking for, or you can grep for it! For instance, modifying the above command to grep for the remote-desktop setting, type this command in a terminal and hit the ENTER key:
[jamie@server.dawgland.com:~]$ gsettings list-recursively org.gnome.desktop.remote-desktop.vnc | grep encryption
Restart your window manger or your entire computer, your choice, but logging out and back in should suffice. You should then be able to use VNC from any operating system, including Windows and MAC, along with Linux which has always worked regardless of the security modes and settings!
Fedora Terminal Missing Menu Fix
gsettings set org.gnome.Terminal.Legacy.Settings headerbar false
USB Flash Drive Info
Controlling USB Devices from the Linux Command Line
There are many tools available for use in controlling and managing USB devices connected to a Linux machine from the command line, giving you the most powerful means of managing USB devices!
Here are some of my favorites, in no particular order:
Have a USB flash drive floating around, and not sure of it's capabilites? I just ran into that same exact issue, though with a brand new USB flash drive that's a really kewl 500GiB double-ended thumb-type drive, one end the standard USB-A connector, and the other end, an iPhone "Lightning" connector! Perfect for me with all my iPhones, iPads, and over 74 computers just in my house!
So, here's a simple one-liner to find out how fast it will run at, which is all I really wanted to kmnow at this immediate moment in time! Here it is:
[jamie@fc33hw01.dawgland.com:~]$ sudo lsusb -vvv | grep operate
And here is the output of the above command, showing the speeds the device is capable of operating at:
can't get debug descriptor: Resource temporarily unavailable Device can operate at Full Speed (12Mbps) Device can operate at High Speed (480Mbps) Device can operate at SuperSpeed (5Gbps) can't get debug descriptor: Resource temporarily unavailable can't get device qualifier: Resource temporarily unavailable can't get debug descriptor: Resource temporarily unavailable can't get debug descriptor: Resource temporarily unavailable can't get device qualifier: Resource temporarily unavailable can't get debug descriptor: Resource temporarily unavailable can't get debug descriptor: Resource temporarily unavailable can't get device qualifier: Resource temporarily unavailable can't get debug descriptor: Resource temporarily unavailable [jamie@fc33hw01.dawgland.com:~]$
You can totally ignore the lines starting with the word "cant", as they are meaningless.
As you can see from the above output, the device can operate at "Full", "High", and "SuperSpeed"! Wonderful, I now know what I wanted. I hope you find that little tidbit useful. Of course, you do have to be a member of the "sudoers" group. So, on that note, why not create another little snippet on how to add a normal, already existing user account to the sudoers group, allowing them to "safely" run apps with eleveate administrator/root user privileges. I'll put it here: SUDO - Running commands and apps with elevated superuser/root/administrator privileges safely!
News
The LinuxJamie.com, TheBestLinux.com & Dawgland.com web and email servers have been moved over to a new box that should provide much faster performance and more stability. Previously, the servers had been running on a very old VMWare server on my Fedora desktop.
I have also maxed out the RAM memory that my new Xeon based server motherboard is able to use, doubling it from 16GB to 32GB!
Please let me know if you experience any performance or other issues with any of my websites.
The best way to let me know is by email, @ Jamie at Dawgland.com.
New Pages Created!
I've created LOTS of new Windows related pages with all sorts of Windows tips, tricks,and How-To's. They can all be accessed directly at Windows so be sure to check them out, as I am currently added many new tips almost daily as I remember how to do things as I need to recall for both work and personal purposes.
Previous "New Wiki Pages":
New VMWare page created including two new custom how-to solution pages! Check it out here: VMWare Page
Special Interest
Linux
Linux - THE BEST OS(Operating System) EVER!
Linux Acronyms - What do they all mean?!?!
Linux Distributions, aka "Distros" - Bundles of software that makes up an entire usable operating system, including apps, utilities, etc.
Brand New Linux Server Administration Info, Tips & Guides
Apple iOS
Linux Gaming
SteamOS: Linux based gaming operating system
MS Windows
Operating Systems
Windows Desktop/End-User Operating Systems (OS)
Windows 11 Info, Upgrading, Configuring, Tweaking & Other Hopefully Useful Stuff Going Forward
Windows Server Information
Windows Server - General Information Common to All Versions for the Most Part
Windows Server 2022 Info - The Latest Greatest!
MS Virtualization
MS Windows computers, both End-User desktops like Windows 10, 11, etc and Windows Server versions come with Microsoft's own virtualization environment called Hyper-V. If you have not tried Hyper-V recently, you should if you are working in a mostly-windows environment, as it's really come a very long way in just the past couple of years with tons of new features that make using virtualization on top of Windows a breeze! It's what Azure machines run on for the most part, and can be administered using a GUI such Hyper-V on single Windows desktop machines, as well as on clusters made up of Windows Server machines. On a cluster, you should use "Failover Cluster Manager" to create, administer, modify and configure. Using PowerShell, you can get even more fine-tuned control over VM's, allowing you to do anything and a LOT more compared to using the GUI interface. And for the ultimate in Hyper-V management, using WAC, "Windows Admin Center". One of the very cool things about using WAC to create and manage Hyper-V VM's is it actually shows you the PowerShell commands to perform what you are doing within the WAC GUI!
PowerShell
Windows PowerShell Information and Examples
Here you will find information on using PowerShell basic commands as well as more complex scripting.
VirtualBox by Oracle
DNS Info
DNS, Bind, Named and other DNS related information
BIND Named DNS Server on Fedora Google Search
Bind on Fedora YouTube Video How-To
More info on the BIND DNS server to come as I find the time to create more documentation...
VMware
Remote Desktop & VNC Info For Linux & Windows!
RDP - Remote Desktop Protocol for Windows - Now Safe Using SSH Tunneling!
VNC - Virtual Network Computing
VNC - Remote Virtual Network Computing for All Operating Systems!
VPN Server & Client Setup Using Linux
VPN - Setup a Virtual Private Network Easily Using a Linux Server!
MySQL & MariaDB
MySQL & MariaDB, the FREE MySQL Clone! - My Favorite SQL Database Servers
Vi/Vim
Vi/Vim Information, Tips & Tricks
PERL
PHP
DOS & Windows
DOS & Windows - Still gotta use it for some work, unfortunately...
iTunes Information for Windows
WMIC Info & Tips - wmic diskdrive list brief
Hardware
Raspberry Pi
- Versions
- Types
- Upgrades
- Cameras
- Other
Cisco Information
Cisco IOS Command Line Information
Cisco 1000 Series Enterprise Routers
Some of My Old floppy Disk Utilities
Here is a link to the link to the ISO of Jamie's Floppy Disk Utilities
Network Utilities
UPnP & DNLA Info
Differences and similarities between the two media sharing protocols can be found here UPnP & DNLA Comparison
Web Utilities
CA Certificate Info
Free CA Certificate Information
Other Operating Systems
Drupal Info
Online Shopping & Related Info
Internet Based Shopping Including Online Store Info & Personal Experiences
Online Banking, Payment Options & Other Monetary Information
Download Safe Software!
Tested Safe Software Downloads
Some Useful Links
Here are some lists of useful URL's and other links on all sorts of topics yet to be categorized!
Reference & Miscellaneous Information
Miscellaneous Conversion and Other Reference Information - Including Metric Conversions
Coming Soon
I just bought the new iPad 3rd generation, so will be adding a new section dedicated to tips and tricks I learn on the way!
I've already learned a lot of cool things that are not normally available without jail breaking the thing,
so check back every so often for new iPad content!
Thanks for visiting My Wiki!
Wiki Abuse
The ability to create your own account has been seriously abused for personal and commercial gain, so I have disabled this feature.
If you wish to contribute content here, please email Jamie at
jamie@dawgland.com, and I will create an account for you.
This policy is subject to change.
Copyright Statement
All content and information on this website is the sole property of Jamie D. Rubinstein.
Any type of duplication is strictly prohibited by United States copyright law unless otherwise granted by Jamie D. Rubinstein.
© 1992 - 2021 Jamie D. Rubinstein - LinuxJamie.com - Dawgland.com - TheBestLinux.com - J.R. Computers. All rights reserved.