Skip to content

Instantly share code, notes, and snippets.

View Akasurde's full-sized avatar
🌏
To the infinity and beyond

Abhijeet Kasurde Akasurde

🌏
To the infinity and beyond
View GitHub Profile
# 2to3 lib/ansible/modules/network/eos/eos_banner.py
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Refactored lib/ansible/modules/network/eos/eos_banner.py
--- lib/ansible/modules/network/eos/eos_banner.py (original)
+++ lib/ansible/modules/network/eos/eos_banner.py (refactored)
@@ -97,7 +97,7 @@
want, have = updates
@Akasurde
Akasurde / haste.py
Created August 9, 2017 11:41 — forked from meunierd/haste.py
Hastebin Python Client
#!/usr/bin/env python
"""
Usage:
$ cat hastebin.py | ./hastebin.py
http://hastebin.com/KEY
$ ./hastebin.py hastebin.py
http://hastebin.com/KEY
"""
@Akasurde
Akasurde / ca.md
Created November 7, 2017 15:20 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@Akasurde
Akasurde / do.md
Created February 7, 2018 10:14
# Digital Ocean Promo Code for 2018 February / March / April 2018

Digital Ocean Promo Code for 2018 February / March / April 2018

Save $25 for your Cloud Computing Solution with Digital Ocean.

How to get the Discount?

1.) Use this link to Sign Up and save your first $10.

2.) Enter the Promocode LOWENDBOX when you choose your payment method and get another $15 discount.

from pyVim.connect import SmartConnect, Disconnect
import ssl
import atexit
from pyVmomi import vim
def connect():
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
context.verify_mode = ssl.CERT_NONE
username = ''
@Akasurde
Akasurde / console.log
Created June 7, 2018 11:40
Ldap_attr
[root@qeos-39 ~]# ldapsearch -x -D "cn=Directory Manager" -h localhost -p 38901 -b "uid=testuser,ou=People,dc=example,dc=com" -w password
# extended LDIF
#
# LDAPv3
# base <uid=testuser,ou=People,dc=example,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# testuser, People, example.com
If you get SSL verify error
# python get-pip.py
Collecting pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None,
@Akasurde
Akasurde / gist:51a951a0b7ab677626a9d079029d9f31
Created June 17, 2018 08:07
Python Pune June Meetup 2018
Revisiting Python3
++++++++++++++++++
Everyone just join this link for etherpad, it will be easy for you to copy links and share code -
https://review.rdoproject.org/etherpad/p/pythonjune-101
Just add your name when you are typing anything here -
[abhijeet] https://gitlab.com/akasurde/python3_101 - Final project code is here
@Akasurde
Akasurde / console.log
Created July 9, 2018 11:20
Multiple tasks
$ cat main.yml
---
- hosts: localhost
gather_facts: no
tasks:
- include: "snapshot.yml snap={{ servername }}"
with_items:
- vm_name: server1
snap_name: snap_1
@Akasurde
Akasurde / gist:5e28e6ecb9ae1262176cdc78a9b91bd3
Created July 31, 2018 10:19
Instructions for the DevConf Ansible Workshop
1. Download and Install VirtualBox - https://www.virtualbox.org/wiki/Downloads (Please check respective OS instructions)
2. Download and Install Vagrant - http://www.vagrantup.com/downloads.html (Please check OS specific instructions)
3. Create a new directory
4. From the command line, run the following commands: (This will download Fedora 28 image and save as box)
$ vagrant init fedora/28-cloud-base
$ vagrant up
$ vagrant ssh
$ exit