Skip to content

Instantly share code, notes, and snippets.

View hamidrhashmi's full-sized avatar

Hamid R. Hashmi hamidrhashmi

View GitHub Profile
@hamidrhashmi
hamidrhashmi / FS-on-Rockey.md
Last active December 19, 2024 14:25
How to install Freeswitch on Rocky Linux 8 from Source

Enable CRB

dnf config-manager --set-enabled crb

Enable Epel Repo for Rocky 8

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-8.noarch.rpm
@hamidrhashmi
hamidrhashmi / VPN.md
Last active October 28, 2024 09:13
How to setup you own VPN Server ?

Prerequisite

  1. Debian 12 Machine
  2. on a cloud with Public IP (I am using DidgitalOcean)
  3. inerface name of public IP ( my interface name is eth0)

STEP 1: Configure IP Forwarding

Eidt sysctl.conf file

vim /etc/sysctl.conf
@hamidrhashmi
hamidrhashmi / viscosity-to-openvpn.py
Created September 19, 2024 18:52
Convert Viscosity file o OpenVPN file
#!/usr/bin/env python3.11
# -*- coding: utf-8 -*-
"""Converts viscosity export files into an open vpn package
Usage: viscosity-to-openvpn.py <input> <output>
"""
import io
import os
import sys
import tarfile
@hamidrhashmi
hamidrhashmi / heplify.md
Last active December 5, 2024 08:01
How to configure / deploy heplify on SIP Server

Download and install the Latest heplify release

wget https://github.com/sipcapture/heplify/releases/latest/download/heplify
chmod +x heplify
mv heplify /usr/bin/heplify

Create service file for heplify

vim /etc/systemd/system/heplify.service
@hamidrhashmi
hamidrhashmi / ipsec_tunnel.md
Created August 14, 2024 10:02
How to create IPsec Tunnel

DEFAULT values

sysctl -a | grep "net.ipv4.ip_forward \|net.ipv6.conf.all.forwarding\|net.ipv4.conf.all.accept_redirects\|net.ipv4.conf.all.send_redirects"
net.ipv4.conf.all.accept_redirects = 1
net.ipv4.conf.all.send_redirects = 1
net.ipv4.ip_forward = 0
net.ipv6.conf.all.accept_redirects = 1
@hamidrhashmi
hamidrhashmi / fail2ban_freeswitch.md
Last active August 14, 2024 09:41
How to configure Fail2Ban with Freeswitch

Install fail2ban

apt install fail2ban

create the following file

vim /etc/fail2ban/jail.d/freeswitch.local

copy the foolowing content in file freeswitch.local

@hamidrhashmi
hamidrhashmi / goautodial.md
Last active December 13, 2024 11:36
Free Call Center Solution for SMEs

STEP 1: Disbale SELinux and firewallD

 setenforce 0

disable permamnanlty

vim /etc/selinux/config

set

SELINUX=disabled

@hamidrhashmi
hamidrhashmi / nginx.md
Created June 21, 2024 06:32
How to relay HTTPS traffic to HTTP endpoint with nginx

Create file in site-available folder

vim /etc/nginx/sites-available/backendservice.conf

and past ethe following line in it

server {
    client_max_body_size 100M;
    server_name PUB_API;
 listen 3555 ssl;
@hamidrhashmi
hamidrhashmi / postgres.md
Last active May 7, 2024 06:53
Postgres HowTo

How to connect with postgres CLI

su postgres
psql -U postgres -W Password

Postgress keywords in comparison to mysql

database=# \l                                           //show databases
database=# \c database                           // use database
database=# \dt // show tables;
@hamidrhashmi
hamidrhashmi / virtualbox.md
Last active May 3, 2024 14:50
How to resize Hard disk of a Linux VM

Pre-Requiste

First Confirm if your Linux machine was created using LVM or not, execute the following commands

pvdisplay
vgdisplay
lvdisplay

if the se commands show som eout then it mean that Vm was created thorugh LVM and you can resize it. now install GRUB in /dev/sda/ so that when you resize the HDD, BIOS can boot the machine.