Skip to content

Instantly share code, notes, and snippets.

View hxtree's full-sized avatar

Matthew Heroux hxtree

View GitHub Profile
@hxtree
hxtree / linux-encrypt-file-with-gpg.txt
Created November 19, 2019 15:44
Linux Encrypt File With GPG
# create file to be encrypted, skip if already existing
echo "My Secret Bank" >> file.txt
# create encryption key
# the longer the more secure
# file only as secure as key file
echo "Your Encryption Key" >> key.txt
# encrypt
gpg --cipher-algo AES256 --passphrase key.txt --symmetric file.txt
@hxtree
hxtree / make-encrypted-copy.py
Last active November 19, 2019 20:35
Python Make Encrypted Copy of Files With Extension
# GPG (GNU Privacy Guard)
# Make Encrypted Copy of Files With Extension
import os
input_dir = '/share/backups/'
output_dir = '/share/backups/encrypted/'
passphrase = '/share/backups/passphrase.txt'
extensions = {'.zip','.bak'}
@hxtree
hxtree / linux-cron-rsync-photos
Last active November 20, 2019 20:19
Linux Cron to Rsync Photos
# Photos placed in this folder and subfolders get automatically uploaded to photos.example.com and removed every 5 minutes.
# Only put files here that you want to be moved to the photo respository.
*/5 * * * * root rsync -avz --exclude='*.mov' --exclude='*.MOV' --exclude="README.md" --remove-source-files -e ssh /media/photos/ user@photos.example.com:/var/www/html/assets/input/ > /dev/null 2>&1
@hxtree
hxtree / php-coding-resources.md
Last active May 17, 2022 16:13
PHP Coding Resources
@hxtree
hxtree / ZendStudio.desktop
Last active November 21, 2019 21:29
ZendStudio Install Ubuntu 18.04
[Desktop Entry]
Name=ZendStudio
Comment=ZendStudio
Exec=/usr/local/sbin/ZendStudio/ZendStudio
Icon=/usr/local/sbin/ZendStudio/icon.xpm
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Network;Application;
Name[en_US]=ZendStudio
@hxtree
hxtree / php-html-email-with-attachment.php
Created December 4, 2019 22:14
PHP HTML Email With Attachments
<?php
$web_email = 'you@example.com';
$subject = 'Email with Attachment';
$mime_boundary = '==Multipart_Boundary_x' . md5(time()) . 'x';
$headers = 'From: ' . $web_email. PHP_EOL .
'CC: ' . $web_email . PHP_EOL .
'MIME-Version: 1.0' . PHP_EOL .
'Content-Type: multipart/mixed;' . PHP_EOL .
@hxtree
hxtree / commands.sh
Created December 5, 2019 16:14
Ubuntu Enable XSession via SSH
touch /home/test/.Xauthority
apt install x11-apps
@hxtree
hxtree / bash.sh
Created December 10, 2019 15:16
Dump traffic by MAC Address
sudo tcpdump ether host 00:1A:62:03:7F:05
@hxtree
hxtree / google-search-ranking.txt
Last active December 16, 2019 21:00
How to Improve Your Google Search Ranking
Google Search Quality Evaluator Guidelines
(How Google evaluators decide what results to show)
https://static.googleusercontent.com/media/guidelines.raterhub.com/en//searchqualityevaluatorguidelines.pdf
The Google Algorithm
(How Google's search algorithms work)
https://www.google.com/search/howsearchworks/algorithms/
Google E-A-T Checklist
(Googles Expertise, Authority, and Trust Checklist)
@hxtree
hxtree / google-search-for-a-phi.md
Last active December 19, 2019 18:11
Google Search To Calculate The Golden Ratio (Phi) within A Number