Skip to content

Instantly share code, notes, and snippets.

View sumonst21's full-sized avatar
💭
I may be slow to respond.

Md. Sumon Islam sumonst21

💭
I may be slow to respond.
View GitHub Profile
@sumonst21
sumonst21 / install-duplicati.sh
Created February 9, 2023 03:20 — forked from aubruz/install-duplicati.sh
Script to install Duplicati on RHEL/CentOS 7+ (Suitable for headless servers)
#!/bin/bash
# Install dependencies
yum install appindicator-sharp libappindicator-sharp mono-core libappindicator -y
# Get Duplicati
wget https://updates.duplicati.com/beta/duplicati-2.0.5.1-2.0.5.1_beta_20200118.noarch.rpm
#Install Duplicati
rpm -i duplicati-2.0.5.1-2.0.5.1_beta_20200118.noarch.rpm
@sumonst21
sumonst21 / index.html
Created February 8, 2023 10:41 — forked from maxkostinevich/index.html
Cloudflare Worker - Handle Contact Form
<!--
/*
* Serverless contact form handler for Cloudflare Workers.
* Emails are sent via Mailgun.
*
* Learn more at https://maxkostinevich.com/blog/serverless-contact-form
* Live demo: https://codesandbox.io/s/serverless-contact-form-example-x0neb
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
@sumonst21
sumonst21 / get_real_ip_cloudflare.php
Created February 3, 2023 04:03 — forked from lenivene/get_real_ip_cloudflare.php
Get REAL IP in CloudFlare by PHP
<?php
function get_ip(){
if( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ){
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
elseif( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else{
$ip = $_SERVER['REMOTE_ADDR'];
#!/bin/bash
# This script is used to create a systemd service for the chromedriver --verbose --allowed-ips=127.0.0.1
# It is used to run the chromedriver as a service on the server and start it automatically on boot
# Create a file called chromedriver.service in /etc/systemd/system/ with the following content
CONTENT="[Unit]
Description=chromedriver
After=network.target
@sumonst21
sumonst21 / google-img-resize.mdown
Created January 6, 2023 09:30
Google’s authentication-less on-the-fly image resizing service

Google's authentication-less on-the-fly image resizing service

I found it while poking around the Google+ HTML. Jotting down some notes felt like a good idea, so here goes. If you know more about this API, let me know, please!

(Word of warning: I spent ~30 minutes on both my experimentation and this here write-up, so it might not be the most thought-provoking, brilliant thing you read today.)

@sumonst21
sumonst21 / deployment_guide.md
Created January 5, 2023 01:43 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel

Q1. Overall structure of a Library Database is given below

Create(5) those tables and insert(5) 5 rows in each table.
Represent the primary key(5) of different table and also foreign key(5) relationship.
Write(5) a query to display the name of the book and the name of the author of the book.

Tables:
    Author ( authorname, citizenship, birthyear)
    Book(isbn, title, authorname)
    Topic(isbn, subject) Branch(libname, city)
<?php
/**
* function for versioning static assets (images, css, js, etc.) by appending a file's last modified time to the filename (e.g. style.1234567890.css)
* Requires Custom Htaccess rules to be in place (see below)
* Apache .htaccess rules:
* <IfModule mod_rewrite.c>
* RewriteEngine On
* RewriteCond %{REQUEST_FILENAME} !-f
* RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
* # to append apply on certain paths only, use the following:
@sumonst21
sumonst21 / github_desktop_ubuntu.sh
Created November 26, 2022 22:01 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest
# UPDATE (2022-11-07): Thanks to Sxvxgee's message, the updated code is as follows
sudo wget https://github.com/shiftkey/desktop/releases/download/release-3.1.1-linux1/GitHubDesktop-linux-3.1.1-linux1.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-3.1.1-linux1.deb
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
@sumonst21
sumonst21 / my.cnf
Created November 24, 2022 02:26 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#