Create tmpfs ramdisk. Note if your Linux user is something other than steve you’ll need to change where appropriate.
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
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
rsync -r -t $RAMDISK/ $MCDIR/
rsync -r -t $MCSTORE/ $MCPATH/
Now add the script to crontab
*/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
Install the open vm tools from the distros repos
if your on Fedora you’ll need to use dnf instead of yum.
yum install open-vm-tools
Enable tools on boot up
systemctl enable vmtoolsd
systemctl enable vmtoolsd
Notes from repairing a Fedora drive.
Mount system in chroot.
If the system is a raid drive and your not able to access it refer to
this post. May just need to install the raid utilities.
For mounting the chroot environment refer to
Repairing grub yum install grub2-efi-*
Install grub. Change /sda to your drive, may need to specify the efi partition.
If your boot and efi partitions are mounted.
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
The reason is probably because the chrooted environment can’t resolve DNS.
Test it with
If it is not resolving, edit “/etc/resolv.conf” and change/add your nameserver. Or just replace everything in it with
echo "nameserver 22.214.171.124" > /etc/resolv.conf
It should now be able to resolve and you should be able to use yum, or dnf.
Posted in CentOS, Fedora, Linux, RedHat |
Tagged centos, chroot, chrooted, dnf, fedora, linux, redhat, yum |
Received this error while trying to access LibreNMS in web browser.
Error: Missing dependencies! Run the following command to fix:
./scripts/composer_wrapper.php install –no-dev
Tried sshing into the LibreNMS server and running the script, but that didn’t fix the issue.
Ran ./validate.php and it came up with the some of the following errors.
[FAIL] Missing PHP extension: mbstring
[FIX] Please install mbstring
[FAIL] The poller (localhost.localdomain) has not completed within the last 5 minutes, check the cron job.
[WARN] Your install is over 24 hours out of date, last update: Thu, 7 May 2018 19:18:35 +0000
[FIX] Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
Installed mbstring. You may need to change the number if yum is complaining about package conflicts. Use “yum search mbstring” to show all the versions available.
yum install php71w-mbstring
Ran ./validate.php again and it wanted this script run
./scripts/composer_wrapper.php install --no-dev
systemctl restart httpd
The commands are for CentOS, but should work on Fedora and RedHat.
If semanage is not installed refer to
You would typically use this along with the systems firewall to allow a port through. Guide for
firewalld and iptables. If you change it in the firewall and fail to add/edit it in semanage you can potentially get weird behavior like sshd not wanting to start after changing the port.
Add port semanage port -a -t ssh_port_t -p tcp 2222
The above command allows the sshd service to start, using port 2222.
List allowed ports semanage port -l
You can use grep to filter the results
[admin@localhost ~]# semanage port -l | grep ssh
ssh_port_t tcp 2222, 22
Delete port semanage port -d -p tcp 2222
semanage port -a -t snmp_port_t -p udp 161
Posted in CentOS, Command Line, Fedora, Linux |
Tagged firewall, firewalld, iptables, port, selinux, semanage, snmp, ssh |
semanage is part of the policycoreutils-python package, as is seen when you run “yum provides semanage”. So you need to install the package to get the semanage functionality.
yum install policycoreutils-python
You should be good to go.
sudo firewall-cmd --zone=public --permanent --add-port=1714-1764/tcp
sudo firewall-cmd --zone=public --permanent --add-port=1714-1764/udp
sudo systemctl restart firewalld.service
sudo ufw allow 1714:1764/udp
sudo ufw allow 1714:1764/tcp
sudo ufw reload
Posted in CentOS, Debian, Fedora, Linux, Networking, Ubuntu |
Tagged firewall, firewalld, kde, kde connect, linux, ufw |
Setup SFTP Server
When finished you’ll have a SFTP server setup that is configured so the users are in a chroot environment, and can not ssh, or telnet to the server.
Install SSH server if it is not already
yum install openssh-server openssh-client
Create group that is limited to sftp so they can’t ssh, scp etc.
Add chroot settings to /etc/ssh/sshd_config. The %u is a variable, which is the users username.
Match Group sftpusers
Make ftp directory
Add SFTP user
useradd -g sftpusers -d /sftp -s /sbin/nologin newsftpuser
Create password for new user
Create directory for user
Create directory to put ftp files
chown newsftpuser:sftpusers /ftp/newsftpuser/files/
systemctl restart sshd
Should be good to go. Test it by logging in with your favorite FTP client.