Set Automatic Reboot When Server is Out of Memory
vi /etc/sysctl.conf
vm.panic_on_oom=1 ;enables panic on OOM kernel.panic=10 ;tells the kernel to reboot ten seconds after panicking
vi /etc/sysctl.conf
vm.panic_on_oom=1 ;enables panic on OOM kernel.panic=10 ;tells the kernel to reboot ten seconds after panicking
sudo apt install fail2ban -y
sudo systemctl enable fail2ban sudo systemctl start fail2ban
sudo systemctl status fail2ban
Configuring Fail2ban
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail. Local
sudo nano /etc/fail2ban/jail. Local
References
https://www.howtoforge.com/how-to-install-fail2ban-on-ubuntu-22-04/
sudo apt-get install php8.1-fpm sudo a2dismod php8.1 sudo a2enconf php8.1-fpm sudo a2enmod proxy_fcgi
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
sudo a2enmod ssl
sudo a2enmod http2
sudo systemctl restart apache2
After enabling and loading necessary Apache modules, navigate to your Apache configuration directory and edit Apache configuration.
To enable HTTP/2 on your Apache web server add one of the following to your global Apache configuration or inside of a particular virtual host.
Protocols h2 http/1.1
Here is the minimal virtual server configuration that can be used to enable HTTP/2 in some virtual host:
<VirtualHost *:443> ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/public_html/example.com SSLEngine on SSLCertificateKeyFile /path/to/private.pem SSLCertificateFile /path/to/cert.pem SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 Protocols h2 http/1.1 </VirtualHost>
References
https://www.howtoforge.com/how-to-enable-http-2-in-apache
warp-cli account
warp-cli set-license <your-warp-plus-license-key>
References
https://community.cloudflare.com/t/how-to-use-warp-with-linux-cli/400952
Install warp-cli
curl https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list
sudo apt update
sudo apt install cloudflare-warp
Run warp-cli in proxy mode
warp-cli --accept-tos register warp-cli --accept-tos set-mode proxy warp-cli --accept-tos set-proxy-port 40040 warp-cli --accept-tos connect warp-cli --accept-tos enable-always-on
Configure xray
nano /usr/local/etc/xray/config.json
"outbounds": [
{
"protocol": "socks",
"settings": {
"servers":[
{
"address":"127.0.0.1",
"port":40040
}
]
},
"tag": "warp"
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type":"field",
"domain":[
"domain:google.com"
],
"outboundTag": "warp"
}
]
},
References
https://developers.cloudflare.com/warp-client/get-started/linux
https://pkg.cloudflareclient.com/install
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Once rebooted, open the Windows App store and search for the “Kali Linux” application, or alternatively click here to go there directly. Install the app and enjoy Kali!
Install Kali Linux Metapackages
sudo apt update sudo apt full-upgrade -y
sudo apt install -y kali-linux-default
Install Win-KeX
Win-KeX provides a Kali Desktop Experience for Windows Subsystem for Linux (WSL 2)
sudo apt update sudo apt install -y kali-win-kex
To start Win-KeX in Window mode with sound support, run
kex --win -s
To start Win-KeX in Enhanced Session Mode with sound support and arm workaround, run
kex --esm --ip -s
To start Win-KeX in Seamless mode with sound support, run
kex --sl -s
Optional Steps
If you have the space, why not install “Kali with the lot”?
sudo apt install -y kali-linux-large
References
https://www.kali.org/blog/kali-linux-in-the-windows-app-store/
https://www.kali.org/docs/general-use/metapackages/
https://www.kali.org/docs/wsl/win-kex/
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start
systemctl enable mongod.service
References
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/
date
date --set="2 OCT 2006 18:00:00"
References
https://www.cyberciti.biz/faq/howto-set-date-time-from-linux-command-prompt/
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb
sudo apt-get update && \ sudo apt-get install -y dotnet-sdk-7.0
References
https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2204-microsoft-package-feed
sudo snap install dotnet-sdk --classic --channel=7.0
sudo snap alias dotnet-sdk.dotnet dotnet
You can edit your shell profile to permanently add the commands.
Bash Shell: ~/.bash_profile, ~/.bashrc
export DOTNET_ROOT=/snap/dotnet-sdk/current
References
https://learn.microsoft.com/en-us/dotnet/core/install/linux-snap
https://stackoverflow.com/questions/68519558/how-to-fix-segmentation-fault-core-dumped-when-creating-new-dotnet-project