Skip to content

Instantly share code, notes, and snippets.

View trafficinc's full-sized avatar

Ron trafficinc

  • Greater Philadelphia
View GitHub Profile
@trafficinc
trafficinc / WebPageCheck.sh
Last active December 23, 2017 14:16
Bash webpage checker, put in cronjob to check if website is up or not
#!/bin/bash
# WebPage checker
# ping 4 times in 5 seconds to check site uptime
# change webpage & EMAIL vars
badpings=()
str="unknown host"
webpage="www.yoursite.com"
EMAIL="youremail@gmail.com"
@trafficinc
trafficinc / miniprofile.js
Created October 12, 2016 01:01
Mini Profile, a super simple JavaScript profiling module
// Small Profiling Lib
// - How to do use
// Profile.start('functionName');
// function functionName(); // function you want to profile
// Profile.end();
//
var Profile = (function () {
var t1;
var t0;
@trafficinc
trafficinc / htaccess_tester.php
Last active December 23, 2017 14:16
htaccess tester to see if the htaccess file is working correctly
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Rons htaccess tester.</title>
<link rel="stylesheet" src="//normalize-css.googlecode.com/svn/trunk/normalize.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script>
var url = "http://www.mysite.com";
var link = "Go to MySite";
<script>
(function () {
function ready(fn) {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
@trafficinc
trafficinc / Find Text in Files
Created August 14, 2017 22:51
Python script to find any text in Files - Recursive
#!/usr/bin/python3
import os,sys
keyWord = sys.argv[1];
rootdir=('/var/www/mysite/public')
found = []
for folder, dirs, files in os.walk(rootdir):
for file in files:
@trafficinc
trafficinc / Find File Recursively
Last active July 13, 2018 19:20
Python script that will find a file in directories below parent Dir recursively
#!/usr/bin/python3
# use: $ python findFile.py "view.html"
import os,sys
fileLook = sys.argv[1];
rootdir=('/var/www/mysite/public')
@trafficinc
trafficinc / Database_Scanner.php
Last active December 23, 2017 14:14
MySql/Magento database scanner PHP script
<?php
/*
* scan Magento or regular MySql database for a search string
* usage: $ php searchEntireDatabase.php
*/
define('TESTING', true);
define('SKIP_TABLES', false);
@trafficinc
trafficinc / dbbackup.py
Last active March 8, 2024 04:26
Python script for taking mysqldump
#!/usr/local/bin/python3
"""
Will backup all the databases listed, will put files in same DIR as script'
To run: $ python dbbackup.py OR python3 dbbackup.py
"""
import configparser
import os
import time
<?php
/*
Francis, a simple message responder that responds as follows:
Francis answers 'Sure.' if you ask him a question
He answers 'Chill!' if you yell at him using all capital letters
He says 'See if I care!' if you address him without actually saying anything
He answers 'Whatevs.' to anything else
*/