Skip to content

Instantly share code, notes, and snippets.

Roberto Polli ioggstream

Block or report user

Report or block ioggstream

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ioggstream
ioggstream / powermt_udev.py
Last active Nov 3, 2018
PowerPath Udev Environment setter
View powermt_udev.py
#!/usr/bin/python
#
# script to be used in udev IMPORT{program} directive
# for naming emcpower devices
#
# Sample output is the following
# #/usr/local/bin/powermt_udev.py /dev/emcpowera
# POWERPATH_WWID=0000FFFF12345678BBBB0000
# POWERPATH_VNXNAME=MY_SPOOL_SPACE
#
View omprog-twisted-sample.py
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Example using stdio, LineReceiver, ClientFactory and twisted.web.client.
This could be used with rsyslog omprog module to forward messages to
different servers
View gist:3a6cb1b0f3cf319a5431
<!-- disable some repository from a catch-all mirror -->
<mirrors>
<mirror>
<id>insideFirewallRepo</id>
<mirrorOf>!nexus-repo-releases,!nexus-repo-snapshots,*</mirrorOf>
<name>Mirror of the world outside.</name>
<url>http://nexus_url/nexus/content/groups/public/</url>
</mirror>
</mirrors>
@ioggstream
ioggstream / arquillian-maven-profiles.xml
Created Nov 27, 2014
arquillian-maven-profiles.xml
View arquillian-maven-profiles.xml
<!-- Those profiles enables arquillian integration tests under
* src/it/java
* src/it/resources
To run them, use eg.
# mvn -Darquillian=true -Parq-eap6-managed
They rely on src/it/resources/arquillian.xml containing the
container qualifiers named:
* eap6-managed
@ioggstream
ioggstream / 20-test.conf
Created Dec 3, 2014
Use rsyslog to separate log levels (eg. for twisted apps)
View 20-test.conf
#cat /etc/rsyslog.d/20-test.conf
# Define a new template to trace syslogseverity
$template TwistedTmpl,"%TIMESTAMP% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
# Then split critical, error, warning, notice in test-rsyslog...
if $programname == 'twisted' and $syslogseverity <= 4 then /var/log/test-rsyslog.log;TwistedTmpl
& ~
# and debug, info in test-rsyslog-debug
if $programname == 'twisted' and $syslogseverity > 4 then /var/log/test-rsyslog-debug.log;TwistedTmpl
@ioggstream
ioggstream / srt-align.py
Created Apr 25, 2015
Align subtitles to video file
View srt-align.py
from __future__ import print_function, division
from time import gmtime,localtime,strptime,strftime,mktime
from sys import argv
View my-example.cnf
#
# A set of default configurations for MySQL
#
[mysql]
socket=/var/lib/mysql/mysql.sock
#
# Configurazione per mysql enterprise backup
#
[mysqlbackup]
@ioggstream
ioggstream / create-swarm-virtualbox.sh
Created Aug 31, 2015
Create a swarm with overlay network - virtualbox.
View create-swarm-virtualbox.sh
unset DOCKER_HOST DOCKER_MACHINE_NAME DOCKER_MACHINE_NAME DOCKER_TLS_VERIFY DOCKER_CERT_PATH
export SWARM_TOKEN=$(cat swarm.token)
echo $SWARM_TOKEN
CONSUL_IP=$(docker-machine ip consul)
_cluster="A"
_master=${_cluster}-0
_cert_home="$HOME/.docker/machine/machines/${_master}"
View oracle_check_constraints
SELECT constraint_name, constraint_type, column_name
from user_constraints natural join user_cons_columns
where table_name = "my_table_name";
@ioggstream
ioggstream / 99-docker.sh
Created Nov 19, 2015
Docker shell profile.
View 99-docker.sh
dip(){
# Show docker ips
local arg=${1}
if [ -z "$arg" ]; then
arg=$(docker ps -q)
fi
/bin/docker inspect --format ' {{.Name}} {{.NetworkSettings.IPAddress}}' $arg
}
You can’t perform that action at this time.