I am pleased to introduce a new (May 22, .1 release) command line tool that dramatically simplifies the collection of common pieces of data that you may be requested to provide if you are asking for help with your LinuxCNC install on the PrintNC Discord server. This script is specifically for the Debian installations of Linux that are found on the LinuxCNC website. If you are using an alternate distribution, some of the commands may not return the expected values.
Adding this command to your system involves downloading it on to your system and then changing a setting on the new file so it is executable (meaning you can run it as a program).
Right now it is best to only install it on a machine with working internet access, as it has to download a few packages to make sure the commands will all work.
NOTE: If you don't have internet access at your machine, you can simply download the file from the link below, save it on a USB drive in the same way you would save a gcode file, and walk it over to your machine. Just copy the file in to your home directory and then go to step 3. If you do put it on a USB driveDO NOTopen and the file, if it autosaves or you save it, it will likely change the character encoding and windows will add hidden characters that will break the file when used on Linux. Fun.
In order to download the program you will use the command line utility ‘wget’, so we will install that first:
1. Open a terminal window and paste in the following command (enter your password when prompted, only you as administrator can install packages):
sudo apt-get update && sudo apt-get install wget
2. Now you can download the script to your home directory (~) using the new command (NOTE: That is an ‘O’h not a Zero in the wget command line):
cd ~; wget -O showme https://raw.githubusercontent.com/5ocworkshop/showme/main/showme.sh
3. Once you downloaded to your home directory, you need to set the program as executable:
chmod u+x showme
This will set the user “execution” bit on the file, allowing you to run it as a command.
That's it, you're all set. Let's try it out.
When you first download it, the command is local to your home directory (not a system wide command) but after you run it for the first time, it will install in the directory with other commands so you can run it from any directory on your system.
Now you can run the command for the first time as ./showme, it works like this (the ./ at the start is necessary as it tells Linux to run the command from the local directory - since we haven't installed it yet, when you run it, it will install itself so the ./ won't be required going forward):
./showme opt1 [opt2] [opt3]
NOTE: The first time you run it, showme will check to see if it is already installed, and when it sees it is not, it will install itself and any packages required for operation. You may be prompted one or more times for your password to allow the required packages to install, this is normal.
To trigger the install, let's call showme for the first time and as about the local IP address:
./showme ip
You will likely see some messages about installing missing/required packages and prompting you for your password (this required that you be connected to the Internet at the time). Once that is complete (will only take a moment or two), you will see a response like this showing your network interfaces and their IP address(es):
IP ADDRESSES (provide passwd if prompted):
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
inet 192.168.2.124/24 brd 192.168.2.255 scope global dynamic eth0
valid_lft 85685sec preferred_lft 85685sec
inet 10.10.10.2/24 brd 10.10.10.255 scope global eth0:0
valid_lft forever preferred_lft forever
ONCE INSTALLED, and as of version .2x showme now supports Unix style tab completion from the command line. So to see a list of available options just type:
showme [tab][tab]
and you will see something like:
you@yourmachine:~$ showme
[tab][tab]
bootoptions dmesg interrupts modules pci usb
cpu grub ip network pcifull usbfull
cpufull history kernel package-versions pstree versions
disk ini mem packets syslog wiki
For commands like 'showme ini' that have sub-options, those also support tab completion. For example:
you@yourmachine:~$ showme ini [tab] [tab]
all SECTION-HEADING x-axis y-axis z-axis
Alternatively, to see a list of all available options, use:
./showme help
Which will return the latest version of this:
PrintNC COMMUNITY SUPPORT TOOL - showme - V. 0.22 - Launched as: /usr/bin/showme help
For a complete list of options, please see /usr/bin/showme help. [TAB] Completion supported.
*** START CUT HERE ***
05/24/21 - 21:21:03 for host: steelmill
USAGE: /usr/bin/showme [tab] opt1 [opt2] [opt3]
Where options are one or more of the following available for display:
bootoptions Parameters the kernel was last booted with
cpufull The full contents of /proc/cpuinfo
cpu The make and model of the CPU
disk Disk space information (human readable)
dmesg Kernel messages with human readable timestamps
grub Grub configuration from /etc/default/grub
history Show last 50 lines of bash shell history
ini Displays (section) from your machinename.ini LinuxCNC config file
interrupts System interuprt counters
ip IP address configuration for all interfaces
kernel The kernel version
mem Available RAM Memory
modules Active kernel modules
network Detailed networking configuration
package-versions Versions for all installed packages
packets Network interface statistics/counters
pcifull Verbose list of PCI/PCIe bus components
pci Summary of PCI/PCIe bus components
pstree The current process tree
syslog Show last 50 lines of /var/log/syslog
usbfull Verbose USB device info
usb Summary of USB device info
versions OS & LinuxCNC Version info
wiki Links to the PrintNC Wiki & Discord servers
*** END CUT HERE ***
PrintNC is a co-op community, once resolved, please take the time to
document your problem & solution on the PrintNC wiki to help the next person.
As an example:
showme cpu kernel
Will return information about your CPU make and model as well as the version of the kernel that you are running. In my case the output looks like this:
CPU MAKE & MODEL:
model name : Intel(R) Pentium(R) Dual CPU T2370 @ 1.73GHz
model name : Intel(R) Pentium(R) Dual CPU T2370 @ 1.73GHz
KERNEL VERSION:
Linux extensa-cnc 5.12.5-xanmod1 #0~git20210519.9486810 SMP PREEMPT Wed May 19 16:33:21 UTC 2021 x86_64 GNU/Linux
This is very much a work in progress and I hope to add in various LinuxCNC config files, or even sections from files, so they can easily be shared and analyzed during requests for assistance.
If you a request or suggestion for the tool features, please let me know - just DM me, Trader on the Discord.