Skip to content

Instantly share code, notes, and snippets.

View fishi0x01's full-sized avatar
💾
0x01

Karl Fischer fishi0x01

💾
0x01
View GitHub Profile
@fishi0x01
fishi0x01 / deploy.sh
Last active March 21, 2020 15:21
Setting up a Django CI with Jenkins. Code for blog post https://fishi.devtail.io/weblog/2015/02/22/setting-django-ci-jenkins-and-git/
#!/bin/bash
# A simple django project deployment script for jenkins
BUILD_ROOT="/srv/www/django/d_project/"
MNGR=${BUILD_ROOT}"manage.py"
# source python env
echo "Sourcing python env..."
source ${BUILD_ROOT}"py-env/bin/activate"
@fishi0x01
fishi0x01 / ConnectWMINamespace.java
Last active March 21, 2020 15:22
Basic j-interop DCOM bridge setup snippets. Code for blog post https://fishi.devtail.io/weblog/2015/01/21/pure-java-dcom-bridge-j-interop/
/**
* Code snippet that tries to create a connection with the given wmiLocator object to the given namespace.
* @return An IJIDispatch object that can be used for WQL queries to the given namesapce of the target machine.
* @Exception In case the ConnectServer method could not be properly executed.
*/
public IJIDispatch createNamespaceServer(IJIDispatch wmiLocator, String nameSpace, String ipAddress) throws Exception
{
// create an instance of the WbemScripting.SWbemLocator object to talk to WMI on the target machine.
// namespace could be for instance "root\\cimv2"
JIVariant results[] =
@fishi0x01
fishi0x01 / example.html
Last active March 21, 2020 15:23
Functional headless UI testing in Django with Selenium. Code for blog post https://fishi.devtail.io/weblog/2015/03/02/functional-headless-ui-testing-django-selenium/
<!-- Simple webpage for Django UI example test -->
<html>
<head>
</head>
<body>
<p id="test">Hello World!</p>
</body>
</html>
/*
* A simple client that opens a socket.
*/
#include <stdio.h>
#include <sys/socket.h>
int main(int argc, char *argv[])
{
int sockfd;
FROM tomcat:8.0.38
# Place the code version inside the webapps directory
ARG PACKAGE_VERSION
RUN echo "${PACKAGE_VERSION}" >> /usr/local/tomcat/webapps/version.txt
COPY project.war /usr/local/tomcat/webapps/project.war
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
#! /bin/bash
usage() {
echo "measureTraffic.sh <targetIP>"
}
if [ -z "$1" ]; then
usage
exit 1
fi
@fishi0x01
fishi0x01 / setup_rpi_openocd.md
Created February 13, 2021 09:36 — forked from tstellanova/setup_rpi_openocd.md
Setup rpi0 with openocd for flashing nrf52

Instructions for setting up a Raspberry Pi Zero for running OpenOCD specifically for the purpose of disabling Access Port Protection on nrf52 boards.

Build OpenOCD with CMSIS-DAP and GPIO support

The below script builds natively on the RPi0, and will take a very long time.

sudo apt install wget git autoconf libtool make pkg-config libusb-1.0-0 libusb-1.0-0-dev libhidapi-dev libftdi-dev libhidapi-dev telnet
git clone https://github.com/ntfreak/openocd
cd openocd
./bootstrap
@fishi0x01
fishi0x01 / dcom-access-x64.ps1
Last active March 4, 2021 07:38
Script to configure DCOM remote access on Windows machines. Code for blog post https://fishi.devtail.io/weblog/2015/01/16/enabling-dcom-windows-7-8-and-server-2012/
# Original script taken and modified from http://shrekpoint.blogspot.de/2012/08/taking-ownership-of-dcom-registry.html
#
# Enable remote DCOM access to the WbemScripting.SWbemLocator class on 64-bit Windows 7/8 and Server 2012 machines,
# by setting the necessary keys inside the registry.
# Use this script at your own risk.
# I do not guarantee that it works, nor do I give any kinds of support in case it doesn't
Try {
[void][TokenAdjuster]
} Catch {
@fishi0x01
fishi0x01 / dashboard.tf
Created April 22, 2021 14:11
Terraform Datadog Debug
This file has been truncated, but you can view the full file.
terraform {
required_providers {
datadog = {
source = "DataDog/datadog"
version = "2.25.0"
}
}
}
resource "datadog_dashboard" "dashboard" {
@fishi0x01
fishi0x01 / header.sh
Last active November 11, 2021 15:02
Dynamic login messages with update-motd framework. Code for blog post https://fishi.devtail.io/weblog/2015/02/06/dyamic-login-messages-update-motd/
# Simple static header for update-motd framework
COLOR_GREEN="\033[0;32m"
# print personal static banner in green
printf "${COLOR_GREEN}
_____ .__ .__ .__
_/ ____\|__| ______| |__ |__|
\ __\ | | / ___/| | \ | |
| | | | \___ \ | Y \| |