Skip to content

Instantly share code, notes, and snippets.

View Clivern's full-sized avatar

Ahmed Clivern

View GitHub Profile
@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 / 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 / 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"
package main
import (
"go.uber.org/zap"
"encoding/json"
)
func main() {
cfg := zap.NewProductionConfig()
@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 / crons_list.sh
Last active June 11, 2019 14:12
Get All Cron Jobs for All Users
# List Cron Jobs
$ for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
$ for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
# Edit crontab
$ sudo crontab -e -u www-data
@Clivern
Clivern / SlackLauncher.sh
Created July 16, 2019 08:51 — forked from viktorklang/SlackLauncher.sh
Launcher script for Slack on macOS which warns you if you open if while on battery power
#!/usr/bin/env bash
if [[ $(pmset -g ps | head -1) =~ "Battery Power" ]]; then
osascript -e 'display notification "You are starting Slack while running on battery power" with title "Battery Drain Source Detected" subtitle ""'
fi
open /Applications/Slack.app
@Clivern
Clivern / introrx.md
Created July 25, 2019 22:07 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@Clivern
Clivern / Dockerfile
Created August 8, 2019 18:38 — forked from thesandlord/Dockerfile
ConfigMaps and Secrets with Kubernetes
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
FROM node:6-onbuild
EXPOSE 3000
ENV LANGUAGE English
ENV API_KEY 123-456-789
@Clivern
Clivern / gist:8d70c1f3f6dd1b7eb4d1679559f49c0e
Created September 8, 2019 10:28
Kubernetes in Cluster Client
https://github.com/kubernetes/client-go/tree/master/examples/in-cluster-client-configuration