Skip to content

Instantly share code, notes, and snippets.

Michael T. DeGuzis mdeguzis

Block or report user

Report or block mdeguzis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mdeguzis
mdeguzis / json2yaml.py
Created May 5, 2018 — forked from noahcoad/json2yaml.py
Python to convert json to yaml
View json2yaml.py
#!/usr/bin/env python3
# convert json to yaml
# http://pyyaml.org/wiki/PyYAMLDocumentation
# python3 json2yaml.py < ~/code/manpow/moneybug/mbuploader/support/offices.json
# gist https://gist.github.com/noahcoad/46909253a5891af3699580b8f17baba8
import yaml, json, sys
sys.stdout.write(yaml.dump(json.load(sys.stdin)))
View gist:241cfa26fbb89ff1ac68b8ba45cc35c0
json_text = r.json()
# get total length of dictionary keys for tracking
for key, value in json_text.iteritems():
item_index = 0
if key == 'FileStatuses':
total_items = len(json_text['FileStatuses']['FileStatus'][:])
for listitems in json_text['FileStatuses']['FileStatus'][:]:
perm_set = []
item_count = len(json_text['FileStatuses']['FileStatus'][:])
octal_perms = json_text['FileStatuses']['FileStatus'][item_index]['permission']
@mdeguzis
mdeguzis / gist:fd2093018a5e49e1bdfd0d50738d58e5
Created Feb 18, 2018 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
View gist:fd2093018a5e49e1bdfd0d50738d58e5
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
View logging
def initialize_logger(output_dir):
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# create console handler and set level to info
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
formatter = logging.Formatter("%(levelname)s - %(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
@mdeguzis
mdeguzis / gpg-import-and-export-instructions.md
Created Dec 17, 2017 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys
View gpg-import-and-export-instructions.md

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
@mdeguzis
mdeguzis / jenkins-plugins.md
Created Nov 26, 2017 — forked from carlessanagustin/jenkins-plugins.md
This is a list of interesting plugins to use with Jenkins
View jenkins-plugins.md

Jenkins plugins

You can read more about each plugin using the SEARCH box at Jenkins homepage.

  • ChuckNorris Plugin: Displays a picture of Chuck Norris (instead of Jenkins the butler) and a random Chuck Norris 'The Programmer' fact on each build page.

Maintenance

  • thinBackup: This plugin simply backs up the global and job specific configurations (not the archive or the workspace).
  • JobConfigHistory Plugin: Saves copies of all job and system configurations.
@mdeguzis
mdeguzis / python-paged-ldap-snippet-2.4.py
Created May 9, 2017 — forked from mattfahrner/python-paged-ldap-snippet-2.4.py
This snippet allows you to do a Python LDAP search with paged controls. The latest version now supports Python "ldap" 2.4. Many thanks to Ilya Rumyantsev for doing the 2.4 legwork.
View python-paged-ldap-snippet-2.4.py
#! /usr/bin/python
import sys
import ldap
from ldap.controls import SimplePagedResultsControl
from distutils.version import LooseVersion
# Check if we're using the Python "ldap" 2.4 or greater API
LDAP24API = LooseVersion(ldap.__version__) >= LooseVersion('2.4')
View temp
-Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Werror=implicit-function-declaration -DNDEBUG -isystem../../../Externals/glslang/glslang/Public -isystem../../../Externals/glslang/SPIRV
g++ ../Core/PowerPC/Jit64Common/ConstantPool.cpp -c -o ../Core/PowerPC/Jit64Common/ConstantPool.o -g -fstack-protector-strong -Wformat -Werror=format-security -DPERF_TEST -DLOGGING -DHAVE_OPENGL_CORE -DHAVE_VULKAN -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -DHAVE_VULKAN -D__LIBRETRO__ -D__STDC_CONSTANT_MACROS -I. -I../Core -I../../../Externals/Bochs_disasm -I../../../Externals/mbedtls/include -I../../../Externals/enet/include -I../../../Externals/LZO -I../../../Externals/zlib -I../../../Externals/libpng -I.. -I../../../Externals/SFML/include -I../../../Externals/SFML/src/ -I../../../Externals/xxhash -I../../../Externals/SOIL -I../../../Externals/Vulkan/Include -fpic -O3 -msse2 -fno-strict-aliasing -fvisibility=hidden -fo
View mrboom
DispatchAsyncEvent backlog, failed to dispatch all this frame. Queue depth: 150 (152 input number was)
HTTP Response for https://steamcommunity-a.akamaihd.net/news/newsforapp/v0001/?appid=2147483661&count=5&maxlength=500&format=json: 403, 0
HTTP Response failed https://steamcommunity-a.akamaihd.net/news/newsforapp/v0001/?appid=2147483661&count=5&maxlength=500&format=json
Launching appid 2147483661
Could not load local selection (), local override (/home/steam/.local/share/Steam//controller_config/app_2147483661.vdf), or user path (/home/steam/.local/share/Steam/userdata/21885827/config/controller_configs/app_2147483661.vdf), checking last resort path: /home/steam/.local/share/Steam//controller_base/app_generic.vdf
Loaded Config for Last Resort Path for App ID -2147483635: /home/steam/.local/share/Steam//controller_base/app_generic.vdf
Could not load local selection (), local override (/home/steam/.local/share/Steam//controller_config/app_2147483661.vdf), or user path (/home/steam/.local/share/Steam/userdata/2
View crash vulkan
Not pushing commands this frame due to failed lock
INF: CPU Power saving is enabled and performance governor is not used.
INF: Encoded user ID = 18a155c4:738ac3f9
WRN: Not using EWMH compliant window manager!
WRN: Missing safe mode file.
INF: udev: Added device /dev/input/event18: Xbox 360 Wireless Receiver (045E:0719)
INF: Connected gamepad 0 - Xbox 360 Wireless Receiver (/dev/input/event18).
WRN: No localization folders found to support requested locale 'enu'.
WRN: Invalid locale string.
INF:
You can’t perform that action at this time.