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
eksctl create cluster --name simple-jwt-api | |
$env:ACCOUNT_ID = aws sts get-caller-identity --query Account --output text | |
$env:TRUST = "{ \`"Version\`": \`"2012-10-17\`", \`"Statement\`": [ { \`"Effect\`": \`"Allow\`", \`"Principal\`": { \`"AWS\`": \`"arn:aws:iam::${env:ACCOUNT_ID}:root\`" }, \`"Action\`": \`"sts:AssumeRole\`" } ] }" | |
aws iam create-role --role-name UdacityFlaskDeployCBKubectlRole --assume-role-policy-document "$env:TRUST" --output text --query 'Role.Arn' | |
echo '{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "eks:Describe*", "ssm:GetParameters" ], "Resource": "*" } ] }' > $env:temp\iam-role-policy |
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
#!/bin/bash | |
# This script's use is largely overshadowed by 7-zip | |
# 7z e Archives*.zip -aot -o"Destination Folder" # Rename duplicate filenames | |
# 7z e Archives*.zip -aoa -o"Destination Folder" # Overwrite duplicate filenames | |
# 7z e Archives*.zip -aos -o"Destination Folder" # Skip duplicate filenames | |
# It should be possible to use `7z e Archives*.zip -aos -o"Destination Folder" *.* -r` to avoid | |
# extracting empty directories, but any such filter, such as *.* or even *, results in no files extracted on Windows. | |
filecount=0 |
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
$subject = 'LOT 3 PHS 2 S OZ NATURAL FALLS DR'; | |
$directionals = array('north', 'east', 'south', 'west'); | |
$pattern = "/(?P<number>^(?:(?:L(?:ot)?|PHS\w*)?(?:\d+(?:th)?(?:\s*\(\d+\))?)?(?:[[:^alnum:]]+)?(?:L(?:ot)?|PHS\w*)?(?:\d+(?:th)?(?:\s*\(\d+\))?)?)+)\s+(?P<direction>north|east|south|west|n|e|s|w)?(?P<street>.*)/i"; | |
$result = preg_match($pattern, $subject, $matches); | |
if($result === 1){ | |
$matches_found = true; | |
} else if ($result === 0) { |
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
<VirtualHost *:80> | |
ServerName magento.local | |
DocumentRoot /var/www/magento | |
<Directory /var/www/magento> | |
Require all granted | |
AllowOverride FileInfo Indexes Options Limit | |
</Directory> | |
</VirtualHost> |
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
<?php | |
$thestring =<<< EOS | |
The beats: fast | |
The rhymes: bold | |
The brass: monkey | |
EOS; | |
// If this doesn't work, try the pattern /$\R?^/m | |
// Yes, that's the endline before the startline. | |
foreach(preg_split("/\r\n|\n|\r/", $thestring) as $line){ |
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
<?php | |
$processUser = posix_getpwuid(posix_geteuid()); | |
print 'Process owner: ' . '<b style="color:blue">' . $processUser['name'] . '</b>'; | |
echo "<br /> This directory's permisions: <i>" . exec('ls -ld') . '</i><br />'; | |
echo file_put_contents('test.txt', 'hey there') . ' bytes written.'; | |
?> |
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
<?php | |
$mrss =<<<EOS | |
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" | |
xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"> | |
<channel> | |
<title>My Movie Review Site</title> | |
<link>http://www.foo.com</link> | |
<description>I review movies.</description> |