Better HN
topnewbestaskshowjobs
Log inSign up

mike-bailey

100 karma · joined Dec 31, 2019 (6y ago) · 31 submissions

https://news.ycombinator.com/user?id=mike-bailey
Submissions

comment 1y ago · link · parent

Claude Opus and Gemini 2.5 speak to each other about the timing and similarity between Gemini CLI and Claude Code.

Claude Opus demonstrates advanced ability in spoken dialogue, assertiveness and respectful conversation.

2.

Show HN: Voice-Mode MCP – Conversational Coding for Claude Code, Gemini CLI(getvoicemode.com ↗)

8 points · by mike-bailey · 1y ago · discuss

comment 1y ago · link · parent

I added a two way voice interface to Gemini CLI.

https://youtu.be/HC6BGxjCVnM?feature=shared&t=36

It's a FOSS MCP server I created a couple of weeks ago:

- https://getvoicemode.com

- https://github.com/mbailey/voicemode

# Installation (~/.gemini/settings.json)

{

  "theme": "Dracula",  

  "selectedAuthType": "oauth-personal",  

  "mcpServers": {  

    "voice-mode": {  

      "command": "uvx",  

      "args": [  

        "voice-mode"  

      ]  

    }  

  }  

}

comment 1y ago · link · parent

openai-proxy connects the many open source models (ASR, TTS, LLMs) with OpenAI compatible APIs with existing tools that use OpenAI SDKs.

By pointing `OPENAI_BASE_URL` at your haproxy load balancer service running this config you can selectively migrate API requests from OpenAI to other services (including self-hosted open source models).

comment 1y ago · link · parent

Last time BMA was on front page of HN was 1 Jan 2020 (for about 23 hours IIRC).

https://news.ycombinator.com/item?id=21921293

comment 1y ago · link · parent

The __bma_read_filters function is designed to take all arguments and join them with | to create a grep pattern. Adding quotes around $@ would break this functionality because:

__bma_read_filters "arg1 arg2" arg3

With unquoted $@:

• Gets word split into: arg1 arg2 arg3 • Results in: arg1|arg2|arg3

With quoted "$@":

• Would be passed as: "arg1 arg2" arg3 • Results in: "arg1 arg2"|arg3

The unquoted version is correct here since the function is intentionally using word splitting to create individual grep pattern elements.

This is one of those cases where the normal "always quote your variables" rule has a valid exception because word splitting is part of the intended behavior.

7.

Show HN: Bash-my-AWS adds `bmai <missing command>` to generate functions(github.com ↗)

3 points · by mike-bailey · 1y ago · 3 comments

8.

Show HN: Cachews – Caching for AWS CLI(bash-my-aws.org ↗)

1 points · by mike-bailey · 3y ago · discuss

9.

Bash-my-AWS: Mature CLI toolset for managing AWS resources(github.com ↗)

5 points · by mike-bailey · 5y ago · discuss

10.

Pipe-Skimming: Pattern enhances the UI of Unix CLI Tools(bash-my-aws.org ↗)

3 points · by mike-bailey · 6y ago · discuss

comment 6y ago · link · parent

Here's the video from my talk on Bash-my-AWS at LinuxConf 2020 in the Gold Coast Australia.

https://www.youtube.com/watch?v=UbH_cg7Ev1Q

comment 6y ago · link · parent

They're good questions. I can tell you how I manage regions and accounts but am interested in learning how people think Bash-my-AWS might better support users in this regard.

The AWCLI, as well as SDKs all support grabbing Regions and account credentials from environment variables.

For Regions, I work tend to use the following aliases:

  alias au='export AWS_DEFAULT_REGION=ap-southeast-2'
  alias us='export AWS_DEFAULT_REGION=us-east-1'
  alias dr='export AWS_DEFAULT_REGION=ap-southeast-1'
I normally work in a single Region and swap when required by typing the 2 character alias.

To run a script or command (doesn't have to be Bash-my-AWS) across all Regions I use region-each:

  $ region-each stacks | column -t
  example-ec2-ap-northeast-1  CREATE_COMPLETE  2011-05-23T15:47:44Z  NEVER_UPDATED  NOT_NESTED  #ap-northeast-1
  example-ec2-ap-northeast-2  CREATE_COMPLETE  2011-05-23T15:47:44Z  NEVER_UPDATED  NOT_NESTED  #ap-northeast-2
  ...
  example-ec2-us-west-2       CREATE_COMPLETE  2011-05-23T15:47:44Z  NEVER_UPDATED  NOT_NESTED  #us-west-2
For AWS accounts, I type the name of the account and I'm in. For accounts using IDP (ldap/AD backed corporate logins) I generate aliases so I have tab completion and simple naming.

In accounts that are only setup to use AWS keys, I use aliases that export credentials kept in GPG encrypted files. Last time I looked, AWS docs suggested keeping these long lives credentials in plaintext files readable by your account. That's asking for trouble IMO, especially if they're kept in a known location that a compromised node library could exfiltrate them from.

AWSCLI v2 beta includes support for SSO so it's probably a good time to look at how BMA could include support for auth.

comment 6y ago · link · parent

I don't like to rely on my memory either! I forget the names of commands and use tab completion to list them.

You can just type bma[TAB][TAB] and it will list them all.

If you know the type of resource you are working with, you can use TAB completion to see it's commands:

  $ stack-
  stack-arn            stack-exports        stack-tag-apply
  stack-asg-instances  stack-failure        stack-tag-delete
  stack-asgs           stack-instances      stack-tags
  stack-cancel-update  stack-outputs        stack-tags-text
  stack-create         stack-parameters     stack-tail
  stack-delete         stack-recreate       stack-template
  stack-diff           stack-resources      stack-update
  stack-elbs           stack-status         stack-validate
  stack-events         stack-tag

comment 6y ago · link · parent

bash-my-github and bash-my-spotify are two things I've made a start on but are not public yet. They've been on the backburner for a while due to competing priorities.

I was able to write a simple command that returned all songs a friend and I had in common in our public playlists.

I forget the exact syntax but it was something roughly along the lines of:

  $ sort <(
      user-playlists alice | playlist-tracks 
      user-playlists bob | playlist-tracks
    ) | uniq --repeated

comment 6y ago · link · parent

AWSCLI backward compatibility has been so good, I've never had a Bash-My-AWS command fail due to a change.

AWS CLI v2 previews were released in Nov 19 and while this may contain some breaking changes, I wouldn't be surprised if all the commands BMA uses continue to work as normal.

https://aws.amazon.com/blogs/developer/aws-cli-v2-installers...

comment 6y ago · link · parent

I have sometimes questioned whether I should be spending my personal time developing an open source tool so tied to a single companies services.

My reasons for continuing include:

- I prefer to use command line over ClickOps

- Using Bash-My-AWS makes me more effective at work

- The emergent UX is equally applicable to other services (e.g. bash-my-github, bash-my-spotify)

- The intrinsic satisfaction from creating

- Helping improve the experience for others

comment 6y ago · link · parent

Thanks!

The intent has always been to enhance rather than replace AWCLI (which is an amazing tool!).

If you're ever wondering how a Bash-My-AWS command works, use `bma type` (it even supports tab completion for all the commands).

  $ bma type instances
  instances is a function
  instances () 
  { 
      local instance_ids=$(__bma_read_inputs);
      local filters=$(__bma_read_filters $@);
      aws ec2 describe-instances $([[ -n ${instance_ids} ]] && echo --instance-ids ${instance_ids}) --query "
          Reservations[].Instances[][
            InstanceId,
            InstanceType,
            State.Name,
            [Tags[?Key=='Name'].Value][0][0],
            LaunchTime,
            Placement.AvailabilityZone,
            VpcId
          ]" --output text | grep -E -- "$filters" | LC_ALL=C sort -b -k 6 | column -s' ' -t
  }

comment 6y ago · link · parent

Windows users have commented at how Bash-My-AWS's innovative use of unix streams reminds them of PowerShell.

The listing functions output lines of tokens. The first token is the resource identifier. Piping that output into functions for that resource type results in the resource IDs only being used.

  $ instances
  i-03dfa28fc8235df7b  t3.nano  running  prometheus  2019-12-31T14:10:45.000Z  ap-southeast-2a  vpc-9def06f8
  i-0fd7a4c81051f2718  t3.nano  running  huginn      2019-12-31T14:10:44.000Z  ap-southeast-2a  vpc-9def06f8
  i-0abcd6e9c302f35bb  t3.nano  running  rails-demo  2019-12-31T14:10:47.000Z  ap-southeast-2b  vpc-9def06f8

  $ instances | grep rails-demo | instance-asg | asg-capacity
  rails-demo-AutoScalingGroup-14SBR6O3W1FBL  0  1  2

  $ instances | grep rails-demo | instance-asg | asg-
  asg-capacity              asg-launch-configuration  asg-processes_suspended   asg-stack
  asg-desired-size-set      asg-max-size-set          asg-resume                asg-suspend
  asg-instances             asg-min-size-set          asg-scaling-activities

  $ instances | grep rails-demo | instance-asg | asg-desired-size-set 2
  $ instances | grep rails-demo | instance-asg | asg-capacity
  rails-demo-AutoScalingGroup-14SBR6O3W1FBL  0  2  2

comment 6y ago · link · parent

AWSCLI is amazingly flexible and powerful.

Bash-My-AWS thinly wraps AWSCLI commands that would otherwise be too long to type. So you're still using AWSCLI and can improve your skill with it by inspecting the source of Bash-My-AWS functions.

https://news.ycombinator.com/item?id=21931298

comment 6y ago · link · parent

Bash-My-AWS wraps AWSCLI as thinly as possible and makes use of JMESPath and the text output.

The result is you have a simple set of commands that don't require you to type hundreds of characters.

  instances() {
    local instance_ids=$(__bma_read_inputs)
    local filters=$(__bma_read_filters $@)

    aws ec2 describe-instances                                            \
      $([[ -n ${instance_ids} ]] && echo --instance-ids ${instance_ids})  \
      --query "
        Reservations[].Instances[][
          InstanceId,
          InstanceType,
          State.Name,
          [Tags[?Key=='Name'].Value][0][0],
          LaunchTime,
          Placement.AvailabilityZone,
          VpcId
        ]"                                                               \
      --output text       |
    grep -E -- "$filters" |
    LC_ALL=C sort -b -k 6 |
    column -s$'\t' -t
  }

comment 6y ago · link · parent

jq is only used in three of the >120 functions (for sort-keys functionality). All the rest use JMESPath.

If anyone can help with a solution I'd be delighted to remove the dependency on jq.

https://github.com/bash-my-aws/bash-my-aws/blob/b74d92a902bb...

comment 6y ago · link · parent

It's probably my fault if you haven't heard of Bash-My-AWS.

Bash-My-AWS is a simple but extremely powerful set of CLI commands for managing resources on Amazon Web Services. They harness the power of Amazon's AWSCLI, while abstracting away the verbosity. The project implements some innovative patterns but (arguably) remains simple, beautiful, readable and easily extensible.

The project started in 2014 and while many hundreds of hours have gone into it, far less has gone into promotion.

I'm speaking about it at LinuxConf and have created a documentation site at https://bash-my-aws.org

https://linux.conf.au/schedule/presentation/144/

12