Skip to content

Instantly share code, notes, and snippets.

@Meai
Meai / calc_innodb_buf_pool.py
Created April 12, 2024 06:50 — forked from stephanGarland/calc_innodb_buf_pool.py
Designed for use with Ansible, but works on its own as well – calculate the tricky parts of InnoDB's buffer pool
#!/usr/bin/env python3
"""
Calculates various parameters for the InnoDB buffer pool based on a simple input.
The InnoDB engine is extremely strict about how its buffer pool can be sized.
Ref: https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_buffer_pool_chunk_size
Other than size restrictions (which are unlikely to be violated in normal practice), there are
complicated relationships between the three main variables that must be met, plus some
best practices to be observed. Getting these three correct can be challenging, hence this calculator.
[Unit]
Description=Streaming MySQL binary logs to local filesystem using %i
After=network.target
[Service]
Type=simple
User=root
Restart=on-failure
ExecStart=/root/binlog_streaming/bin/binlog_to_local.sh /root/binlog_streaming/conf/%i.conf
@Meai
Meai / keybase.md
Created December 17, 2019 19:47
keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@Meai
Meai / gist:7f910ab0e8f50c80b296fd065501e978
Created December 9, 2018 08:08
Here is how bazel works
Here is how bazel works:
A BUILD file is just a .bzl (== bazel == starlark) file without an extension.
WORKSPACE seems to be its own format.
These starlark files are configuration files that evaluate statically to some list of output files.
So now you have to write rules how these output files are going to be created within this configuration language.
First you create a 'Rule' object from a global function called 'rule()'.
Call it like this:
Unpacking C:\ParticleSDK\frontend\update\com.particlecode.ide.site_1.3.0-eclipse.feature\site.p2\plugins\com.particlecode.ide_1.3.0.20110926_1603.jar
Directory already exists: C:\ParticleSDK
Unpacking files
Unpacking C:\ParticleSDK\readme.txt
Un-installing Particle platform plug-in for eclipse...
Executing C:\eclipse/Eclipse -application org.eclipse.equinox.p2.director -uninstallIU com.particlecode.ide.feature.group -destination "C:\eclipse" -noSplash
Script exit code: 13
Script output:
Installation failed.
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.2.R36x_v20101019_1345
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
@Meai
Meai / gist:949653
Created April 30, 2011 13:14
playframework exception
Debugger failed to attach: handshake failed - received >GET / HTTP/1.1< - expected >JDWP-Handshake<
15:10:33,047 ERROR ~ Unable to set localhost. This prevents creation of a GUID. Cause was: pc: pc
java.net.UnknownHostException: pc: pc
at java.net.InetAddress.getLocalHost(InetAddress.java:1426)
at net.sf.ehcache.Cache.<clinit>(Cache.java:155)
at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:298)
at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:214)
at net.sf.ehcache.CacheManager.configure(CacheManager.java:552)
at net.sf.ehcache.CacheManager.init(CacheManager.java:323)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:279)