Skip to content

Instantly share code, notes, and snippets.

View shaardie's full-sized avatar

Sven Haardiek shaardie

View GitHub Profile
@shaardie
shaardie / runner.py
Created October 30, 2016 16:55
Run external python function "run" mostly secure
#!/usr/bin/env python3
import os
import sys
import pwd
import grp
from importlib.machinery import SourceFileLoader
def secure(directory, user='nobody', group='nogroup'):
@shaardie
shaardie / run
Last active November 11, 2016 11:02
Create a rpi3 debian imge
#!/bin/bash
set -x
set -u
set -e
apt-get update
apt -y install debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git ca-certificates curl psmisc build-essential bc dbus
dpkg --add-architecture armhf
@shaardie
shaardie / __init__.py
Last active March 16, 2017 13:41
Simple python system logger example
import logging
import logging.handlers
handler = logging.handlers.SysLogHandler(address='/dev/log')
logger = logging.getLogger('')
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
@shaardie
shaardie / gsad.service
Last active February 10, 2020 05:59
OpenVAS Systemd Service files
[Unit]
Description=OpenVAS - Greenbone Security Assistant
After=network.target
[Service]
ExecStart=/usr/local/sbin/gsad --foreground
[Install]
WantedBy=multi-user.target
@shaardie
shaardie / main.cpp
Created October 19, 2020 16:21
C++ Interface Example for mocking Hardware
#include <iostream>
using namespace std;
/**
* @brief Base Class
*
*/
class Interface
{