воскресенье, 22 марта 2020 г.

apache2 python wsgi install compile

1)  wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.7.1.tar.gz
2) apt update
3) apt install  apache2-dev
4)  ./configure --with-apxs=/usr/bin/apxs   --with-python=/usr/bin/python3.5
5) make
6) make install
7) ls /etc/apache2/mods-enabled/wsgi.conf
ls /etc/apache2/mods-enabled/wsgi.load
ls -al /usr/lib/apache2/modules/mod_wsgi.so
8) service apache2 start

среда, 4 марта 2020 г.

POSTGRES manipulation

простые манипуляции Postgres
\l  - просмотр баз
\c - connect to database
\db - посмотреть таблицы

CREATE DATABASE name;
CREATE DATABASE dbname OWNER rolename;DROP DATABASE name;
Создать таблицу
CREATE TABLE <table-name> ( <column name> <data type>[(<size>)], <column name> <data type>[(<size>)] ... );
например
create table table1 ( name char(10), age integer);

CREATE INDEX <index name> ON <table name> (<column name> [,<column name>]...);
CREATE INDEX Clientgroup ON Customers (snum);
DROP INDEX <Index name>;
Вставить данные
INSERT INTO products VALUES (1, 'Cheese', 9.99);

Задачи: пример1
 таб1

 name       | age
------------+-----
 vasya      | 18
 kolya      | 20
 ivan       | 23

таб2

name        | surname
------------+------------
 vasya      | pupkin
 kolya      | morozov
 ivan       | grozniy

select * from table2 inner join table1 on (table1.name=table2.name) where age=(select min(age) from table1);
 аналогично
select * from table1,table2 where (table1.name=table2.name) and age=(select min(age) from table1);
Выполнение внешней комманды

su - postgres -c psql << __EOF__ CREATE DATABASE noc WITH OWNER=noc ENCODING='SQL_ASCII'; __EOF__

четверг, 27 февраля 2020 г.

Freeswitch tools commands like asterisk

fs_cli  - Консоль
/exit    - Выйти из консоли
fs_cli -x "status"   - выполнить комманду, не заходя в консоль

например: посмотреть sip пиры

fs_cli -x "sofia status gateway"

  • /quit
  • /bye
  • /exit
Other "slash" commands correspond to mod_event_socket commands:
  • /event - Enable events (More Info)
  • /noevents - Disable all events previously enabled with /event
  • /nixevent - Enable all but one type of event (More Info)
  • /log - set loglevel of the FreeSWITCH daemon (e.g. /log info or /log alert) (More Info)
  • /nolog - Disable logging (More Info)
  • /uuid - Filter logs for a single call uuid
  • /filter (More Info)
  • /help - List fs_cli commands
Additional command available only in fs_cli
  • /logfilter <string> - Displays only lines in /log containing <string>. /logfilter without argument disables logfilter


Configuration Files

Asterisk
FreeSWITCH
extensions.confconf/dialplan/default.xml; also features.xml, public.xml, extensions/*xml
logger.confmod_console and mod_syslog
rtp.confconf/autoload_configs/switch.conf.xml
sip.confconf/directory/*.xml (see mod_sofia)
voicemail.confmod_voicemail - voicemail.conf.xml, conf/directory/*xml
zapata.confconf/autoload_configs/openzap.conf.xml
RealtimeUse mod_xml_curl to fetch the user and/or dialplan in XML, mod_ldap for LDAP backend

Console Commands

Asterisk Console
FreeSWITCH Fs cli
Shortcut Key
core show helphelpF1
core show uptimestatusF2
core show channelsshow channelsF3
core show callsshow callsF4
sip show settingssofia status
sofia status profile internal
F5
F9
core reloadreloadxmlF6
core set verbose 0/log 0F7
core set verbose 9/log 7F8
core set debug 9/debug 7
core show versionversionF12
channel originate sip/source extension destinationoriginate user/source destination xml default
channel originate sip/source application appname dataoriginate user/source &appname(data)
console dial 1000pa call 1000 (see  mod_portaudio)
database get family keydb select/family/key
dialplan showxml_locate dialplan
hangup request channeluuid_kill uuid
module load app_queue.soload mod_callcenter

queue show
callcenter_config queue list
callcenter_config tier list 
queue show queue_name
callcenter_config queue list agents queue_name@default
callcenter_config queue list members queue_name@default
sip reloadsofia profile internal rescan
sip set debug onsofia global siptrace on
sofia global debug (presence|sla|none)
sofia loglevel all [0-9]
sip set debug (ip|peer)sofia profile (internal|external) siptrace onsip mesage debug
sip show peerslist_users
sofia status profile internal reg
sip show peer sip_providersofia status gateway sip_provider
fs_cli -x "sofia status profile profile_out reg"
fs_cli -x "sofia status profile profile_in reg"

пятница, 14 февраля 2020 г.

freeswitch + mod_shout = mp3

1) uncomment formats/mod_shout in modules.conf
2) apt-get install libvorbis0a libogg0 libogg-dev libvorbis-dev libmpg123-dev  libshout3-dev
3) compile ./configure & make & make install
4) restart freeswitch or load mod_shout

четверг, 24 октября 2019 г.

ssl nginx certificate cerbot freeswitch ключи, сертификат

1) apt-get install certbot python-certbot-nginx

2) certbot --nginx

3)
IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/sfcg.eu/fullchain.pem

   Your key file has been saved at:
   /etc/letsencrypt/live/sfcg.eu/privkey.pem

   Your cert will expire on 2019-11-14. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"

 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.



4) Сделать  сертификат для фрисвича

cat /etc/letsencrypt/live/demo.raydo.com/fullchain.pem /etc/letsencrypt/live/demo.raydo.com/privkey.pem > /etc/freeswitch/tls/wss.pem



crontab -e
0 0 * * 7 certbot renew

вторник, 9 июля 2019 г.

VIM 8 copy past mode

Важно! Изменения должны быть в файле в домашней папке пользователя VIM!!!!

Disable vim automatic visual mode on mouse select issue: 

:set mouse-=a
add to ~/.vimrc: set mouse-=a

вторник, 2 июля 2019 г.

Wii best games

Wii music
Super Monkey Ball
Rytm heaven
Wii fit plus
Wii fit

Balance board games:
Ikenie no Yoru

Rayman’s Raving Rabbids TV Party

Tetris Party

Skate It

Shaun White Snowboarding

Mario and Sonic at the Winter Olympic Games

Family Ski and Snowboard