Skip to content

Instantly share code, notes, and snippets.

View TG9541's full-sized avatar

Thomas TG9541

View GitHub Profile
@aslakhellesoy
aslakhellesoy / Dockerfile
Last active July 11, 2018 12:58
Docker Subversion image
# Sets up
FROM ubuntu:precise
# Install Subversion 1.8 and Apache
RUN apt-get install -y wget
RUN echo 'deb http://us.archive.ubuntu.com/ubuntu/ precise universe' >> /etc/apt/sources.list
RUN sh -c 'echo "deb http://opensource.wandisco.com/ubuntu precise svn18" >> /etc/apt/sources.list.d/WANdisco.list'
RUN wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | apt-key add -
RUN apt-get update -y
@bademux
bademux / dch2ihx.py
Last active February 15, 2019 15:03
Converts uCsim dumps to ihx format
#!/usr/bin/env python2.7
# Converts uCsim dumps to ihx format https://en.wikipedia.org/wiki/Intel_HEX
# 'dch 0xXX 0xXX 16' dumps ROM to multiple rows formated like {adress} {byte 1} ... {byte 16} {ASCI_representation}
import argparse
import sys
NUMBER_OF_BYTES = 16
def parse_arguments():
import telnetlib
import time
def read_header(tn):
tn.read_until("\n", 1)
def twos_complement(input_value):
return (~input_value +1) & 0xFF
def mbascii_request(payload):
\ ADC single scan mode 1 channel at a time
\res MCU: STM8L051
\res export CLK_PCKENR2 ADC1_CR1 ADC1_CR2 ADC1_CR3
\res export RI_ASCR1 RI_IOSR2
\res export ADC1_SQR1 ADC1_SQR2 ADC1_SQR3 ADC1_SQR4
\res export ADC1_DRH ADC1_DRL
\res export ADC1_SR
#require ]B!
@gclayburg
gclayburg / workflow.gdsl
Last active August 3, 2020 11:29
Jenkins workflow plugin groovy code completion support for IntelliJ IDE
/*
Author: Gary Clayburg
This file allows IntelliJ IDEA to perform basic syntax checking and code completion for
Jenkins workflow groovy scripts. https://github.com/jenkinsci/workflow-plugin
These methods are supported
sh
readFile
node
echo
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 4 09:16:27 2021
@author: mark
"""
import serial
from numpy.random import randint
@motine
motine / README.md
Last active October 12, 2021 03:35
Redis Pub/Sub with Python (notes for my collegue)

Redis Pub/Sub with Python

Overview:

  • Redis supports PUB/SUB
  • It supports pattern matching. Clients may subscribe to glob-style patterns in order to receive all the messages sent to channel names matching a given pattern.

Prerequisites

Assuming Fedora 23.

@timcardenuto
timcardenuto / redhawk-raspberry-pi.md
Last active September 10, 2022 14:56
How to build Redhawk for Raspberry Pi, Raspbian Stretch, using QEMU

Redhawk on Raspberry Pi

One option for compiling Redhawk for the Raspberry Pi is using QEMU on a host to compile it into the image before loading on the rpi hardware - this takes advantage of the superior hardware on your host to decrease compile time. These instructions verified for host system Ubuntu 16.04, Raspberry Pi image Raspbian Stretch 2017-09-07, and Redhawk 2.0.7.

It is important to note that Redhawk is only officially supported on CentOS 6 and 7 and therefore any time you try to compile it for other OS's it's possible (likely on systems like Ubuntu/Debian) that you'll have issues with newer versions of dependencies, the most likely offenders in the past have been:

Library CentOS 6.9 CentOS 7.4 Ubuntu 16.04 Debian 9.2 Raspbian Stretch Fedora 28
gcc 4.4.7 4.8.5 5.4.0 6.3.0 6.3.0 8.1.1
libstdc++ 4.4.7 4.8.5 5.4.0 6.3.0 6.3.0 8.1.1
@DavidBruchmann
DavidBruchmann / combining_composer_git_pear.md
Last active October 13, 2023 17:58
Combining Composer, Git repositories and Pear

Combining composer, git repositories and pear

Problem

Pear is the the old PHP-packagemanager, but most 'packages' are nowadays managed with composer on base of git-repositories.
Adding pear-packages to a composer based installation is a little challenge that shall be explained below.

Solution

Prerequisites

@kianby
kianby / zproxy.py
Last active November 25, 2023 07:28
ZeroMQ, Python, XSUB / XPUB proxy
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import zmq
def main():
context = zmq.Context()