To redirect old site to new url using .htacces, use following
RewriteCond %{HTTP_HOST} ^old-url.com$ [OR] RewriteCond %{HTTP_HOST} ^www.old-url.com$ RewriteRule (.*)$ http://www.new-url.com/$1 [R=301,L]
See htaccess
To redirect old site to new url using .htacces, use following
RewriteCond %{HTTP_HOST} ^old-url.com$ [OR] RewriteCond %{HTTP_HOST} ^www.old-url.com$ RewriteRule (.*)$ http://www.new-url.com/$1 [R=301,L]
See htaccess
sleep-monitor system is about to suspend
See Remote Desktop
To list kernal modules, use
lsmod
Example
boby@sok-01:~$ lsmod | grep rtl rtl8xxxu 122880 0 mac80211 778240 2 ath9k_htc,rtl8xxxu boby@sok-01:~$
mitmproxy is a man in the middle proxy server for debugging.
To install mitmproxy on Ubuntu, run
sudo apt install mitmproxy -y
On Ubuntu 18.04, this is broken. To insall i created a virtualenv
mkdir -p ~/www/mitmproxy cd ~/www/mitmproxy virtualenv --python=/usr/bin/python3 venv source venv/bin/activate
Install mitmproxy inside virtualenv with
pip install mitmproxy
To start, run
mithproxy
This will listen proxy on port 8080, you can verify with command
netstat -lntp
If you get error like
boby@sok-01:~$ /home/boby/www/mitmproxy/venv/bin/mitmproxy Error: mitmproxy requires a UTF console environment. Set your LANG environment variable to something like en_US.UTF-8 boby@sok-01:~$
Run
export LANG=en_US.UTF-8 mitmproxy
To configure in browser, you can use it as HTTP proxy. Here is how i configure it on Firefox FoxyProxy.
To log commands executed by users on Linux shell, edit file
vi /etc/bash.bashrc
Add
export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$(whoami) [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"'
Create file
vi /etc/rsyslog.d/bash.conf
Add
local6.* /var/log/commands.log
Restart rsyslog
systemctl restart rsyslog
Now log off and login, you will be able to see all commends executed by users on bash shell in file /var/log/commands.log
edit
vi /etc/logrotate.d/rsyslog
Find
/var/log/kern.log
Add below
/var/log/commands.log
To upgrade Debian 9 to Debian 10, first make sure your system is up-to-date.
apt update && apt upgrade -y
Edit file /etc/apt/sources.list. Find all occurrences of “stretch” and replace it with “buster”.
sed -i 's/stretch/buster/g' /etc/apt/sources.list
Or use following
deb http://cloudfront.debian.net/debian/ buster main non-free contrib
deb-src http://cloudfront.debian.net/debian/ buster main non-free contrib
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free
Now update the system
apt update && apt upgrade -y
run dist-upgrade
apt dist-upgrade -y
During the upgrade, you will be asked to replace some of the configuration files. If this is a fresh server, you can always replace these files with a newer version. If your server has these files modified, you should be careful as replacing these files will lose the changes you made.
Reboot the server.
reboot
After reboot, you can verify the server is running Debian 10 with commands
lsb_release -a
hostnamectl
xinput command on linux shows all available input devices.
xinput
Example
To install zip on Ubuntu/Debian, run
apt install zip unzip -y
To unzip a file, run
unzip FILE_NAME.zip
To unzip to specific directory, run
unzip FILE_NAME.zip -d DIR_NAME
To create a ZIP file, run
zip -r FILE.zip FILE_OR_DIR
Example
root@server:~# zip -r 1.zip organicinstinct.sql adding: organicinstinct.sql (deflated 85%) root@server:~#
Free DNS Hosting
Paid DNS Hosting
Free Dynamic DNS
After adding Server to R1Soft Server Backup Manager, you need to configure it.
Verify backup manager can connect to protected machine. If you can’t connect, you need to open TCP port 1167 on firewall.
Click on Wheel icon > Test Agent Connection.
If backup manager cna connect to server, you will see
You can click
Wheel > Backup now
Go to
Protected Machines > Wheel icon > Edit Policy > MySQL > Add new MySQL instance
You will be asked to enter MySQL server login details. I created a user with remote access permission with following command.
GRANT ALL PRIVILEGES ON *.* TO 'r1soft'@'%' IDENTIFIED BY 'YOUR_PASSWORD_HERE' WITH GRANT OPTION; GRANT PROXY ON ''@'' TO 'r1soft'@'%' WITH GRANT OPTION;
You may need to edit MySQL configuration and make it listen to public IP to allow R1Soft backup manager can connect to your MySQL server.
Back to r1soft