Skip to content

Instantly share code, notes, and snippets.

@sasajib
sasajib / maildirtocouch.py
Created October 20, 2022 09:51 — forked from faried/maildirtocouch.py
Store messages in a Maildir into a couchdb database.
#!/usr/bin/env python
"""Store messages in a Maildir into a couchdb database."""
import couchdb
from mailbox import Maildir
from optparse import OptionParser
import os
from pprint import pprint
import sys
from uuid import uuid4
@sasajib
sasajib / letsencrypt_2017.md
Created September 18, 2022 09:00 — forked from leeoniya/letsencrypt_2017.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@sasajib
sasajib / psql-with-gzip-cheatsheet.sh
Created August 21, 2022 06:40 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database

Last Updated: May 5, 2022

Zoom's Video and Meeting SDKs allow your company to accelerate development and build fully customizable video-based applications with the performance, scale, and reliability of Zoom's industry leading video-first communications platform. Our SDKs are available for Window, macOS, Android, and iOS.

Find more information about our SDKs on the Zoom App Marketplace

Comparison of Video SDK and Meeting SDK offerings

@sasajib
sasajib / gitlab-docker-compose.yml
Created March 2, 2022 18:49 — forked from boiyama/docker-compose.yml
docker-compose.yml configuring GitLab with Container Registry, Pages, CI, Mattermost (enabled WebRTC), and some other options
version: '2'
services:
gitlab:
container_name: gitlab
image: gitlab/gitlab-ce:latest
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
## GitLab configuration settings
##! Check out the latest version of this file to know about the different
rem [https://www.youtube.com/watch?v=AxfZ5NOoDxo]
rem ['This batch file was created by Ioannis Ntizoglou on: 28/01/2021]
rem ['Before you run this batch file you will need to:]
rem ['1 - install the latest Java JDK (visit: https://www.oracle.com/uk/java/technologies/javase-downloads.html)]
rem ['2 - Go to the C: drive and locate the JDK's Bin folder:]
cd "C:\Program Files\Java\jdk-15.0.2\bin"
@sasajib
sasajib / gist:9a0b2a45b182d7a6f96f9fcdca790613
Created January 16, 2022 06:58 — forked from Axxon/gist:c150339eba06dd5cd8ec8b9e2904e40e
Fix append_path message (add fn in /etc/profile.d/perlbin.sh)
append_path()
{
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${PATH:+$PATH:}$1"
esac
}
@sasajib
sasajib / git-branch-rename.sh
Last active August 23, 2024 13:52 — forked from grimzy/git-pull-all
Git rename local and remote branch
#!/usr/bin/env sh
# usage git-branch-rename.sh <oldName> <newName>
# make code up to date
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@sasajib
sasajib / nginx-tuning.md
Created January 17, 2021 11:11 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@sasajib
sasajib / bucket-policies-primer.md
Created August 17, 2020 09:33 — forked from krishnasrinivas/bucket-policies-primer.md
Explanation of bucket polices by example

Bucket Policy

Bucket policy is an access policy available for you to grant anonymous permissions to your Minio resources. Bucket policy uses JSON-based access policy language.

This section presents a few examples of typical use cases for bucket policies. The policies use testbucket strings in the resource value. To test these policies, you need to replace these strings with your bucket name. For more information please read Amazon S3 access policy language

Granting Read-Only Permission to an Anonymous User

The following example policy grants the s3:GetObject permission to any public anonymous users. This permission allows anyone to read the object data under testbucket, which is useful for when you have publicly readable assets. A typical example is a website assets stored in testbucket.