Skip to content

Instantly share code, notes, and snippets.

View justincampbell's full-sized avatar
🌯
🍩

Justin Campbell justincampbell

🌯
🍩
View GitHub Profile
@justincampbell
justincampbell / threaded.bat
Created July 20, 2010 14:21
Threaded batch script
@echo off
set strVariable=[%1]
if %strVariable% NEQ [] goto :Thread
set intTotal=0
echo Start %date% %time%
for /F %%a in ('net view ^| find /i "\\"') do call :Parse %%a
echo Stop %date% %time%
echo Total %intTotal%
goto :eof
<html>
<head>
<title>JustinCampbell.me</title>
<style type="text/css">
body {
background-color: white;
color: black;
font-size: 16px;
}
</style>
#!/bin/bash
# Git commits for dummies
echo Enter a commit message:
read MESSAGE
git rm -r --cached . > /dev/null
git add .
git commit -m "$MESSAGE"
git push origin master
@justincampbell
justincampbell / gist:615780
Created October 7, 2010 19:58
EEM apps for Cisco 4500
event manager environment MailRecipient user
event manager environment MailDomain domain.com
event manager environment MailServer 1.2.3.4
event manager applet mail_on_module3_down
event syslog occurs 1 pattern "LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet3.*to down" period 1
action 1.0 info type routername
action 1.1 cli command "show interface desc"
action 2.0 mail server "$MailServer" to "$MailRecipient" from "$_info_routername@$MailDomain" subject "Interface down module3" body "$_info_routername $_syslog_msg $_cli_result"
action 3.0 syslog msg "sent"
event manager applet mail_on_module3_up
# don't set prompt if this is not interactive shell
[[ $- != *i* ]] && return
################################################################### CONFIG
##### read config file if any.
unset dir_color rc_color user_id_color root_id_color init_vcs_color clean_vcs_color
unset modified_vcs_color added_vcs_color addmoded_vcs_color untracked_vcs_color op_vcs_color detached_vcs_color
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
<?php
class MY_Loader extends CI_Loader {
/**
* Load View With Layout
* http://bitbucket.org/markhuot/codeigniter/src/tip/application/core/MY_Loader.php
* This function is used to load a "view" file inside the specified layout. It has four parameters:
*
* 1. The name of the "layout" file to be included.
@justincampbell
justincampbell / .git-prompt.sh
Created February 6, 2011 15:05
Profile config for git helpers
# don't set prompt if this is not interactive shell
[[ $- != *i* ]] && return
################################################################### CONFIG
##### read config file if any.
unset dir_color rc_color user_id_color root_id_color init_vcs_color clean_vcs_color
unset modified_vcs_color added_vcs_color addmoded_vcs_color untracked_vcs_color op_vcs_color detached_vcs_color
<!-- Copyright (C) 2009 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,