Skip to content

Instantly share code, notes, and snippets.

View Clivern's full-sized avatar

Ahmed Clivern

View GitHub Profile
@Clivern
Clivern / sha256file.go
Created May 29, 2019 23:58 — forked from miguelmota/sha256file.go
Golang SHA256 checksum of file
package main
import (
"crypto/sha256"
"fmt"
"io"
"log"
"os"
)
@Clivern
Clivern / nomad-install.sh
Created May 9, 2019 20:49 — forked from ryanpadilha/nomad-install.sh
HashiCorp Nomad installation on Linux x64
#!/bin/bash
#
# Installation of Hashicorp Nomad for deploy process
#
# Download this file:
# curl -sSL https://gist.githubusercontent.com/ryanpadilha/351a4a4f17afdc8eb0d963897b98122a/raw/ -o nomad-install.sh
#
echo "Initializing script for devops - Nomad Hashicorp"
@Clivern
Clivern / main.go
Created May 8, 2019 20:27 — forked from walm/main.go
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@Clivern
Clivern / 0_python_email.md
Created April 13, 2019 22:03 — forked from nickoala/0_python_email.md
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@Clivern
Clivern / upgrade2.3-to-2.7.md
Created January 29, 2019 14:31 — forked from mickaelandrieu/upgrade2.3-to-2.7.md
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS

From Symfony 2.3 to Symfony 2.7: the complete guide

Objectives

  • assume your code doesn't use any deprecated from versions below Symfony 2.3
  • update dependencies from 2.3 to 2.7
  • do not support "deprecated", be "Symfony3-ready"
  • list tasks component by component, bundle by bundle.
@Clivern
Clivern / upgrade_to_symfony3-lts.md
Created January 29, 2019 14:18 — forked from mickaelandrieu/upgrade_to_symfony3-lts.md
Migration guide to Symfony 3 LTS

Let's migrate a Symfony 2.8 LTS application to Symfony 3 LTS

Handle deprecations

First of all, ensure you don't have any deprecated!

The Symfony documentation explains it well, but let's sum up:

  • install the phpunit bridge ($ composer require --dev symfony/phpunit-bridge)
  • also check all your pages using web profiler and be ensure there is no deprecation error handled
  • found errors and need help about how to fix it ? I did a sort of guide.
@Clivern
Clivern / handler.go
Created October 2, 2018 12:39 — forked from rjz/handler.go
Handle Github webhooks with golang
// Now available in package form at https://github.com/rjz/githubhook
package handler
// https://developer.github.com/webhooks/
import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
"errors"
@Clivern
Clivern / gist:742f511e8554b1510c9139a1ecaf1dc4
Created October 1, 2018 16:27
An example of a JSON Unmarshal into a Go struct.
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
type Artist struct {
@Clivern
Clivern / vault-install.sh
Created August 29, 2018 20:22 — forked from ewilde/vault-install.sh
Install hashicorp vault on ubuntu using systemd
#!/usr/bin/env bash
set -e
echo "Installing dependencies..."
sudo apt-get update -y
sudo apt-get install -y unzip
echo "Fetching vault..."
VAULT=0.6.5
@Clivern
Clivern / nginxproxy.md
Created May 12, 2018 14:45 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers