Skip to content

Instantly share code, notes, and snippets.

View andrius's full-sized avatar

Andrius Kairiukstis andrius

View GitHub Profile
@andrius
andrius / vscode-cli.sh
Created May 21, 2024 14:54
script that open the vscode cli tunnel so you can access your vps from the laptop
#!/usr/bin/env bash
cd /tmp
[ -f vscode_cli.tar.gz ] && rm -f vscode_cli.tar.gz
if [ ! -f code ]; then
# Based on the CPU architecture, download the appropriate version of Visual Studio Code and install it.
if [ "$(uname -m)" == "x86_64" ]; then
curl -Ls 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-arm64' --output vscode_cli.tar.gz
elif [ "$(uname -m)" == "aarch64" ]; then
@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
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
@andrius
andrius / description.md
Last active September 30, 2019 12:17
Loopback SIP calls with Asterisk PBX

Loopback SIP call with Asterisk

Reason

I need it for testing of new AMI/AGI/ARI library with crystal-lang;

Demo

asciicast

@andrius
andrius / # crystal - 2019-08-10_14-47-32.txt
Created August 10, 2019 14:50
crystal on Debian GNU/Linux 10 (buster) - Homebrew build logs
Homebrew build logs for crystal on Debian GNU/Linux 10 (buster)
Build date: 2019-08-10 14:47:32
@andrius
andrius / # crystal - 2019-08-10_14-30-50.txt
Created August 10, 2019 14:49
crystal on Debian GNU/Linux 9.9 (stretch) - Homebrew build logs
Homebrew build logs for crystal on Debian GNU/Linux 9.9 (stretch)
Build date: 2019-08-10 14:30:50
@andrius
andrius / # crystal - 2019-08-10_13-44-09.txt
Created August 10, 2019 13:34
crystal on Debian GNU/Linux 9.9 (stretch) - Homebrew build logs
Homebrew build logs for crystal on Debian GNU/Linux 9.9 (stretch)
Build date: 2019-08-10 13:44:09
require 'pp'
def embedded_hash(levels, key, data)
if levels == 0
{key => data}
else
{key => embedded_hash(levels-1, key, data)}.merge(data)
end
end