Skip to content

Instantly share code, notes, and snippets.

View pklimai's full-sized avatar

Peter Klimai pklimai

View GitHub Profile
import java.lang.StringBuilder
/*
RS = relative scoping (all calls are relative to the receiver object)
ARG = receiver is sent as argument and must be accessed using 'it'
fun | obj input | returns | comment
---------+-----------+----------------------------------+--------------------------------------------
apply | RS | this |
#!/usr/bin/python
import yaml
import sys
from pprint import pprint
if len(sys.argv) != 2:
print "Call me with filename as an argument"
else:
with open(sys.argv[1], 'r') as stream:
@pklimai
pklimai / pyez_version.py
Created July 22, 2017 19:51
How to determine PyEZ version
# The problem is that on-box PyEZ has version.pyc and not version.py, but you can get version this way:
from jnpr.junos import version
print version.VERSION
@pklimai
pklimai / ChangePassword.java
Created October 23, 2015 10:37 — forked from zach-klippenstein/ChangePassword.java
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall ([email protected]), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{