Skip to content

Instantly share code, notes, and snippets.

View GlowDB's full-sized avatar
🏠
Working from home

GlowDB GlowDB

🏠
Working from home
View GitHub Profile
@GlowDB
GlowDB / prepull.yaml
Created January 26, 2024 17:37 — forked from itaysk/prepull.yaml
Kubernetes: Pre-pull images into node (moved to: https://github.com/itaysk/kube-imagepuller )
###
# There's a newer version available here:
# https://github.com/itaysk/kube-imagepuller
# All future updates will be made there.
# Please also post you questions as issues on that repo instead of commenting here
###
apiVersion: apps/v1beta2
kind: DaemonSet
@GlowDB
GlowDB / gist:ab79a7f94e9dc8bbf784932325d1ac4a
Created November 16, 2018 20:39 — forked from Khoulaiz/gist:41b387883a208d6e914b
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@GlowDB
GlowDB / openshift-cheatsheet.md
Created October 19, 2018 00:14 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Examine the cluster quota defined for the environment:

$ oc describe AppliedClusterResourceQuota

Install paks using yum in a Dockerfile

@GlowDB
GlowDB / yaml2json.py
Created August 23, 2018 14:18 — forked from davepeck/yaml2json.py
My dumb script to convert yaml files to json files. Use stdin/stdout.
#!/usr/bin/env python
import sys
import yaml
import json
# Assumed we want to use stdin and stdout
print json.dumps(yaml.load(sys.stdin.read()), indent=4)
AWSTemplateFormatVersion: '2010-09-09'
Metadata: {}
Parameters:
###########
KeyName:
Description: The EC2 Key Pair to allow SSH access to the instance
Type: 'AWS::EC2::KeyPair::KeyName'
AvailabilityZone:
Description: Availability zone to deploy
@GlowDB
GlowDB / asg_of_server_with_floating.yaml
Created May 22, 2018 15:28 — forked from StephenKing/asg_of_server_with_floating.yaml
Assigning a Floating IP Address to Each Instance of an Autoscaling Group in OpenStack Heat
heat_template_version: 2013-05-23
description: >
This template creates an AutoScalingGroup based on the stack
defined in the file `server_with_floating.yaml`.
parameters:
key_name:
type: string
description: Name of an existing key pair to use for the instances
@GlowDB
GlowDB / asg_of_server_with_floating.yaml
Created May 22, 2018 15:28 — forked from StephenKing/asg_of_server_with_floating.yaml
Assigning a Floating IP Address to Each Instance of an Autoscaling Group in OpenStack Heat
heat_template_version: 2013-05-23
description: >
This template creates an AutoScalingGroup based on the stack
defined in the file `server_with_floating.yaml`.
parameters:
key_name:
type: string
description: Name of an existing key pair to use for the instances
@GlowDB
GlowDB / asg_of_server_with_floating.yaml
Created May 22, 2018 15:28 — forked from StephenKing/asg_of_server_with_floating.yaml
Assigning a Floating IP Address to Each Instance of an Autoscaling Group in OpenStack Heat
heat_template_version: 2013-05-23
description: >
This template creates an AutoScalingGroup based on the stack
defined in the file `server_with_floating.yaml`.
parameters:
key_name:
type: string
description: Name of an existing key pair to use for the instances
@GlowDB
GlowDB / config.yml
Created May 18, 2018 17:36 — forked from cmdruid/config.yml
This is my Ruby DNS Updater script. If you are using an .htaccess file to forward a domain or subdomain to your server's dynamic IP address, this script will make sure that .htaccess file stays updated with your server's current address. This script is an alternative to using services like Dynamic DNS or No-IP. This script uses SFTP and the 'net…
# This is my Ruby DNS Updater script. If you are using an .htaccess
# file to forward a domain or subdomain to your server's dynamic IP
# address, this script will make sure that file stays updated with
# your server's current address. This script is an alternative to
# using services like Dynamic DNS.
# This script uses SFTP and the 'net-sftp' gem to connect to your
# hosting via a secure connection. You must add all your relevant
# information below in order for this script to work.
@GlowDB
GlowDB / guide.md
Created May 14, 2018 15:01 — forked from fyrebase/guide.md
Setup individual pools for PHP-FPM and NGINX - http://www.binarytides.com/php-fpm-separate-user-uid-linux/

Php-FPM

Php fpm is the new way to setup php to run with your webserver. Php-fpm is a fastcgi process manager for php that is totally separate from the webserver. The webserver communicates with fpm through a socket and passes the name of the script to execute. So fpm can run with any web server that is fastcgi compatible.

I recently moved from my old shared hosting to linode. Linode provides linux vps hosting at economic prices. However the servers are totally unmanaged are just raw linux machines that have shell access. So through the shell you have to setup everything including the web server, php and the web files.

So this time I decided to go with the combination of nginx and php-fpm. I had multiple sites to setup on this new webserver. Nginx deals with these through separate server blocks (aka vhost in apache). However there was another thing needed. Php on each site should run with its own user and not the nginx common user named www-data.

Running each site with its own uid/gid is more secure and