ansible with docker dynamic inventory

2017-01-09 2 min read Bash Fedora Vurtualization

So, I have a few dockers. Every now and then I want to run some command on all of them. Doing ‘docker exec’ is tiresome. I found this neat solution with ansible that I thought I should share with you.

To get started, you need to have the “docker.py” script. This script will be used as python script inventory for ansible. So, use the following command and get the script:

Continue reading

Trello – backup to your linux machine

2017-01-02 1 min read Bash

Just in case, you are looking for backing up your trello account boards, you can use the following bash script to do so:

 

#!/bin/bash -
#===============================================================================
#
#          FILE: backup-trello.sh
#
#         USAGE: ./backup-trello.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka)
#  ORGANIZATION: Mobileum
# Last modified: Thu Dec 22, 2016  01:14PM
#       CREATED: 08/12/2016 09:41:08 AM IST
#      REVISION: $Revision: 1.0 $$
#===============================================================================

# Your backup directory
BDIR=/backup

# Your trello api token and key goes here :)
token=<>
key=<>


# IDs of the boards go here. This is easy to get, just go to your 
# board and check the last part of URL
BOARDS=( a b )


URL="https://trello.com/b/"
POST='&actions=all&actions_limit=1000&cards=all&lists=all&members=all&member_fields=all&checklists=all&fields=all'

for i in ${BOARDS[*]}
do
    /usr/bin/curl -H 'Accept-Encoding:gzip, deflate, br' -H 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' "$URL$i.json?&key=$key&token=$token$POST" > "$BDIR/$i.json.gz"
    # gzip -f "$BDIR/$i.json"
done

 

Continue reading

email with templates (with variables) from the command line with sendmail or any other MTA.

2010-06-09 2 min read Bash Fedora Linux

I was trying to get templates to work on evolution and found that although templates are there in evolution mail client, its not that efficient to use. What I thus wanted was to have something that could allow me to send mails to (and cc and bcc) to specified people with predefined template, only some values changed, like changelog and so on. So I wrote a set of files and below files to achieve the same. Hope it helps you too 🙂

Continue reading

Checking the links to your site (from affiliates) using cron and bash script.

2010-05-27 2 min read Fedora Learning Linux Uncategorized

If you have some affiliate links and are concerned about their presence then you can setup <a class="zem_slink freebase/guid/9202a8c04000641f80000000045c9c5b" title="Cron" rel="wikipedia" href="http://en.wikipedia.org/wiki/Cron">cron to check the links for you regularly. For this you need a very simple script (as below) and a cron entry (example further down).

#!/bin/bash –
#===============================================================================

#          FILE:  checklinks.sh

#         USAGE:  ./checklinks.sh

#   DESCRIPTION:  Check if the links exists on affiliate sites

#       OPTIONS:  —
#  REQUIREMENTS:  —
#          BUGS:  —
#         NOTES:  —
#        AUTHOR:  <a class="zem_slink" title="Amit Agarwal" rel="homepage" href="http://amit-agarwal.co.in">Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in
#       COMPANY:  Individual
#       VERSION:  1.0
#       CREATED:  04/07/2010 08:19:29 AM IST
#      REVISION:  —
#===============================================================================

Continue reading

List all the installed firefox addons from the bash script

2010-05-18 1 min read Bash Fedora Linux

Here is a one-line that would help you get the <a class="zem_slink freebase/en/mozilla_firefox" title="Firefox" rel="homepage" href="http://www.mozilla.com/en-US/firefox/">Firefox addons in the bash script:

grep -hIr \<em:name ~/.mozilla/firefox/*.default/extensions|sed &#8217;s#\s*##&#8217;|sed &#8217;s#.*\(>.*<\).*#\1#&#8217;|sed &#8217;s/[<\|>]//g&#8217;|sort -u<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2010/05/16/firefox-3-6-4-build-4-released/">Firefox 3.6.4 Build 4 Released (ghacks.net) <li class="zemanta-article-ul-li"><a href="http://www.webmonkey.com/2010/05/first-look-firefox-4-preview-delivers-speed-revamped-interface/">First Look: Firefox 4 Preview Delivers Speed, Revamped Interface (webmonkey.com) <li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2010/05/15/protect-firefox-bookmarks-with-link-password/">Protect Firefox Bookmarks With Link Password (ghacks.net) <li class="zemanta-article-ul-li"><a href="http://www.huffingtonpost.com/2010/05/12/mozilla-firefox-4-upgrade_n_573062.html">Firefox 4 Upgrade Offers Simpler Design, More Privacy Control (huffingtonpost.com) <li class="zemanta-article-ul-li"><a href="http://www.readwriteweb.com/archives/mozilla_talks_firefox_4_sleeker_interface_better_privacy_controls.php">Mozilla&#8217;s Plans for Firefox 4: Faster, Sleeker Interface, Better Privacy Controls (readwriteweb.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/6a3ffd4a-91cf-47e3-85ff-7dc3b27ffd7d/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b89.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading
Newer posts