Skip to content

Instantly share code, notes, and snippets.

View Hidenmy's full-sized avatar
🏠
Working from home

Hidenmy

🏠
Working from home
View GitHub Profile
@Hidenmy
Hidenmy / jssip.md
Created January 1, 2022 20:19 — forked from dtolb/jssip.md
JsSip Demo

#JSSIP with Catapult API ​ ##Prerequisites ​

  • Register for a Catapult (Bandwidth Application Platform) account here
  • Register a SIP domain
  • Create an endpoint/user
  • If you want to make calls to the PSTN (normal phones) you will need a server to handler events from Catapult
  • Make phone calls ​
@Hidenmy
Hidenmy / parser.py
Created December 15, 2021 20:58 — forked from hreeder/parser.py
Python nginx Log Parser
#!/usr/bin/env python
import gzip
import os
import sys
import re
INPUT_DIR = "nginx-logs"
lineformat = re.compile(r"""(?P<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?P<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] ((\"(GET|POST) )(?P<url>.+)(http\/1\.1")) (?P<statuscode>\d{3}) (?P<bytessent>\d+) (["](?P<refferer>(\-)|(.+))["]) (["](?P<useragent>.+)["])""", re.IGNORECASE)
@Hidenmy
Hidenmy / asterisk.sh
Created July 10, 2021 21:12 — forked from kolosek/asterisk.sh
Install Asterisk 16 LTS on Ubuntu 18.04 / 16.04 & Debian 10/9
#Update system & reboot
sudo apt update && sudo apt -y upgrade
sudo reboot
#Install Asterisk 16 LTS dependencies
sudo apt -y install git curl wget libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libjansson-dev libxml2-dev uuid-dev
#Add universe repository and install subversio
sudo add-apt-repository universe
sudo apt update && sudo apt -y install subversion
@Hidenmy
Hidenmy / docker-compose.yml
Created March 15, 2021 12:53 — forked from thomas15v/docker-compose.yml
Install odoo with docker-compose
version: '2'
services:
db:
image: postgres:9.4
restart: always
environment:
- POSTGRES_USER=odoo
- POSTGRES_PASSWORD=odoo
odoo:
image: odoo:11
@Hidenmy
Hidenmy / aiohttp-server.py
Created September 2, 2020 21:31 — forked from rcarmo/aiohttp-server.py
Example: asyncio and aiohttp, handling longpoll, eventsource and websocket requests with a queue and background workers
from aiohttp import web
from threading import Thread
import asyncio
import time, uuid
loop = asyncio.get_event_loop()
def long_blocking_thing(sleep):
time.sleep(sleep)
return 42
@Hidenmy
Hidenmy / .env-example
Created October 29, 2019 11:23 — forked from gjbagrowski/.env-example
Django-environ example
# project-repo/app/settings/.env-example
#
# DJANGO
#
SITE_HOST=localhost:8000
USE_SSL=False
ALLOWED_HOSTS=localhost,127.0.0.1
SECRET_KEY=asdasd
DEBUG=true # never on production, will cause settings including api keys to leak
DJANGO_LOG_LEVEL=DEBUG
@Hidenmy
Hidenmy / generate-certificates.sh
Created May 23, 2019 15:11
Generate self-signed ssl certificates.
#!/bin/bash
# set values for certificate DNs
# note: CN is set to different values in the sections below
ORG="000_Test_Certificates"
# set values that the commands will share
VALID_DAYS=360
CA_KEY=ca.key
CA_CERT=ca.crt
@Hidenmy
Hidenmy / host-react-app-on-apache-server.md
Created May 21, 2019 10:19 — forked from ywwwtseng/host-react-app-on-apache-server.md
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production