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
a_of_a = [["Jazz", "Soul", "Rock"],["Cheeseburgers", "Hot dogs", "Milkshakes"], ["cable", "radio", "internet"]] | |
result = Array.new(a_of_a.length) | |
procky = Proc.new { |arg| | |
print arg.join(" and "), " are my favorite things. \n" | |
} | |
def controlled_perm(x, a_of_a, result, procky) | |
x += 1 | |
if a_of_a.length == x | |
procky.call(result) | |
return |
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 | |
echo Reports the percentage of matching bytes between two files. | |
LENGTH_OF_A=$( wc -c $1 | grep -Eo [0-9]+) | |
LENGTH_OF_B=$( wc -c $2 | grep -Eo [0-9]+) | |
SAME_SIZE="false" | |
if [ "$LENGTH_OF_B" -gt "$LENGTH_OF_A" ] | |
then | |
LONGER=$2 |
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
wget -q -O- {http://www.example.com/foo.xml} | xpath -q -e '{path/to/xml_element/attr1} | {path/to/xml_element/attr2}' | sed -re 's/(<\w+?>|<\/\w+?>)//g' |
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
diff --suppress-common-lines -yw <(sort -u restore_log) <(sed -r 's/^\///g' <(sort -u original_log) ) |
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
yum update | |
#Install for compiling and configuring needs | |
yum install nano bzip2 gcc git pkgconfig autoconf automake libtool gperf byacc libxslt bison flex | |
#If in a VM you will need to install files for kernel dev to load Guest additions (VirtualBox) | |
yum install kernel-devel | |
#Mount the guest additions CD and install | |
sudo mount /dev/sr0 /media |
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
The current password policy is insufficient for properly securing my account. | |
While trying to reset my password I noticed a limit of {pw_limit}. | |
1. This artificially imposed limit locks my account password to only {pw_limit} characters and not all symbols. | |
2. The above suggests the passwords are stored in plain text. Which is never a good thing. | |
3. The current input limit is {pw_limit} characters. Google recommends a 60 character limit and 8 character minimum. | |
4. I typically use passwords of at least 20 characters and use any symbol available in the regular US key set. | |
Please upgrade the service to be able to handle passwords of greater length, symbols, and enable proper hashing and salting. For reference please see the following. |
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
# Script for testing file existence in two places | |
# PS C:\> . .\removeOldBackups.ps1 | |
# PS C:\> existsInBoth -DestRoot 'C:\Program Files\' -SourceRoot 'C:\Program Files (x86)\' -CommonPath "Common Files" | |
# True | |
# PS C:\> existsInBoth -DestRoot 'C:\Program Files\' -SourceRoot 'C:\Program Files (x86)\' -CommonPath "UnmatchedFile" | |
# False | |
function existsInBoth{ | |
param ( [string] $SourceRoot, | |
[string] $DestRoot, |
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-ChildItem -Recurse | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-14) } |
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/sh | |
# Syncs files from directory A to B. With the 'chown' this will need to be run as root. | |
# Drop that to run as unprivileged user. | |
if [ $# -lt 2 ] ; then | |
echo "usage: $0 <dir to watch> <sync to>" | |
fi | |
source="$1" | |
destination="$2" |
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
--- | |
- hosts: redhat_aws | |
vars: | |
remote_user: ec2-user | |
target_user: myUserName | |
tasks: | |
- name: 1.Check if EPEL repo is already configured. | |
stat: path=/etc/yum.repos.d/epel.repo | |
register: epel_repofile_result |
OlderNewer