Commands

Raizo62

Network

fast-ip

  • Configuration of IP address and eventually the gateway.
  • fast-ip, fast-dhcp and fast-dns used together enable to setup a dynamic DNS.

Synopsis

  • fast-ip [INTERFACE-NAME][INTERFACE-NUMBER][.VLAN-NUMBER] IP-ADDRESS/NET-MASK [IP-GATEWAY]
  • fast-ip [INTERFACE-NAME][INTERFACE-NUMBER][.VLAN-NUMBER] dhcp

Examples

  • fast-ip 172.16.40.17/24
    • eth0 : 172.16.40.17/24
  • fast-ip 1 172.16.40.17/24
    • eth1 : 172.16.40.17/24
  • fast-ip 2 172.16.40.17/24 172.16.40.254
    • eth2 : 172.16.40.17/24 and gateway : 172.16.40.254
  • fast-ip 3 dhcp
    • eth3 requests an IP to a DHCP server
  • fast-ip 0.10 172.16.40.17/24 172.16.40.254
    • vlan 10 on eth0 : 172.16.40.17/24 and gateway : 172.16.40.254
  • fast-ip tap0 172.16.40.17/24 172.16.40.254
    • tap0 : 172.16.40.17/24 and gateway : 172.16.40.254
  • fast-ip eth0.10 172.16.40.17/24 172.16.40.254
    • vlan 10 on eth0 : 172.16.40.17/24 and gateway : 172.16.40.254

fast-dhcp

  • Configuration of a DHCP server based on the IP address of the server.
  • fast-dhcp configures the dnsmasq server
  • fast-ip, fast-dhcp and fast-dns used together enable to setup a dynamic DNS.
  • You can change the default domain (domain.local) used by fast-dhcp and fast-dns by modifying the variable DOMAINE into /opt/raizo/etc/fast.conf

Synopsis

  • fast-dhcp [INTERFACE-NAME]INTERFACE-NUMBER[.VLAN-NUMBER] [IP-DNS]

By default :

  • IP-DNS is IP address of nameserver found in /etc/resolv.conf. If it doesn't find it, it uses the IP address of INTERFACE-NUMBER
  • The default gateway of dhcp clients is the default gateway of the network of chosen interface, or IP address of INTERFACE-NUMBER

Example

  • fast-dhcp 2 172.16.4.3
    • if IP address of eth2 is 192.168.33.17
      • create pool of IP addresses : 192.168.33.[10,100]/24
      • gateway of dhcp clients can be 192.168.33.17
      • DNS of dhcp clients will be 172.16.4.3
  • fast-dhcp eth2
    • if IP address of eth2 is 192.168.33.17
      • create pool of IP addresses : 192.168.33.[10,100]/24
      • gateway of dhcp clients can be 192.168.33.254
      • DNS of dhcp clients will be 192.168.33.17

fast-dns

  • Configuration of a DNS server.
  • fast-dns configures the dnsmasq server
  • fast-ip, fast-dhcp and fast-dns used together enable to setup a dynamic DNS.
  • You can change the default domain (domain.local) used by fast-dhcp and fast-dns by modifying the variable DOMAINE into /opt/raizo/etc/fast.conf

Synopsis

  • fast-dns NAME IP [NAME2 IP2 [NAME3 IP3 [NAME4 IP4...]]]
    • Creates a DNS server (if necessary), and adds the record for theirs IPs and theirs NAMEs
  • fast-dns dns
    • Clears the previous records of the DNS server and creates a new one.

Examples

  • fast-dns PC1 10.0.0.1
    • For the server DNS, PC1 has IP address 10.0.0.1
  • fast-dns PC2 10.0.0.2
    • For the server DNS, PC1 has IP address 10.0.0.1 and PC2 has IP address 10.0.0.2
  • fast-dns PC3 10.0.0.3 PC4 10.0.0.4
    • For the server DNS, PC1 has IP address 10.0.0.1, PC2 has IP address 10.0.0.2, PC3 has IP address 10.0.0.3 and PC4 has IP address 10.0.0.4
  • fast-dns dns
    • Reset records of the DNS server

fast-rip

  • RIPv2 router configuration
  • fast-rip configures the quagga server


System

fast-syslog

  • Displays in color the last 40 lines of the file /var/log/syslog

fast-mountUSB

  • Mount the USB key in the directory /media/usb0. If /mnt/usb0 is already used, fast-mountUSB will use /mnt/usb1, etc

-> Be Careful : fast-mountUSB don't detect the USB keys already connected before the boot of Live Raizo. In this case, you must disconnect and reconnect the USB key before to launch fast-mountUSB


fast-battery

  • Display the percentage of energy remaining in the battery.
    • Try to bring the console windows to the front if percentage of energy remaining is less of 10%, and if the battery is detected and not charging

Synopsis

  • fast-battery [-i] [-t] [-p] [-b] [-u]
    • -i|I : checks this percentage every 60 seconds and displays the changes
    • -t|T : show this percentage into the title bar of xterm
    • -p|P : do a pause before to stop the program
    • -b|-B : do a beep if percentage of energy remaining is less of 10% (<- not really tested)
    • -u|U : test of utility. exit 0 only if usefull : battery detected and not charging
    • -h|? : show this help


Laboratory

fast-save-project

  • Asks questions to save a GNS3 project

Synopsis

  • fast-save-project [options]
    • [options] is totally used with fast-backup-lab

Steps

  1. Show detected projects of GNS3 into /home/user and ask which you want to save.
  2. Launch fast-mountUSB to detect new usb keys connected
  3. Show destinations where to copy the backup of project
  4. Do the backup
  5. If destination is usb, ask to umount the usb key

Your own commands

  • You can add your own destination and associated commands into /opt/raizo/etc/cmd-fast-save-project.conf
  • Line is commented if it begins with #
  • Each line must be : title [command options]

    • title : title shown by fast-save-project in the step where you must choose the destination
    • command options : if it is not empty, the command "command options" is launched after the backup
    • Into command options, use "%f" for name of archive
  • You can use more functionality if title begins with "local:", "net:" or "usb:",

    • local:directory : Before to show it, Live Raizo verifies that directory exists
    • net:title : Before to show it, Live Raizo verifies that it has an IPv4 address
    • usb:mountPoint : Before to show it, Live Raizo verifies that mountPoint is already mounted, and after the backup into mountPoint, fast-save-project asks if it musts unmount mountPoint
  • Example of /opt/raizo/etc/cmd-fast-save-project.conf

# Copy into /mnt/archive and ask to unmount /mnt/archive
usb:/mnt/archive
# Copy into /tmp and show details on archive
local:/tmp  ls -l %f
# Copy on the FTPs server : srvftp.domain.local
net:ftps read -p "Login : " LOGIN && lftp -u $LOGIN -e "set ftp:ssl-protect-data true ; put %f; exit" srvftp.domain.local

fast-backup-lab

  • Backup of the GNS3 project with VirtualBox Machines.

Synopsis

  • fast-backup-lab [-g] [-p] [-s] [-v] [-c] [-n] [-t] [-y] [DIRECTORY-PROJECT-GNS3] [DIRECTORY-DESTINATION]
    • Creates an archive of the directory "DIRECTORY-PROJECT-GNS3" and the VirtualBox Machines. This archive is created in the directory "DIRECTORY-DESTINATION"
    • -g|G : exclude the configurations files of GNS3 from archive
    • -p|P : exclude the GNS3 project from archive
    • -s|S : exclude the Startups files from archive
    • -v|V : exclude the configurations files of VirtualBox from archive
    • -c|C : exclude the Capture files from archive
    • -n|N : ADD the network files of Live to archive
    • -t|T : test only the config. Don't create the archive
    • -y|Y|o|O : Don't ask for confirmation from user
    • -h|? : show this help

Examples

  • fast-backup-lab TP
    • Create an archive TP_backup_20130723_12_20_10.tar.xz
  • fast-backup-lab TP /media/usb0
    • Create an archive /media/usb0/TP_backup_20130723_12_23_05.tar.xz
  • fast-backup-lab -v TP /media/usb0
    • Create an archive /media/usb0/TP_backup_20130723_12_25_12.tar.xz without the VirtualBox files
  • fast-backup-lab -P
    + Create an archive config_backup_20130723_12_29_43.tar.xz with only the configurations files

fast-restore-lab

  • Restore a GNS3 project, which has been saved with fast-backup-lab.

Synopsis

  • fast-restore-lab [-g] [-p] [-s] [-v] [-n] BACKUP-PROJECT-GNS3
    • -g|G : don't extract the configurations files of GNS3 from archive
    • -p|P : don't extract the GNS3 project from archive
    • -s|S : don't extract the Startups files from archive
    • -v|V : don't extract the configurations files of VirtualBox from archive
    • -c|C : don't extract the Capture files from archive
    • -n|N : don't extract the network files of Live from archive
    • -h|? : show this help

Example

  • fast-restore-lab TP_backup_20130723_12_20_10.tar.xz
    • Restores files from the archive TP_backup_20130723_12_20_10.tar.xz
  • fast-restore-lab -s TP_backup_20130723_12_20_10.tar.xz
    • Restores files from the archive TP_backup_20130723_12_20_10.tar.xz, without restoring Startups files

fast-reset-vbox

  • Reset the VirtualBox Machines.

Synopsis

  • fast-reset-vbox [-a|-A] [-y|-Y|-o|-O] [NAME-VBOX]
    • -a|-A : Select all the VirtualBox VMs
    • -y|-Y|-o|-O : Don't ask for confirmation from user
    • NAME-VBOX : reset only the VirtualBox VM "NAME-VBOX"
    • -h|? : show this help

Examples

  • fast-reset-vbox
    • Display the VirtualBox Machines availables and ask the number of the VM. fast-reset-vbox ask for confirmation before to reset the VirtualBox Machines selected.
  • fast-reset-vbox -Y
    • Display the VirtualBox Machines availables and ask the number of the VM. fast-reset-vbox do not ask for confirmation to reset the VirtualBox Machines selected.
  • fast-reset-vbox Router1
    • Ask for confirmation before to reset the VirtualBox Machine "Router1".
  • fast-reset-vbox -Y Server1
    • Reset the VirtualBox Machine "Server1".
  • fast-reset-vbox -Y PC1 PC2 Server5
    • Reset the VirtualBox Machines "PC1", "PC2" and "Server5"

fast-clean-crash-gns3

  • Kill all the processes used by GNS3 (in case of a crash for instance).

Synopsis

  • fast-clean-crash-gns3 [-y|-Y|-o|-O]
    • -y|-Y|-o|-O : Don't ask for confirmation from user

Examples

  • fast-clean-crash-gns3
    • Ask for confirmation before to kill all the processes used by GNS3.
  • fast-clean-crash-gns3 -Y
    • Kill all the processes used by GNS3.

fast-nat

  • enable IP forwarding, configure an DHCP Server and use NAT with network of the interface tap0

Synopsis

  • fast-nat [IP-ADDRESS]
    • if tap0 has an IP, and IP-ADDRESS is not defined, then fast-nat uses the IP of tap0
    • if tap0 has no IP, and IP-ADDRESS is not defined, then fast-nat uses the IP 10.145.147.1
    • if IP-ADDRESS is defined, then fast-nat uses this IP and modifies with it the IP of tap0

Example

> fast-nat
* fast-ip tap0 10.145.147.1/24
* ifdown tap0 --force
+ [/etc/network/interfaces : Add the new configuration for tap0]
* ifup tap0
* fast-dhcp tap0
# Pool      : 10.145.147.[10,100]/24
# Gateway   : 10.145.147.1
# DNS       : 212.27.40.240
-----------------------------
+ [/etc/dnsmasq.conf : Add pool 10.145.147.[10,100]/24]
- [/etc/dnsmasq.conf : Disable the DNS service]

* systemctl start dnsmasq
* systemctl enable dnsmasq
Synchronizing state for dnsmasq.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d dnsmasq defaults
insserv: warning: current start runlevel(s) (empty) of script `dnsmasq' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `dnsmasq' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d dnsmasq enable
* sudo sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
* sudo iptables -t nat -I POSTROUTING -s 10.145.147.0/24 -j MASQUERADE

Add-to-GNS3.sh

  • API who use a vdi from VirtualBox to create VirtualBox VM and to add it to GNS3

Synopsis

Create VM into VirtualBox

  • Add-VM-to-VirtualBox 1 2 [3] [4]
    • 1 : Name Of VM in VirtualBox
    • 2 : Type of OS ( vboxmanage list ostypes )
    • 3 : If exist, path of the VDI file
    • 4 : If exist, path of the second VDI file

Add this VM to GNS3

  • Add-VM-to-GNS3 1 2 3 4 5
    • 1 : Name of VM in VirtualBox
    • 1 : Name of VM in GNS3
    • 3 : Number of network card
    • 4 : Without VirtualBox's Windows : true / false
    • 5 : Console mode : true / false

Examples

Example of use with fast-update or fast-startup :

#!/bin/bash

source /opt/raizo/script/Add-to-GNS3.sh
if (( $? ))
then
    return
fi

DIR_VDI="/media/usb0/vdi"

# Kali Linux :

Add-VM-to-VirtualBox Linux-Kali Debian "${DIR_VDI}/linux-kali.vdi"
if (( ! $? ))
then
    # Processor : PAE/NX : (otherwise Kali Linux doesn't start)
    VBoxManage modifyvm Linux-Kali --pae on
    # 1 Gb of memory for Kali Linux
    VBoxManage modifyvm Linux-Kali --memory 1024

    Add-VM-to-GNS3 Linux-Kali Kali 2 false false
fi

# Windows Server 2003 :

# Default network card doesn't work with windows server 2003
TYPE_NETWORK_CARD="PCNet-FAST III (Am79C973)"

Add-VM-to-VirtualBox Windows-Server2003 Windows2003 "${DIR_VDI}/windows-2003-server.vdi" "${DIR_VDI}/CDRom-Win2003.vdi"
if (( ! $? ))
then
    Add-VM-to-GNS3 Windows-Server2003 Win2003 1 false false
fi


Update

fast-startup

  • Mount automatically the USB key in /media/usb0 (or usb1, usb2..) and processes the script /media/usb0/raizo.sh.

Synopsis

  • fast-startup [NAME-SCRIPT]

    • By default, NAME-SCRIPT is raizo.sh. NAME-SCRIPT will always be lowercase before downloading.
    • You can modify default values into the file /opt/raizo/etc/fast-startup.conf
    • Your script raizo.sh (or NAME-SCRIPT) can affect a value different of zero at the variable FAST_ERROR_RAIZO to indicate an error at fast-startup. You can use the variable FAST_ERROR_RAIZO_LOG to indicate also a message
    • You can use the variable MOUNT_KEY to know where the usb key is mounted

Examples

  • fast-startup
    • Mount automatically the USB key in /media/usb0 and processes the script /media/usb0/raizo.sh.
  • fast-startup US
    • Mount automatically the USB key in /media/usb0 and processes the script /media/usb0/us.

fast-update

Synopsis

  • fast-update [NAME-SCRIPT]

    • By default, NAME-SCRIPT is raizo.sh. NAME-SCRIPT will always be lowercase before downloading.
    • You can modify default values into the file /opt/raizo/etc/fast-startup.conf
    • Your script raizo.sh (or NAME-SCRIPT) can affect a value different of zero at the variable FAST_ERROR_RAIZO to indicate an error at fast-update. You can use the variable FAST_ERROR_RAIZO_LOG to indicate also a message.

Examples



Helps

fast-memo

  • Display a reminder in French.

Synopsis

  • fast-memo
    • Displays all reminders available. You must indicate the number of memo that you want display
  • fast-memo [NAME-MEMO]
    • Display the reminder "NAME-MEMO"

q to quit (as less command)

Examples

> fast-memo
Available choices :
 1) *QUIT*    24) diff    47) mkdir    70) sockstat
 2) 7z        25) dig     48) mount    71) sort
 3) ab        26) distcc      49) mysql    72) split
 4) apparmor  27) emacs   50) mysqldump    73) ssh
 5) apt-cache 28) find    51) ndiswrapper  74) ssh-copy-id
 6) apt-get   29) gcc     52) netcat       75) ssh-keygen
 7) aptitude  30) gdb     53) netstat      76) stdout
 8) asterisk  31) git     54) nmap     77) strace
 9) at        32) GNS3    55) notify-send  78) systemctl
10) awk       33) gpg     56) od       79) tail
11) bash      34) grep    57) openssl      80) Tap
12) Bridge    35) gs          58) pdftk    81) tar
13) chmod     36) head    59) php      82) tcpdump
14) chown     37) history     60) ping     83) tmux
15) Cisco     38) ifconfig    61) ps       84) top
16) convert   39) ip          62) python       85) truncate
17) crontab   40) iptables    63) rm       86) uname
18) curl      41) iwconfig    64) Routage      87) vim
19) cut       42) less    65) sam2p    88) Vlan
20) date      43) ln          66) scp      89) wget
21) dd        44) ls          67) screen       90) WiFi
22) df        45) lsof    68) sed
23) dhclient  46) MAC     69) shred
#?
> fast-memo pi
(From cheat / https://github.com/chrisallenlane/cheat)

# ping a host with a total count of 15 packets overall.
ping -c 15 www.example.com

# ping a host with a total count of 15 packets overall, one every .5 seconds (faster ping).
ping -c 15 -i .5 www.example.com

# test if a packet size of 1500 bytes is supported (to check the MTU for example)
ping -s 1500 -c 10 -M do www.example.com

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks