Skip to content

Instantly share code, notes, and snippets.

View kaymccormick's full-sized avatar
🎯
Focusing

Kay McCormick kaymccormick

🎯
Focusing
View GitHub Profile
@kaymccormick
kaymccormick / ConsoleDumpWalker.cs
Created February 13, 2020 01:06 — forked from amazedsaint/ConsoleDumpWalker.cs
Syntax Tree Dumper using Roslyn SyntaxWalker
using System;
using System.Linq;
using Roslyn.Compilers.CSharp;
namespace RoslynApp
{
public static class SyntaxTreeExtensions
{
public static void Dump(this SyntaxTree tree)
import * as Py from "../src/Py";
let __docformat__: any;
let sys: any;
let re: any;
let FunctionType: any;
let MethodType: any;
let nodes: any;
let statemachine: any;
let utils: any;
let ApplicationError: any;
@kaymccormick
kaymccormick / copyTree.ts
Created August 3, 2019 13:44
recursively copy an ast-types AST tree, in typescript
import {visit,getFieldNames, getFieldValue, eachField, namedTypes, builders} from 'ast-types';
import { NodePath } from 'ast-types/lib/node-path';
import { Map, List, Set} from 'immutable';
import { ValueKind } from './types';
export type CopyTreeResult = Map<string, ValueKind>;
export function copyTree(node: namedTypes.Node,
report?: (arg: string) => void,
level: number = 0): CopyTreeResult {
let cache: List<Map<string, any>> = List<Map<string, any>>();
import React from 'react'
import DocViewer from '../src/components/doc/Viewer'
import { setupSaxParser } from 'docutils-react/lib/getComponentForXmlSax'
import regeneratorRuntime from "regenerator-runtime";
export default class Viewer extends React.Component {
constructor(props) {
super(props);
}
[Unit]
Description=The PHP 7.3 FastCGI Process Manager
Documentation=man:php-fpm7.3(8)
After=network.target
[Service]
Type=simple
PIDFile=/opt/php-dev/var/run/php-fpm.pid
EnvironmentFile=/etc/default/php-dev-fpm
#ExecStart=/usr/bin/strace -o /tmp/out-trace -f /opt/php-dev/sbin/php-fpm --nodaemonize
/*
* Host definitions with object attributes
* used for apply rules for Service, Notification,
* Dependency and ScheduledDowntime objects.
*
* Tip: Use `icinga2 object list --type Host` to
* list all host objects after running
* configuration validation (`icinga2 daemon -C`).
*/
@kaymccormick
kaymccormick / get-dist-config.py
Created November 17, 2018 22:58
Use python-apt to extract disttributed config files. This will fill up your disk with package files!
#!/usr/bin/python3
import shutil
import apt_pkg
import apt_inst
import apt
import apt.debfile
import apt.progress
import aptsources.distinfo
import os.path
LINODE_CLI=linode-cli
CREATE_CMD_CATEGORY=create
ROOT_PASS=XXXX
SS_ID=349134
BOOTED=yes
STACKSCRIPT_DATA=stackscript-data.json
HOSTNAME=XXXX
PYTHON=python
LINODE_TOKEN=`cat .linode_token`
KERBEROS=yes
@kaymccormick
kaymccormick / xsend
Created October 29, 2018 13:17 — forked from tskrynnyk/xsend
Command-line utility for sending jabber messages.
#!/usr/bin/python
# xsend: command-line utility for sending jabber messages
# http://xmpppy.sourceforge.net/
#
import sys,os,xmpp,time
if len(sys.argv) < 2:
print "Syntax: xsend JID msg"
sys.exit(0)
@kaymccormick
kaymccormick / pysyslog.py
Created October 21, 2018 13:24 — forked from marcelom/pysyslog.py
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'