Skip to content

Instantly share code, notes, and snippets.

View deajan's full-sized avatar

Orsiris de Jong deajan

View GitHub Profile
@deajan
deajan / csv2json.sh
Created July 9, 2018 07:54 — forked from DecisionNerd/csv2json.sh
CSV to JSON converter using BASH. Original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
#!/bin/bash
# CSV to JSON converter using BASH
# original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
# thanks SecaGuy!
# Usage ./csv2json.sh input.csv > output.json
input=$1
[ -z $1 ] && echo "No CSV input file specified" && exit 1
[ ! -e $input ] && echo "Unable to locate $1" && exit 1
@deajan
deajan / admin_elevator.py
Last active September 1, 2021 10:36
Python elevation code that works on Windows and Linux, with Nuitka, PyInstaller and CPython
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017-2020 Orsiris de Jong
# This file is part of command_runner module
"""
elevate is a Windows/ unix compatible function elevator for Python 3+
usage:
@deajan
deajan / service.py
Created January 24, 2019 01:17
python_service
import win32serviceutil
import win32service
import win32event
import win32api
import servicemanager
import os
import sys
from time import sleep
import socket
{"calls": [["Crypto", "Crypto"], ["Crypto.Cipher", "Crypto.Cipher"], ["Crypto.Cipher.AES", "Crypto.Cipher"], ["Crypto.Cipher._create_cipher", "Crypto.Cipher"], ["Crypto.Cipher._mode_cbc", "Crypto.Cipher._mode_cbc"], ["Crypto.Cipher._mode_cbc._create_cbc_cipher", "Crypto.Cipher._mode_cbc"], ["Crypto.Cipher._mode_ccm", "Crypto.Cipher._mode_ccm"], ["Crypto.Cipher._mode_ccm._create_ccm_cipher", "Crypto.Cipher._mode_ccm"], ["Crypto.Cipher._mode_cfb", "Crypto.Cipher._mode_cfb"], ["Crypto.Cipher._mode_cfb._create_cfb_cipher", "Crypto.Cipher._mode_cfb"], ["Crypto.Cipher._mode_ctr", "Crypto.Cipher._mode_ctr"], ["Crypto.Cipher._mode_ctr._create_ctr_cipher", "Crypto.Cipher._mode_ctr"], ["Crypto.Cipher._mode_eax", "Crypto.Cipher._mode_eax"], ["Crypto.Cipher._mode_eax._create_eax_cipher", "Crypto.Cipher._mode_eax"], ["Crypto.Cipher._mode_ecb", "Crypto.Cipher._mode_ecb"], ["Crypto.Cipher._mode_ecb._create_ecb_cipher", "Crypto.Cipher._mode_ecb"], ["Crypto.Cipher._mode_gcm", "Crypto.Cipher._mode_gcm"], ["Crypto.Cipher._mode_
@deajan
deajan / setup.sh
Created September 24, 2023 19:43
grommunio-setup/setup.sh
#!/bin/bash
# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2021-2023 grommunio GmbH
# Interactive grommunio setup
DATADIR="${0%/*}"
if [ "${DATADIR}" = "$0" ]; then
DATADIR="/usr/share/grommunio-setup"
else
DATADIR="$(readlink -f "$0")"
@deajan
deajan / dialogs
Created September 24, 2023 19:45
grommunio-setup/common/dialogs
#!/bin/bash
# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2021 grommunio GmbH
dialog >/dev/null 2>&1
if [ "$?" -eq 127 ]; then
echo ERROR: /usr/bin/dialog not installed
exit 1
fi