Skip to content

Instantly share code, notes, and snippets.

mysql2 gem + mariadb + Alpine Linux

tl;dr Use mariadb-dev. In case of Alpine Linux 3.8, 3.9, use mysql2 >= 0.4.10.

Starting with Alpine Linux 3.8 there are basically 2 options to install the mysql2 gem:

1.sh:

@kedder
kedder / migrate_psql_to_mysql.py
Created October 12, 2019 20:55
Simple script to copy data from postgresql database to mysql with the same schema
"""Convert postgres database to mysql on live running servers
Schemas in both databases should match.
"""
from pprint import pprint
import pymysql.cursors
import psycopg2
import psycopg2.extras
@thepwrtank18
thepwrtank18 / keys.md
Last active April 19, 2024 13:06
Windows XP/2003 Product Keys

Windows XP/2003 Product Keys

These keys have been tested to work. These are a combination of keys from Chinese websites, trial keys inside ISO's, auto-activate keys in OEM ISO's, and directly from Microsoft's website, all aggregated for your convenience.

Usage

In order to use these keys, you need the right edition of Windows XP/2003. Not just Home/Pro/Enteprise/etc, whether it's a Retail, OEM or Volume version. There's a clear cut way to check this.

If you see this, you have a Retail copy.
image

@scriptdev
scriptdev / .php
Last active April 19, 2024 13:05
RELATÓRIO HTML PARA PDF VIA AdiantiHTMLDocumentParser
<?php
$html = new AdiantiHTMLDocumentParser('app/resources/relatorio.html');
$parametros = array(
'{{nome}}' => 'JOÃO DA SILVA',
'{{celular}}' => '(83) 98655-6461'
);
foreach($parametros as $chave => $valor)
@doraTeX
doraTeX / ocr.sh
Last active April 19, 2024 13:04
A shell script to perform OCR on images/PDFs using macOS built-in OCR engine
#!/bin/bash
SCRIPTNAME=$(basename "$0")
function realpath () {
f=$@;
if [ -d "$f" ]; then
base="";
dir="$f";
else
base="/$(basename "$f")";
@dnaroma
dnaroma / binary.py
Last active April 19, 2024 13:04
Extract AppHash from unity assets
from io import RawIOBase
from struct import *
from typing import Callable
def offset_decorate(func: Callable) -> Callable:
def func_wrapper(*args, **kwargs) -> Callable:
offset = kwargs.get('offset')
if offset is not None:
@Daan-Grashoff
Daan-Grashoff / google_search_maps_addon.js
Last active April 19, 2024 13:04
Bring back the google maps button when searching on google
// ==UserScript==
// @name Google maps addon
// @namespace http://tampermonkey.net/
// @version 2024-03-21
// @description Bring google maps button back
// @author You
// @match https://www.google.com/search*
// @include https://www.google.tld/search*
// @icon https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @grant none
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:02
COLUNA SITUAÇÃO DATAGRID
<?php
$column_situacao->setTransformer(function($value, $object, $row)
{
if($value == 'SIM' || $value == 'sim' || $value == 's' || $value == 'T' || $value == true || $value == 't')
{
return '<span class="label label-success">ATIVO</span>';
}
return '<span class="label label-danger">INATIVO</span>';
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active April 19, 2024 13:02
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;