Skip to content

Instantly share code, notes, and snippets.

View stevenriggs's full-sized avatar
🙃

Steven Riggs stevenriggs

🙃
View GitHub Profile
@stevenriggs
stevenriggs / createsslcerts.sh
Last active August 29, 2015 14:16
Bash shell script for generating self-signed certs.
#!/bin/bash
# Bash shell script for generating self-signed certs.
#
# By: Steven Riggs
# Date: 2/19/2015
#
# Requires JDK 1.6 to generate a java keystore file (.jks)
#
# Script accepts 3 arguments
@stevenriggs
stevenriggs / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@stevenriggs
stevenriggs / base_package_code.vbs
Created March 22, 2015 01:13
Skeleton script to build a Windows application deployment for use with SCCM, Altiris, etc.
'base version:6
'DESCRIPTION OF TASKS
'AUTHOR
'DATE CREATED
'To run this silently:
'cscript.exe install_APPNAME.vbs /q
'Deal with command line arguments
Dim IsSilent
@stevenriggs
stevenriggs / ePOAgent.vbs
Created March 22, 2015 01:17
McAfee ePOAgent verify and install
Option Explicit
'==================================
' Plagarized by Steven Riggs (thanks google!)
' created:08/14/2009
' modified: 08/17/2009
'
' The script will check to see if the agent is installed, the current version, and the ePO
' server IP address. If any of the above mentioned items are incorrect according to your
' variables, the new agent will be installed.
@stevenriggs
stevenriggs / FindAndReplaceFiles.vbs
Created March 22, 2015 01:20
This script will get each file contained in the same folder as this script and search for files named the same on all physical drives of the computer it is executed on. If a match is found, it will be replaced by the file included in the same folder as this script. I'm sure this makes no sense. Good luck.
' file: FindAndReplaceFiles.vbs
' author: Steven Riggs
' created: 3/16/10
' modified: 3/17/10
' This script will get each file contained
' in the same folder as this script and search
' for files named the same on all physical
' drives of the computer it is executed on.
' If a match is found, it will be replaced by
@stevenriggs
stevenriggs / RemoteAltirisUpdate.vbs
Last active August 29, 2015 14:17
This script forces the Altiris Agent on a remote computer to update its configuration from the Notification Server
'This script forces the Altiris Agent on a remote computer to
'update its configuration from the Notification Server
'
'Revised 03/23/11 by Steven Riggs
'Example: cscript.exe RemoteAltirisUpdate.vbs somecomputername
'Or doubleclick on the vbs file to get an input box
Option Explicit
@stevenriggs
stevenriggs / altiris_agent_uninstall.vbs
Created March 22, 2015 01:39
Complete uninstall of 6.x Altiris agent
' Purpose: Complete uninstall of 6.x Altiris agent
' Reference: https://kb.altiris.com/article.asp?article=1995&p=1
' Created: 5/17/2010
' Modified: 5/20/2010
' Author: Steven Riggs
Option Explicit
On Error Resume Next
@stevenriggs
stevenriggs / LinuxFolderSizes.sh
Created March 22, 2015 02:08
Linux folder sizes
#Linux folder sizes
du -sh /*
#I often need to find the biggest directories, so to get a sorted list containing the 20 biggest dirs I do this:
du -m /some/path | sort -nr | head -n 20
@stevenriggs
stevenriggs / create-test-log-data.sh
Last active November 3, 2016 13:14
Simulates a rotating log file on Linux/UNIX
#!/bin/sh
# Debug mode 0 = off, 1 = on
blnDebugMode="1"
strLogFolderPath="/var/log/temptestlogs"
# INITIAL VARIABLES
intMinutesTillNewLogFile="1"
intWriteFrequencyInSeconds="1"
strLogText="This is a line"
If you like to return multiple values from a function, simply populate a hash table variable in function and return the variable. See my example below. Feel free to use my example function and Enjoy.
Function Get-UserInfo($username)
{
#Create an hashtable variable
[hashtable]$Return = @{}
Import-Module ActiveDirectory