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 / generate_chown_fix.sh
Created December 22, 2016 15:50
Read all files in /etc and generate chown lines for them using the current owner/group (for use on another server whos ownership got messed up):
find /etc|xargs -n 1 stat -c "chown %U.%G %n;"
@detain
detain / index.html
Created February 6, 2018 03:48
Status Board
<dashboard class="dashboard">
<dashboard-header title="Teb-2 DataCenter">
<dashboard-clock digital="true" binary="true" />
</dashboard-header>
<server-list>
<server v-for="(server, index) in servers" :class="{ 'has-failed': !server.status }" :type="server.type" @click.native="updateServerStatus(index)">
<span slot="name" class="data">{{server.name}}</span>
<span slot="status" class="data signal">{{server.status ? 'ONLINE' : 'OFFLINE'}}</span>
<span slot="adr" class="data">{{server.adr}}</span>
</server>
@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)" | \
@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 / index.html
Created August 17, 2018 20:57
MBNqPv
<div id="textOutput" style="white-space: pre;">//////////////////////////////////////////////////////////*///**////////////////////////////////////////////////////////////////////////////////////////////////////////////*/**********************************************************************... ..****....*******.*************************************... . . ......<br>//////////////////////////////////////////**////******///*********//////////////////////////////////////////////////////////////////////////////////*////////////////////*///*****/************************************************************. . .... ..*..........*********************************************......... .............<br>/////////////////////////////////////////***////*******///*******///////////////////////////////////////////////////////////////////////////////////*/////////////////**///*///*///***********************************************************.. .... .***........*********************************
@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 / 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 / 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';
}