Skip to content

Instantly share code, notes, and snippets.

@jabez007
jabez007 / Start-SqlService
Created October 18, 2017 13:25
Quick PowerShell to start SQL Express service with an admin account
# Sometimes my SQLEXPRESS service doesnt start with the rest of my services even though it is set to automatic
# In order to get it started, I would have to explicity switch over to my domain admin account and kick the service
# This allows me to shortcut all of that
$PSPath = "C:\Windows\System32\WindowsPowerShell\v1.0"
$admin = Get-Credential;
$startSqlService = @'
$(Get-Service 'MSSQL$SQLEXPRESS').Start();
@jabez007
jabez007 / SqlQueryReader.cs
Created October 23, 2017 21:18
Generic SqlDataReader to List<OrderedDictionary>
private static List<OrderedDictionary> TrySqlQuery(string sqlQuery)
{
List<OrderedDictionary> sqlResults = new List<OrderedDictionary>();
using (SqlConnection conn = new SqlConnection(connectionString))
{
try
{
conn.Open();
using (SqlCommand _cmd = new SqlCommand(sqlQuery, conn))
{
@jabez007
jabez007 / FullCalendarTooltips.html
Created October 26, 2017 22:10
Rough draft of in idea for an event calendar
<html>
<!-- https://fullcalendar.io/ -->
<!-- https://getbootstrap.com/docs/3.3/javascript/#tooltips -->
<head>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.6.2/fullcalendar.min.css"></link>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.6.2/fullcalendar.print.css" media="print"></link>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.19.1/moment.min.js"></script>
@jabez007
jabez007 / JWM.PowerOnTheWall.PND
Created November 14, 2017 14:24
An "on demand" script written in PowerOn to recite 99 Bottles of Beer
[*
* Written in PowerOn, a language used to access the Episys database,
* Symitar's core processing soution for credit unions
*]
[This is a template for creating specfiles.]
TARGET=ACCOUNT [ Modify here]
DEFINE
[Define variables and arrays here.]
@jabez007
jabez007 / FlipAnimation.css
Last active January 30, 2018 22:28
CSS Flip Animation in Bootstrap Cards
@-ms-keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-webkit-keyframes fadeIn {
from {
@jabez007
jabez007 / Install-Barnyard.sh
Created February 12, 2018 15:02
A simple Bash script for install Snort and Barnyard on Cent OS 7 from source
!/bin/bash
# Set the internal field separator
IFS=$'\n'
##
# Install pre-reqs
##
yum install libtool autoconf git
@jabez007
jabez007 / Get-PublicKey.ps1
Created February 12, 2018 15:05
A PowerShell script for retrieving public certificates from remote websites.
function Get-PublicKey
{
# https://stackoverflow.com/questions/22233702/how-to-download-the-ssl-certificate-from-a-website-using-powershell
[OutputType([System.Security.Cryptography.X509Certificates.X509Certificate])]
PARAM (
[Uri]$Uri
)
if (-Not ($uri.Scheme -eq "https"))
@jabez007
jabez007 / Get-BasicADObject.ps1
Created February 12, 2018 15:07
Powershell script I found for searching AD without the AD Module
Function Get-BasicADObject
{
<#
.SYNOPSIS
Function allow to get AD object info without AD Module.
.DESCRIPTION
Use Get-BasicADObject to get information about Active Directory objects.
.PARAMETER Filter
@jabez007
jabez007 / DNS_Final.sh
Created February 12, 2018 15:10
My bash script to configure DNS and IPTables for my final exam
#!/bin/bash
# Set the internal field separator
IFS=$'\n'
pkill ncat
####################
# regex pattern for IP addresses
@jabez007
jabez007 / Import-CAChain.ps1
Created February 12, 2018 15:14
A PowerShell script to import a certificate authority chain in a very specific order
# Make sure we are running as Admin
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")){
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
# # # #
$Tab = [char]9