Skip to content

Instantly share code, notes, and snippets.

View zaherg's full-sized avatar
🎯
Focusing

Zaher Ghaibeh zaherg

🎯
Focusing
View GitHub Profile

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2

@zaherg
zaherg / rcstart.sh
Created July 6, 2021 08:21
simple bash script to start a 6-node redis cluster
#!/bin/sh
PORTS=($(seq 7001 1 7006))
# set up servers
rm -f appendonly.aof
rm -f dump.rdb
for i in ${PORTS[@]}
do
rm -rf $i
mkdir $i
@zaherg
zaherg / country_date_formats.csv
Created June 9, 2021 05:56 — forked from mlconnor/country_date_formats.csv
Listing of countries with their preferred date formats, ISO3166 code, ISO629-2
ISO 3166 Country Code ISO639-2 Country Code Country ISO 3166 Country Code ISO639-2 Lang Language Date Format
ALB AL Albania sqi sq Albanian yyyy-MM-dd
ARE AE United Arab Emirates ara ar Arabic dd/MM/yyyy
ARG AR Argentina spa es Spanish dd/MM/yyyy
AUS AU Australia eng en English d/MM/yyyy
AUT AT Austria deu de German dd.MM.yyyy
BEL BE Belgium fra fr French d/MM/yyyy
BEL BE Belgium nld nl Dutch d/MM/yyyy
BGR BG Bulgaria bul bg Bulgarian yyyy-M-d
BHR BH Bahrain ara ar Arabic dd/MM/yyyy
@zaherg
zaherg / rethinkdb_cheat_sheet.MD
Created August 1, 2020 10:54 — forked from bradtraversy/rethinkdb_cheat_sheet.MD
RethinkDB Query Cheat Sheet

RethinkDB Cheat Sheet

Create database

r.dbCreate('mydb')

List databases

RethinkBD cluster with Traefik & Docker Swarm

The main key is to create two network interfaces, one will be used with traefik and the other one will be used for the containers to communicate with each other

In the yml file I called them application and traefik, then you need to tell Traefik via the labels to use one of them.

When you deploy a stack you will have a name for it, which is also used as a prefix for the netwroks .. etc, to make it simple we will use the environment variables, so that we can have a flixable yml file.

Keybase proof

I hereby claim:

  • I am zaherg on github.
  • I am zaher (https://keybase.io/zaher) on keybase.
  • I have a public key whose fingerprint is ECBF 1A4B B882 85F4 8CE7 9428 8272 27E3 6BEB 0529

To claim this, I am signing this object:

@zaherg
zaherg / std.md
Created March 31, 2020 09:11 — forked from turbo/std.md
Git Commit Message Standard

Merged from https://github.com/joelparkerhenderson/git_commit_message and https://chris.beams.io/posts/git-commit/

General Rules

  • Commit messages must have a subject line and may have body copy. These must be separated by a blank line.
  • The subject line must not exceed 50 characters
  • The subject line should be capitalized and must not end in a period
  • The subject line must be written in imperative mood (Fix, not Fixed / Fixes etc.)
  • The body copy must be wrapped at 72 columns
  • The body copy must only contain explanations as to what and why, never how. The latter belongs in documentation and implementation.
service: my-api-gateway
provider:
name: aws
runtime: nodejs6.10
region: sa-east-1
stage: v1
deploymentBucket: ${env:DEPLOYMENT_BUCKET}
iamRoleStatements:
- Effect: Allow
@zaherg
zaherg / README.md
Created May 2, 2019 16:47 — forked from boneskull/README.md
syntax highlighting for Vagrantfile in non-RubyMine JetBrains IDEs
  1. Add this file to /path/to/prefs/filetypes/
  2. Restart IDE

This page will help you find the correct directory.

@zaherg
zaherg / Readme.MD
Created April 29, 2019 13:54 — forked from JacobBennett/Readme.MD
Regarding Filesystems