Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Engineering #security stuff in #go and #python in #AWS

Victor Dorneanu dorneanu

💭
Engineering #security stuff in #go and #python in #AWS
View GitHub Profile
@dorneanu
dorneanu / client.conf
Last active Oct 6, 2022
OpenVPN configuration
View client.conf
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
@dorneanu
dorneanu / convert_json_to_strct_list.go
Last active Sep 20, 2022
Golang: Convert JSON string/objects to list of structure
View convert_json_to_strct_list.go
// Go Playground: https://play.golang.org/p/cMutpCzpmth
package main
import (
"fmt"
"encoding/json"
)
// Field is a key value structure
@dorneanu
dorneanu / multiprocessing.py
Created May 6, 2015
Simple parallelism with Python
View multiprocessing.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Simple demo of using multiprocessing when parsing files """
import sys
import os
import codecs
from multiprocessing import Pool, Process, Queue, cpu_count
@dorneanu
dorneanu / plugin_architecture.md
Last active Sep 1, 2022
Python: Implement basic plugin architecture with Python and importlib
View plugin_architecture.md

Implementing a basic plugin architecture shouldn't be a complicated task. The solution described here is working but you still have to import every plugin (inheriting from the base class).

This is my solution:

Basic project structure

$ tree
@dorneanu
dorneanu / subscriptions.opml
Created Jun 13, 2022
My RSS Subscriptions
View subscriptions.opml
<?xml version="1.0"?>
<opml version="1.0">
<head>
<title>Elfeed-Org Export</title>
</head>
<body>
<outline title="elfeed">
<outline title="reddit">
<outline title="inbox" xmlUrl="https://www.reddit.com/message/inbox/.rss?feed=68ab399ca4600a1cfa26b3b49b794299eb01583c&amp;user=cyneox"/>
<outline title="listings" xmlUrl="https://www.reddit.com/.rss?feed=68ab399ca4600a1cfa26b3b49b794299eb01583c&amp;user=cyneox"/>
@dorneanu
dorneanu / JBlowfish.java
Created Jul 1, 2014
Blowfish Decrypt/Encrypt in Java
View JBlowfish.java
/*
* Based on https://raw.githubusercontent.com/usefulfor/usefulfor/master/security/JBoss.java
*
* JBoss.java - Blowfish encryption/decryption tool with JBoss default password
* Daniel Martin Gomez <daniel@ngssoftware.com> - 03/Sep/2009
*
* This file may be used under the terms of the GNU General Public License
* version 2.0 as published by the Free Software Foundation:
* http://www.gnu.org/licenses/gpl-2.0.html
*/
@dorneanu
dorneanu / add_link_to_dropbox.sh
Created Aug 16, 2021
This will fetch readable content from an URL (using rdrview), convert HTML content to Epub (using pandoc) and finally upload the e-book to Dropbox (using rclone)
View add_link_to_dropbox.sh
@dorneanu
dorneanu / go.mod
Created Jun 10, 2021
Convert miMind XML exports to JSON
View go.mod
module mimind2json
go 1.16
require github.com/beevik/etree v1.1.0
@dorneanu
dorneanu / main.go
Last active Feb 24, 2021
Simple JS keylogger (can be used in XSS) in combination with a websocket server in Golang. Adapted from the example in the "Black Hat Go" book.
View main.go
package main
import (
"flag"
"fmt"
"html/template"
"log"
"net/http"
"github.com/gorilla/mux"
@dorneanu
dorneanu / chroot.sh
Last active Jan 21, 2020
Put nginx and PHP to jail using Debian 8
View chroot.sh
#!/bin/bash
# Config
N2CHROOT=~victor/tmp/n2chroot
export JAIL=/var/www/chroot
function create_chroot {
# Create devices
mkdir $JAIL/dev
mknod -m 0666 $JAIL/dev/null c 1 3