Skip to content

Instantly share code, notes, and snippets.

View carstencodes's full-sized avatar
🖤
Head in the clouds, heart dropped to the gut ...

Carsten Igel carstencodes

🖤
Head in the clouds, heart dropped to the gut ...
View GitHub Profile
@nandoquintana
nandoquintana / sidekiq.py
Created April 3, 2019 08:40
Enqueue messages into Sidekiq with Python, directly via Redis
#!/usr/bin/python3
import os
import redis
import json
from os.path import join, dirname
from dotenv import load_dotenv
from random import choice
from datetime import datetime
@Alegrowin
Alegrowin / trx-to-junit.xml
Last active January 17, 2023 20:09
Convert .Trx file to Junit Xml using xslt 2.0
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:vs="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" >
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<testsuites>
<xsl:variable name="buildName" select="//vs:TestRun/@name"/>
<xsl:variable name="duration" select="xs:dateTime(//vs:Times/@finish) - xs:dateTime(//vs:Times/@start)" />
@jbe2277
jbe2277 / AssemblyAnalyzer.cs
Created July 2, 2017 17:52
AssemblyAnalyzer via System.Reflection.Metadata
using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
using System.Security.Cryptography;
@RobThree
RobThree / gitlab-checkandnotify
Last active November 21, 2023 18:00
gitlab version checker & notifier
#!/bin/bash
#mail recipient
RCPT=someone@gmail.com
#args: $rcpt $subject $text
sendnotification() {
echo -e "$3" | mail -s "$2" -t $1
}
echo -n "Checking version: "
@haukurk
haukurk / syslogger.py
Created December 11, 2014 17:04
Logger that sends to syslog servers.
#!/usr/bin/python
# -*- encoding: iso-8859-1 -*-
"""
Python syslog client.
This code is placed in the public domain by the author.
Written by Christian Stigen Larsen.
This is especially neat for Windows users, who (I think) don't
@sneal
sneal / configure-winrm.ps1
Last active May 13, 2023 15:04
Configure WinRM for Vagrant
netsh advfirewall firewall set rule group="remote administration" new enable=yes
netsh advfirewall firewall add rule name="Open Port 5985" dir=in action=allow protocol=TCP localport=5985
winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="7200000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
@rxaviers
rxaviers / gist:7360908
Last active December 26, 2024 09:23
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active August 4, 2024 14:41
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@sweenzor
sweenzor / logtest.py
Created February 9, 2012 19:59
Writing to syslog with Python's logging library
import logging
import logging.handlers
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
handler = logging.handlers.SysLogHandler(address = '/dev/log')
formatter = logging.Formatter('%(module)s.%(funcName)s: %(message)s')