Skip to content

Instantly share code, notes, and snippets.

View bfrancom's full-sized avatar
💥
Power wheels, power wheels, pow-pow-power wheels!

Ben Francom bfrancom

💥
Power wheels, power wheels, pow-pow-power wheels!
View GitHub Profile
@bfrancom
bfrancom / conky.rc
Last active January 3, 2019 21:48
i3 conky Node js script for weather
#In .conkyrc, I have a line like:
{ "full_text" : "${execi 301 node /home/bob/weather.js}" , "color" : "\#ffffff" },
#see result in attached image
@bfrancom
bfrancom / openbsd_volume_percentage.js
Created March 3, 2017 21:29
OpenBSD Volume Percentage for Conky
//Node.js script which calculates OpenBSD Volume percentage for the master output
//Only calculates the right channel, and assumes both channels are equal
//I use this with i3 + i3bar + conky
const spawn = require('child_process').spawn;
const mixerctl = spawn('mixerctl', ['-v', 'outputs.master']);
mixerctl.stdout.on('data', (data) => {
var arr = data.toString().split(",");
var lastNum = arr[1].replace(/(\r\n|\n|\r)/gm,"");
var perc = (lastNum/226*100);
var wholeNum = Math.floor(perc);

Keybase proof

I hereby claim:

  • I am bfrancom on github.
  • I am bfrancom (https://keybase.io/bfrancom) on keybase.
  • I have a public key ASA9v4gXnzJzx6RyLdvFoBCy_f0caEW3Zbt1xl68DqEbXQo

To claim this, I am signing this object:

@bfrancom
bfrancom / bumpme
Last active October 18, 2019 04:03
Fri Oct 18 04:03:21 UTC 2019
@bfrancom
bfrancom / get-opensearch-info.sh
Last active May 26, 2022 19:46
aws cli iterate through opensearch domains, get info, export to CSV
#!/bin/bash
#export AWS_PAGER="";
# for i in $(aws opensearch list-domain-names |jq -r '.DomainNames[].DomainName')
# do
# aws opensearch describe-domains --domain-name $i --query 'DomainStatusList[*].[EngineVersion,ClusterConfig.InstanceType,ClusterConfig.InstanceCount,EBSOptions.VolumeType,EBSOptions.VolumeSize]'
# done
export AWS_PAGER=""
@bfrancom
bfrancom / get-ec2-info.sh
Created May 30, 2022 22:03
AWS CLI Get EC2 Info and Export to CSV
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,State.Name,InstanceType'] |jq -r '.[][] | @csv' >>/tmp/ec2.csv
@bfrancom
bfrancom / pipelinestack.ts
Created February 16, 2023 15:55
CDK Pipeline with GitHub, Artifactory, and Tests
import * as cdk from 'aws-cdk-lib';
//import * as codecommit from 'aws-cdk-lib/aws-codecommit';
import { Construct } from 'constructs';
import { BenzPipelineStage } from './pipeline-stage';
import { CodeBuildStep, CodePipeline, CodePipelineSource } from 'aws-cdk-lib/pipelines';
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
export class BenzPipelineStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
@bfrancom
bfrancom / get-aws-iam-users.sh
Last active February 24, 2023 22:15
Quick one liner to get AWS users in an account
aws iam list-users --query 'Users[*].UserName'
@bfrancom
bfrancom / get-direct-reports.sh
Last active March 7, 2023 18:12
Get direct reports of manager from Microsoft Graph API filtered by name and email.
#Get users under a manager using MS graph query. Uses select filter for displayName and email address
#Use this query in https://developer.microsoft.com/en-us/graph/graph-explorer
https://graph.microsoft.com/v1.0/me/directReports?$select=displayName,mail