Skip to content

Instantly share code, notes, and snippets.

s3Buffer, numBytes, err := DownloadS3File(event.S3Bucket, event.S3ObjectID, session)
header, err = GetHeader(s3Buffer)
var outBuffer []byte
if HeaderIndicatesConversionNeeded(header) {
outBuffer, err = ConvertBuffer(s3Buffer, event.ObjectID)
} else {
// outBuffer = s3Buffer or copy(outBuffer, s3Buffer) or ??
/usr/bin/check_remote
#!/bin/bash
# check_remote
SET="/etc/interop/backupapp/backupset.txt"
TMPSET="/tmp/set"
. /usr/bin/backupapp.h
START=$(date +%s)
@chewmanfoo
chewmanfoo / my code
Last active January 15, 2020 19:27
cdk problem
env = core.Environment(account=os.environ['CDK_DEFAULT_ACCOUNT'], region=os.environ['CDK_DEFAULT_REGION'])
these envars are set in my environment. I triple checked them.
I have this file containing a lot of this
authorized_cidr = ""
concourse_keys = ""
encryption_key = ""
instance_ami = ""
name_prefix = ""
postgres_database = ""
postgres_host = ""
postgres_password = ""
variable "task_name_suffixes" {
default = {
"0" = "lob-tables-01"
"1" = "datashack-tables-01"
"2" = "wexnet-tables-01"
"3" = "wexnet-tables-02"
"4" = "arch-tables-01"
"5" = "tiger-tables-01"
"6" = "tiger-tables-02"
"7" = "wwex-tables-01"
@chewmanfoo
chewmanfoo / gist:834086
Created February 18, 2011 17:55
spec file
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: i386
Requires: memcached start-stop-daemon perl-IOT-Spooler
Requires: perl-DBD-MySQL perl(Proc::Queue)
BuildRequires: libtool libmemcache-devel libxmlparser-devel mysql++-devel
BuildRequires: libevent-devel e2fsprogs-devel libxml2-devel libiop_log-devel
BuildRequires: ss7dpk-devel libioputils-devel libiopconfig-devel protobuf-devel
$ aws cloudformation list-stack-resources --stack-name $stack_name --query "StackResourceSummaries[][?ResourceType=='AWS::EC2::Instance'][]" --region $reg --profile $acct
[]
$ aws cloudformation list-stack-resources --stack-name $stack_name --query "StackResourceSummaries[][?ResourceType=='AWS::EC2::Instance'][*]" --region $reg --profile $acct
[]
$ aws cloudformation list-stack-resources --stack-name $stack_name --query 'StackResourceSummaries[*][?contains(ResourceType,`Instance`) == true].[ResourceType,ResourceStatus,LogicalResourceId]' --region $reg --profile $acct
[]
prompt$ aws ec2 describe-route-tables --filters "Name=route-table-id,Values=rtb-0f5e3e513a140d8c5" --query "RouteTables[*].Routes" --region eu-west-1 --profile sabre-as-dev-01
[
[
{
"Origin": "CreateRoute",
"DestinationCidrBlock": "10.179.216.0/24",
"State": "active",
"VpcPeeringConnectionId": "pcx-06756ed4585adc737"
},
{
JAMB3LHHTDD:admin-scripts sg0218049$ python -m pip install boto3
Traceback (most recent call last):
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/site-packages/pip/__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "/usr/local/lib/python2.7/site-packages/pip/_internal/__init__.py", line 5, in <module>
import logging
mylaptop:cleverfolder mycleverusername$ python cleverfile.py
Traceback (most recent call last):
File "cleverfile.py", line 3, in <module>
import ecshelper
File "/Users/mycleverusername/Documents/git.sabre.com/cleverfolder/ecshelper.py", line 3, in <module>
import boto3
ImportError: No module named boto3
mylaptop:cleverfolder mycleverusername$ pip install boto3
Requirement already satisfied: boto3 in /usr/local/lib/python2.7/site-packages (1.7.62)