Skip to content

Instantly share code, notes, and snippets.

View pattu777's full-sized avatar
πŸ’­
Learning..

Chinmaya Kr. Patanaik pattu777

πŸ’­
Learning..
View GitHub Profile
@pattu777
pattu777 / task.py
Created August 10, 2016 12:11
Search a string from a list of strings using a Trie.
"""
Lets say you have an array with a list of sub strings. Write a function that takes an input string and return true if the string can be divided into substrings contained in the array.
Example: array: [β€˜and’, β€˜the’, β€˜back’, β€˜front’, β€˜ory’ , β€˜end’, β€˜po’ , β€˜pu’, β€˜lar’]
function subDivideString(inputString):
if inputString ==’backend’ return true since array has β€˜back’ , β€˜end’
if inputString == β€˜popular’ return true since array has β€˜po’ , β€˜pu’, β€˜lar’
if inputString == β€˜backwards’ return false since array doesnt have β€˜wards’
if inputString == β€˜swapan’ return false since array doesnt have any part of the word.
@pattu777
pattu777 / sample.yml
Created September 16, 2013 11:42
delete ec2 instances, ebs volumes and security groups via ansible playbooks.
Hi,
I have just started learning ansible. I have written a simple playbook which will create , delete a server using ansible's ec2 module. I can also create a volume and attach it to a previously created instance.
---
- name: Sample playbook for Amazon AWS ec2 management via ansible
hosts: local
connection: local
vars:
aws_access_key: xxxx