Asterisk from source

Linux vultr.guest 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux

apt-get update
apt-get upgrade
apt-get install build-essential
cd /usr/local/src
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar -zxvf asterisk-13-current.tar.gz
cd asterisk-13.*
contrib/scripts/get_mp3_source.sh
contrib/scripts/install_prereq install
contrib/scripts/install_prereq install-unpackaged
./configure --with-pjproject-bundled
make menuselect
make
make install
make samples
mkdir /etc/asterisk/samples/
mv /etc/asterisk/* /etc/asterisk/samples/
make basic-pbx
mkdir /etc/asterisk/basic_pbx
mv /etc/asterisk/* /etc/asterisk/basic_pbx/
make progdocs
make config
make install-logrotate
systemctl enable asterisk
systemctl start asterisk

Loops…..

#!/bin/sh
#
# Convert Music On Hold to native codecs.
#
for y in ulaw alaw
do
    for x in /var/lib/asterisk/moh/*.gsm;
    do
        asterisk -rx "file convert $x /var/lib/asterisk/moh/`basename $x .gsm`.$y";
    done
done

Pi External rootfs

Using a GPT partition table.

apt-get install gdisk rsync parted
parted  /dev/sda mklabel gpt 
parted  --align optimal /dev/sda mkpart primary ext4 0% 100% 
mkfs -t ext4 -L rootfs /dev/sda1
mount /dev/sda1 /mnt 
rsync -axv / /mnt
blkid /dev/sda1 | awk '{print $6}'
nano /boot/cmdline.txt 
root=PARTUUID=.......    rootdelay=5
reboot

 

Using a MBR partition table.

apt-get install gdisk rsync parted
parted  /dev/sda mklabel msdos
parted  --align optimal /dev/sda mkpart primary ext4 0% 100%
mkfs -t ext4 -L rootfs /dev/sda1
mount /dev/sda1 /mnt
rsync -axv / /mnt
blkid /dev/sda1 | awk '{print $3}'
nano /boot/cmdline.txt
root=UUID=.......    rootdelay=5
mkinitramfs -o /boot/initrd.sda
nano /boot/config.txt
initramfs initrd.sda followkernel
reboot

 

Source

Posted in Pi

SQL

SELECT 
 FIRSTNAME, 
 LASTNAME, 
 TO_CHAR((SELECT SYSDATE FROM dual)) AS NOW, 
 TO_CHAR(DATEOFBIRTH) AS DATEOFBIRTH, 
 trunc(((SELECT SYSDATE FROM dual) - DATEOFBIRTH)/365) AS AGE
FROM 
 CUSTOMER;