Skip to content

Instantly share code, notes, and snippets.

View dorneanu's full-sized 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
import requests
import pandas as pd
import os
# Config stuff
url="https://www.yourapp.com/add/new/file"
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0'
# Add here more headers
@dorneanu
dorneanu / diagmagic.py
Created July 9, 2014 09:47
Embed blockdiag into IPython using ipython-diags
# -*- coding: utf-8 -*-
"""magics for using blockdiag.com modules with IPython Notebook
The module provides magics: %%actdiag, %%blockdiag, %%nwdiag, %%seqdiag
Sample usage (in IPython cell):
%%blockdiag
{
A -> B -> C;
@dorneanu
dorneanu / matplotlib-dashboard
Created March 7, 2014 08:38
Unfancy dashboard using matplotlib
import datetime as dt
import matplotlib.dates as mdates
from mpl_toolkits.axes_grid.axislines import Subplot
from time import sleep
%matplotlib inline
def gen_dashboard():
# Generate months
months = []
@dorneanu
dorneanu / chroot.sh
Last active January 21, 2020 13:01
Put nginx and PHP to jail using Debian 8
#!/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
@dorneanu
dorneanu / go.mod
Created June 10, 2021 11:43
Convert miMind XML exports to JSON
module mimind2json
go 1.16
require github.com/beevik/etree v1.1.0
@dorneanu
dorneanu / add_link_to_dropbox.sh
Created August 16, 2021 11:49
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)
@dorneanu
dorneanu / JBlowfish.java
Created July 1, 2014 17:35
Blowfish Decrypt/Encrypt in 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 / subscriptions.opml
Created June 13, 2022 12:03
My RSS Subscriptions
<?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 / convert_json_to_strct_list.go
Last active September 20, 2022 03:27
Golang: Convert JSON string/objects to list of structure
// Go Playground: https://play.golang.org/p/cMutpCzpmth
package main
import (
"fmt"
"encoding/json"
)
// Field is a key value structure
@dorneanu
dorneanu / client.conf
Last active October 6, 2022 11:38
OpenVPN configuration
##############################################
# 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 #