Skip to content

Instantly share code, notes, and snippets.

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

Hamid R. Hashmi hamidrhashmi

🏠
Working from home
View GitHub Profile
@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.

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 / 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'
@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 / INSTALL.md
Created February 23, 2024 13:03
How to install Freeswitch from Source on Debian 12

Step 1: install dependencies

apt install aptitude build-essential
aptitude install autoconf libtool libtool-bin pkg-config libpq-dev lua5.4 liblua5.4-dev libmariadb-dev git libtiff-dev libsqlite3-dev libcurl4-openssl-dev libcurl4-nss-dev libcurl4-gnutls-dev libpcre3 libpcre3-dev libspeex-dev libspeexdsp-dev libldns-dev yasm uuid-dev uuid libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0 libvo-amrwbenc-dev libvo-amrwbenc0 libswscale-dev libavformat-dev libopus-dev libshout3-dev libmpg123-dev libmp3lame-dev libsndfile-dev libapr1 libapr1-dev libncurses5 libncurses5-dev libsctp-dev libsctp1 libtinfo5 sqlite3 unzip zip libedit-dev cmake

Step 2: Install spandsp

git clone https://github.com/freeswitch/spandsp.git
cd spandsp
@hamidrhashmi
hamidrhashmi / Install_grafana_agent.md
Created January 3, 2024 06:33
How to configure grafana agent to send logs

Go to Grafana agent git repo, and download the altest release or use the following command to download for Debian

wget https://github.com/grafana/agent/releases/download/v0.38.1/grafana-agent-0.38.1-1.amd64.deb

instal the agent

dpkg -i grafana-agent-0.38.1-1.amd64.deb

Edit grafana-agent configuration file /etc/grafana-agent.yaml

@hamidrhashmi
hamidrhashmi / install_vector.md
Last active January 3, 2024 06:27
Install Vector to received syslog and send them as Loki

Install vector

curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev | bash

this will install vector in home directory, move it to /usr/local

mv /root/.vector /usr/local/vector/

create a config file

@hamidrhashmi
hamidrhashmi / install_grafana.md
Last active January 3, 2024 06:36
How to configure Logging Server with Grafana and qryn

STEP 3: Install qryn

STEP 4: Install grafana-server

apt-get install -y apt-transport-https software-properties-common wget
mkdir -p /etc/apt/keyrings/
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
@hamidrhashmi
hamidrhashmi / qryn_install.md
Last active January 4, 2024 10:33
How to Install qryn

STEP 3: Install qryn

go to the directory

cd /usr/local/
git clone https://github.com/metrico/qryn && cd qryn
npm install

Create a Unit file