Tags » Bash

Find AWS EC2 tags and delete them

Quick script to find all tags associated with an EC2 instance, and then delete them.

Requires awscli

#!/bin/bash
for i in `aws ec2 describe-tags --resource=$INSTANCE_ID --query "Tags[].ResourceId"`
do
aws ec2 delete-tags --resources $i
done

HTH someone.

Linux

Linux Fu: Better Bash Scripting

It is easy to dismiss bash — the typical Linux shell program — as just a command prompt that allows scripting. Bash, however, is a full-blown programming language. 84 more words

Hackaday Columns

Insert Data to Mysql Table Using Bash Command Line

To insert data from bash command line you will need username and password to your MySQL database. Consider a following table called “fruits” with auto increment “id”: 35 more words

Mysql

"basename" -- Tell Me The Last Bus Stop

Few commands exist in Linux (and other Unix-derivatives) for the sole reason of aiding scripting and writing one-liners. basename is one of the little-known commands in that pack (at least for me). 310 more words

Basename

GPG key adding script for Debian*

*Debian based systems

There might be an easier way. Or maybe there is even an automatic way to do it. I couldn’t be bothered to search long enough. 127 more words

Debian

A Powerline style prompt for your shell

For a hassle free powerline like shell. Works with bash and zsh.

* Shows some important details about the git/svn/hg/fossil branch (see below)
* Changes color if the last command exited with a failure code…

38 more words
Bash

powerline-gitstatus

Problem:
Git status with powerline

Solution:
https://github.com/jaspernbrouwer/powerline-gitstatus

1. pip install –user powerline-gitstatus

Follow the instructions in on site https://github.com/jaspernbrouwer/powerline-gitstatus
2. Add custom highlight groups.

vim .local/lib/python2.7/site-packages/powerline/config_files/colorschemes/default.json
… 358 more words
Bash