Skip to content

Instantly share code, notes, and snippets.

View rahman541's full-sized avatar
🎯
Focusing

Rahman rahman541

🎯
Focusing
View GitHub Profile
@rahman541
rahman541 / full-screen-video-with-text-overlay.markdown
Created September 25, 2023 09:36
Full Screen Video with Text Overlay
@rahman541
rahman541 / index.html
Last active May 10, 2020 11:20
Simple Vue JS
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.2/css/bulma.min.css">
</head>
@rahman541
rahman541 / mail.php
Created May 27, 2019 15:14
SMTP Gmail sending mail.
<?php
// REF: https://swiftmailer.symfony.com/docs/introduction.html
// composer require "swiftmailer/swiftmailer:^6.0"
require_once './vendor/autoload.php';
$MAIL_HOST = 'smtp.gmail.com';
$MAIL_PORT = '465';
$MAIL_USERNAME = 'server@gmail.com';
$MAIL_PASSWORD = 'mypwd';
@rahman541
rahman541 / rahman541.zshrc
Last active March 29, 2019 16:53
Custom oh-my-zsh powerlevel9k
# https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config#kayants-configuration
# https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config#tunnckocore-configuration
POWERLEVEL9K_MODE='awesome-patched'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
os_icon root_indicator context dir vcs
)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time background_jobs ram)
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_STATUS_VERBOSE=false
@rahman541
rahman541 / .zshrc
Last active March 29, 2019 17:50
ZSHRC powerlevel9k
ZSH_THEME="powerlevel9k/powerlevel9k"
# powerlevel9k
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_TIME_FOREGROUND='red'
POWERLEVEL9K_DIR_HOME_BACKGROUND='123'
POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND='123'
POWERLEVEL9K_DIR_ETC_BACKGROUND='123'
POWERLEVEL9K_DIR_DEFAULT_BACKGROUND='123'
; Block executable from internet access with Windows Firewall
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell]
[HKEY_CLASSES_ROOT\exefile\shell\Firewall: Add]
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\exefile\shell\Firewall: Add\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd && netsh advfirewall firewall add rule name=\\\"%1\\\" dir=out action=block program=\\\"%1\\\" & pause & exit' -Verb RunAs\""
@rahman541
rahman541 / tdexample.js
Created February 4, 2019 09:46
TDLib in Javascript
const ref = require('ref-napi')
const ffi = require('ffi-napi')
const win = require('./win')
const rs = require('readline-sync')
win.SetDllDirectoryA('../tdlib')
tdlib = ffi.Library('tdjson.dll', {
'td_json_client_create': ['pointer', []],
'td_json_client_send': ['void', ['pointer', 'string']],
@rahman541
rahman541 / factorialFinder.cpp
Created January 20, 2019 08:14
Factorial finder in C++
#include <iostream>
using namespace std;
int factorialFinder(int x) {
if (x == 1) return 1;
return x * factorialFinder(x-1);
}
int main() {
cout << factorialFinder(5) << endl;
#include <iostream>
#include <string>
using namespace std;
// REF: https://www.quora.com/Why-use-of-pointer-make-the-c-c++-language-less-secure-How-hackers-can-take-advantage-of-it
class Example
{
private:
int a=10; //private variable

Automate Deploy Node App in Amazon EC2 Linux

PREREQUISITES

To Login

ssh -i <private-key-file/pem> ec2-user@[ec2-hostname].amazonaws.com
  1. Install Node JS & pm2 Ref: