Local Commands (Mac)

# Flush local DNS
sudo killall -HUP mDNSResponder;
# Enable Mac Root User
dsenableroot

https://www.maketecheasier.com/enable-root-user-mac/

# Reindex Mac
sudo mdutil -E /
# Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E  -o 'http[s]{0,1}://.*' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'

https://gist.github.com/andphe/3232343

Server Commands


# SSH Login	
ssh user@000.00.000.00 -p11	

# Reboot Server	
sudo reboot

# Server errors
abrt-cli list 

# Add user to wheel group
usermod -aG wheel shiny

# Reset password
passwd shiny

# Install Package
yum install [package]

# Remove package
yum remove [package_name]
yum erase [package_name]

# Make SSH keygen
ssh-keygen -t rsa

# Copy password
ssh-copy-id -i ~/.ssh/id_rsa.pub root@000.00.000.00
# Restart Apache
sudo service httpd restart
sudo service nscd restart
# Disable 2factor Auth
whmapi1 twofactorauth_disable_policy

Disabling 2FA from the Command Line for WHM

# Force all modules
/scripts/checkperlmodules –full –force
/scripts/upcp –force
			
# touch /forcefsck
# touch /xfs_repair
# dig sabali.co

Directory Commands

# Get Working Directory	
pwd	
# Change Working Directory
cd	
cd ~/Desktop/	
cd ~/Desktop/folder/subfolder/	
# List All Files	
ls	
# List All + Hidden Files	
ls -la

MYSQL Commands

# Start MySQL
systemctl start mysql
/scripts/restartsrv_mysql
# Restart MySQL
systemctl restart mysql
/scripts/restartsrv_mysql
# Stop MySQL
systemctl stop mysql
/scripts/restartsrv_mysql
# Access Database
mysql -u dbusername -p dbname
# dbusername: the name of a database user assigned to this database (it should be in the format of CPANELUSERNAME_DATABASEUSER), or your cPanel username
# dbname: the name of your database you are importing to or exporting from. It should be created in your cPanel. 
# The format is the following: CPANELUSERNAME_DATABASENAME
# If 3306 port is closed for inbound connections you should open it to connect to a database. 
# Ports could be opened in the WHM: Plugins -> ConfigServer Security & Firewall -> csf tab -> Fireall Configuration -> TCP_IN.
# Show mySQL connections
mysql -e "show variables like '%connection%';"
# Update max connections
mysql -e "SET GLOBAL max_connections = 50000;"

MySQL OBDC Driver

# http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/Downloads#Mac%20OS%20X # https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation-binary-macos.html # https://bugs.mysql.com/bug.php?id=81726
cd ~/Downloads/	

# Install MySQL OBDC Driver
# https://dev.mysql.com/downloads/connector/odbc/
tar xvzf mysql-connector-odbc-8.0.24-macos11-x86-64bit.tar.gz

cd ~/Downloads/mysql-connector-odbc-8.0.24-macos11-x86-64bit
sudo cp bin/* /usr/local/bin
sudo cp lib/* /usr/local/lib
cd /usr/local/bin/

# For Connector/ODBC 8.0:
# myodbc-installer -a -d -n "MySQL ODBC 8.0 Driver" -t "Driver=/usr/local/lib/libmyodbc8w.so"

# For Connector/ODBC 5.3:
myodbc-installer -a -d -n "MySQL ODBC 5.3 Driver" -t "Driver=/usr/local/lib/libmyodbc5w.so"

# Verify installed drivers using myodbc-installer utility:
myodbc-installer -d -l

Cartography Commands

# Merge geojson Files	
# npm install --save @mapbox/geojson-merge
geojson-merge mex.json gtm.json > combined.geojson

Reference Links

GIT Reference