Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Streeter danstreeter

View GitHub Profile
@danstreeter
danstreeter / ssh-no-key
Created Feb 28, 2020
Connect to a SSH server envforicng password authenticaiton (ignoring keys)
View ssh-no-key
ssh -o PasswordAuthentication=yes -oPreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no user@server
View outputXmlNicely.php
<?php
/* To output XML as a nicely formatted (line breaks and indentations) on screen */
$doc = new \DOMDocument('1.0');
$doc->loadXML($rawXml);
$doc->preserveWhiteSpace = false;
$doc->formatOutput = true;
$xml_string = $doc->saveXML();
echo $xml_string;
@danstreeter
danstreeter / getMysqlTableVersionsFromFrmFiles.sh
Created May 15, 2019
Find MySQL Table Versions from raw versions
View getMysqlTableVersionsFromFrmFiles.sh
for file in *.frm; do echo $file" : "$(hexdump -s 0x33 -n 2 -v -d *.frm | head -1 | rev | awk '{$1=$1};1' | cut -d" " -f1 | rev); done;
@danstreeter
danstreeter / nginx.conf
Created Feb 1, 2019
Nginx Config block for PHP-FPM Status and Ping page requests
View nginx.conf
location ~ ^/(status|ping)$ {
allow 127.0.0.1;
log_not_found off;
access_log off;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_pass php:9000;
# fastcgi_pass unix:/var/run/php7.2-fpm.sock;
}
@danstreeter
danstreeter / Alfred-VSCodeWorkspaces.py
Created Dec 23, 2018
Alfred 3 Workflow to list and open VSCode Workspaces.
View Alfred-VSCodeWorkspaces.py
from os import listdir
from os.path import isfile, join, expanduser
import json
import copy
new_list = list()
new_file_dict = {
"uid": "",
"path": "",
"title": "",
@danstreeter
danstreeter / docker-compose.yml
Created May 27, 2018
Laravel Mix Docker-Compose Asset Compilation
View docker-compose.yml
npm-watch:
image: node:8.11.1
volumes:
- ./:/home/node/app
working_dir: /home/node/app
restart: unless-stopped
command: ['npm', 'run', 'watch']
View keybase.md

Keybase proof

I hereby claim:

  • I am danstreeter on github.
  • I am mrstreeter (https://keybase.io/mrstreeter) on keybase.
  • I have a public key ASD8wSefM39BVYMZS3qa5nPB_PWx0RIATQxY9KKnjFwONgo

To claim this, I am signing this object:

View docker-wordpress-quickstack.sh
# Can be used to quickly spin up Wordpress and MySQL containers for testing something quickly.
# uploads.ini content - Write this to a file local to your running docker command, removing the hashes.
# file_uploads = On
# memory_limit = 64M
# upload_max_filesize = 64M
# post_max_size = 64M
# max_execution_time = 600