Skip to content

Instantly share code, notes, and snippets.

View fiftin's full-sized avatar

Denis Gukov fiftin

View GitHub Profile
@neo1908
neo1908 / lets-encypt-internal.md
Last active December 2, 2021 15:50
Let's Encrypt On Internal Infratructure

Internal Let's Encrypt Certificates

Here are some thoughts and ideas on how I have lets encrypt certificates deployed to home infrastructure ...

At a high level , my setup assigns a hostname based subdomain for each internal host.

E.G. If my registered domain is example.com and my host is host1 then I will generate a cert for host1.example.com.

Let's encrypt supports wildcards, you could use a wildcard if you wanted to. I didn't like the idea of every internal host using the same keypair.

@alyleite
alyleite / wsl.md
Last active June 16, 2024 06:32
Failed to connect to bus: Host is down - WSL 2

» sudo systemctl daemon-reload

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

==============================================

Edit*

  1. Open /etc/wsl.conf with any editor:
@Fliktrax
Fliktrax / gist:9c5f79ad038094a2684ccd14f28fe967
Last active October 15, 2019 19:58
WordPress 4.7 CDN URL Update
add_filter('upload_dir', 'cdn_upload_url');
function cdn_upload_url($args)
{
$current_user = wp_get_current_user();
$current_user_id = $current_user->ID;
$is_id_user = ($current_user_id > 0) ? true : false;
switch($is_id_user)
{
case true:
$admin_users = array('administrator', 'editor', 'author'); //Add roles that you don't want to CDN swap
@javilobo8
javilobo8 / download-file.js
Last active July 1, 2024 23:21
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@thedumbtechguy
thedumbtechguy / ansible_semaphore_ubuntu.md
Last active August 21, 2019 21:14
Install Ansible Semaphore on Ubuntu

Ansible Installation

Ansible is a powerful configuration management tool that we use in managing our infrastructure and applications.

It requires a centralized Control server and can connect to hosts over an array of connection types including SSH.

Controller Setup

The Ansible controller will run our playbooks. This needs both Ansible and Semaphore (web based management console) setup.

@daliborgogic
daliborgogic / delay.js
Created December 16, 2016 15:26
Node.js Async/Await delay
'use strict'
const timeout = ms => new Promise(res => setTimeout(res, ms))
function convinceMe (convince) {
let unixTime = Math.round(+new Date() / 1000)
console.log(`Delay ${convince} at ${unixTime}`)
}
async function delay () {
@Yegorov
Yegorov / readme.md
Last active December 22, 2018 20:54
IaaS, PaaS, BaaS, VPS (VDS), Dokker etc
anonymous
anonymous / Pure CSS Parallax Scrolling.markdown
Created April 23, 2016 18:16
Pure CSS Parallax Scrolling
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@bluele
bluele / targz.go
Created September 28, 2015 05:18
Golang compress tar.gz example.
package main
import (
"archive/tar"
"compress/gzip"
"io/ioutil"
"log"
"os"
"path"
)