Skip to content

Instantly share code, notes, and snippets.

View antonraharja's full-sized avatar
💭
slow mode on

Anton Raharja antonraharja

💭
slow mode on
View GitHub Profile
@antonraharja
antonraharja / gentestsms.php
Last active December 8, 2023 05:44
Generate test SMS
<?php
/**
* Copy this file to playSMS web path and run from shell
*/
include 'init.php';
include $core_config['apps_path']['libs'] . '/function.php';
ob_end_clean();
@antonraharja
antonraharja / notes-elk-asteriskcdrdb.md
Last active August 26, 2024 20:36
Setup ELK for Asterisk CDR

ELK for Asterisk CDR

Assumption:

  • You have 2 VM, 1 for ELK server and the other for Asterisk server
  • Asterisk is setup so that CDR saved in MySQL db asteriskcdrdb
  • From ELK VM you can query MySQL on Asterisk server
  • Asterisk server IP is 192.168.100.2
  • asteriskcdrdb access from ELK server: user: elkdbuser pass: c03br9hncmdD2$Asd
  • We're doing this howto step by step on ELK server VM
@antonraharja
antonraharja / dummy-sendfromfile-4000.csv
Created January 25, 2021 23:48
[playSMS] 4000 dummy/fake numbers for send from file menu
0100001 Hello world, this is a test admin
0100002 Hello world, this is a test admin
0100003 Hello world, this is a test admin
0100004 Hello world, this is a test admin
0100005 Hello world, this is a test admin
0100006 Hello world, this is a test admin
0100007 Hello world, this is a test admin
0100008 Hello world, this is a test admin
0100009 Hello world, this is a test admin
0100010 Hello world, this is a test admin
## About : /etc/kannel/kannel.conf for testing purposes
## Author : Anton Raharja <[email protected]>
## Last update : 2101260300
## Comments : https://forum.playsms.org/t/kannel-conf-for-testing-purposes/2827
## CORE
## ================================================================================
group = core
@antonraharja
antonraharja / fn.php
Created January 29, 2019 04:21
HTTP Respond 200 for Telegram Bot
/**
* Respond 200 OK with an optional
* This is used to return an acknowledgement response indicating that the request has been accepted and then the script can continue processing
* ref: http://keepcoding.ehsanabbasi.com/php/processing-php-after-sending-200-ok/
*
* @param null $text
*/
function http_respond_200($text = null)
{
// check if fastcgi_finish_request is callable
@antonraharja
antonraharja / input.php
Created February 19, 2018 02:59
input.php
<?php
// If request with query string available
$param['user'] = $_REQUEST['user'];
$param['pass'] = $_REQUEST['pass'];
// --
// When request is using POST and content-type application/json
// with HTTP body in json
#!/usr/bin/php -q
<?php
/**
* cli2sms.php by Anton Raharja ([email protected])
*
* Example script to get data from shell script and send it as SMS via playSMS
* You need to have a configured and working playSMS
* In this example playSMS is accessible from http://localhost/playsms
* Don't forget to chmod +x cli2sms.php to use it from Linux shell
@antonraharja
antonraharja / dummy-phonebook-4000.csv
Last active January 25, 2021 23:49
[playSMS] 4000 dummy/fake phonebook entries as import sample
Name Phone Email Group code
Tracey Tucker 0100001 TESTGROUP
Thomas Ross 0100002 TESTGROUP
Emily Buckland 0100003 TESTGROUP
Theresa Grant 0100004 TESTGROUP
Julia Gray 0100005 TESTGROUP
Alexandra Clarkson 0100006 TESTGROUP
Adam Langdon 0100007 TESTGROUP
Andrea Poole 0100008 TESTGROUP
Emma Howard 0100009 TESTGROUP
@antonraharja
antonraharja / gist:2483cde2861589a78de4
Created June 4, 2014 15:18
[playSMS] Copy existing themes 'flatly' as new themes 'godzilla'
cd plugin/themes/
cp -rR flatly godzilla
cd godzilla/
for A in $(find . -type f); do sed -i 's/flatly/godzilla/g' $A; done
@antonraharja
antonraharja / gist:9dc70034d3de2b44d5c3
Last active August 29, 2015 14:02
[playSMS] Recovery from 'Fail to load...' error by changing themes to themes 'default'
UPDATE `playsms_tblRegistry` SET `registry_value` = 'default' WHERE `registry_family` = 'main_config' AND `registry_key` = 'themes_module';