Skip to content

Instantly share code, notes, and snippets.

@cinco
cinco / letsencrypt_tls_manual.md
Created July 18, 2022 22:26 — forked from cpburnz/letsencrypt_tls_manual.md
Manually Request Let's Encrypt TLS Certificate with certbot

Manually Request Let's Encrypt TLS Certificate with certbot

A TLS certificate can be manually requested from [Let's Encrypt][1] using [certbot][2]. In order to successfully acquire the certificate you will need to have a domain name properly set up through DNS, and you need to be able to make a file available from an arbitrary URL under your domain.

TL;DR

@cinco
cinco / ftp-sync.sh
Created August 24, 2021 22:27
Sync between two FTPs
#!/bin/bash
DEST_DIR=$(mktemp -d /tmp/ftp-sync-XXXX)
FTP_ORIGIN_HOST=
FTP_ORIGIN_USER=
FTP_ORIGIN_PASS=
FTP_DESTINATION_HOST=
FTP_DESTINATION_USER=
@cinco
cinco / my.cnf
Created December 18, 2020 17:18 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated January 2020 ~
#
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@cinco
cinco / dockergrep.sh
Created March 12, 2020 15:32 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@cinco
cinco / sync-projects
Created February 4, 2020 21:14 — forked from nathanbrauer/sync-projects
Gitlab: Clone / Pull all projects in a group
#!/usr/bin/env bash
# Documentation
# https://docs.gitlab.com/ce/api/projects.html#list-projects
if [[ `whoami` == "root" ]]; then
echo "DO NOT run this program as root! Quitting."
exit 1
fi
@cinco
cinco / terraform-install.sh
Last active January 26, 2020 18:57 — forked from danisla/terraform-install.sh
Terraform latest version install script (modified to zsh and exclude alpha versions)
#!/bin/bash
function terraform-install() {
[[ -f ${HOME}/bin/terraform ]] && echo "`${HOME}/bin/terraform version` already installed at ${HOME}/bin/terraform" && return 0
LATEST_URL=$(curl -sL https://releases.hashicorp.com/terraform/index.json | jq -r '.versions[].builds[].url' | egrep 'terraform_[0-9]\.[0-9]{1,2}\.[0-9]{1,2}_linux.*amd64' | sort -V | tail -1)
curl ${LATEST_URL} > /tmp/terraform.zip
mkdir -p ${HOME}/bin
(cd ${HOME}/bin && unzip /tmp/terraform.zip)
if [[ -z $(grep 'export PATH=${HOME}/bin:${PATH}' ~/.bashrc) ]]; then
echo 'export PATH=${HOME}/bin:${PATH}' >> ~/.zshrc
@cinco
cinco / install-terraform-packer-os-x.sh
Created January 9, 2020 13:40 — forked from Adron/install-terraform-packer-os-x.sh
Install Terraform & Packer on Linux
#!/usr/bin/env bash
# Script prerequisite > install jq > https://stedolan.github.io
# ********************************************************************************************
# UPDATE: Check out Robert's repo here https://github.com/robertpeteuil/terraform-installer
# Robert's repo is more built out and has more options around the installation process.
# Cheers! -Adron
# ********************************************************************************************
cd ~
@cinco
cinco / Dockerfile
Created July 11, 2019 03:58 — forked from ktquez/Dockerfile
Dockerfile for PHP7 memcache and Redis ext
FROM php:7-fpm
# Install modules
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libmemcached-dev \
libmysqlclient-dev \
libicu-dev \
@cinco
cinco / karigran.com.zone
Created June 14, 2019 01:52 — forked from maazghani/karigran.com.zone
karigran.com.zone
; Domain: karigran.com
; Exported (y-m-d hh:mm:ss): 2015-05-30 15:15:58
;
; This file is intended for use for informational and archival
; purposes ONLY and MUST be edited before use on a production
; DNS server.
;
; In particular, you must update the SOA record with the correct
; authoritative name server and contact e-mail address information,
; and add the correct NS records for the name servers which will