CentOS/Fedora/RedHat
Add sudo privileges
usermod -a -G wheel LinuxUsername
remove
sudo deluser username wheel
Ubuntu/Debian
Add sudo privileges
usermod -a -G sudo LinuxUsername
remove
sudo deluser username sudo
CentOS/Fedora/RedHat
Add sudo privileges
usermod -a -G wheel LinuxUsername
remove
sudo deluser username wheel
Ubuntu/Debian
Add sudo privileges
usermod -a -G sudo LinuxUsername
remove
sudo deluser username sudo
Freeradius by default uses ports 1812 and 1813, udp traffic. To allow through firewalld run the following commands and restart the service.
sudo firewall-cmd --port-add=1812/udp --permanent
sudo firewall-cmd --port-add=1812/udp --permanent
sudo systemctl restart firewalld
Had an issue trying to recover from a failed upgrade. Apt would complain about dependencies, suggested running apt-get install -f.
Running apt-get install -f would still fail. It showed a conflict with the systemd1.service, ended up renaming the file with the following command
sudo mv /usr/share/dbus-1/system-service/org.freedesktop.systemd1.service{,bak}
and reran
sudo apt-get install -f
after that I was able to rerun the upgrade and finish
sudo apt-get upgrade
Easiest way is to use the Network Manager nmtui tool
nmtui
It gives you a “command line GUI” to search and select your preferred WiFi network.
Alternate way is to use the iw tools.
Scan for available WiFi networks
iwlist scan
Connect with iwconfig, replace WiFiName with your WiFi name. Note this only works with open networks.
iwconfig wlan0 essid WiFiName
You’ll need to get an address now, so run
dhclient
Check if your DNS is working. If not, as a “hack” manually add it to /etc/resolv.conf and restart the networking service.
sudo echo "nameserver 8.8.8.8" >> /etc/resolv.conf sudo service networking restart
Your not supposed to manually put the nameservers in resolv.conf. But it works in a pinch.
There is a php script in /opt/librenms/ that lets you delete a host from the command line.
sudo /opt/librenms/delhost.php 192.168.1.20
Replace 192.168.1.20 with the hostname/ip address of the host you want to delete.
Delete Multiple Hosts
First you’ll need to get a list of devices you want to remove. You can do this by viewing the devices in the LibreNMS MySQL database;
Example:
$ mysql -u librenms -p librenms MariaDB [librenms]> select hostname from devices; +----------------------------------------+ | hostname | +----------------------------------------+ | 192.168.88.1 | | 192.168.1.20 | | 192.168.1.12 | | 192.168.88.5 | 4 rows in set (0.00 sec) MariaDB [librenms]> exit
Put all the IP addresses you want to remove into a file and run the following for loop. Replace “remove_ip.lst” with the name of your ip list file.
for i in `cat ~/remove_ip.lst`; do sudo /opt/librenms/delhost.php $i; done
The following command
systemctl restart auditd
Returns the following error on CentOS
Failed to restart auditd.service: Operation refused, unit auditd.service may be requested by dependency only (it is configured to refuse manual start/stop). See system logs and 'systemctl status auditd.service' for details.
Work around is to use service for the restart
service auditd restart
Login to MySQL
mysql -u root -p
Show Active processes
SHOW PROCESSLIST;
or to list all the processes use “FULL”
SHOW FULL PROCESSLIST;
Run MySQL optimizer
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl perl ./mysqltuner.pl
MySQL tuner should give some recommendations on settings to tweak.
sudo apt-get install build-essential make gcc g++
Other things to install
sudo apt-get install p7zip bzip2
Should be able to get all the dependencies for MXE in one go by running
sudo apt-get install -y autoconf automake bison make build-essential gcc g++ python intltool libgdk-pixbuf2.0-0 libtool-bin p7zip-full
Full requirements are listed at the following url.
https://mxe.cc/#requirements
Create tmpfs ramdisk. Note if your Linux user is something other than steve you’ll need to change where appropriate.
mkdir /home/steve/mcdisk
In etc/fstab add the following
tmpfs /home/steve/mcdisk tmpfs defaults,size=4096m 0 0
This creates a 4GB ram disk at /home/steve/mcdisk
To mount it you can either reboot, or run
mount -a
Copy your current Minecraft directory to the ram disk
cp -R /home/steve/Current_MC_Server/ /home/steve/mcdisk
Create a Bash script in “/home/steve” named “ramdisk_save.sh”
Paste the following in. You may need to install rsync if you do not have it installed
!/bin/bash RAMDISK="/home/steve/mcram/" MCDIR="/home/steve/1.13" rsync -r -t $RAMDISK/ $MCDIR/ rsync -r -t $MCSTORE/ $MCPATH/
Now add the script to crontab
crontab -e
and
*/5 * * * * /home/steve/ramdisk_save.sh
This will now run every 5 minutes and sync any changes on the ram disk to the original directory.
Start the Minecraft server
java -Xmx3072M -Xms3072M -jar server.jar nogui