Skip to content

Instantly share code, notes, and snippets.

View gkarugi's full-sized avatar

Karugi Gitau gkarugi

View GitHub Profile
@gkarugi
gkarugi / README.md
Created January 15, 2024 06:43 — forked from gilangvperdana/README.md
Monitoring Nginx with InfluxDB - Telegraf - Prometheus - Grafana

Monitoring Nginx from Grafana with InfluxDB-Telegraf & Prometheus

InfluxDB for Time Database
Telegraf for Metrics Server Agent
Prometheus for Metrics Collector
Grafana for Metrics Visualizator
I just want to exploration about monitoring some metrcis Nginx with LoadBalancer Topology on Grafana. 
This is an continous project from [https://gist.github.com/gilangvperdana/53a70f9a64d3f7becebfa5f3a3d54c1f]
@gkarugi
gkarugi / Envoy.blade.php
Created July 1, 2020 18:20 — forked from freekmurze/Envoy.blade.php
Multi server zero downtime Envoy script
@setup
require __DIR__.'/vendor/autoload.php';
(new \Dotenv\Dotenv(__DIR__, '.env'))->load();
$appName = "my-app.com";
$repository = "spatie/{$appName}";
$baseDir = "/home/forge/{$appName}";
$releasesDir = "{$baseDir}/releases";
$currentDir = "{$baseDir}/current";
$newReleaseName = date('Ymd-His');
@gkarugi
gkarugi / a.md
Created January 16, 2019 13:12 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.

@gkarugi
gkarugi / office2016_activation.bat
Created September 8, 2018 16:52 — forked from Kibur/office2016_activation.bat
Microsoft Office 2016 activation script for all versions
@echo off
title Activate Microsoft Office 2016 ALL versions for FREE!&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2016&echo - Microsoft Office Professional Plus 2016&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&ech
@gkarugi
gkarugi / letsencrypt_2017.md
Created June 8, 2017 04:46 — forked from cecilemuller/letsencrypt_2020.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.

@gkarugi
gkarugi / deploy.php
Created June 7, 2017 11:27 — forked from nickdenardis/deploy.php
Zero downtime local build Laravel 5 deploys with Deployer
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'vendor/deployer/recipes/local.php';
require 'vendor/deployer/recipes/rsync.php';
require 'vendor/deployer/recipes/npm.php';
// Configuration
set('ssh_type', 'native');
@gkarugi
gkarugi / deploy.php
Created June 7, 2017 10:38 — forked from martincarlin87/deploy.php
Deployer Laravel 5 Example
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Configuration
set('ssh_type', 'native');
set('repository', '[REPO URL]');
set('branch', 'master');
set('keep_releases', 5);
@gkarugi
gkarugi / deploy.php
Created June 7, 2017 10:38 — forked from martincarlin87/deploy.php
Deployer Laravel 5
<?php
namespace Deployer;
require 'recipe/laravel.php';
$repo_url = '';
$branch = 'master';
$server_url = '';
$user = '';
@gkarugi
gkarugi / Laravel PHP7 LEMP AWS.md
Created June 6, 2017 20:20 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@gkarugi
gkarugi / README.md
Created May 22, 2017 12:23 — forked from hofmannsven/README.md
Notes on working with October CMS