Skip to content

Instantly share code, notes, and snippets.

View Clivern's full-sized avatar

Ahmed Clivern

View GitHub Profile
@Clivern
Clivern / install_go_1.12.sh
Created November 18, 2019 11:21
Install golang 1.12
sudo apt-get update
sudo apt-get -y upgrade
cd /tmp
wget https://dl.google.com/go/go1.12.linux-amd64.tar.gz
sudo tar -xvf go1.12.linux-amd64.tar.gz
sudo mv go /usr/local
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
@Clivern
Clivern / WordCounter.scala
Created November 4, 2019 22:06 — forked from Diego81/WordCounter.scala
Simple Word Counter implemented using Akka
import akka.actor.{ Actor, ActorRef, Props, ActorSystem }
case class ProcessStringMsg(string: String)
case class StringProcessedMsg(words: Integer)
class StringCounterActor extends Actor {
def receive = {
case ProcessStringMsg(string) => {
val wordsInLine = string.split(" ").length
sender ! StringProcessedMsg(wordsInLine)
@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
@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 / introrx.md
Created July 25, 2019 22:07 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@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 / 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 / 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"
)
package main
import (
"go.uber.org/zap"
"encoding/json"
)
func main() {
cfg := zap.NewProductionConfig()
@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"