Skip to content

Instantly share code, notes, and snippets.

View mohsenk's full-sized avatar
🎯
Focusing

Mohsen Karimi mohsenk

🎯
Focusing
View GitHub Profile
#!/bin/sh
api_key=$1
receptor=$2
message=$3
curl -X POST \
https://api.kavenegar.com/v1/$api_key/sms/send.json \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d "receptor=$receptor&message=$message"
{
"Name": "customers",
"Properties": {
"Elements": [
{
"Name": "userDetail",
"Properties": {
"ItemKey": {
"Kind": "Org",
"IntID": 5638404075159552,
06-14 22:46:21.311 V/FA: Inactivity, disconnecting from the service
06-14 22:46:25.145 I/AvanegarMessaging: onMessage : {"action":"call.response","status":"accepted","callId":"9405d34b-3823-4da5-8bfc-4c115f6fafff","sdp":"v=0\r\no=- 3737988985 3737988985 IN IP4 0.0.0.0\r\ns=Kurento Media Server\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=msid-semantic: WMS stream1\r\na=group:BUNDLE audio\r\nm=audio 1 UDP/TLS/RTP/SAVPF 111 0\r\na=mid:audio\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=rtpmap:111 opus/48000/2\r\na=rtpmap:0 PCMU/8000\r\na=setup:active\r\na=sendrecv\r\na=rtcp-mux\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=ssrc:3818985134 cname:user2941904868@host-f88d3eb1\r\na=ice-ufrag:1LEM\r\na=ice-pwd:xlj+uHTdPx50XFRVnYR1mg\r\na=fingerprint:sha-256 25:45:14:33:AC:45:6A:25:14:97:A0:60:01:5B:55:56:5C:F1:96:C1:29:28:21:1A:DE:D5:BA:6C:B3:CD:AC:50\r\n","tag":"cd25e641-d23c-442e-833e-6fa5c17b23a8"}
06-14 22:46:25.160 I/libjingle: (peerconnection.cc:4769): BUNDLE already enabled for audio on audio.
06-14 22:46:25.160 I/libjingle: (transpo
2018-06-09 16:59:54:37 Info[MainViewController->callButtonAction:226] #####################################################################################
2018-06-09 16:59:54:38 Info[MainViewController->callButtonAction:227] Calling to 09120822930
2018-06-09 16:59:54:67 Info[AvanegarMessaging->connect:64] Connect
2018-06-09 16:59:54:78 Info[AvanegarMessaging->connect:71] Websocket on connect
2018-06-09 16:59:54:78 Info[AvanegarMessaging->start:97] Start success completion
2018-06-09 16:59:54:78 Info[AvanegarMessaging->sendRequest:304] Send request: {"action":"login","apiToken":"8c335ef3-d1bb-4d3f-99d0-03dd0b3bfc22","callId":null}
2018-06-09 16:59:54:86 Info[AvanegarMessaging->connect:86] Websocket on text: {"action":"login.response","status":"success","userName":"09198464956","domainName":"dev","accessToken":"8c335ef3-d1bb-4d3f-99d0-03dd0b3bfc22"}
2018-06-09 16:59:54:87 Info[AvanegarMessaging->handleMessage:172] handleMessage: {
"status" : "success",
"userName" : "09198464956",
2018-06-09 16:57:53:50 ℹ️[MainViewController->callButtonAction:226] #####################################################################################
2018-06-09 16:57:53:50 ℹ️[MainViewController->callButtonAction:227] Calling to 09120822930
2018-06-09 16:57:53:95 ℹ️[AvanegarMessaging->connect:64] Connect
2018-06-09 16:57:54:28 ℹ️[AvanegarMessaging->connect:71] Websocket on connect
2018-06-09 16:57:54:28 ℹ️[AvanegarMessaging->start:97] Start success completion
2018-06-09 16:57:54:29 ℹ️[AvanegarMessaging->sendRequest:304] Send request: {"action":"login","apiToken":"04475394-83d8-4c7f-8cd9-a5e49dd6fdba","callId":null}
2018-06-09 16:57:54:35 ℹ️[AvanegarMessaging->connect:86] Websocket on text: {"action":"login.response","status":"success","userName":"09198464956","domainName":"dev","accessToken":"04475394-83d8-4c7f-8cd9-a5e49dd6fdba"}
2018-06-09 16:57:54:36 ℹ️[AvanegarMessaging->handleMessage:172] handleMessage: {
"status" : "success",
"userName" : "09198464956",
@mohsenk
mohsenk / asdasd.txt
Created June 3, 2018 10:15
Created via API
Demo
@mohsenk
mohsenk / file1.txt
Created June 3, 2018 08:24
Created via API
Demo
@mohsenk
mohsenk / nginx-tuning.md
Created March 27, 2018 11:14 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

public class MainActivity extends AppCompatActivity {
KavenegarApi kavenegarApi = new KavenegarApi("API_KEY");
String senderLine = "{YOUR_LINE_NUMBER}";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);