Skip to content

Instantly share code, notes, and snippets.

View DastanIqbal's full-sized avatar
🎯
Focusing

Iqbal Ahmed DastanIqbal

🎯
Focusing
View GitHub Profile
@DastanIqbal
DastanIqbal / extractDeals
Created April 12, 2024 20:50
Extract Deals from the website
import re
import requests
def extract_second_parameter_from_js(url):
# Load JavaScript file from the URL
response = requests.get(url)
# Check if the request was successful
if response.status_code == 200:
@DastanIqbal
DastanIqbal / remote-debugging
Created June 22, 2022 12:58
Debug app while building app to find the crash cause, mark the breakpoint where it's crashing
./gradlew assembleProdDebug --no-daemon -Dorg.gradle.debug=true -Dkotlin.compiler.execution.strategy="in-process" -Dkotlin.daemon.jvm.options="-agentlib:jdwp=transport=dt_socket\,server=y\,suspend=n\,address=5005"
#Android Studio -> Edit Configuration -> Remote Debugging -> Okay
# Enable allow parllel run, choose java jdk
# press debug or ctrl + D
@DastanIqbal
DastanIqbal / ssl.sh
Created August 9, 2021 14:08
Find website certificate RSA 2048 SHA256
#!/bin/bash
certs=`openssl s_client -servername $1 -host $1 -port 443 -showcerts </dev/null 2>/dev/null | sed -n '/Certificate chain/,/Server certificate/p'`
rest=$certs
while [[ "$rest" =~ '-----BEGIN CERTIFICATE-----' ]]
do
cert="${rest%%-----END CERTIFICATE-----*}-----END CERTIFICATE-----"
rest=${rest#*-----END CERTIFICATE-----}
echo `echo "$cert" | grep 's:' | sed 's/.*s:\(.*\)/\1/'`
echo "$cert" | openssl x509 -pubkey -noout |
openssl rsa -pubin -outform der 2>/dev/null |
@DastanIqbal
DastanIqbal / icons.py
Last active August 16, 2020 11:33
Generate Android icons.xml file using demo.html Glyph icons
#pip3 install bs4
#pip3 install lxml
import sys
from bs4 import BeautifulSoup as bs
separator = "="
file = open("icons.xml",'w')
file.write('<?xml version="1.0" encoding="utf-8"?>\n')
file.write('<resources>\n')

Install Gitlab Runner

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt-get install gitlab-runner
apt-cache madison gitlab-runner
sudo apt-get install gitlab-runner=13.1.1

Register Gitlab Runner Setting can be find gitlab runner project setting

apt install certbot python-certbot-nginx
certbot --nginx
@DastanIqbal
DastanIqbal / export_import.md
Created July 6, 2020 09:30
Export Import MySQL/MariaDB Databases

Export existing Databases

 mysqldump --all-databases > dump.sql

If you want to download from your website

mv dump.sql /var/www/vhosts/webiste/git/repo/src/public/
@DastanIqbal
DastanIqbal / mariadb.sh
Created July 6, 2020 09:22
Install MariaDB
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository "deb [arch=amd64,arm64,ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu $(lsb_release -cs) main"
sudo apt update
sudo apt -y install mariadb-server mariadb-client
mysql_secure_installation
wget http://software.virtualmin.com/gpl/scripts/install.sh;chmod +x install.sh;./install.sh -b LEMP