Skip to content

Instantly share code, notes, and snippets.

View ppai-plivo's full-sized avatar

Prashanth Pai ppai-plivo

View GitHub Profile
@ppai-plivo
ppai-plivo / sqs_long_poll.go
Last active November 29, 2021 06:32
Set SQS long polling in all SQS queues
package main
import (
"context"
"fmt"
"log"
"strconv"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
@ppai-plivo
ppai-plivo / curl-format.txt
Created April 7, 2020 06:05
curl -w "@curl-format.txt"
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
@ppai-plivo
ppai-plivo / shard.go
Last active April 12, 2019 07:33
Program to check distribution of keys (UUIDs) across hashslots and shards in Redis
package main
import (
"fmt"
"log"
"math/rand"
"time"
"github.com/go-redis/redis"
"github.com/google/uuid"
@ppai-plivo
ppai-plivo / dag_delete.sql
Last active April 11, 2019 17:34
Delete DAG metadata (remove state) in airflow
delete from dag where dag_id = 'verification_dag';
delete from dag_run where dag_id = 'verification_dag';
delete from dag_stats where dag_id = 'verification_dag';
delete from job where dag_id = 'verification_dag';
delete from log where dag_id = 'verification_dag';
delete from sla_miss where dag_id = 'verification_dag';
delete from task_fail where dag_id = 'verification_dag';
delete from task_instance where dag_id = 'verification_dag';
delete from xcom where dag_id = 'verification_dag';
@ppai-plivo
ppai-plivo / kannel.c
Last active April 22, 2019 13:02
message status in kannel
// From gw/smsc/smsc_smpp.c
case 0: /* SCHEDULED, defined in SMPP v5.0, sec. 4.7.15, page 127 */
if (smpp->version == 0x50) /* being very pedantic here */
dlrstat = DLR_BUFFERED;
break;
case 1: /* ENROUTE */
case 6: /* ACCEPTED */
dlrstat = DLR_BUFFERED;
break;