Skip to content

Instantly share code, notes, and snippets.

@neg3ntropy
neg3ntropy / pulcino.py
Created July 31, 2020 11:46
il pulcino py
from dataclasses import dataclass
@dataclass
class Strofa:
nome: str
verso: str
ripetizioni: int
anche: bool = False
@neg3ntropy
neg3ntropy / http2https_vhost.conf
Created February 2, 2017 09:01
http2https with apache
<VirtualHost *:80>
SSLProxyEngine on
ErrorLog /dev/stderr
CustomLog /dev/stdout combined
ServerName www.google.it
ProxyPass / https://www.google.it/
ProxyPassReverse / https://www.google.it/
ProxyPreserveHost Off
@neg3ntropy
neg3ntropy / mavenizer.sh
Last active August 29, 2015 14:21
Mavenizer script
#!/bin/bash
DEFAULT_JAR_FOLDER='src/main/webapp/WEB-INF/lib'
DEFAULT_JAR_PATTERN='*.jar'
DELETE=no
HELP="Usage: $(basename "$0") [--delete] [jar folder/file] [pattern]
Looks up jar files on Maven central using their hash and outputs dependency
elements for the pom.xml.
@neg3ntropy
neg3ntropy / example
Last active August 29, 2015 14:19
Command decoration along the $PATH
#!/bin/bash
# an hypothetical /usr/local/bin/example intercepts invocations to /usr/bin/example
export SPECIAL_VAR="customize enviroments for all invocations"
do_something_before
# now invoke the same command somewhere down the $PATH (e.g. /usr/bin/example),
unwrap "$0" "${@}" --add-an-option
@neg3ntropy
neg3ntropy / git-promote
Last active January 28, 2017 17:10
Promote an "upstream" Git branch by merging it into a "downstream" branch.
#!/bin/bash -eu
git_promote="$(basename "$0" | sed -e 's/-/ /')"
HELP="Usage: $git_promote [options...] [upstream] <downstream>
Promote an \"upstream\" Git branch by merging it into a \"downstream\" branch.
When omitted, the currently checked out branch is used as upstream.
Options:
@neg3ntropy
neg3ntropy / project_env.sh
Last active August 8, 2016 14:44
Bash script to manage per-project shell environment and other settings. Include in the project root, customize and source with the shell to activate. The rest of the boilerplate adds support for: * finding the absolute path of project root, independently of the current shell's working directory * a nice indicator with the project name to the pro…
###############################################################################
# Development environment helper to set up project paths and other variables #
###############################################################################
#
# Copyright (C) 2012 Andrea Ratto <andrearatto at yahoo dot it>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
@neg3ntropy
neg3ntropy / csv.sql
Last active August 31, 2016 19:30
Oracle csv exportingin UTF-8, with quotes escaping and optional headers
CREATE OR REPLACE PACKAGE csv AS
-- --------------------------------------------------------------------------
-- Name : http://www.oracle-base.com/dba/miscellaneous/cvs.sql
-- Author : DR Timothy S Hall
-- Description : Initial setup:
-- CREATE OR REPLACE DIRECTORY CSV_DIR AS '/tmp';
-- GRANT WRITE ON DIRECTORY CSV_DIR TO scott;
-- Usage:
-- ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
-- ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SSXFF';