Skip to content

Instantly share code, notes, and snippets.

View warnerpr's full-sized avatar

Paul Warner warnerpr

View GitHub Profile
- name: ensure 7-Zip is installed via win_package
win_package:
path: C:\temp\7z.msi
state: present
pwarner@pwarner-VirtualBox:~$ python hw.py
_
| |
|_|
|
|
_
_|
|_
@warnerpr
warnerpr / foo.html
Last active March 28, 2018 04:02
foo.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{title}}</title>
<meta name="description" content="{{description}}" />
</head>
<body>
<article id="main">
<time datetime="{{date}}" pubdate>{{date}}</time>
{{content}}
@warnerpr
warnerpr / A0 - master
Created November 2, 2017 05:27
A0 - master
MariaDB [(none)]> show master status;
+--------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+--------------------+----------+--------------+------------------+
| mariadb-bin.000001 | 1185 | | |
+--------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
MariaDB [(none)]> show slave hosts;
+-----------+------+------+-----------+
@warnerpr
warnerpr / gist:0fb8825e49bce72761e0bdd95b0512d9
Created November 2, 2017 05:19
galera B 1 - running in Galera cluster with slave B0
MariaDB [(none)]> show variables like 'gtid_%';
+------------------------+--------+
| Variable_name | Value |
+------------------------+--------+
| gtid_binlog_pos | 5-24-1 |
| gtid_binlog_state | 5-24-1 |
| gtid_current_pos | |
| gtid_domain_id | 0 |
| gtid_ignore_duplicates | OFF |
MariaDB [(none)]> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 172.16.1.10
Master_User: root
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mariadb-bin.000001
Read_Master_Log_Pos: 1185
Relay_Log_File: mysqld-relay-bin.000002
mysql dump run from the A0 host
mysqldump \
--host A0 \
--add-drop-table \
--add-drop-database \
-uroot \
-pXXXXXX \
--master-data \
--single-transaction \
@warnerpr
warnerpr / cm.py
Created April 14, 2015 21:48
context manager example
from contextlib import contextmanager
SOME_GLOBAL = None
@contextmanager
def manage_global(value):
global SOME_GLOBAL
SOME_GLOBAL = value
try:
yield