Skip to content

Instantly share code, notes, and snippets.

View detain's full-sized avatar
💯
Da Vinci of Linux, Van Gogh of Code, [self proclaimed, but legit]

Joe Huss detain

💯
Da Vinci of Linux, Van Gogh of Code, [self proclaimed, but legit]
View GitHub Profile
@detain
detain / utf_emoji.json
Last active September 15, 2020 16:38
UTF Emoji Characters Grouped by Category in TXT, JSON, and PHP Array
{
"Smileys & Emotion": [],
"face-smiling": [
{
"code": "U+1F600",
"char": "\ud83d\ude00",
"name": "grinning face"
},
{
"code": "U+1F603",
@detain
detain / set_genre_by_artist_genre_frequency.php
Last active February 29, 2020 23:37
Recursivly Iterates a directory finding MP3s and then loading the ID3 info via 'mediainfo' for each. it then builds a list of genre popularity by artist (how many songs for each artist use which genre) working with genre beingset to multiple genres and split with either a semicolon (;) or foreslash (/)
<?php
/**
* Recursivly Iterates a directory finding MP3s and then loading the ID3 info via 'mediainfo' for each.
* it then builds a list of genre popularity by artist (how many songs for each artist use which genre)
* working with genre beingset to multiple genres and split with either a semicolon (;) or foreslash (/)
*
* - Automatic Backups every 120 seconds (configurable)
* @see $backupSeconds
* - Intelligent Reprocessing of MP3s only updating when the "Last Modified Time" is newer than what we stored in the db
* - Commands Optimization drastically cutting back on the number of times "mediainfo" is ran
@detain
detain / wordpress_password_hash_generator.php
Created February 27, 2020 04:43
Generates a WordPress Hashed Password
<?php
/**
* Generates a WordPress Hashed Password
* - Written by detain@interserver.net
*/
if (file_exists('public_html')) {
require __DIR__.'/public_html/wp-load.php';
} else {
require __DIR__.'/wp-load.php';
}
@detain
detain / README.md
Last active September 29, 2019 14:57
Parsed listing from http://s2.tinydl.info/Series/ overlaid with TheTVDB matching and additional information.

Parsed listing from s2, s3, s4, and s5 .tinydl.info/Series/ overlaid with TheTVDB matching and additional information

  • After that the build_tinydl.php converts it to tinydl.json while loading up information from TheTVDB

Building The Data

  1. Run get_rclone_ls.sh to:
  • autoamtically define site entries in rclone for all 4 sites
  • asynchronously grab recursive listings of all sites with size info
  • wait for background tasks to all complete
@detain
detain / gh-pages-tips.md
Created August 30, 2019 10:11 — forked from jedschneider/gh-pages-tips.md
github pages tips for jekyll wiki

Working With Github Pages

The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.

Gitignore

Add _site to .gitignore. The generated site should not be uploaded to Github since its gets generated by github.

Working With Code Partials

@detain
detain / index.html
Created August 17, 2018 20:57
MBNqPv
<div id="textOutput" style="white-space: pre;">//////////////////////////////////////////////////////////*///**////////////////////////////////////////////////////////////////////////////////////////////////////////////*/**********************************************************************... ..****....*******.*************************************... . . ......<br>//////////////////////////////////////////**////******///*********//////////////////////////////////////////////////////////////////////////////////*////////////////////*///*****/************************************************************. . .... ..*..........*********************************************......... .............<br>/////////////////////////////////////////***////*******///*******///////////////////////////////////////////////////////////////////////////////////*/////////////////**///*///*///***********************************************************.. .... .***........*********************************
@detain
detain / rebuild_svn_history.sh
Created August 9, 2018 22:30
rebuild svn history
#!/bin/bash
#rm -rf /var/lib/submin/svn/cisco_parser; cp -a cisco_parser /var/lib/submin/svn/ ; submin2-admin /var/lib/submin unixperms fix
read -p "username:password for svn repo" CURLAUTH
#export CURLAUTH="username:password"
IFS="
"
set -x
for file in *cisco.php; do
for rev in $(svn log "$file" |grep -A1 -- "----------------" |grep "^r"| cut -d" " -f1 | cut -c2-); do
echo "$file $rev";
@detain
detain / convert_db_to_utf8.sh
Created August 9, 2018 22:15
converts mysql data to character set utf8mb4 set / collation utf8mb4_unicode_ci
#!/bin/bash
function make_mysql_utf8_convert() {
db="$1"
echo "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci, COLLATION_CONNECTION = utf8mb4_unicode_ci, COLLATION_DATABASE = utf8mb4_unicode_ci, COLLATION_SERVER = utf8mb4_unicode_ci;" > update_utf8.sql;
echo "SET FOREIGN_KEY_CHECKS=0;" >> update_utf8.sql;
echo "ALTER DATABASE ${db} CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;" >> update_utf8.sql;
for t in $(echo "show table status where Engine IS NOT NULL;" | mysql -s "${db}"| awk '{ print $7 " " $1 }' |sort -n | awk '{ print $2 }'); do
echo "ALTER TABLE ${t} CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci$(mysqldump -d "${db}" "$t" | grep "^ *\`"| \
grep -i -E -e "\` (varchar|mediumtext|text|char)" | \