User Tools

Site Tools


scripting

Linux Server web

https://www.tecmint.com/install-ajenti-a-web-based-control-panel-for-managing-linux-server/

IPT CC

  • * set static routes in Ubuntu**

auto eth0 iface eth0 inet static

    address 192.168.1.2
    netmask 255.255.255.0
    up route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1
    up route add -net 172.16.0.0 netmask 255.240.0.0 gw 192.168.1.1
  • # The loopback network interface
  • auto lo
  • iface lo inet loopback
  • # The primary network interface
  • auto em1
  • iface em1 inet static
  • address 192.168.30.2
  • netmask 255.255.255.0
  • broadcast 192.168.30.255
  • gateway 192.168.30.254
  • #persistent static routes
  • up route add -net 192.168.40.0/24 gw 192.168.30.1 dev em1

route add default gw 192.168.56.4

1. Quit Bash Shell Without Saving History: Unset HISTFILE .

unset HISTFILE && exit

Simple Bash Ping Script

for i in `seq 1 255`; do ping -c 1 210.4.64.$i | tr \\n ' ' | awk '/1 received/ {print $2}'; done

How to disable the VISUAL mode in Debian 9 … … …

touch ~/.vimrc

echo “set mouse-=a” > ~/.vimrc

source ~/.vimrc


  • touch rc.local.txt chmod 777 rc.local.txt
  • #!/bin/bash
  • echo '[Unit]
  • Description=/etc/rc.local
  • ConditionPathExists=/etc/rc.local
  • [Service]
  • Type=forking
  • ExecStart=/etc/rc.local start
  • TimeoutSec=0
  • StandardOutput=tty
  • RemainAfterExit=yes
  • SysVStartPriority=99
  • [Install]
  • WantedBy=multi-user.target' > /etc/systemd/system/rc-local.service
  • echo '#!/bin/sh -e
  • #
  • # rc.local
  • #
  • # This script is executed at the end of each multiuser runlevel.
  • # Make sure that the script will “exit 0” on success or any other
  • # value on error.
  • #
  • # In order to enable or disable this script just change the execution
  • # bits.
  • #
  • # By default this script does nothing.
  • exit 0' > /etc/rc.local
  • chmod +x /etc/rc.local
  • systemctl enable rc-local

—-

scripting.txt · Last modified: 2023/03/06 11:31 by 127.0.0.1