Skip to content

Instantly share code, notes, and snippets.

View jasonraimondi's full-sized avatar

Jason Raimondi jasonraimondi

View GitHub Profile
#!/usr/bin/python
#
# Extract video files from source video based on array of timestamps
#
# times - array of times we are extracting, from times[x] to times[x + 1]
# src - src file
# dest - destination file
#
import os
from timecode import Timecode
#!/bin/sh
#
# Clips a video file and removes audio
#
# $1 - the path to the movie we're converting.
# $2 - destination of the clipped result
# $3 - the start time of the finished product.
# This can be in seconds, or it also accepts the "hh:mm:ss[.xxx]" format.
# $4 - the duration of the video sequence.
# This can be in seconds, or it also accepts the "hh:mm:ss[.xxx]" format.
find . -type f \( -iname '*.jpg' -o -iname '*.png' -o -iname '*.gif’ -o -iname ‘*.tif' \) -exec jhead -n%Y-%m-%d\ %H-%M-%S {} \;
#!/bin/bash
echo -n 'Are you in the root of the WordPress install? [Y/n]:'
read wproot
echo -n "WordPress Owner: "
read wpowner
echo -n "WordPress Group: "
read wpgroup
@jasonraimondi
jasonraimondi / import-export-mysql-databases.txt
Created November 10, 2015 21:53
commands to import and export mysql databases
To export
If it's an entire DB, then:
$ mysqldump -u [uname] -p[pass] db_name > db_backup.sql
If it's all DBs, then:
$ mysqldump -u [uname] -p[pass] --all-databases > all_db_backup.sql
If it's specific tables within a DB, then:
@jasonraimondi
jasonraimondi / full-system-backup.sy
Created November 21, 2015 17:42
Full System Backup
#!/usr/local/bin/python
import os
import sys
from datetime import datetime
NAMESPACE = 'TheServerBackup'
START = datetime.now()
TODAY = datetime.strftime(START, '%Y-%m-%d')
#!/bin/sh
# install figlet to enable ASCII art
apt-get install figlet
# create directory
mkdir /etc/update-motd.d/
# change to new directory
cd /etc/update-motd.d/
# create dynamic files
touch 00-header && touch 10-sysinfo && touch 20-updates && touch 90-footer
@jasonraimondi
jasonraimondi / website-monitoring.py
Created January 11, 2016 20:56
Website monitoring script to alert you when your site is down
# pip install requests
# run it on a cron, the more clients you are looking, the longer the script takes
# currently it delays for 15 seconds between successful pings
import time
import pprint
## list of sites to track along with email address to send the alert
clients = [
"http://www.website1.com",
@jasonraimondi
jasonraimondi / brew.sh
Created March 9, 2016 18:55
Brew Install
#!/bin/sh
## INSTALL HOMEBREW WITH THE FOLLOWING LINE
## First you need to install XCode and agree
## to the terms and service
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap homebrew/dupes
brew tap caskroom/versions
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Request;
use View;
use App;
abstract class ApplicationsServiceProvider extends ServiceProvider
{
public function register()