Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/usr/bin/env pytest | |
| """ | |
| Configuring python test environment to work against LocalStack | |
| Expanding upon README.md in https://github.com/localstack/localstack-python-client | |
| Pre-reqquisites: | |
| pip install localstack-client pytest && | |
| git clone https://github.com/localstack/localstack.git && |
| #!/bin/bash | |
| #clean the com.apple.macl attribute from a file or folders using zip to sidestep SIP on Catalina | |
| #WARNING: This will overwrite the original file/folders with the zipped version - DO NOT use on production data | |
| #hold down command key at launch or touch /tmp/debug to enable xtrace command expansion | |
| commandKeyDown=$(/usr/bin/python -c 'import Cocoa; print Cocoa.NSEvent.modifierFlags() & Cocoa.NSCommandKeyMask > 1') | |
| [ "$commandKeyDown" = "True" -o -f /tmp/debug ] && set -x && xtraceFlag=1 | |
| #hacky example to clean the com.apple.macl attribute from a file using zip to sidestep SIP | |
| : <<-EOL |
| # 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 |
| #!/user/bin/env ruby | |
| require 'bundler/inline' | |
| gemfile(true) do | |
| source 'https://rubygems.org' | |
| gem 'sinatra', '~> 1.4' | |
| gem 'bcrypt', '~> 3.1' | |
| end | |
| require 'sinatra/base' |
| package main | |
| import ( | |
| "compress/gzip" | |
| "io" | |
| "net/http" | |
| "strings" | |
| ) | |
| // Gzip Compression |
| # Simple Recommendation Engine in Ruby | |
| # Visit: http://otobrglez.opalab.com | |
| # Author: Oto Brglez <otobrglez@gmail.com> | |
| class Book < Struct.new(:title) | |
| def words | |
| @words ||= self.title.gsub(/[a-zA-Z]{3,}/).map(&:downcase).uniq.sort | |
| end |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # download latest libevent2 and tmux sources, and extract them somewhere | |
| # (thx bluejedi for tip on latest tmux URL) | |
| # | |
| # at the time of writing: | |
| # https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
| # http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
| # | |
| # install deps | |
| yum install gcc kernel-devel make ncurses-devel |