Skip to content

Instantly share code, notes, and snippets.

Charles Peterson Artistan

View GitHub Profile
@Artistan
Artistan / A Readme for Adding Certs.md
Last active Jun 2, 2020
Add new certificate (cert) from local/internal intranet to your mac
View A Readme for Adding Certs.md

Add a cert to you macbook

USAGE

~/add_cert.sh my.intra.net

you will be asked for your password to add thit to keychain

  • downloads pem file
  • adds to trusted root certificates
View free_email_provider_domains.txt
hitmail.com
rxdoc.biz
cox.com
126.net
126.com
comast.com
comast.net
yandex.com
wegas.ru
twc.com
@Artistan
Artistan / .1. mysql.reset.sh
Last active Apr 15, 2020
Reset Master (root) MySQL Password -- Digital Ocean
View .1. mysql.reset.sh
service mysql stop
mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld
/usr/bin/mysqld_safe --skip-grant-tables --skip-networking &
# do the reset.sql stuff...
killall mysql ## ps ax|grep mysql -- you may have to list them with this and manually kill them!! :)
service mysql start
@Artistan
Artistan / .aliases.sh
Last active Apr 10, 2020
Bash/ZSH Aliases
View .aliases.sh
source .zsh.ssh.autocomplete.sh
alias l='ls -lahG'
# safety net aliases
alias cp='cp -iv'
alias mv='mv -iv'
alias rm='rm -i'
alias ln='ln -i'
@Artistan
Artistan / add gitlab admin labels.md
Last active Mar 26, 2020
Add gitlab labels to your repo from admin labels
View add gitlab admin labels.md

quick hack in admin labels to all repos...

in addition to @Xunnamius package. you may use the dbconsole if your are feeling brave and want to check and update just the labels that are off in color or case. Also, I deleted only the labels that did not exist in the admin labels, and then ren teh gitlab-fix-labels ... add all to add the missing labels to all our projects.

login to your server

sudo gitlab-rails dbconsole

template (admin) labels.

@Artistan
Artistan / EloquentUser.php
Last active Jan 30, 2020
Paginator with relations... load the relations on the model
View EloquentUser.php
<?php
namespace App;
use Illuminate\Pagination\LengthAwarePaginator;
use App\Http\Controllers\Controller;
class EloquentUser extends Controller {
// these will work for eloquent, but not with a scout->search since scout is not building a query.
public function paginate($query)
@Artistan
Artistan / a ngrok_background.sh
Last active Dec 10, 2019 — forked from rjz/ngrok_hostname.sh
Get ngrok hostname from command line
View a ngrok_background.sh
#!/bin/sh
########################################################################################
# I do not need to use the ngrok subdomains...
# start ngrok for my local box (vagrant homestead) in th background
# get the cname from command line for the ngrok alias
# update my subdomain cname to point at new ngrok name
# use it!!!
########################################################################################
# requires ngrok and jq installed.
@Artistan
Artistan / test.css
Last active Nov 16, 2019
css for vids
View test.css
#site-logo-link,
.video-ad, .ad-support-desktop,
.xv-responsive #header h2.mobile-hide {
display:none;
}
.xv-responsive #page {
max-width: none;
}
@Artistan
Artistan / README.md
Last active Sep 13, 2019
homestead box - remote xdebug
View README.md

HOMESTEAD BOX

Remote PhpStorm Xdebug

This will allow PhpStorm to use remote debugging with xdebug and Book marklets for quick and easy remote debugging

Updated the xdebug settings to include just in time debugging with remote_host If you do not want to use that, just leave out the last 2 lines of the xdebug.ini

You can’t perform that action at this time.