Skip to content

Instantly share code, notes, and snippets.

View change_password.yml
- hosts: all
remote_user: pi
become_method: sudo
vars_prompt:
- name: new_password
prompt: "Enter the password you would like to use for the user pi"
confirm: yes
tasks:
- name: backup shadow file
@virantha
virantha / chp.py
Last active Oct 1, 2017
Palindrome checker
View chp.py
from curio import Queue, CancelledError
class Port:
def __init__(self):
self.chan = None
self.proc = None
class InputPort(Port):
async def recv(self):
tok, timestamp = await self.chan.recv()
View process_buffer5.py
from curio import Queue, CancelledError
class Port:
def __init__(self):
self.chan = None
self.proc = None
class InputPort(Port):
async def recv(self):
tok, timestamp = await self.chan.recv()
View process_buffer4.py
from curio import Queue, CancelledError
class Port:
def __init__(self):
self.chan = None
class InputPort(Port):
async def recv(self):
tok = await self.chan.recv()
return tok
View process_buffer3.py
from curio import Queue, CancelledError
class Port:
def __init__(self):
self.chan = None
class InputPort(Port):
async def recv(self):
tok = await self.chan.recv()
return tok
@virantha
virantha / process_buffer2.py
Last active Sep 28, 2017
process_buffer2.py
View process_buffer2.py
from curio import Queue, CancelledError
class Port:
def __init__(self):
self.chan = None
class InputPort(Port):
async def recv(self):
tok = await self.chan.recv()
return tok
View process_buffer1.py
class Process:
next_id = 0
def __init__(self, name):
self.name = name
self.id = Process.next_id
Process.next_id += 1
@virantha
virantha / Main.java
Created Dec 2, 2016
Bundling Python with Moneydance Extensions
View Main.java
package com.moneydance.modules.features.myextension;
import com.moneydance.apps.md.controller.FeatureModule;
import com.moneydance.apps.md.controller.FeatureModuleContext;
import com.moneydance.apps.md.controller.ModuleUtil;
import com.moneydance.apps.md.controller.UserPreferences;
import java.io.*;
import java.util.*;
import java.text.*;
@virantha
virantha / 1-simple-moneydance-popup.py
Last active Nov 29, 2016
Simple moneydance gui extension in python
View 1-simple-moneydance-popup.py
from com.infinitekind.moneydance.model import *
import os
from javax.swing import JButton, JFrame, JScrollPane, JTextArea, BoxLayout, BorderFactory
class SimplePopupExtension(object):
def initialize(self, extension_context, extension_object):
self.moneydanceContext = extension_context
self.moneydanceExtensionObject = extension_object
You can’t perform that action at this time.