Skip to content

Instantly share code, notes, and snippets.

@mkubenka
mkubenka / search_mysql.md
Last active May 24, 2021 20:52
How to search whole MySQL database for a particular string

How to search whole MySQL database for a particular string

https://dba.stackexchange.com/a/37041/7994

SELECT
    CONCAT('SELECT ',QUOTE(db),',',QUOTE(tb),',',QUOTE(col),',COUNT(1) FieldHasIt
    FROM `',db,'`.`',tb,'` WHERE \`',col,'\` LIKE ''%',SearchString,''%';') SearchSQL
FROM
(
@mkubenka
mkubenka / centos_php_fpm_coredumps.md
Created March 23, 2020 16:03
How to enable CentOS PHP-FPM coredumps.

CentOS PHP-FPM coredumps

https://wiki.archlinux.org/index.php/Core_dump

Enabling core dumps for PHP-FPM on CentOS 7 require several steps.

Set the rlimit_core directive in /etc/php-fpm.d/pool.conf and /etc/php-fpm.conf to unlimited:

rlimit_core = unlimited
@mkubenka
mkubenka / sparsecheckout.yml
Created December 1, 2018 17:43
Ansible Sparse Checkout
---
- hosts: all
vars:
repo_url: ssh://[email protected]/user/repo.git
base_dir: /var/www
sparse_checkout:
- folder1
@mkubenka
mkubenka / isohybrid.pl
Created November 21, 2018 09:51 — forked from jsarenik/isohybrid.pl
isohybrid.pl from Syslinux-6.03
#!/usr/bin/perl
## -----------------------------------------------------------------------
##
## Copyright 2002-2008 H. Peter Anvin - All Rights Reserved
## Copyright 2009 Intel Corporation; author: H. Peter Anvin
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
## Boston MA 02111-1307, USA; either version 2 of the License, or
@mkubenka
mkubenka / terraform-build.md
Created October 5, 2017 09:23
Compiling Terraform Provider with Docker for OSX

Compiling Terraform Provider with Docker for OSX

Create binary terraform-provider-aws in current directory:

docker run \
  --rm \
  -v $(pwd):/go/src/github.com/terraform-providers/terraform-provider-aws \
  -w /go/src/github.com/terraform-providers/terraform-provider-aws \
 -e GOOS=darwin \
@mkubenka
mkubenka / rpi-kiosk.md
Created September 3, 2017 10:44
RPi Kiosk

RPi Kiosk

$ sudo apt-get update
$ sudo apt-get install unclutter
$ vim.tiny ~/.config/lxsession/LXDE-pi/autostart
@mkubenka
mkubenka / scaleway_packet_loss.md
Created July 9, 2017 09:29
Scaleway AMS1 Network Issues

Two fresh instances in rescue mode:

  • AMS1 - VC1S - scw-7a0865 - 51.15.40.49
  • PAR1 - VC1S - scw-8d89f4 - 163.172.189.156

AMS1

root@scw-7a0865:~# curl checkip.amazonaws.com
51.15.40.49
@mkubenka
mkubenka / install-parallel-centos-6.sh
Created March 24, 2017 11:28
Install GNU Parallel on CentOS 6
#!/bin/bash
# Install GNU parallel on CentOS 6.
# http://software.opensuse.org//download.html?project=home%3Atange&package=parallel
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-6/home:tange.repo
yum install parallel
# Alternative:

Keybase proof

I hereby claim:

  • I am mkubenka on github.
  • I am mkubenka (https://keybase.io/mkubenka) on keybase.
  • I have a public key whose fingerprint is A266 D582 D20B 551B 7036 07FD A4CC 8E62 F11A 5A99

To claim this, I am signing this object:

@mkubenka
mkubenka / clean.ps1
Last active April 30, 2017 18:25
Remove the ‘Modern apps’ (anything from the ‘Store’) from the profile you are using to create your Windows 10 image.
# Remove some Windows Store pakacges which are blocking Sysprep
# Execution of scripts has to be neabled: Set-ExecutionPolicy RemoteSigned
# https://forums.fogproject.org/topic/5873/windows-10-unattend-xml-sysprep-answer-file-challenge/16
$AppsList = "Microsoft.Bing" , "Microsoft.BingFinance" , "Microsoft.BingMaps" , "Microsoft.BingNews"`
, "Microsoft.BingSports" , "Microsoft.BingTravel" , "Microsoft.BingWeather" , "Microsoft.Camera"`
, "microsoft.microsoftskydrive" , "Microsoft.Reader" , "microsoft.windowscommunicationsapps"`
, "microsoft.windowsphotos" , "Microsoft.XboxLIVEGames" , "Microsoft.ZuneMusic"`
, "Microsoft.ZuneVideo" , "Microsoft.Media.PlayReadyClient"
, "9E2F88E3.Twitter", "king.com.CandyCrushSaga"