Skip to content

Instantly share code, notes, and snippets.

View d4rkstar's full-sized avatar
😁
Curious about everything

d4rkstar d4rkstar

😁
Curious about everything
View GitHub Profile
@d4rkstar
d4rkstar / gist:215628dd03f3251c8a1b15033532be56
Last active November 1, 2020 09:20
Install remotedebug-ios-webkit-adapter on Linux
#!/bin/bash
DESTDIR = ~/tmp/install
mkdir -p ~/tmp/install
sudo apt install \
build-essential \
checkinstall \
git \
autoconf \
@d4rkstar
d4rkstar / CustomKeycloakSpringBootConfigResolver.java
Last active January 2, 2020 15:45
business-application keycloak integration
package com.company.service;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.KeycloakDeploymentBuilder;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver;
import org.keycloak.adapters.springboot.KeycloakSpringBootProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@d4rkstar
d4rkstar / configure
Created June 18, 2019 13:08
PHP 7.2 configure script
./configure \
--enable-maintainer-zts \
--prefix=/usr/local/php72 \
--with-config-file-scan-dir=/usr/local/php72/etc/conf.d \
--with-pear=/usr/local/php72/lib \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--enable-intl \
--enable-exif \
@d4rkstar
d4rkstar / freetype-config
Created June 18, 2019 13:06
Script to be placed in /usr/local/bin/freetype-config
#! /bin/sh
#
# Copyright 2000-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
@d4rkstar
d4rkstar / installphp70zts
Last active September 17, 2017 06:20
Install ZTS php70 on OSX with brew
brew uninstall --ignore-dependencies --force php70
brew uninstall --ignore-dependencies --force \
php70-apcu \
php70-igbinary \
php70-intl \
php70-mcrypt \
php70-memcached \
php70-opcache \
php70-pcntl \
php70-pdo-dblib \
@d4rkstar
d4rkstar / installoci8
Created September 17, 2017 06:18
Install pecl oci8 extension on OSX
#!/usr/bin/expect
set timeout 60
spawn /usr/local/bin/pecl install oci8
expect "Please provide the path to the ORACLE_HOME directory"
send "instantclient,/usr/local/lib/instantclient_12_1/\n"
interact
@d4rkstar
d4rkstar / gist:84714d3848862ca37abf
Last active September 25, 2015 05:40
icinga2 corosync check command
# INSTRUCTIONS
# this script have to run on the server where you have corosync installed.
#
# 1) download the plugin from https://exchange.nagios.org/directory/Plugins/Clustering-and-High-2DAvailability/Check-CRM/details
# 2) put the plugin inside your PluginDir (on ubuntu 14.04 lts is /usr/lib/nagios/plugins/)
# 3) on ubuntu 14.04. you'll require apt-get install libnagios-plugin-perl
# 4) add these lines to sudoers (visudo):
# a) nagios ALL=(ALL) NOPASSWD: /usr/sbin/crm_mon -1 -r -f
# b) nagios ALL=(ALL) NOPASSWD: /usr/sbin/crm configure show
@d4rkstar
d4rkstar / galera_nodes.conf
Created September 22, 2015 05:27
galera nodes icinga2
# INSTRUCTIONS
# 1) download the plugin from http://www.fromdual.com/galera-cluster-nagios-plugin-en
# 2) put the plugin inside your PluginDir (on ubuntu 14.04 lts is /usr/lib/nagios/plugins/)
# 3) add a user for checks if you need one: GRANT USAGE ON *.* TO 'check_db'@'[ip of your monitoring server]' IDENTIFIED BY '[password]';
object CheckCommand "galera_nodes" {
import "plugin-check-command"
command = [
PluginDir + "/check_galera_nodes.pl"
#!/bin/bash
BIND_NETWORK="192.168.5.0"
SHARED_VIP="192.168.5.30"
apt-get update
apt-get install -y pacemaker ntp
# Allow bind on a IP which is not yet defined on the system
echo 'net.ipv4.ip_nonlocal_bind=1' >> /etc/sysctl.conf
sysctl -p