This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/user/bin/python3.8 | |
from kafka import KafkaConsumer, KafkaProducer, KafkaAdminClient | |
from datetime import datetime, date | |
from time import sleep, monotonic_ns | |
import argparse | |
import json | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-b", "--kafka_broker", help="Set ip/hostname to kafka broker, host:port", type=str, required=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import usb.core | |
import usb.util | |
import sys | |
from pprint import pprint | |
# find our device with lsusb | |
# 046d:c53e | |
dev = usb.core.find(idVendor=0x046d, idProduct=0xc53e) | |
# was it found? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on the following question from stack-exchange: | |
# https://devops.stackexchange.com/questions/2731/downloading-docker-images-from-docker-hub-without-using-docker | |
# Get token | |
TOKEN="$(curl --silent --header 'GET' "https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/ubuntu:pull" | jq -r '.token')" | |
# Get manifest | |
echo "Manifest: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <sched.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
volumes: | |
mysql: | |
services: | |
gitlab_app: | |
image: gitlab/gitlab-ce:11.9.0-ce.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function, absolute_import, division | |
import logging | |
import mysql.connector | |
from errno import ENOENT | |
from stat import S_IFDIR, S_IFREG | |
from time import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
# Example of TCP's threeway handshake using python and scapy | |
# source: https://www.fir3net.com/Programming/Python/how-to-build-a-tcp-connection-in-scapy.html | |
# Requires: | |
# iptables -A OUTPUT -p tcp --tcp-flags RST RST -j DROP | |
# Otherwise the kernel will send a TCP RESET as the kernel is not aware of TCP connection going on. | |
from scapy.all import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM arm32v7/debian:stretch | |
RUN apt-get update && apt-get install -y openssh-server sudo iptables | |
RUN mkdir /var/run/sshd | |
RUN useradd -ms /bin/bash -g sudo student | |
RUN echo 'student:Plz4Ch4nG3' | chpasswd | |
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin no/' /etc/ssh/sshd_config | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# This is a slight variant on an example provided by Net::DBus. | |
use strict; | |
use warnings; | |
# Load the Net::DBus D-Bus binding. | |
use Net::DBus; | |
# Connect to the system bus. |
NewerOlder