Skip to content

Instantly share code, notes, and snippets.

View envygeeks's full-sized avatar
🐢

Jordon Bedwell envygeeks

🐢
View GitHub Profile
git commit --amend --date="$(date -R)"
#!/bin/bash
nvram 8be4df61-93ca-11d2-aa0d-00e098032b8c:epid_provisioned=%01%00%00%00
#!/bin/bash
[ "$DEBUG" = "true" ] && set -x
set -e
a=$(openssl x509 -noout -modulus -in "$1".crt | openssl md5)
b=$(openssl rsa -noout -modulus -in "$1".key | openssl md5)
c=$(openssl req -noout -modulus -in "$1".csr | openssl md5)
if a != b || b != c || c != a; then
echo "Mismatch"
find . -maxdepth 1 -name \*.mp4 -type f | while read f; do
date=$(mediainfo "$f" | grep -i "Recorded Date" | \
sed -E 's/\s**recorded date\s*:\s*//i')
touch -d "$date" "$f"
done
on idle
tell application "Finder"
do shell script "find ~ -name .DS_Store -mindepth 2 -delete"
set volumesToClean to {"Backups", "Movies"}
repeat with volume in volumesToClean
if (exists disk volume) then
set volPath to "/Volumes/" & volume
do shell script "find " & quoted form of volPath & " -name .DS_Store -delete"
do shell script "dot_clean " & quoted form of volPath
@envygeeks
envygeeks / Samba Drives.scpt
Last active February 12, 2019 18:24
Mount SMB on Boot
set smbHost to "192.168.1.3"
set closeOnUnmount to {"iTunes"}
set volnames to {"Storage", "Movies"}
set tmVolname to "Backups"
set idleTime to 120
set maxWait to 60
on idle
tell application "Finder"
repeat with vol in volnames
@envygeeks
envygeeks / nginx.conf
Last active February 12, 2019 18:27
[HSTS Nginx -> HTTPS] #nginx
server {
server_name _;
rewrite ^(.*) https://$host$1 permanent;
listen 80;
}
server {
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
}
@envygeeks
envygeeks / peek.graphql
Last active March 8, 2019 06:59
Github API GraphQL
fragment UserFields on User { url, name, avatarUrl, login }
fragment PageInfoFields on PageInfo { startCursor, hasPreviousPage, hasNextPage, endCursor }
fragment OrganizationFields on Organization { url, org: name , avatarUrl, login }
fragment RateLimitFields on RateLimit { resetAt, remaining, limit, cost }
fragment RepositoryFields on Repository {
pushedAt
nameWithOwner
hasIssuesEnabled
hasWikiEnabled
name

Keybase proof

I hereby claim:

  • I am envygeeks on github.
  • I am envygeeks (https://keybase.io/envygeeks) on keybase.
  • I have a public key whose fingerprint is 1E47 C010 BF1C B42A 61C5 CFBB 2D67 0E76 F3B1 9D80

To claim this, I am signing this object:

@envygeeks
envygeeks / let-mysql-know-the-boss.sql
Last active February 12, 2019 19:30
Force own MySQL Root
SET @@SESSION.SQL_LOG_BIN=0;
DELETE FROM mysql.user WHERE Host = '';
DELETE FROM mysql.user WHERE User = 'root';
DELETE FROM mysql.user WHERE User = '$MYSQL_USER';
CREATE OR REPLACE USER 'root'@'%' IDENTIFIED BY '$MYSQL_ROOT_PASS';
GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;
DROP DATABASE IF EXISTS test;
CREATE DATABASE IF NOT EXISTS $MYSQL_DB;
CREATE OR REPLACE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASS';