Skip to content

Instantly share code, notes, and snippets.

View andrius's full-sized avatar

Andrius Kairiukstis andrius

View GitHub Profile
@andrius
andrius / Dockerfile
Last active May 21, 2023 12:27
Running Crystal-lang on aarch64 Linux with Docker
FROM crystallang/crystal:1.8
# FROM crystallang/crystal:1.8-alpine
ARG USER=user
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN sh <<'EOF'
if [ "$(awk -F= '/^ID=/{print $2}' /etc/os-release)" = "alpine" ]; then
apk add bash curl
@andrius
andrius / Dockerfile
Last active January 2, 2023 13:39
multi-stage Elixir build (this create production-ready image, small as possible) #docker #elixir
#===========
#Build Stage
#===========
FROM elixir:alpine as build
#Copy the source folder into the Docker image
COPY elixir-docker-guide/ .
#Install dependencies and build Release
ENV MIX_ENV prod
@andrius
andrius / docker-volume-migration.md
Last active November 16, 2022 16:03
#howto rename #docker volume

Say, folder with docker-compose files was renamed or we do merging volumes etc. Then we shall rename docker volume. Because docker natively does not support renaming, we shall create it, then copy data, then inspect new volume, test and delete old one at the end

Volumes:

docker volume ls
@andrius
andrius / Procfile
Last active July 22, 2022 22:00
How to dockerize #rails app with #puma. Edit config/application.rb and config/puma.rb #docker #ruby
api: bundle exec puma -C config/puma.rb
@andrius
andrius / osx-for-hackers.sh
Last active July 21, 2022 22:44 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox... #macos #setup #dotfiles
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@andrius
andrius / tts.sh
Last active June 8, 2022 17:27
Quick and dirty IVR sounds for your Asterisk PBX
#!/bin/bash
#title : tts.sh
#description : This script will convert text to speech using Google translate API
# and then to Asterisk formats (wav, sln, gsm)
#
#author : Andrius Kairiukstis <k@andrius.mobi>
#date : 26 July 2013
#version : 0.1
#usage : bash tts.sh FILENAME VOICE PHRASE
@andrius
andrius / 1-odbc.ini
Last active September 1, 2021 17:26
ODBC.ini for Asterisk PBX res_odbc, cdr_odbc and realtime integration #asterisk #odbc
; place this file to /etc (/etc/odbc.ini)
[mysql-asterisk]
Description = MySQL Asterisk database
; MySQL DB name
Database = asterisk
; User
User = asterisk
; Password
freeswitch@dev-voice>
error: tport_logging: capture socket error: No error information
2021-05-14 11:49:22.883128 [NOTICE] switch_channel.c:1118 New Channel sofia/internal/USR-7800c431-e6bf-4af0-9bf7-e03b4bd9ca4f@dev-voice.app.mobitalk.io [e2a313f6-36a4-4c4f-b246-6663dbe6772f]
2021-05-14 11:49:22.883128 [DEBUG] switch_core_state_machine.c:585 (sofia/internal/USR-7800c431-e6bf-4af0-9bf7-e03b4bd9ca4f@dev-voice.app.mobitalk.io) Running State Change CS_NEW (Cur 1 Tot 24)
2021-05-14 11:49:22.883128 [DEBUG] sofia.c:10279 sofia/internal/USR-7800c431-e6bf-4af0-9bf7-e03b4bd9ca4f@dev-voice.app.mobitalk.io receiving invite from 172.18.0.2:41880 version: 1.10.3 -release 64bit
2021-05-14 11:49:22.883128 [DEBUG] sofia.c:10373 verifying acl "domains" for ip/port 172.18.0.2:0.
2021-05-14 11:49:22.883128 [DEBUG] sofia.c:10402 IP 172.18.0.2 Approved by acl "domains[]". Access Granted.
2021-05-14 11:49:22.883128 [DEBUG] sofia.c:11476 Setting NAT mode based on via received
2021-05-14 11:49:22.883128 [DEBUG] sofia.c:7325 Channel
@andrius
andrius / keybase.md
Last active November 4, 2020 12:52
keybase proof

Keybase proof

I hereby claim:

  • I am andrius on github.
  • I am andrius_kai (https://keybase.io/andrius_kai) on keybase.
  • I have a public key whose fingerprint is 5C74 52AF 3515 361A 29AA FDE2 C7F7 E072 25E1 DD9C

To claim this, I am signing this object:

@andrius
andrius / terminate-calls-after-timeout.md
Last active October 27, 2019 20:11
Script to terminate Asterisk PBX calls after the timeout

Initial steps:

Following command will print out details of all active calls:

asterisk -rx "core show channels concise"
# Output:
# SIP/alice-00000002!asterisk.cr!!1!Up!Echo!!!!!3!77!!1572188916.4