mkaa

@mkaa

Just some notes, and my thought, and random useless stuff Check me: https://thomasbad.github.io

Joined on Oct 11, 2022

  • CrowdSec is a very good and modern replacement if your server is using fail2ban before. Here is the simple guideline to teach you how to install and using it simply on your Debian based server, which shouldn't be much different on using it on Centos or Windows server as well. Management Console Login Information: Link: https://app.crowdsec.net/ Local CLI command Control: https://docs.crowdsec.net/docs/user_guides/decisions_mgmt/ sudo cscli help With this command you would see all the command information
     Like  Bookmark
  • Assume you have install all of the required software in the server, and ready to hand it out for the devlopers, it would be recommended to install and perform the following step to harden you system. 1. Install hardbian-audit What is this tools for: This is a tool able to do the system auditing, and automatically hardern the system with one of the harden level based on STIG Red_Hat_Enterprise_Linux_7_V2R5 STIG Ubuntu V1R2, cisecurity.org and HardenedLinux community recommendations Source code and Manual: The software source code and further usage detail can be found in https://github.com/hardenedlinux/harbian-audit Installation guide:
     Like  Bookmark
  • Original from: https://gist.github.com/acarril/dc03a66361e42614005562e979f2bf7c Regain control over the annoying GlobalProtect macOS install I need to use GlobalProtect because it's becoming the only VPN to access resources in my school. The VPN client is simple enough, but it does two annoying things: Registers itself to autostart on login Doesn't provide you with a simple 'quit' action Here I'll show you how I fixed both issues in macOS 12.2 (Monterey). 1. Disable autostart on login
     Like  Bookmark
  • Reference from: https://netfuture.ch/2013/08/simple-versioned-timemachine-like-backup-using-rsync/ Over many years, I have dealt with scripts that do backup versioning, i.e., maintain multiple backups. Due to their flexibility, they have been complex to understand and configure. Here is a simple rsync-based tool with a different focus: The experienced systems administrator who wants to keep his system’s complexity down. Backup in action It consists of a simple script, which you can call rsync-backup.sh and store wherever you like, e.g., in /usr/local/sbin. I will use these names and paths in the examples. #!/bin/sh # Usage: rsync-backup.sh <src> <dst> <label> if [ "$#" -ne 3 ]; then
     Like  Bookmark
  • The VM template have 50GB by default which is usually not enough. Once the VM have setup with additional hard disk space, the actual root disk may still have only 50GB, you needs to add the additional space with LVM to make root disk able to use it To do this, please follow the below steps. The below steps are dangerous, you should follow the steps carefully under run though the whole steps. Type “lsblk” to see what is the disk name, for example, the above picture already shows that we need to work with sda, because root disk “/” is under sda3. Follow Steps will assume you are working with “sda”. Type “sudo fdisk /dev/sda”, this will get you into the fdisk tool, the tool used for format and partitioning the hard disk Type “n” to add a new partition, we will need to create a new partition with all new available space. It will ask you the setting, all you need to do is just pressing enter and use the default setting instead, usually this should create a new partition called sda4. After that, press “w” and enter, this will write the table and exit the tool to confirm the setting. Press Ctrl+C to quit the tool if it didn’t quit. Type “sudo pvcreate /dev/sda4” to make the new partition as new physical volume.
     Like  Bookmark
  • If you are new on install Nvidia stuff on Ubuntu, you may sometimes find out: why there are errors like "something version not match", or the command nvidia-smi is just not working, this guide will guide you though to fix the problem and configurate it correctly without that thick as **** Nvidia installation guide. Remove all nvidia related package (if crashed) Try to remove all nvidia related package with the below command: apt-get remove --purge ^nvidia-.* apt-get remove --purge ^libnvidia-.* apt-get remove --purge ^cuda-.* It might encouter error when try to remove them, or install Cuda after removing them, then it might require you to run:
     Like  Bookmark
  • This page is the reminder notes for me if someone setup the docker container of MySQL not correctly, you can't block it in multiple offical way in some reason, like if it is not done and follow by you, and it accident roar for it, there is bunch of sh*t already turns on and running, you don't have time to check it one by one but you need to block it or else the mySQL port will be publiclly accessable problem in the network restricted envoriment, then this guide will save your life. Offical way to do so before the docker is up Normal I would recommend you to do it in offically way by creating a network rules first before eveything, making rules is very important as if there are bunch of containers, you won't want to amended their network setting one by one if they are sharing some same network rules. By doing so, first create a network allow to access the internet but expose the ports internally: docker network create --subnet=172.19.0.0/16 internet Adding this IPTable rules would be recommend also:
     Like  Bookmark
  • Reinstall sendmail: If it crashed, it would be a pain to remove and reinstall it because it use MAKE to install stuff, and those stuff would stored everywhere. First you may want to remove it first, read carefully what it have removed, confirm there is no stuff which should not be uninstall: sudo apt purge sendmail* Or you may want to remove it with aptitude, as it would remove the stuff more clean: audo aptitude purge sendmail* Then go to /etc/sendmail, read the makefile, check what it have done and try to remove all the other stuff it have done manually, then run
     Like  Bookmark
  • Why use it: If the Python environment become too big or too messy, we will always suggest you to use “Virtual environment” instead, which you would benefit with it by: You can save your environment in different location, even copy and move your environment to other machine for use You can always create different virtual environment for different project, to make sure that project will be run smoothly in a clear environment without facing weird issues, might be some module installed by previous working project is not compatible with current project. How to install it: To do so, you may just simply install it by the command:python -m pip install --user virtualenv Do see the quick manual, you can view it by:
     Like  Bookmark
  • It is simple but useful, especially you may need it able to connect to the network and save all you stuff inside it, long story short, by doing do: 1. Configure network in rescue mode Run the below command and check what is the name of your network adapter: ip a Then run the below command to turn the network on ip link set dev <dev> up ip link
     Like  Bookmark
  • for a bond network usage network: bonds: bond0: addresses: - 192.168.1.4/24 interfaces: - eno1 - eno2 nameservers:
     Like  Bookmark
  • This page will give you a list of the commonly used commands for SLURM. Although there are a few advanced ones in here, as you start making significant use of the cluster, you’ll find that these advanced ones are essential! General commands Get documentation on a command: man <command> Try the following commands: man sbatch
     Like  Bookmark