Skip to content

Instantly share code, notes, and snippets.

View hamidrhashmi's full-sized avatar

Hamid R. Hashmi hamidrhashmi

View GitHub Profile
@hamidrhashmi
hamidrhashmi / Deploy.md
Last active February 23, 2024 13:33
How to Deploy Dot Net API on Debian 12

STEP 1: Install .NET Runtime

wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

install SDK

sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0
@hamidrhashmi
hamidrhashmi / mongooseIM.md
Last active April 5, 2024 07:21
How to Deploy MongooseIM - XMPP Server

Pre-rquisite:

I will be using Debian 12

Step 1: Install MariaDB

Add MariaDB repository

sudo apt-get install apt-transport-https curl
sudo mkdir -p /etc/apt/keyrings
sudo curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'

Installation Steps Kamailio v5.7.1

wget https://www.kamailio.org/pub/kamailio/latest/src/kamailio-5.7.0_src.tar.gz 
tar -xf kamailio-5.7.0_src.tar.gz 
cd kamailio-5.7.0 
apt install libunistring-dev bison flex 
make PREFIX="/opt/kamailio" include_modules="db_mysql tls websocket xmlrpc http_client" cfg 
make Q=0 all 
make install 
cp pkg/kamailio/deb/debian/kamailio.service /etc/systemd/system/ 
@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.

@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 / 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 / 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 / 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 / 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 / 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