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 / 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

// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@GlowDB
GlowDB / bitcoin.conf
Created January 20, 2018 15:32 — forked from JoshuaEstes/bitcoin.conf
Install bitcoind on linux and setup server
# bitcoin.conf configuration file. Lines beginning with # are comments.
# Network-related settings:
# Run on the test network instead of the real bitcoin network.
#testnet=0
# Connect via a socks4 proxy
#proxy=127.0.0.1:9050
##############################################################
@GlowDB
GlowDB / monitoring.sh
Created December 11, 2017 21:33 — forked from jstop/monitoring.sh
CloudWatch Monitoring
sleep $(( ( RANDOM % 30 ) + 1 ))
vars=($(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document |/usr/bin/jq '.' | grep -e instanceType -e privateIp -e instanceId -e imageId| cut -f 4 -d ' ' | sed 's/^.//' |sed 's/..$//'))
docker run alexturek/aws-cli-docker cloudwatch put-metric-alarm \
--region us-east-1 \
--alarm-name "Disk Utilization ${vars[0]}:/" \
--alarm-description "Disk Utilization alarm for ${vars[0]}" \
--actions-enabled \
--alarm-actions arn:aws:sns:us-east-1:501188896998:PagerDuty \
--metric-name DiskUtilization \
--namespace System/Linux \
@GlowDB
GlowDB / monitoring.sh
Created December 11, 2017 21:33 — forked from jstop/monitoring.sh
CloudWatch Monitoring
sleep $(( ( RANDOM % 30 ) + 1 ))
vars=($(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document |/usr/bin/jq '.' | grep -e instanceType -e privateIp -e instanceId -e imageId| cut -f 4 -d ' ' | sed 's/^.//' |sed 's/..$//'))
docker run alexturek/aws-cli-docker cloudwatch put-metric-alarm \
--region us-east-1 \
--alarm-name "Disk Utilization ${vars[0]}:/" \
--alarm-description "Disk Utilization alarm for ${vars[0]}" \
--actions-enabled \
--alarm-actions arn:aws:sns:us-east-1:501188896998:PagerDuty \
--metric-name DiskUtilization \
--namespace System/Linux \
{
"Version": "...",
"Id": "...",
"Statement": [
{
"Sid": "...",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::BUCKETNAME/*"
{
"Version": "...",
"Id": "...",
"Statement": [
{
"Sid": "...",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::BUCKETNAME/*"
System overview
Staff, roles & responsibilities
Environments
Applications
Software Licenses
Version control
Process Flows
Documentation
Support & Maintenance
Issue Submission & Resolution
System overview
Staff, roles & responsibilities
Environments
Applications
Software Licenses
Version control
Process Flows
Documentation
Support & Maintenance
Issue Submission & Resolution
@GlowDB
GlowDB / directions.md
Created November 29, 2017 17:16 — forked from ab2525/directions.md
Samba4 initscript for CentOS

Installing Samba4 as a File Server

This document serves to help you set up Samba4 as a file server on CentOS 5 and 6. CentOS 6 has RPMs for Samba4, but they are not built with the requisite DC functionality you'll need for the advanced SAMBA lab. The following steps should be run as root. If you are logging in on a text-mode console, you can do this by logging in as root with the password netsys. If you are doing it in a GUI, you can elevate your privs using the command sudo -i

  1. You need to install the python development libraries and the libacl development libraries. This can be accomplished with the following command:
yum install python-devel libacl-devel