Skip to content

Instantly share code, notes, and snippets.

View Spredzy's full-sized avatar

Yanis Guenane Spredzy

  • eNovance from RedHat from IBM
  • Bordeaux, France
View GitHub Profile
@Spredzy
Spredzy / loaderload
Created March 19, 2012 15:24
Implementing loader gif file
* Open the file $PENTAHO_SOLUTIONS/system/custom/xsl/DefaultParameterForm.xsl
* Look for the string OK
* Modify those line of codes
<xsl:attribute name="onClick">doRun("<xsl:value-of select="/filters/id" />", '<xsl:value-of select="/filters/action"/>', '<xsl:value-of select="/filters/target"/>', document.getElementById('run_as_background_yes').checked);</xsl:attribute>
to
<xsl:attribute name="onClick">var a = doRun("<xsl:value-of select="/filters/id" />", '<xsl:value-of select="/filters/action"/>', '<xsl:value-of select="/filters/target"/>', document.getElementById('run_as_background_yes').checked);if(a != -1) {document.getElementById('run2button<xsl:value-of select="/filters/id" />').style.display = 'none';document.getElementById('loader').style.display = 'block';};</xsl:attribute>
@Spredzy
Spredzy / connectorj_optimization.sql
Created April 22, 2012 09:03
Connector/J and multiple connections
Connect root@localhost on mydb
Query /* mysql-connector-java-5.1.17 ( Revision: ${bzr.revision-id} ) */SHOW VARIABLES WHERE Variable_name ='language' OR Variable_name = 'net_write_timeout' OR Variable_name = 'interactive_timeout' OR Variable_name = 'wait_timeout' OR Variable_name = 'character_set_client' OR Variable_name = 'character_set_connection' OR Variable_name = 'character_set' OR Variable_name = 'character_set_server' OR Variable_name = 'tx_isolation' OR Variable_name = 'transaction_isolation' OR Variable_name = 'character_set_results' OR Variable_name = 'timezone' OR Variable_name = 'time_zone' OR Variable_name = 'system_time_zone' OR Variable_name = 'lower_case_table_names' OR Variable_name = 'max_allowed_packet' OR Variable_name = 'net_buffer_length' OR Variable_name = 'sql_mode' OR Variable_name = 'query_cache_type' OR Variable_name = 'query_cache_size' OR Variable_name = 'init_connect'
Query /* mysql-connector-java-5.1.17 ( Revision: ${bzr.revision-id} ) */SELECT @@session.auto_increment_inc
  • NETWORKING : yes or no Enable or disable the network on the machine
  • HOSTNAME : The Fully Qualified Domain Name (FQDN) of the machine

/etc/hosts

whatis hosts

hosts(5)                 - host name data base

Quoting the man page :

For each host a single line should be present with the following information:

@Spredzy
Spredzy / customer_post-receive_hook
Created December 14, 2012 16:25
This shows how to edit the gitolite post-receive hook in order for gitlab to use customs one and not only web hooks This needs the creation of the post-receive.secondary.d directory prior to run. This specific case show a 1:1 relation between post-receive hook and projects
#!/usr/bin/env bash
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
while read oldrev newrev ref
do
# For every branch or tag that was pushed, create a Resque job in redis.
path_to_hook='hooks/post-receive.secondary.d/'
pwd=`pwd`
@Spredzy
Spredzy / jstack.out
Created March 7, 2013 18:42
jstack on JSONEventLayout #8
Attaching to process ID 15246, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 20.0-b12
Deadlock Detection:
No deadlocks found.
Thread 20331: (state = BLOCKED)
- org.apache.log4j.Category.callAppenders(org.apache.log4j.spi.LoggingEvent) @bci=13, line=205 (Interpreted frame)
@Spredzy
Spredzy / Crypt-SmbHash
Created August 30, 2013 12:49
Script to generate SambaSamAccount necessary informations
# cat /tmp/Crypt-SmbHash-0.12/gen_hash.pl
#!/usr/local/bin/perl
use Crypt::SmbHash;
$username = $ARGV[0];
$password = $ARGV[1];
if ( !$password ) {
print "Not enough arguments\n";
print "Usage: $0 username password\n";
exit 1;
}
@Spredzy
Spredzy / gist:6626540
Created September 19, 2013 17:05
Logstash Augeas Lense
module Logstash =
autoload xfm
let eol = Util.eol
let indent = Util.indent
let string_t = /('|")[^ \t\n]*('|")/
let sep_obr = del /[ \t]*\{([ \t]*\n)*/ " {\n"
let sep_cbr = del /[ \t]*\}([ \t]*\n)*/ "}\n"
@Spredzy
Spredzy / gist:6626557
Created September 19, 2013 17:07
Output issue
Syntax error in lens definition
../lenses/logstash.aug:40.43-.50:type error: expected regexp, or lens but found string -> lens
../lenses/logstash.aug:40.43-.50:type error: expected regexp, or lens but found string -> lens
../lenses/logstash.aug:40.43-.50:Type error:
../lenses/logstash.aug:40.43-.50:Incompatible types: repetition is only defined for regexp and lens, not for string -> lens
@Spredzy
Spredzy / gist:6627114
Created September 19, 2013 17:46
[Fixed] Logstash augeas lense
module Logstash =
autoload xfm
let eol = Util.eol
let indent = Util.indent
let string_t = /('|")[^ \t\n]*('|")/
let sep_obr = del /[ \t]*\{([ \t]*\n)*/ " {\n"
let sep_cbr = del /[ \t]*\}([ \t]*\n)*/ "}\n"