How to print the name of a variable in C. This could be quite useful.
How to print the variabkle name instead of the value in C programming.
How to print the variabkle name instead of the value in C programming.
There is yet another way to print useful code to the terminal in C. This program below shows a very simple way to print text to the terminal and this is not using printf(). simple.c1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include <sys/uio.h> int … Read more
How to best view all available terminal colours This one-liner will print out all available terminal colours for your chosen Linux terminal application. This is very useful for creating a colourful bash prompt and the user wishes to know which colour codes will work and look good in the terminal. for x in {0..8}; do … Read more
Listing all available WIFI access points can be a hassle on Linux, but iwlist makes this very easy. It can be used to list verbose information about any WIFI access points that are near you. Used as root, it will list comprehensive information about each access point. Cell 08 – Address: 10:13:31:22:30:41 Channel:11 Frequency:2.462 GHz … Read more
The factor command for Linux will find the prime factors of any number that is entered as STDIN. Look below for an example. 4.4 Thu Aug 30 jason@Yog-Sothoth 0: $ factor 2018 2018: 2 1009 Use this command to create an old-fashioned Dot-Matrix printer banner. This is very useful if there is a Dot-Matrix printer … Read more
This simple one liner will print out your IP address and then IPv6 equivalent if you have it set. [homer@localhost ~]$ ifconfig enp6s1 | awk ‘/inet/ { print $2 } ‘ | sed -e s/addr:// 192.168.1.2 fe80::213:46ff:fe3a:283[homer@localhost ~]$ ifconfig enp6s1 | awk ‘/inet/ { print $2 } ‘ | sed -e s/addr:// 192.168.1.2 fe80::213:46ff:fe3a:283 Here … Read more
This code prints out a tick sign using asterisks. I tested this code on Fedora 19 and gcc 4.8 and it compiles without any problems. #include <iostream> #include <iomanip> using std::cout; int main() { cout<<std::setw(8)<<"*"<<"n"; cout<<std::setw(7)<<"*"<<"n"; cout<<std::setw(6)<<"*"<<"n"; cout<<"* *"<<"n"<<"* *"<<"n"<<"*"; cout<< "n"; return 0; }#include <iostream> #include <iomanip> using std::cout; … Read more
This is a BASH shell script that will print all of the available colors using the BASH shell. The colors are useful for colorizing your BASH prompt to differentiate it from your shell output. #!/bin/bash # colors.sh – Print out all the different ECMA color-mod combos # # 2008 – Mike Golvach – [email protected] … Read more