Skip to content

Instantly share code, notes, and snippets.

Login with admin access and create the user account.

1> CREATE LOGIN user_name WITH PASSWORD = 'password'

2> GO

Switch to the database.

1> USE database_name

#!/usr/bin/env python
BUCKET = input("Bucket name: ")
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket(BUCKET)
bucket.object_versions.delete()

Thanks to this article on doing the heavy lifting.

In Ubuntu:

RUN apt-get update \
  && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    tzdata \
  && apt-get clean \
 && rm -rf /var/lib/apt/lists/*
  1. Install nc with apt install netcat on Ubuntu.
  2. Get the URL and port for Redis.
  3. $ echo -e "*1\r\n\$4\r\nINFO\r\n" | nc redis-server.usw2.cache.amazonaws.com 6379

Sample output

$2117
# Server

This seems to work better:

$ grep -rl list-inactive-ecs?ref=v0.3.35 . | xargs sed -i '' 's/v0.3.35/v0.3.36/'

This one has been sketchy.

LC_ALL=C find . -type f -name '*.tfvars' -exec sed -i '' s/this/that/g {} +

docker commit CONTAINER NEWIMAGENAME

Then start the newly saved image with a different CMD, so for example:

docker run -it --entrypoint /bin/bash NEWIMAGENAME

  1. Clone or update Homebrew-core from https://github.com/Homebrew/homebrew-core

  2. Search the git log for the specific commit for the Terraform that needs to be installed.

    $ git log --grep "update 0.10.8 bottle" -- Formula/terraform.rb

  3. Brew install terraform.

    $ brew install terraform

  4. Unlink the installed version.

$ brew unlink terraform

htop -p `{ unzip ~/Downloads/sample.zip > /dev/null & } && echo $!`
@jknsware
jknsware / aws-cli-jq.sh
Last active January 11, 2019 19:50
aws cli + jq examples
# Pull InstanceId, Private IP, and Tag
aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | [.InstanceId, .NetworkInterfaces[].PrivateIpAddress, (.Tags[]|select(.Key=="Name")|.Value)]'

Keybase proof

I hereby claim:

  • I am jknsware on github.
  • I am jware (https://keybase.io/jware) on keybase.
  • I have a public key ASBVPzgDuNugqD4NZivuG2ijYjfUP6c2HmjOL1xxx67U7Ao

To claim this, I am signing this object: