Skip to content

Instantly share code, notes, and snippets.

@shaardie
shaardie / main.cpp
Created Oct 19, 2020
C++ Interface Example for mocking Hardware
View main.cpp
#include <iostream>
using namespace std;
/**
* @brief Base Class
*
*/
class Interface
{
@shaardie
shaardie / gsad.service
Last active Feb 10, 2020
OpenVAS Systemd Service files
View gsad.service
[Unit]
Description=OpenVAS - Greenbone Security Assistant
After=network.target
[Service]
ExecStart=/usr/local/sbin/gsad --foreground
[Install]
WantedBy=multi-user.target
@shaardie
shaardie / __init__.py
Last active Mar 16, 2017
Simple python system logger example
View __init__.py
import logging
import logging.handlers
handler = logging.handlers.SysLogHandler(address='/dev/log')
logger = logging.getLogger('')
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
@shaardie
shaardie / run
Last active Nov 11, 2016
Create a rpi3 debian imge
View run
#!/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 / runner.py
Created Oct 30, 2016
Run external python function "run" mostly secure
View runner.py
#!/usr/bin/env python3
import os
import sys
import pwd
import grp
from importlib.machinery import SourceFileLoader
def secure(directory, user='nobody', group='nogroup'):