Skip to content

Instantly share code, notes, and snippets.

View adrianlzt's full-sized avatar

Adrián López adrianlzt

View GitHub Profile
@adrianlzt
adrianlzt / gist:6864843
Created October 7, 2013 09:07
Netcat testing 3306 tcp connexion
[root@centos mysql]# nc -vz localhost 3306
nc: connect to localhost port 3306 (tcp) failed: Connection refused
Connection to localhost 3306 port [tcp/mysql] succeeded!
The reason is the first connection is against ::1 (IPv6), and the second to 127.0.0.1.
This could be seen with: tcpdump -i lo -n
[root@centos mysql]# grep localhost /etc/hosts
@adrianlzt
adrianlzt / Error on cascade
Created October 17, 2013 10:33
Percona XtraDB Cluster error with ON CASCADE. Following this guide: http://www.mysqltutorial.org/mysql-on-delete-cascade/
mysql> use adritest;
Database changed
mysql> CREATE TABLE buildings (
-> building_no int(11) NOT NULL AUTO_INCREMENT,
-> building_name varchar(255) NOT NULL,
-> address varchar(355) NOT NULL,
-> PRIMARY KEY (building_no)
-> ) ENGINE=InnoDB;
Query OK, 0 rows affected (3.39 sec)
@adrianlzt
adrianlzt / hello.sh
Created December 5, 2013 09:09
salute
echo 'ola ke ase'
@adrianlzt
adrianlzt / gist:7986263
Created December 16, 2013 12:31
explain icinga query
mysql> EXPLAIN SELECT DISTINCT i3.icon_image AS i3__0, i6.instance_name AS i6__1, i.statehistory_id AS i__2, i4.host_object_id AS i4__3, i5.name1 AS i5__4, i4.alias AS i4__5, i4.display_name AS i4__6, i3.service_object_id AS i3__7, i2.name2 AS i2__8, i3.display_name AS i3__9, i.state AS i__10, i.state_time AS i__11, i.current_check_attempt AS i__12, i.max_check_attempts AS i__13, i.current_check_attempt AS i__14, i.max_check_attempts AS i__15 FROM icinga_statehistory i INNER JOIN icinga_objects i2 ON i.object_id = i2.object_id AND (i2.objecttype_id = 2) INNER JOIN icinga_services i3 ON i2.object_id = i3.service_object_id INNER JOIN icinga_hosts i4 ON i3.host_object_id = i4.host_object_id INNER JOIN icinga_objects i5 ON i4.host_object_id = i5.object_id INNER JOIN icinga_instances i6 ON i.instance_id = i6.instance_id WHERE (i3.config_type = '1') ORDER BY i.state_time DESC LIMIT 25;
+----+-------------+-------+--------+----------------------------------------------------------------------------+-----------------
@adrianlzt
adrianlzt / gist:8099272
Created December 23, 2013 15:46
Hiera test failed
Failures:
1) Hiera::Backend::Json_backend#lookup should retain the data types found in data files
Failure/Error: @backend.lookup("numericval", {}, nil, :priority).should == 1
Mocha::ExpectationError:
unexpected invocation: Hiera::Backend.datafile(:json, {}, 'one', 'json')
unsatisfied expectations:
- expected exactly 3 times, invoked 4 times: Hiera::Backend.datafile(:json, {}, 'one', 'json')
- expected exactly 3 times, invoked 4 times: Hiera::Backend.datasources(any_parameters)
satisfied expectations:
@adrianlzt
adrianlzt / Debug mode
Last active August 29, 2015 13:57
vagrant-lxc error
INFO global: Vagrant version: 1.5.1
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.5.1/bin/vagrant"
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Linux"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
@adrianlzt
adrianlzt / resource-agent-bug-320.sh
Created May 22, 2014 11:43
Testing IPaddr2 bug
#!/bin/bash
# https://github.com/ClusterLabs/resource-agents/pull/320
# Script to try to reproduce the bug
while true; do
PRE=$(</proc/net/dev)
STDOUT=$(/bin/bash /usr/lib/ocf/lib/heartbeat/findif.sh 2>&1)
if [[ $? != 0 ]]; then
echo "Before /proc/net/dev" > /tmp/bug-resource-agents
echo "$PRE" >> /tmp/bug-resource-agents
<section data-markdown>
<script type="text/template">
## Page title
A paragraph with some text and a [link](http://hakim.se).
</script>
</section>
<section data-markdown>
<script type="text/template">
## Otra pagina
<section>
<h2>Broadcasting Your</h3>
<h1>Reveal.js</h1>
<h2>Slideshow Presentations</h2>
</section>
<section>
Balbalblab
</section>
<section class="" data-id="c6f4a3adfec9442f0c5176bee6c3ecc3">
<h1>Monitorización automatizada</h1>
<div>presentacion</div>
</section>
<section class="" data-id="fde3a8402e73af2183265cb6f68d0098">
<h2>Puppet</h2>
<div>
<br>
</div>
<div>blabl</div>