This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Wirten by James Calleja | |
32/11/2017 | |
*/ | |
function rot13(str) | |
{ | |
var strArray = str.split(""); | |
var result = []; | |
for (var i = 0; i < str.length; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd Cert:\LocalMachine\My\ | |
$mypwd = cat Microsoft.PowerShell.Core\FileSystem::\\rplan\netlogon\Logon\pwd.txt | ConvertTo-SecureString -key (1..16) | |
Import-PfxCertificate -Exportable:$false -Password $mypwd -FilePath '\\rplan\netlogon\Logon\star.dev.rplani.co.uk.pfx' -Confirm:$false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#delets all volumes not attached to a running instance | |
$volumes = Get-EC2Volume | |
for ($i = 0; $i -ne $volumes.Length; $i ++) {if ($volumes[$i].state -eq 'available') {Remove-EC2Volume -VolumeId $volumes[$i].volumeID -Force; write-host 'Deleting volume:' $volumes[$i].volumeID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#search for all images owened by <user> select for *web* | |
$aim_web = Get-EC2Image -Owner 399828342872 | ?{$_.name -like '*web*'} | |
#create an EBSBlockDevice profile | |
$volume1 = New-Object Amazon.EC2.Model.EbsBlockDevice | |
$volume1.DeleteOnTermination = $true | |
$volume1.Encrypted = $true | |
$volume1.VolumeSize = 30 | |
$volume1.VolumeType = 'standard' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################### | |
#Writen by James Calleja | |
#Date 22/06/2016 | |
######################################################### | |
# create a byte array for the M-F 8:00 am to 8 pm logon hours | |
$hours = New-Object byte[] 21 | |
$hours[0] = 0;#sunday 00:00 - 08:00 | |
$hours[1] = 0;# 08:00 - 16:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Written by: James Calleja # | |
#Date: 15/07/2016 # | |
# # | |
#This script will connect to vcentre, clone from the Golden_Base_Image, and push it to the # | |
#environment selected via cirtix # | |
################################################################################################ | |
#load powershell modules and snapins | |
add-pssnapin vmware.vimautomation.core -EA SilentlyContinue -WarningAction SilentlyContinue | |
Add-PSSnapin citrix* -EA SilentlyContinue -WarningAction SilentlyContinue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################################## | |
#Written By James Calleja # | |
#20/05/2016 # | |
# # | |
#this scrip will migrate a host from one vsphere to another or from cluster to cluster in# | |
#the same vSphere # | |
########################################################################################## | |
$nl = [Environment]::NewLine | |
#get creds for the operation & the source Vcentre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Run from top level domain to get a full list of computer in the forest, excluding the top level domain (just run get-adcomputer for them) | |
(get-addomain).childdomains | %{(Get-ADDomainController -Discover -Domain $_).hostname} | %{Get-ADComputer -Filter * -Server $_ -properties * | select name,dnshostname, enabled, distinguishedname,LastLogOnDate } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* helpers.c | |
* | |
* Computer Science 50 | |
* Problem Set 3 | |
* | |
* Helper functions for Problem Set 3. | |
*/ | |
#include <cs50.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*#################################### | |
#vigenere.c # | |
#Written by James Calleja, 2016 # | |
# # | |
#Encrypts a string of text by a # | |
#cypher word provided by the user # | |
###################################### | |
#include <stdio.h> |
NewerOlder