Skip to content

Instantly share code, notes, and snippets.

View matzefriedrich's full-sized avatar

Matthias Friedrich matzefriedrich

View GitHub Profile
@matzefriedrich
matzefriedrich / Dockerfile
Created November 1, 2022 18:37
Install Osquery interactive console in Docker
FROM ubuntu AS osquery-base
WORKDIR /osquery
ENV PACKAGE_NAME=osquery_5.5.1-1.linux_amd64.deb
RUN apt-get update && apt-get install -y curl
RUN curl -L https://pkg.osquery.io/deb/${PACKAGE_NAME} -o ${PACKAGE_NAME} && \
apt-get install -y ./${PACKAGE_NAME}
@matzefriedrich
matzefriedrich / Main.bas
Last active April 13, 2022 18:31
Write to stdout from VB6 console app
Option Explicit
Private Declare Function AttachConsole Lib "Kernel32" ( _
ByVal dwProcessId As Long) As Long
Private Declare Function FreeConsole Lib "Kernel32" () As Long
Private Declare Function GetStdHandle Lib "Kernel32" ( _
ByVal nStdHandle As Long) As Long
@matzefriedrich
matzefriedrich / ip2dh.py
Created January 6, 2022 19:07
Convert IP address to Decimal or hexadecimal format
"""
You can run this in the following format:
For decimal: python3 ip2dh.py D <Ip-address>
For Hexadecimal: python3 ip2dh.py H <Ip-address>
"""
#!/usr/bin/python3
import sys
if len(sys.argv) < 3:
@matzefriedrich
matzefriedrich / settings.json
Last active November 19, 2021 09:09
Adds Visual Studio 2022 Tools Powershell to Windows Terminal
{
"colorScheme": "BlulocoDark",
"commandline": "C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe -noe -c \"&{Import-Module \"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Microsoft.VisualStudio.DevShell.dll\"\"\"; Enter-VsDevShell 83d97da6}\"",
"guid": "{f26ed67f-314f-44b7-ab82-b328bac55369}",
"hidden": false,
"name": "Visual Studio 2022 Tools PowerShell"
}
@matzefriedrich
matzefriedrich / ModulesFromPeb.c
Created July 12, 2021 21:37 — forked from Spl3en/ModulesFromPeb.c
Get current process modules from PEB
#include <windows.h>
#include <subauth.h>
#include <stdio.h>
/* Windows structures */
typedef struct _PEB_LDR_DATA {
BYTE Reserved1[8];
PVOID Reserved2[3];
LIST_ENTRY InMemoryOrderModuleList;
} PEB_LDR_DATA, *PPEB_LDR_DATA;
@matzefriedrich
matzefriedrich / Dockerfile
Created May 6, 2021 21:47
Docker api-spec-converter CLI
FROM alpine:3.13 AS buildbase
RUN apk update && apk add nodejs npm git
FROM buildbase AS build
RUN git clone https://github.com/LucyBot-Inc/api-spec-converter.git && \
cd api-spec-converter && \
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=0 && \
npm install
RUN npm i -g ./api-spec-converter
@matzefriedrich
matzefriedrich / settings.json
Last active November 19, 2021 09:09
Adds Developer Command Prompt for VS 2019 to Windows Terminal
{
"colorScheme": "Vintage",
"commandline": "%comspec% /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat\"",
"guid": "{bbcfd122-ef78-49eb-af5d-8249e2ba2242}",
"hidden": false,
"name": "Developer Command Prompt for VS 2019",
"startingDirectory": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\"
}
@matzefriedrich
matzefriedrich / zeromq-vs-redis.md
Created July 19, 2019 22:12 — forked from hmartiro/zeromq-vs-redis.md
Comparison of ZeroMQ and Redis for a robot control platform

ZeroMQ vs Redis

This document is research for the selection of a communication platform for robot-net.

Goal

The purpose of this component is to enable rapid, reliable, and elegant communication between the various nodes of the network, including controllers, sensors, and actuators (robot drivers). It will act as the core of robot-net to create a standardized infrastructure for robot control.

Requirements:

@matzefriedrich
matzefriedrich / install-redis.sh
Created June 27, 2019 21:55
Install Redis on Debian
# assuming the system is fresh and clean, we need to install the following additional packages
apt-get update && apt-get -y install curl build-essential
# download latest Redis release; see: https://redis.io/download
cd /tmp
curl http://download.redis.io/releases/redis-5.0.5.tar.gz --output redis-5.0.5.tar.gz
tar xvzf redis-5.0.5.tar.gz
# build Redis
cd redis-5.0.5
@matzefriedrich
matzefriedrich / DockerRedis_ExportImport_Dump.sh
Created March 22, 2017 14:53 — forked from alister/DockerRedis_ExportImport_Dump.sh
Example of creating a Docker data volume, exporting it, and re-importing it to a completely fresh container
# Create the container - we run 'echo' in the container, and reuse the same as we will be running later
docker run -d -v /data --name redis.data dockerfile/redis echo Data-only container for Redis
# the data container doesn't show up - nothing is running
docker ps
# will show 'redis.data', but as stopped
docker ps -a
# start redis, attach to 'redis.data'
docker run -d -p 6379:6379 --volumes-from redis.data --name ca.redis.1 dockerfile/redis