Skip to content

Instantly share code, notes, and snippets.

import abc
import importlib
class Plugins(abc.ABCMeta):
plugins = dict()
def __new__(metaclass, name, bases, namespace):
cls = abc.ABCMeta.__new__(
metaclass, name, bases, namespace)
if isinstance(cls.name, str):
metaclass.plugins[cls.name] = cls
@Deepakkothandan
Deepakkothandan / ansible_debug_vscode.md
Last active September 2, 2020 22:33
Debug ansible with vscode

Ansible VSCode Debugging

  1. VSCode version 1.23.1
  2. Create launch.json for python attach
  3. Make sure ptvsd version is 3.0.0 pip install ptvsd==3.0.0
{
    "name": "Python: Attach",
 "type": "python",
@Deepakkothandan
Deepakkothandan / bash_date_formats.sh
Created March 27, 2018 08:58
Useful Bash Date Formats
#! /bin/bash
# An overly obvious reference for most commonly requested bash timestamps
# Now all you Mac fags can stop pestering me.
cat << EOD
Format/result | Command | Output
--------------------------------+----------------------------+------------------------------
YYYY-MM-DD_hh:mm:ss | date +%F_%T | $(date +%F_%T)
YYYYMMDD_hhmmss | date +%Y%m%d_%H%M%S | $(date +%Y%m%d_%H%M%S)
@Deepakkothandan
Deepakkothandan / snapshots.py
Created September 26, 2017 18:54 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
@Deepakkothandan
Deepakkothandan / bb_deployment_key.sh
Created May 4, 2017 07:04
bitbucket-create-deployment-key
#!/usr/bin/env bash
set -e
KEY="contents_of_public_key_here"
LABEL=some_custom_label
AUTH=username:password
curl -X POST --user $AUTH \
https://api.bitbucket.org/1.0/repositories/username/repo_name/deploy-keys \
@Deepakkothandan
Deepakkothandan / xdebug.ini
Last active June 9, 2017 14:14
xdebug config for vagrant
zend_extension=xdebug.so
;xdebug.idekey = "PHPSTORM"
;xdebug.default_enable = 1
;xdebug.remote_enable = 1
;xdebug.remote_autostart = 0
;xdebug.remote_port = 9000
;xdebug.remote_handler=dbgp
;xdebug.remote_connect_back = 1
@Deepakkothandan
Deepakkothandan / phantomjs
Created February 15, 2017 12:14
phantom js init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: phantomjs
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PhantomJS headless browser
### END INIT INFO
@Deepakkothandan
Deepakkothandan / rocketchat.py
Created February 15, 2017 10:30
Rocketchat callback plugin for Ansible
# (C) 2016, Deepak Kothandan
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
INSERT INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES ('websites', '0', 'dev/debug/template_hints', '1');
Disable-BingSearch
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableOpenFileExplorerToQuickAccess -EnableShowRecentFilesInQuickAccess -EnableShowFrequentFoldersInQuickAccess -EnableExpandToOpenFolder
cinst googlechrome
cinst flashplayerplugin
cinst jre8
cinst adobereader
cinst winrar
cinst skype
cinst cyberduck
cinst openvpn