Script – MAC generate voice and upload

#!/bin/bash

#
# to convert and upload voice prompts to asterisk using mac voice.
#

rate=200
voice=lee
file=$1
words=$2
extype=/$3

user=root
host=192.168.81.240
dst=/var/lib/asterisk/sounds/$voice$extype
pem=/Users/hegars/ssh.pem

#define the function to process files
function process {

#generate voice file
say -v $voice -r $rate “$words” -o $file.wav –file-format=WAVE –data-format=LEF32@8000

#all in one?
#say -v $voice -r $rate “$words” -o $file.ulaw –file-format=WAVE –data-format=ulaw@8000

#convert voice files to right format
ffmpeg -i $file.wav -codec:a pcm_mulaw -f mulaw $file.ulaw -y

#copy file to server
scp -i $pem $file.ulaw $user@$host:$dst

#remove temp files
rm $file.wav
rm $file.ulaw

#end function process
}

#check to see if input from console else continue
if [ “$1” = “” ]; then
       echo nothing entered, please try again
       exit
else
       process
fi

Advertisements

CentOS Install and basic setup

CentOS Install and basic setup

 

Install from CD

 

Install Xentools

# mkdir /media/cdrom

# mount /dev/xvdd /media/cdrom

# /media/cdrom/Linux/install.sh

# reboot

 

Set Hostname

# vim /etc/sysconfig/network

Edit HOSTNAME= to hostname.domain

 

Enable Network at boot

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Edit ONBOOT= to yes

or

# sed -i s/ONBOOT=no/ONBOOT=yes/g /etc/sysconfig/network-scripts/ifcfg-eth0

 

#service network restart

 

Disable selinux

Disable SELinux by changing “enforcing” to “disabled” in /etc/selinux/config.

 

# vi /etc/selinux/config

Edit SELINUX=enforcing to SELINUX=disabled   

or

# ping

# reboot

 

Disable Firewall

# service iptables save

# service iptables stop

# chkconfig iptables off

 

# service ip6tables save

# service ip6tables stop

# chkconfig ip6tables off

 

Install Network config scripts

# yum install system-config-network*

 

Install VIM

# yum install vim

 

Install Web tools

# yum install wget w3m

 

Install network tools

# yum install tcpdump

 

Install NTP

# yum install ntp

# chkconfig ntpd on

# ntpdate au.pool.ntp.org

# service ntpd start

 

Install MySQL

# yum install mysql-server

# service mysqld start

# chkconfig –levels 235 mysqld on  

# mysqladmin -u root password ‘[setpassword]’

# mysql -u root -p

 

Install Apache

# yum install httpd

# chkconfig –levels 235 httpd on

 

Install VSFTPD

# yum install vsftpd

# chkconfig vsftpd on

#

 

Setup logging and conf

 

Fixing the home dir issue.

getsebool -a | grep ftp
setsebool -P ftp_home_dir on

 

fixing “426 Failure writing network stream”.

use_sendfile=NO.

 

Install PHP

# yum install php php-mysql

 

Install JRE

# wget jre-7u25-linux-i586.rpm

# rpm -Uvh jre-7u25-linux-i586.rpm

# java -version

 

Install phpMyadmin

# rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm  

# yum update

# yum install phpMyAdmin

# service httpd restart

 

Comment out Deny alls

# vim /etc/httpd/conf.d/phpMyAdmin.conf

Install openssl

# yum install openssl openssl-devel

 

Install Webmin

# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.650-1.noarch.rpm

# rpm -Uvh webmin-1.630-1.noarch.rpm

 

Install Splunk

# rpm -Uvh splunk-5.0.4-172409.i386.rpm

# /opt/splunk/bin/splunk start

# /opt/splunk/bin/splunk enable boot-start

# chkconfig –list | grep splunk

 

Install OpenFire

 

# yum install nss-softokn-freebl.i686yum install glibc.i686

 

Install the database from

/opt/openfire/resources/database/openfire_mysql.sql

 

# mysql -u root -p

mysql> create database openfire;

mysql> use openfire;

Database Changed

mysql> show tables;

Empty set (0.00 sec)

mysql> source openfire_mysql.sql;

Query OK, 0 rows affected (0.01 sec)

etc….

mysql> show tables;

+———————-+

| Tables_in_openfire   |

+———————-+

| ofExtComponentConf   |

| ofGroup              |

| ofGroupProp          |

| ofGroupUser          |

| ofID                 |

| ofMucAffiliation     |

| ofMucConversationLog |

| ofMucMember          |

| ofMucRoom            |

| ofMucRoomProp        |

| ofMucService         |

| ofMucServiceProp     |

| ofOffline            |

| ofPresence           |

| ofPrivacyList        |

| ofPrivate            |

| ofProperty           |

| ofPubsubAffiliation  |

| ofPubsubDefaultConf  |

| ofPubsubItem         |

| ofPubsubNode         |

| ofPubsubNodeGroups   |

| ofPubsubNodeJIDs     |

| ofPubsubSubscription |

| ofRemoteServerConf   |

| ofRoster             |

| ofRosterGroups       |

| ofSASLAuthorized     |

| ofSecurityAuditLog   |

| ofUser               |

| ofUserFlag           |

| ofUserProp           |

| ofVCard              |

| ofVersion            |

+———————-+

34 rows in set (0.00 sec)

mysql> exit

Bye

 

# chown daemon:daemon /opt/openfire/conf/openfire.xml

# service openfire start

# chkconfig –level 235 openfire on

 

Install Asterisk

http://blogs.digium.com/2012/11/05/how-to-install-asterisk-11-on-centos-6/

For this install I am using Asterisk 11.0.0 and will be compiling from source on CentOS 6.3. This tutorial should also work on Fedora and RHEL (Red Hat Enterprise Linux) systems with little or no modification.

 

First, you will want to be sure that your server OS is up to date.

yum update -y

 

Disable SELinux by changing “enforcing” to “disabled” in /etc/selinux/config. Use a text editor or copy and paste this command.

sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config

 

After you update and disable SELinux, you’ll need to reboot.

reboot

 

Next, you will want to resolve basic dependencies. (More information on Asterisk dependencies.)

yum install -y make wget openssl-devel ncurses-devel  newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel libuuid-devel

 

Change into the /usr/src/ directory to store your source code.

cd /usr/src/

 

Download the source tarballs. These commands will get the current release of DAHDI 2.6, libpri 1.4 and Asterisk 11.

wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz

 

Extract the files from the tarballs.

tar zxvf dahdi-linux-complete*
tar zxvf libpri*
tar zxvf asterisk*

 

kernel sources for RHEL

yum install kernel-devel-`uname -r`

 

For the next set of commands it is important to follow the proper order: DAHDI first, then libpri, then Asterisk.

Install DAHDI.

cd /usr/src/dahdi-linux-complete*
make && make install && make config

 

Install libpri.

cd /usr/src/libpri*
make && make install

 

Change to the Asterisk directory.

cd /usr/src/asterisk*

 

In the next step, running the “configure” script will vary depending on whether your system is 32-bit or 64-bit. (Watch the video for more details.) When the menuselect command runs, select your options, then choose “Save and Exit” and the install will continue.

 

Install Development packages for app_mysql use

yum install mysql-devel

 

Install Subversion and MP3 sources

yum install subversion

./contrib/scripts/get_mp3_source.sh

 

Use this command if you are installing Asterisk on 32bit CentOS.

./configure && make menuselect && make && make install

 

Use this command if you are installing Asterisk on 64bit CentOS.

&& make && make install

 

Optional: If ./configure –libdir=/usr/lib64 && make menuselectyou ran into errors you will want to clean the install directory before recompiling.

make clean && make distclean

 

Once you have an error-free install, copy the sample files from the configs subdirectory into /etc/asterisk.

make samples

 

Then add the Asterisk start script to the /etc/init.d/ directory

make config

 

Start DAHDI.

service dahdi start

 

Start Asterisk.

service asterisk start

 

Connect to the Asterisk CLI.

asterisk -rvvv

 

And now you have Asterisk 11 running on CentOS 6! If you’d like to continue configuring Asterisk you can check out this guide to setting up basic pbx functionality

 

ODBC

yum install unixODBC unixODBC-devel mysql-connector-odbc php-odbc libtool-ltdl libtool-ltdl-devel

Asterisk Source Build

Installation of Asterisk

AMI

https://wiki.debian.org/Cloud/AmazonEC2Image/Jessie

 

PREREQS

apt-get install vim screen -y

apt-get install build-essential

apt-get install linux-headers-$(uname -r)

apt-get install libxml2 libxml2-dev openssl libssl-dev libncurses5 libncurses5-dev libnewt0.52 libnewt-dev vim-nox libsqlite3-dev subversion

Summary:

apt-get install build-essential linux-headers-$(uname -r) libxml2 libxml2-dev openssl libssl-dev libncurses5 libncurses5-dev libnewt0.52 libnewt-dev vim-nox libsqlite3-dev autoconf subversion

apt-get install libmysqlclient18 mysql-common libmysqlclient-dev

apt-get install unixODBC unixODBC-dev

apt-get install uuid-dev

apt-get install libjansson4 libjansson-dev
Libgsmme-dev

libgsm1-dev

apt-get install pkg-config

apt-get install pkg-config
apt-get install libmysqlclient18 mysql-common libmysqlclient-dev unixODBC unixODBC-dev uuid-dev libjansson4 libjansson-dev  Libgsmme-dev libgsm1-dev pkg-config -y

 

PJSIP

apt-get install libpj2 libpjlib-util2 libpjsip2 libpjsua2

cd /usr/src/

wget http://www.pjsip.org/release/2.x/pjproject-2.x.tar.bz2

tar -jxvf pjproject-2.x.tar.bz2

cd pjproject-2.x

./configure –prefix=/usr –enable-shared –disable-sound –disable-resample –disable-video –disable-opencore-amr CFLAGS=’-O2 -DNDEBUG’

make dep && make && make install && ldconfig

http://www.pjsip.org/using.htm

Apt-get install git

git clone -b 13 http://gerrit.asterisk.org/asterisk

git clone http://gerrit.asterisk.org/asterisk asterisk

 

DAHDI install

wget http://downloads.asterisk.org/pub/telephony/certified-asterisk/asterisk-certified-13.8-current.tar.gz

tar -zxvf dahdi-linux-complete-current.tar.gz

Asterisk Install

cd /usr/src

wget http://downloads.asterisk.org/pub/telephony/certified-asterisk/asterisk-certified-13.8-current.tar.gz

tar -zxvf asterisk-certified-13.8-current.tar.gz

cd asterisk-certified-13.8-cert2/

./contrib/scripts/install_prereq install

./contrib/scripts/get_mp3_source.sh

./bootstrap

./configure

make menuconfig

make

make install

make samples

make config

 

HOMER INSTALL

sudo apt-get install git build-essential autoconf -y
cd /usr/src/
git clone https://github.com/sipcapture/homer.git
cd homer
git submodule init
git submodule update –init –recursive
git submodule foreach git pull origin master
autoreconf -if
mkdir -p build
cd build
../configure –enable-deb
make setup.sh
export PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/root/bin
sudo ./setup.sh

Debian 8 (Jessie)

make debian-jessie-x86_64.homer.deb

ip-10-0-32-100*CLI>

 == Using SIP RTP CoS mark 5

   — Executing [639230990430@OSsites:1] Answer(“SIP/10.0.33.45-00000009”, “”) in new stack

      > 0x7ff408013ee0 — Probation passed – setting RTP source address to 10.0.33.45:10368

   — Executing [639230990430@OSsites:2] Dial(“SIP/10.0.33.45-00000009”, “SIP/6700”) in new stack

 == Using SIP RTP CoS mark 5

   — Called SIP/6700

   — SIP/10.0.33.45-00000009 requested media update control 20, passing it to SIP/6700-0000000a

   — SIP/6700-0000000a answered SIP/10.0.33.45-00000009

   — Channel SIP/10.0.33.45-00000009 joined ‘simple_bridge’ basic-bridge <500329ef-a05b-40e7-8dd5-cfaedc31a45f>

   — Channel SIP/6700-0000000a joined ‘simple_bridge’ basic-bridge <500329ef-a05b-40e7-8dd5-cfaedc31a45f>

      > Bridge 500329ef-a05b-40e7-8dd5-cfaedc31a45f: switching from simple_bridge technology to native_rtp

      > 0x7ff47c007150 — Probation passed – setting RTP source address to 192.168.81.254:16386

   — Channel SIP/10.0.33.45-00000009 left ‘native_rtp’ basic-bridge <500329ef-a05b-40e7-8dd5-cfaedc31a45f>

   — Channel SIP/6700-0000000a left ‘native_rtp’ basic-bridge <500329ef-a05b-40e7-8dd5-cfaedc31a45f>

 == Spawn extension (OSsites, 639230990430, 2) exited non-zero on ‘SIP/10.0.33.45-00000009’

 

ip-10-0-33-45*CLI>

 == Using SIP RTP CoS mark 5

   — Executing [639230990430@public:1] Answer(“SIP/205.207.0.82-0000000b”, “”) in new stack

      > 0x7f879c004140 — Probation passed – setting RTP source address to 205.207.0.82:24048

   — Executing [639230990430@public:2] Dial(“SIP/205.207.0.82-0000000b”, “SIP/10.0.32.100/639230990430”) in new stack

 == Using SIP RTP CoS mark 5

   — Called SIP/10.0.32.100/639230990430

   — SIP/10.0.32.100-0000000c answered SIP/205.207.0.82-0000000b

   — Channel SIP/205.207.0.82-0000000b joined ‘simple_bridge’ basic-bridge <1cdee761-e16e-4760-b572-b4e214adba4b>

   — Channel SIP/10.0.32.100-0000000c joined ‘simple_bridge’ basic-bridge <1cdee761-e16e-4760-b572-b4e214adba4b>

      > Bridge 1cdee761-e16e-4760-b572-b4e214adba4b: switching from simple_bridge technology to native_rtp

   — Channel SIP/205.207.0.82-0000000b left ‘native_rtp’ basic-bridge <1cdee761-e16e-4760-b572-b4e214adba4b>

 == Spawn extension (public, 639230990430, 2) exited non-zero on ‘SIP/205.207.0.82-0000000b’

   — Channel SIP/10.0.32.100-0000000c left ‘native_rtp’ basic-bridge <1cdee761-e16e-4760-b572-b4e214adba4b>

 

YubiKey PIV Manager

Importing a SSH key to the PIV smartcard.

https://developers.yubico.com/PIV/Guides/SSH_with_PIV_and_PKCS11.html

PS C:\Program Files (x86)\Yubico\YubiKey PIV Manager>

.\yubico-piv-tool.exe -a import-key -s 9a -i hegars.key.pem -k
Enter management key:
Successfully imported a new private key.

Get the PEM formatted PUB key
openssl rsa -in hegars.key.pem -pubout -out hegars.pub.pem

.\yubico-piv-tool.exe -a verify-pin -a selfsign-certificate -s 9a -S “/CN=hegars/OU=hegars/O=hegars.com/” -i hegars.pub.pem -o cert.pem
Enter PIN:
Successfully verified PIN.
Successfully generated a new self signed certificate.

.\yubico-piv-tool.exe -a import-certificate -s 9a -i cert.pem -k
Enter management key:
Successfully imported a new certificate.

 

Logging in with ssh 

hegars@debian:~$ ssh -I /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so server.hegars.com
Enter PIN for ‘PIV_II (PIV Card Holder pin)’:
Linux server 4.15.13-x86_64#1 SMP Tue Mar 27 14:42:14 UTC 2018 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Mon Jun 11 13:08:51 2018 from 1.2.3.4
hegars@server:~$

Set in ~/.ssh/config environment variable

PKCS11Provider /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so

hegars@debian:~$ ssh server.hegars.com
Enter PIN for ‘PIV_II (PIV Card Holder pin)’:
Linux server 4.15.13-x86_64#1 SMP Tue Mar 27 14:42:14 UTC 2018 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Mon Jun 11 13:09:17 2018 from 1.2.3.4
hegars@server:~$

Read and convert the certificate from the sim card

hegars@debian:~$ pkcs15-tool –read-certificate 01 | openssl x509 –noout -text
Using reader with a card: Yubico Yubikey NEO OTP+U2F+CCID 00 00
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
….
….
hegars@debian:~$

OpenSSL

OpenSSL Convert PEM

Convert PEM to DER

openssl x509 -outform der -in certificate.pem -out certificate.der

Convert PEM to P7B

openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer

Convert PEM to PFX

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

OpenSSL Convert DER

Convert DER to PEM

openssl x509 -inform der -in certificate.cer -out certificate.pem

OpenSSL Convert P7B

Convert P7B to PEM

openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer

Convert P7B to PFX

openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer

openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer

OpenSSL Convert PFX

Convert PFX to PEM

openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes

Linux – ser2net Serial Server

ser2net

apt-get install ser2net

lsusb
Bus 001 Device 010: ID 0557:2011 ATEN International Co., Ltd UC-2324 4xSerial Ports [mos7840]
Bus 001 Device 009: ID 9710:7840 MosChip Semiconductor MCS7820/MCS7840 2/4 port serial adapter
Bus 001 Device 008: ID 9710:7840 MosChip Semiconductor MCS7820/MCS7840 2/4 port serial adapter

dmesg |grep tty
[3619219.523708] usb 1-1.3.1: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB0
[3619219.525874] usb 1-1.3.1: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB1
[3619219.542097] usb 1-1.3.1: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB2
[3619219.544635] usb 1-1.3.1: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB3
[3619219.775360] usb 1-1.3.2: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB4
[3619219.777499] usb 1-1.3.2: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB5
[3619219.782304] usb 1-1.3.2: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB6
[3619219.784983] usb 1-1.3.2: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB7
[3619379.464566] usb 1-1.3.3: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB8
[3619379.484241] usb 1-1.3.3: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB9
[3619379.487233] usb 1-1.3.3: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB10
[3619379.495349] usb 1-1.3.3: Moschip 7840/7820 USB Serial Driver converter now attached to ttyUSB11

 

cat /etc/ser2net.conf

BANNER:banner:\r\nser2net port \p device \d [\s] (Debian GNU/Linux)\r\n\r\n

#2000:telnet:600:/dev/ttyS0:9600 8DATABITS NONE 1STOPBIT banner
#2001:telnet:600:/dev/ttyS1:9600 8DATABITS NONE 1STOPBIT banner
#3000:telnet:600:/dev/ttyS0:19200 8DATABITS NONE 1STOPBIT banner
#3001:telnet:600:/dev/ttyS1:19200 8DATABITS NONE 1STOPBIT banner
#
2000:telnet:600:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT banner
2001:telnet:600:/dev/ttyUSB1:9600 8DATABITS NONE 1STOPBIT banner
2002:telnet:600:/dev/ttyUSB2:9600 8DATABITS NONE 1STOPBIT banner
2003:telnet:600:/dev/ttyUSB3:9600 8DATABITS NONE 1STOPBIT banner
2004:telnet:600:/dev/ttyUSB4:9600 8DATABITS NONE 1STOPBIT banner
2005:telnet:600:/dev/ttyUSB5:9600 8DATABITS NONE 1STOPBIT banner
2006:telnet:600:/dev/ttyUSB6:9600 8DATABITS NONE 1STOPBIT banner
2007:telnet:600:/dev/ttyUSB7:9600 8DATABITS NONE 1STOPBIT banner
2008:telnet:600:/dev/ttyUSB8:9600 8DATABITS NONE 1STOPBIT banner
2009:telnet:600:/dev/ttyUSB9:9600 8DATABITS NONE 1STOPBIT banner
2010:telnet:600:/dev/ttyUSB10:9600 8DATABITS NONE 1STOPBIT banner
2011:telnet:600:/dev/ttyUSB11:9600 8DATABITS NONE 1STOPBIT banner

 

ENABLE Control Port in ser2net.conf

# Don’t do this by default
CONTROLPORT:2999

ser2net-cp

Script – Cicso – Plot DSL binbucket ATM

Cisco ATM dsl bin bucket grapher

2

 

—————-

#!/bin/bash

#Be quiet /root/cisco/script.sh >> /dev/null 2>&1

#debug

#set -x

#/debug

#—————————————————

#host data

USER=hegars

PASS=password

HOST=192.168.1.1

#slot data

declare CARD=(0 1)

DATE=`date`

EDATE=`date +%s`

HDIR=/var/www/html

#—————————————————

function_getdata()

{

URL=level/15/exec/-/show/dsl/interface/ATM/0//$CARDS//0

FILE=ATM0.$CARDS.0

echo $FILE on $DATE

## curl get from router

## find it hads and tail

## tr to remove the carrage returns

## awk the line after : and get the 16 bit string

## sed to add spaces between chars

## place it all in an array

ATM=(`echo $(curl -s -u $USER:$PASS http://$HOST/$URL | tail -n 40 | head -n 35 | tr -d ‘\r’|awk ‘/:/ {print $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17}’|sed -e ‘s/\(.\)/\1 /g’)`)

## Check how many entries are in this array

echo “${#ATM[@]} entries included in this Array”

## Convert HEX to DEC

### for each entity in the array echo back into the new DCT array the DEC converted value

DCT=($(for bin in ${ATM[@]}; do echo $((16#`echo $bin`)); done))

## Create an empty file for array conversion values

touch $FILE

## Copy each array entity onto a new line of the file

for FreqSlot in ${DCT[@]};

        do

        echo $FreqSlot >> $FILE;

        done

}

#—————————————————

function_graph()

{

gnuplot -persist << EOF

set terminal png transparent nocrop enhanced size 1000,320 font “arial,8”

set output ‘$HDIR/$FOUT.png’

set title “GMT Bit Bins as of $DATE”

set ylabel “Bits per bin”

set xlabel “Frequency Slot”

set style data lines

x = 0.0

#set terminal dumb size 160,50 aspect 1

plot “$GFILE”

#plot “ATM0.0.0″,”ATM0.1.0”

unset xlabel

unset ylabel

EOF

}

#—————————————————

# Do some stuff

## Create Backups of gifs

echo “Copying current Combo gif to backup”

cp $HDIR/COMBO.png $HDIR/bu/COMBO.`date +%Y`.`date +%m`.`date +%d`.`date +%H`.`date +%M`.png

for backup in ${CARD[@]};

        do

        echo “Copying current $backup gif to backup”

#        cp $HDIR/ATM0.$backup.0.png $HDIR/bu/ATM0.$backup.0.$EDATE.png

        cp $HDIR/ATM0.$backup.0.png $HDIR/bu/ATM0.$backup.0.`date +%Y`.`date +%m`.`date +%d`.`date +%H`.`date +%M`.png

        done

## Create Graph for the two cards.

for data in ${CARD[@]};

        do

        CARDS=${CARD[$data]}

        function_getdata

        GFILE=$FILE

        FOUT=$FILE

        echo “Graphing $GFILE”

        function_graph

        echo “Done”;

done

## Create the Combo Graph

for combo in 1

        do

        echo “Creating Combo graph”

        GFILE=”ATM0.0.0\”,\”ATM0.1.0″

        FOUT=”COMBO”

        function_graph

        echo “Done”;

done

## Clean Up

for clean in ${CARD[@]};

        do

        rm ATM0.$clean.0

        echo “Cleaning up ATM0.$clean.0”

        echo “Done”;

done

SSH – Find fingerprint

To find the finger print of the publickey

hegars@hegars:~$ ssh-keygen -lf ~/.ssh/id_rsa.pub
2048 SHA256:TE………………………………………………………9I6k hegars@hegars.com (RSA)

Or in MD5
hegars@hegars:~$ ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub
2048 MD5:7e:a1:……………………………………………………..:2d:72 hegars@hegars.com (RSA)

Get finger print from ssh-agent
Start ssh-agent
hegars@hegars:~$ eval “$(ssh-agent -s)”

add the key
hegars@hegars:~$ ssh-add /home/hegars/.ssh/id_rsa

hegars@hegars:~$ ssh-add -l
2048 SHA256:TE……………………………………………….9I6k /home/hegars/.ssh/id_rsa (RSA)

and in MD5
hegars@hegars:~$ ssh-add -l -E md5
2048 MD5:7e:a1………………………………………………:2d:72 /home/hegars/.ssh/id_rsa (RSA)

Create a website or blog at WordPress.com

Up ↑