Skip to content

Instantly share code, notes, and snippets.

View asabirov's full-sized avatar

Artur Sabrov asabirov

  • Apliteni.com
  • Spain
View GitHub Profile
@asabirov
asabirov / load-configs
Last active February 17, 2021 05:44
Use multiple kube config files for kubectl
#!/usr/bin/env bash
DEFAULT_KUBECONFIG_FILE="$HOME/.kube/config"
if test -f "${DEFAULT_KUBECONFIG_FILE}"
then
export KUBECONFIG="$DEFAULT_KUBECONFIG_FILE"
fi
# Your additional kubeconfig files should be inside ~/.kube/configs
ADD_KUBECONFIG_FILES="$HOME/.kube/configs"
mkdir -p "${ADD_KUBECONFIG_FILES}"
@asabirov
asabirov / .bashrc
Last active December 18, 2019 23:00
envs for cka exam
source <(kubectl completion bash)
complete -F __start_kubectl k
alias k='kubectl'
alias kgd='k get deploy'
alias kgp='k get pods'
alias kgn='k get nodes'
alias kgs='k get svc'
alias kge="k get events — sort-by='.metadata.creationTimestamp' |tail -"
====== Admin API =====
{badge}That feature available only for PRO or higher editions{badge}
~~TOC~~
Sorry, this page is not finished yet. You can see all entry points by using cli.php:
<code bash>
$ php bin/cli.php admin_api:routes
+--------+-------------------------------------------------+------------------------------------+
| Method | Route | Description |
@asabirov
asabirov / php-7.1-isp-ioncube
Created October 16, 2017 19:03
Install ioncube for PHP 7.1 on ISPManager
cd /tmp
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxvf ioncube_loaders_lin_x86-64.tar.gz
PHP_CONFD=$(/opt/php71/bin/php --ini | grep "Scan for" | grep -oE "(\/.*)")
PHP_VERSION=$(/opt/php71/bin/php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(/opt/php71/bin/php-config --extension-dir)
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini"
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../fpm/conf.d/00-ioncube.ini" 2> /dev/null
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../cgi/conf.d/00-ioncube.ini"
cd /tmp
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxvf ioncube_loaders_lin_x86-64.tar.gz
PHP_CONFD=$(/opt/php70/bin/php --ini | grep "Scan for" | grep -oE "(\/.*)")
PHP_VERSION=$(/opt/php70/bin/php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(/opt/php70/bin/php-config --extension-dir)
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini"
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../fpm/conf.d/00-ioncube.ini" 2> /dev/null
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../cgi/conf.d/00-ioncube.ini"
cd /tmp
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxvf ioncube_loaders_lin_x86-64.tar.gz
PHP_CONFD=$(php --ini | grep "Scan for" | grep -oE "(\/.*)")
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini"
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../fpm/conf.d/00-ioncube.ini" 2> /dev/null
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../cgi/conf.d/00-ioncube.ini"
@asabirov
asabirov / gist:e977d1d76b266101c0bc38152af61b9e
Created June 29, 2016 04:24
[BitBucket] To show all diffs in a PR Overview
$('.load-diff').click()
module nginx 1.0;
require {
type var_run_t;
type user_home_dir_t;
type httpd_log_t;
type httpd_t;
type user_home_t;
type httpd_sys_content_t;
type initrc_t;
@asabirov
asabirov / install_keitaro.yml
Last active March 31, 2016 10:44
Ansible playbook which installs Keitaro TDS on fresh CentOS 7
---
- hosts: all
sudo: true
vars:
php_version: 'php56'
swap_space: 1000
db:
username: tds
dbname: tds
password: 012e-f23rh2e
check process mariadb with pidfile /var/run/mariadb/mariadb.pid
start program = "/bin/systemctl start mariadb"
stop program = "/bin/systemctl stop mariadb"