Browsed by
Tag: tip

AWS Cloudwatch Log Scroller

AWS Cloudwatch Log Scroller

This is a quick tip about a quick solution to a regular small problem! AWS CloudWatch logs are great, but the search feature on those logs is not. The search only lists the lines that are exact match to your search term. Usually you would want to see a few lines above or below the match as well! Not all logs are single line, unless you spend efforts in ensuring that there are no newlines in the content being logged out. And so, every so often you have resort to ‘scrolling’ through the logs.

The logs load dynamically on scroll of the mouse wheel, and it is tedious (read ‘irritating’) to keep spinning the mouse wheel to scroll through those logs, especially the ECS container logs. So here is a little script which does that for you. Run this in your browser console and specify it the number of times it should run, and done. It does the scroll action, waits for the page to load (fixed) and scrolls again till it has scrolled for the times you specified.

You can also stop the scroll in between by calling clearTimeout on the timer.

Here it is:

Disclaimer: This is still not the best solution for long running tasks / huge log files, you are limited by the load times anyway. This only takes the need for manually scrolling through logs where you would have otherwise done so. For larger logs, it is probably best to export them.

Mute Mic With Keyboard Shortcut On Ubuntu Or Linux Mint

Mute Mic With Keyboard Shortcut On Ubuntu Or Linux Mint

Here is a quick tip for all the automation buffs like me. Turn your mic on and off with just a keyboard combo.

I do all my work remotely. Which is also to say I have a lot of conference calls. And like you, I hate it when people do not mute their phones / mic on laptops when not speaking! (cue in the obligatory meme about not putting your phone on mute during a call!)

I always wished for a hotkey of some sort to mute / un-mute myself during a call. So here is a way to do it.

  1. Use a Linux machine. (This in itself is a great tip! 😉 ) These steps in particular are for an Ubuntu / Linux Mint machine.
  2. Put the following snippet in a bash script file and add it to path. You can also define it as a bash alias and load it from your custom bash profile, but then assigning it a shortcut may not be that easy.
  3. Set a keyboard shortcut to trigger this script. I use Meta+M for this.

Here are the two variants of the script for that:

This script toggles mic state, shows a nice (transient) notification of the changed state, with an intuitive icon! It should also replace previous notification quickly, but somehow it does not seem to work yet.

(cue in the meme about speaking on mute! ;))