Skip to content

Instantly share code, notes, and snippets.

@aaronlake
aaronlake / gist:1993658
Created March 7, 2012 15:00 — forked from padolsey/gist:527683
JavaScript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@aaronlake
aaronlake / dskinfo
Created February 13, 2015 20:25
Solaris Disk Info
#!/usr/bin/python -tt
'''
dskinfo - Solaris utility for listing disk information
dskinfo collects and summarizes information for local, fiber-channel and iSCSI
disks in Solaris. It can display size of disks, use in imported or exported
zpools, mounted slices, LUN id and product-vendor data for disks.
While it was primarily written to handle systems using ZFS it can be useful in
@aaronlake
aaronlake / extReserved.py
Created February 24, 2015 19:32
Change ext3, ext4 file system reserved blocks to 1%
#!/usr/bin/python
import subprocess
import sys
import re
version = '1.0'
# Quit if no server specifed
if len(sys.argv) == 1:
print "Usage: fixtune2fs.py <servername>"
############################
#
# Reference: VNX CLI Docs
# Script: VNX BACKUPS
#
# Date: 2015-01-23 14:30:00
#
# Version Update:
# 1.0 David Ring
#
@aaronlake
aaronlake / VNXe_Backup.ps1
Created March 6, 2015 17:38
VNXe Backup Script
#################################
#
# Reference: VNXe UEMCLI Docs
# Script:VNXe BACKUPS
# Date: 2015-02-10 17:30:00
#
# Version Update:
# 1.0 David Ring
#
#################################
accounts-base@1.2.0
accounts-password@1.1.0
aldeed:autoform@5.1.1
aldeed:collection2@2.3.2
aldeed:delete-button@1.0.0
aldeed:simple-schema@1.3.0
aldeed:tabular@1.0.4
autoupdate@1.2.0
base64@1.0.3
binary-heap@1.0.3
@aaronlake
aaronlake / Get-SystemInfo.ps1
Last active March 14, 2016 18:10
Get Windows system information
$Computers = "localhost anotherhost01 yetanother01"
Clear-Host
foreach ($Computer in $Computers)
{
$computerSystem = get-wmiobject Win32_ComputerSystem -Computer $Computer
$computerBIOS = get-wmiobject Win32_BIOS -Computer $Computer
$computerOS = get-wmiobject Win32_OperatingSystem -Computer $Computer
$computerCPU = get-wmiobject Win32_Processor -Computer $Computer
$computerHDD = Get-WmiObject Win32_LogicalDisk -ComputerName $Computer -Filter drivetype=3
# Beginning script
# Section 1 – vCenter Server settings
$vcentertocollectstatsfrom = “192.168.1.101”
$vcenterusername = “root”
$vcenterpassword = “P@ssw0rd”
# Section 2 – Collection time frame
$noofdaystocollect = “7”
# Section 3 – CSV Output filename and directory
$csvoutput = “C:\scriptoutput\ZertoOutput.csv”
# Nothing to edit below this line
clear
Write-Host This PowerShell script collects Windows system details and outputs to an Excel file. -ForegroundColor yellow
Write-Host `n
Write-Host Prerequisites: -ForegroundColor yellow
Write-Host `n
Write-Host "1) Admin rights on your servers and excel application installed in this local machine." -ForegroundColor yellow
Write-Host "2) MS Office version 2010 or lower need to be installed in the machine you execute this script." -ForegroundColor yellow
Write-Host `n
Write-Host "If you dont have the prerequisites, please cancel this script by closing this window and run it when you have all the prerequisites." -ForegroundColor yellow
Write-Host `n
@aaronlake
aaronlake / Azure-list-untagged-resources.ps1
Last active October 10, 2018 14:14
Azure: List untagged resources
Write-Host "List all resource where Tag value is not Set"
Write-Host "********************************************"
#Fetch all resource details
$resources = get-AzureRmResource
foreach ($resource in $resources) {
$tagcount = (get-AzureRmResource | where-object {$_.Name -match $resource.Name}).Tags.count
if ($tagcount -eq 0) {
Write-Host "Resource Name - " $resource.Name
Write-Host "Resource Type and RG Name : " $resource.resourcetype " & " $resource.resourcegroupname "`n"