Skip to content

Instantly share code, notes, and snippets.

View mohammadhb's full-sized avatar
☠️
Climb with me to Death

Mohammad Hosein Balkhani mohammadhb

☠️
Climb with me to Death
  • @CarpinoTaxi @usc-devs
  • GNU/Linux Kernel
  • 02:46 (UTC +03:30)
View GitHub Profile
@mohammadhb
mohammadhb / README.md
Last active September 30, 2024 19:23
AWS Cloudwatch

AWS Cloudwatch Agent

  1. Install
  2. Create a role and add CloudwatchFullAccess to it
  3. Assign to the EC2 Instance
  4. Edit configs and add the template above
  5. Change Namespace
  6. Pull configs
  7. Start
  8. See status
@mohammadhb
mohammadhb / vscode.json
Created May 2, 2023 13:23
Clean Code Rules
{
// Most code lines should be 40~80 column long after 150 col is not acceptable.
// And the reader have to scroll to the right
"editor.rulers": [
40,
80,
150
],
}
@mohammadhb
mohammadhb / singleton.js
Last active August 3, 2022 15:54
Javascript ES6 Singleton pattern with pure class
class Counter {
static instance;
static getInstance(){
if(!Counter.instance) Counter.instance = new Counter();
return Counter.instance;
}
counter = 0;
getCount() {

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

echo pass | sudo openconnect c9.serverkm.xyz:443 --user=user --passwd-on-stdin --script=/etc/vpnc/vpnc-script
const {performance} = require('perf_hooks');
const start = performance.now();
//Your Code Lays Here :)
const end = performance.now();
/*
cte : Constant to make 0 < (end-start) < 1 when there is no code
* it's just for better understanding ( if you dont want it leave it to be )
@mohammadhb
mohammadhb / nginx-owasp.conf
Last active February 14, 2018 13:57 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048