Skip to content

Instantly share code, notes, and snippets.

View NazmusShakib's full-sized avatar
:octocat:
Working from home

Nazmus Shakib NazmusShakib

:octocat:
Working from home
View GitHub Profile
@NazmusShakib
NazmusShakib / prepare-windows-workstation.txt
Last active April 13, 2023 06:33
Window in focus doesn't minimize when I click on its icon in the taskbar (Windows 10)??
# Window in focus doesn't minimize when I click on its icon in the taskbar (Windows 10)??
# This is likely a temporary bug. Try to gracefully restart Explorer.exe to solve the problem without a reboot.
# Paste each line below, one at a time, followed by enter
taskkill /f /IM explorer.exe
explorer.exe
exit
# enable conda command in git-bash
@NazmusShakib
NazmusShakib / Nginx-Reverse-Proxy.conf
Last active June 10, 2022 09:50
Docker containers port serve through domains use Nginx-Reverse-Proxy
# Reverse-Proxy - mydomain api & admin
server {
listen 443 ssl;
# listen [::]:443 ssl;
server_name stage-api-v2.mydomain.com;
client_max_body_size 100M;
location / {
@NazmusShakib
NazmusShakib / Presence status - google cloud function.js
Last active August 6, 2020 09:26
Presence feature using google firestore, realtime database and the cloud function
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
const firestore = functions.firestore;
exports.onUserPresenceStatusChanged = functions.database
.ref('/online/{userId}')
.onUpdate((change, context) => {
## Create a file in '~/.ssh' directory called 'config' and set below code with valid configuration.
## Then simply type 'ssh example-1.com' to go there.
Host example-1.com
Hostname 00.000.000.000
User ubuntu
IdentityFile ~/.ssh/pem-files/example-1.pem
Host example-2.com
Hostname 000.000.000.000
@NazmusShakib
NazmusShakib / ffmpeg_audio_merged.py
Created June 17, 2019 11:00
Merge multiple audio files along with silence using ffmpeg.
import subprocess
import json
def main():
jsonfilename = 'source_list.json'
with open(jsonfilename) as f:
data = json.load(f)
inFiles = data["read_info"]["files"]
@NazmusShakib
NazmusShakib / concatenate-media-files.py
Created June 12, 2019 18:55
ffmpeg: merge multiple MP4 files, it's necessary to pass by .ts files
import os
import subprocess
import glob
def main():
tsFileList = []
# consider only .mp4 files
files = glob.glob('*.mp4')
for file in files:
-- Download the Postman from: https://www.getpostman.com/downloads
-- Extract and move it to: /opt/
-- Then open terminal and execute below code:
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Version=1.0
sudo apt install libapache2-mod-php7.0 php7.0-xml php7.0-gd php7.0-opcache php7.0-mbstring php7.0-fpm php7.0-intl php7.0-imap php7.0-pgsql php7.0-soap php7.0-zip php7.0-bcmath php-pear php7.0-zip php7.0-curl php7.0-mysql php7.0-mcrypt
# Need to modify and run::
$ vim /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All # None to All
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import datetime
import boto3
client = boto3.client(
'ses',
region_name = 'us-east-1',
aws_access_key_id = 'IUITRERTTUUOI',
@NazmusShakib
NazmusShakib / api.php
Last active March 21, 2018 07:31
Laravel 5.6 jwt routing.
<?php
Route::post('signup', 'AuthController@register');
Route::post('login', 'AuthController@login');
Route::group(['prefix' => 'auth', 'middleware' => 'jwt.auth'], function () {
Route::get('user', 'AuthController@user');
Route::post('logout', 'AuthController@logout');