Skip to content

Instantly share code, notes, and snippets.

@ca4ti
ca4ti / build-gcc-offload-nvptx.sh
Created January 26, 2022 20:04 — forked from matthiasdiener/build-gcc-offload-nvptx.sh
Script to build gcc with OpenMP offloading to Nvidia devices (via nvptx)
#!/bin/bash
#
# Build GCC with support for offloading to NVIDIA GPUs.
#
set -o nounset -o errexit
# Location of the installed CUDA toolkit
cuda=/usr/local/cuda
@ca4ti
ca4ti / termux_mxrig.md
Created January 26, 2022 17:44 — forked from 2niuhe/termux_mxrig.md
install XMRig on termux

Monero XMR mining via termux ;ubuntu

  1. install ubuntu in termux command; (ubuntu is optional)
pkg install update && upgrade
apt install git
apt install wget
apt install proot
@ca4ti
ca4ti / check-auth.py
Created December 9, 2021 13:26 — forked from 62mkv/check-auth.py
Python script to calculate SIP REGISTER Digest authentication (in order to check password validity)
from md5 import md5
# header from 401 response on REGISTER
# Authorization: Digest username="883140776410950", realm="gw_youmagic", algorithm=MD5, uri="sip:GW_Youmagic", nonce="1476157437:0a1418a40f8ee1c9a55f1587ab931c14", response="3ff479ccc24874f66aae45dac889d099"
login = '883140776410950'
uri = 'sip:GW_Youmagic'
nonce = '1476157437:0a1418a40f8ee1c9a55f1587ab931c14'
realm = 'gw_youmagic'
password = '----------'
@ca4ti
ca4ti / remotehintpoll.php
Created December 7, 2021 21:18 — forked from lgaetz/remotehintpoll.php
Simple PHP script that checks the extension status at a remote PBX and updates a custom hint on the local pbx for proper BLF operation.
<?php
/**** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
* remotehintpoll.php
*
* Created by Lorne Gaetz [email protected]
*
* Latest version: https://gist.github.com/lgaetz/8545099
*
* Licensed under GNU GPL version 2 or any later verison.
@ca4ti
ca4ti / asterisk-13.2.0-win.patch
Created November 29, 2021 12:49 — forked from meitinger/asterisk-13.2.0-win.patch
Compile guide for Asterisk on Cygwin.
diff -ru asterisk-13.2.0-orig/apps/Makefile asterisk-13.2.0-patched/apps/Makefile
--- asterisk-13.2.0-orig/apps/Makefile 2013-04-15 18:43:47.000000000 +0200
+++ asterisk-13.2.0-patched/apps/Makefile 2015-03-24 03:28:53.684406200 +0100
@@ -34,6 +34,6 @@
$(subst .c,.o,$(wildcard confbridge/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,app_confbridge)
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
- LIBS+= -lres_features.so -lres_ael_share.so -lres_monitor.so -lres_speech.so
+ LIBS+= -lres_stasis.so -lres_ael_share.so -lres_monitor.so -lres_speech.so
LIBS+= -lres_smdi.so
@ca4ti
ca4ti / HowToOTG.md
Created November 29, 2021 00:24 — forked from gbaman/HowToOTG.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

https://community.asterisk.org/t/call-detail-records-are-not-saving-in-cdr/76743/6
Install packages
apt-get install unixodbc-dev unixodbc-bin unixodbc
/etc/odbc.ini
[asterisk-mysql]
Description = MySQL connection to ‘asterisk’ database
Driver = MySQL
Database = asterisk
Server = localhost
@ca4ti
ca4ti / stt.sh
Created November 22, 2021 17:21 — forked from germanattanasio/stt.sh
curl commands to use the Speech to Text service
#!/bin/sh
# This script clears the terminal, call the IBM Watson Speech to Text service.
USERNAME="<SERVICE_USERNAME>"
PASSWORD="<SERVICE_PASSWORD>"
SESSION_ID="<SESSION_ID>" # you will get this after running (1)
# 1. Create a session:
curl -X POST -b cookies.txt -c cookies.txt -u $USERNAME:$PASSWORD -d "{}" "https://stream.watsonplatform.net/speech-to-text/api/v1/sessions"
# This returns you a session URL. Note that the client needs to support cookies for sessions to work.
@ca4ti
ca4ti / ari_originate.py
Created October 25, 2021 15:09 — forked from litnimax/ari_originate.py
Asterisk REST interface origination script to call from console or other apps
#!/usr/bin/env python2.7
# Requirements: pip install ari gevent
import argparse
import ari
import gevent
from gevent.monkey import patch_all; patch_all()
from gevent.event import Event
import logging
from requests.exceptions import HTTPError, ConnectionError
import socket
@ca4ti
ca4ti / vlc-elgato-catpure.md
Created September 9, 2021 22:08 — forked from ThatGuySam/vlc-elgato-catpure.md
Windows Shortcut Target for VLC to show Elgato HD60S Video Stream of PS4 Pro

How to Capture an Elgato Device(or any capture device) in VLC


Make a copy of your normal VLC Shortcut and paste this into it's Target under Properties and customize according to you're system and setup.

"C:\Program Files\VideoLAN\VLC\vlc.exe" dshow:// :dshow-vdev="Game Capture HD60 S (Video) (#01)" :dshow-adev="Game Capture HD60 S (Audio) (#01)" :dshow-aspect-ratio="16:9" :dshow-audio-samplerate=48000 :dshow-audio-channels=2 :live-caching=0 :dshow-fps=60