Skip to main content

Posts

How to reset the Mysql root password in case of password forget.

  How to reset the Mysql root password in case of password forget. ***************************** Step 1 : stop the mysql ***************************** /etc/init.d/mysql stop it will outputs  stopping MySQL database server : mysqld ***************************** Step 2 : starting the mysql in safemode ***************************** run the below command to start mysql in safe mode mysqld_safe --skip-grant-tables & the above command outputs as [1]5988 Starting mysqld daemon with databases from /var/lib/mysql mysqld_safe[6025]: started ***************************** Step 3 : logging to mysql ***************************** mysql -u root  output Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> ***************************** Step 4 : updating new password for mysql root ***************************** use mysql update user ...

Email alert when hard disk is full in linux

Email alert when hard disk is full in linux           ******************************* Step 1: Create a bash script file ******************************* nano /opt/diskspacealert.sh ******************************* Step 2 : paste the below script ******************************* #!/bin/sh # refered https://www.cyberciti.biz/tips/shell-script-to-watch-the-disk-space.html # enter your mailed below for email alert ADMIN="admin123@gmail.com" # set alert level 90% is default ALERT=90 df -HP | grep -vE '^Filesystem|tmpfs|cdrom' |   while read partition size used free perc mnt ;   do     usep=$(echo $perc | tr -d '%' )     if [ $usep -ge $ALERT ]; then       echo "Running out of space \"$partition ($usep%)\" on $(hostname) as   on $(date)" |        mail -s "Alert: Almost out of disk space - $usep%" $ADMIN     fi   done Note *** change the admin123@gmail....

Mysql Database Autobackup

Create file called dbbackup.sh put below mention lines in it and save. nano /home/dbbackup/dbbackup.sh #!/bin/bash echo "Starting to backup database" mysqldump --opt -uroot asterisk > /home/dbbackup/asterisk_`date '+%Y-%m-%d'`.sql echo "backup done..." echo "Please wait, Compressing backup file..." /bin/gzip /home/dbbackup/asterisk_`date '+%Y-%m-%d'`.sql echo "gzip done..." echo "Deleting 3 Days old backups" find /home/dbbackup -iname '*.sql.gz' -type f -mtime +3 -print | xargs rm -f \{\} \; put below line in cron file 00 02 * * * /home/dbbackup/dbbackup.sh

Asterisk Random callerid setting

  Why Random callerid setting required             In call centers sometimes they need to show random callerids for each call, which are generated by autodiallers or predictive diallers ,so customers wont see that call is from same center. in this blog i will show two methods to set random callerid  in asterisk or vicidial or goautodial based diallers, pbx. Option 1 :   using  RAND function in asterisk         RAND Function can be used in a scenario , if you have a range of DID's  like  40004001 to 40004999 pick any one number randomly within this range and set it has callerid. Before entering the dialplan , let me explain little bit about RAND function Asterisk Function RAND Synopsis: Choose a random number within a range Description: RAND(min,max) choose a random number between min and max , min default to 0 if not specified,  while max may be upto 2...

Centos Remove ReadOnly Mode

  https://www.centos.org/forums/ viewtopic.php?t=13798 It turns out that unmouting it, and remounting it, restored the situation to normal - it was no longer read-only after mounting. Results of the fsck root@server [/]# fsck / fsck 1.39 (29-May-2006) e2fsck 1.39 (29-May-2006) /home contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /home: 3525299/107905024 files (1.0% non-contiguous), 10106708/107874459 blocks

Connect Mysql Database Remotly

  add below mention lines in /etc/my.cnf file __________________________ port=3306 bind-address=0.0.0.0 # skip-networking _______________________ net references old_passwords=1 #bind-address=10.233.137.233 #can skip this line port=3306 # skip-networking _________________ Create user sync to linux pc CREATE USER 'sync'@'%' IDENTIFIED BY 'sync'; GRANT ALL PRIVILEGES ON *.* TO 'sync'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; systemctl restart mariadb.service   restart mysql service and check with telnet port 3306 able to access

Goautodial 3.3/vicidial XLSX upload issue

  cpan -i String::CRC Tk::TableMatrix Net::Address::IP::Local Term::ReadLine::Gnu Spreadsheet::Read Net::Address::IPv4::Local RPM::Specfile Spreadsheet::XLSX Spreadsheet::ReadSXC perl -e'use CPAN; install "Spreadsheet::ParseExcel"' cpan -i Spreadsheet::ParseXLSX yum -y install perl-CPAN cpan -i cpan Spreadsheet::WriteExcel cpan -i Spreadsheet::WriteExcel; ls cd .. find -name Spreadsheet/Read.pm find ... -print0 | grep -FzZ ‘Spreadsheet/Read.pm’ find -name Read.pm mkdir -p /usr/lib64/perl5/Spreadsheet cp -R ./root/perl5/lib/perl5/ Spreadsheet/Read.pm /usr/lib64/perl5/Spreadsheet check speadsheer/Read.pm file exist in path and check /var/log/httpd/error_log file for more info.

Multiple trunk failover / random order dialing Asterisk vicidial

  exten => _7X.,1,AGI( agi://127.0.0.1:4577/call_log ) exten => _7X.,n,Dial(${ABC}/${EXTEN:1},10000,To) exten => _7X.,n,Hangup in ABC exten => _8X.,1,AGI( agi://127.0.0.1:4577/call_log ) exten => _8X.,n,Dial(${XYZ}/${EXTEN:1},10000,To) exten => _8X.,n,Hangup and in same XYZ exten => _9X.,1,AGI( agi://127.0.0.1:4577/call_log ) exten => _9X.,n,Dial(${ABC}/${EXTEN:1},10000,To) exten => _9X.,n,Dial(${XYZ}/${EXTEN:1},10000,To) exten => _9X.,n,Hangup or exten => _6X.,1,AGI( agi://127.0.0.1:4577/call_log ) exten => _6X.,n,Set(Trunk=${RAND(1|2)}) exten => _6X.,n,GoToIf($[${Trunk} = 1]?trunkA) exten => _6X.,n,GoToIf($[${Trunk} = 2]?trunkB) exten => _6X.,n(trunkA),Dial(${ABC}/${EXTEN:1},,tToR) exten => _6X.,n(trunkB),Dial(${XYZ}/${EXTEN:1},,tToR) exten => _6X.,n,Hangup then in campaing set the PREFIX as per ur requirement 7 to dial via ABC 8 to dial via XYZ 9 to dial via the failover dialplan 6 to dial via the random d...