Skip to content

Instantly share code, notes, and snippets.

View mike10004's full-sized avatar

Mike Chaberski mike10004

View GitHub Profile
@mike10004
mike10004 / jiraczar.py
Created February 20, 2015 18:53
Example of viewing and editing issues through JIRA REST API
#!/usr/bin/env python
#
# (c) 2015 Mike Chaberski
#
# MIT License
#
# TODO:
# * use keyring for username/password
# * support OAuth authentication
# * support something besides issue assignment
@mike10004
mike10004 / DictReader.java
Created February 25, 2015 15:32
Java CSV reader like Python's csv.DictReader
/*
* (c) 2015 mike10004@users.noreply.github.com
* MIT License
*/
package com.github.mike10004.csvdictreader;
import com.google.common.base.Function;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import com.google.common.collect.ImmutableList;
#!/usr/bin/env python
# inspired by http://stackoverflow.com/questions/5060710/format-of-dev-input-event
import struct
from argparse import ArgumentParser
if __name__ == '__main__':
p = ArgumentParser()
p.description = 'Read events from /dev/input and print them to console. Must be run as root.'
/*******************************************************************************
* Copyright (c) 2013 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
******************************************************************************/
@mike10004
mike10004 / ReservePortsRule.java
Created June 1, 2015 21:47
JUnit test rule to reserve a network port
/*
* The MIT License
*
* Copyright (c) 2004, The Codehaus
* Copyright (c) 2015 Mike Chaberski
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
@mike10004
mike10004 / HttpRequests.java
Created June 19, 2015 17:36
Simple Java HTTP client
/*
* (c) 2015 Mike Chaberski
*
* MIT License
*/
package com.github.mike10004.util.net;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.Strings;
@mike10004
mike10004 / README.md
Last active February 12, 2024 17:52
Reverse Shell Using Python
@mike10004
mike10004 / not-on-the-weekend.sh
Created August 26, 2016 18:58
Bash snippet that does one thing or another if it's a weekday or weekend day
echo "the shell is $SHELL";
DAY=$(date "+%a");
case $DAY in
Sat|Sun)
echo "$DAY is on the weekend";
# do something here
;;
*)
echo "$DAY is not on the weekend";
# do something else here
@mike10004
mike10004 / SysPropsTool.java
Created September 1, 2016 16:48
Program that prints Java system properties; can be run interactively
import java.util.Properties;
import java.util.Scanner;
public class SysPropsTool {
public static final String QUIT = "/Q";
public static final String QUIT_ = "/QUIT";
public static final String HELP = "/?";
public static final String HELP_ = "/H";
public static final String HELP__ = "/HELP";
public static final String LIST = "/LS";
@mike10004
mike10004 / msfa_detect.py
Created October 3, 2016 15:47
Microsoft Face API command line Python 2.7 program
#!/usr/bin/env python
# msfa_detect.py
#
# See https://www.microsoft.com/cognitive-services/en-us/face-api
# This code is based on the API reference sample code at
# https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236
#
# If they provide it with some sort of license that requires redistribution
# under the same license, then this code is hereby distributed under that