This file contains hidden or 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
#Get the list of servers. | |
$serverList = Get-Content -Path .\servers.txt | |
#Loop through each. | |
foreach($server in $serverList) { | |
#Get the contents of the netlogon file. | |
$netlogonContent = Get-Content -Path \\$server\C$\Windows\debug\netlogon.log -Tail 5 | |
#Boolean to only write the server name once if at all. | |
$serverNameWritten = $false |
This file contains hidden or 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
#Array to hold the results. | |
my %uniqueIPs; | |
my $index_of; | |
my $sub; | |
#Open the file. |
This file contains hidden or 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
#!/bin/bash | |
letters=`echo $HOSTNAME | wc -m | tr -d ' '` | |
if [[ $letters -gt 15 ]]; then | |
echo "Your name is too long at $letters." | |
else | |
echo "Domain join can continue." | |
fi |
This file contains hidden or 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
#!/usr/local/bin/zsh | |
#Get the left word. | |
echo -n "Enter the left word: " | |
read leftWord | |
echo -n "Enter the right word: " | |
read rightWord | |
#Get the length of each. | |
llen=${#leftWord} |
This file contains hidden or 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
<# | |
# Challenge is here: | |
# http://www.reddit.com/r/dailyprogrammer/comments/2tr6yn/2015126_challenge_199_bank_number_banners_pt_1/ | |
#> | |
#Function to loop through each of the supplied inputs. | |
function ParseNums | |
{ | |
param([string] $passedNum) |
This file contains hidden or 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
<# | |
# Reddit Daily Programmer 199 Part 2 | |
# http://www.reddit.com/r/dailyprogrammer/comments/2u0fyx/2015126_challenge_199_bank_number_banners_pt_2/ | |
#> | |
#Create the strings for the inputs. | |
$inputTop = " _ _ _ _ _ _ _ " | |
$inputMid = "|_| |_| | | |_| |_ | | | |_ " | |
$inputBot = " | _| |_| |_| |_| | | | _|" |
This file contains hidden or 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
#!/usr/pkg/bin/zsh | |
dateMath() { | |
todayMonth=$(date "+%m/%d/%y" | awk -F\/ '{print $1}' | sed "s/^0//") | |
todayDay=$(date "+%m/%d/%y" | awk -F\/ '{print $2}' | sed "s/^0//") | |
todayYear=$(date "+%m/%d/%y" | awk -F\/ '{print $3}' | sed "s/^0//") | |
today="$todayMonth/$todayDay/$todayYear" | |
current=$(date -d $today +%s) | |
submitted=$(date -d $1 +%s) | |
diffDays=$((($submitted - $current) / 86400)) | |
echo "You must wait $diffDays days from $today to $1" |
This file contains hidden or 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
#!/usr/bin/ruby | |
def sums(list) | |
if list.length > 1 | |
return list.pop + sums(list) | |
else | |
return list.pop | |
end | |
end | |
#Make a list. |
This file contains hidden or 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
<# Reddit Daily Programmer | |
# http://www.reddit.com/r/dailyprogrammer/comments/2xoxum/20150302_challenge_204_easy_remembering_your_lines/ | |
#> | |
function MoveBack | |
{ | |
param | |
( | |
$text, | |
$location |
This file contains hidden or 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
<# | |
DNA Sequence - Daily Programmer #207 | |
http://www.reddit.com/r/dailyprogrammer/comments/2zyipu/20150323_challenge_207_easy_bioinformatics_1_dna/ | |
#> | |
#Main input. | |
$inputSequence = "A A T G C C T A T G G C" | |
#Hash defining the pairs. | |
$pairs = @{'A'='T';'T'='A';'G'='C';'C'='G'} |
OlderNewer