Skip to content

Instantly share code, notes, and snippets.

View selfcommit's full-sized avatar
🏠
Working from home

Dan OBoyle selfcommit

🏠
Working from home
View GitHub Profile
@selfcommit
selfcommit / FizzBuzz.py
Last active August 29, 2015 13:56
Python FizzBuzz
for x in xrange(1,101):
fizzbuzz_check = {'Fizz':0, 'Buzz':0}
if x%3 == 0:
#print str(x)+" Fizz"
fizzbuzz_check['Fizz'] = 1
pass
if x%5 == 0:
#print str(x)+" Buzz"
fizzbuzz_check['Buzz'] = 1
pass
@selfcommit
selfcommit / PXE Boot for Chromezilla
Last active August 29, 2015 13:56
PXE Boot for Chromezilla
#Edit file located at /tftpboot/pxelinux.cfg/default
\n
LABEL Chromebook image for Acers
kernel fog/dell/memdisk raw #This line relative to /tftpboot get memdisk here: http://goo.gl/2WHKVG
append iso initrd=chromezilla/chromezilla.iso raw #this line is relative to /tftpboot this is your iso
MENU LABEL Ubuntu
TEXT Clonezilla Converstion Tool
ENDTEXT
@selfcommit
selfcommit / view.ps1
Created February 21, 2014 17:58
Vmware View Monitor
############################################################################
# Scriptname: Pool_Prov.ps1
# Description: Checks against ADAM for Pool Status
# By: Adam Baldwin
# Edited for Hillsborough Township Public Schools by Dan O'Boyle
# Usage: Use this script to check whether any pools are in a non-provisioning
# state and send an email alert with a list of errors
#
############################################################################
@selfcommit
selfcommit / FizzBuzz.ps1
Created February 21, 2014 19:36
Better FizzBuzz
1 .. 100 | foreach{
if ($_ % 15 -eq 0) {
Write-Host "FizzBuzz"
}
elseif ($_ % 5 -eq 0 ) {
Write-Host "Fizz"
}
elseif ($_ % 3 -eq 0 ) {
Write-Host "Buzz"
140219 18:30:34 [Warning] Checking table: './drinking_wp932/wp_usermeta'
140310 3:03:30 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140310 3:03:30 [Note] Plugin 'FEDERATED' is disabled.
140310 3:03:30 InnoDB: The InnoDB memory heap is disabled
140310 3:03:30 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140310 3:03:30 InnoDB: Compressed tables use zlib 1.2.8
140310 3:03:30 InnoDB: Using Linux native AIO
140310 3:03:30 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140310 3:03:30 InnoDB: Completed initialization of buffer pool
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
$csv = Import-Csv -Delimiter t -Encoding UTF8 -Header Groups -Path C:\Users\doboyle.STACKEXCHANGE\Desktop\groups.txt
foreach ($i in $csv) {
$Group = $i.Groups
New-ADGroup -Name $Group -GroupCategory Security -GroupScope Global -DisplayName $Group -Path "OU=GADS_Groups,OU=IT,DC=Something,DC=YourDomain,DC=com" -Description $Group
}
$Group = "All"
$path = $("C:\Users\doboyle.STACKEXCHANGE\Desktop\", $Group, ".txt" -join "")
#There's no Header in our TSV, so we define one as "GoogleUser"
$csv = Import-Csv -Delimiter t -Encoding UTF8 -Header GoogleUser -Path $path
foreach ($user in $csv) {
$email = $($user.GoogleUser.ToString(), "@stackoverflow.com" -join "")
$user = Get-ADUser -Filter {mail -like $email}
Add-ADGroupMember $Group $user
#alias ls='ls -G'
export CLICOLOR=1
export LSCOLORS=Gxfxcxdxbxegedabagacad
export PS1="\u@\w"