Skip to content

Instantly share code, notes, and snippets.

View ArsSirek's full-sized avatar

Arsen ArsSirek

  • Armenia Yerevan
  • 20:38 (UTC +04:00)
View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
html, body {
@ArsSirek
ArsSirek / defaults
Last active July 5, 2018 12:22
node_exporter ubuntu local network install
# Set the command-line arguments to pass to the server.
#
# @origin source url - https://gist.github.com/eloo/a06d7c70ff2a841b7bb98cd322b851b9
#
ARGS='-web.listen-address=selfprivateip:9100 -collector.diskstats.ignored-devices="^(ram|loop|fd)\\d+$"'
# Prometheus-node-exporter supports the following options:
# -collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$": Regexp of devices to ignore for diskstats.
# -collector.filesystem.ignored-mount-points="^/(sys|proc|dev)($|/)": Regexp of mount points to ignore for filesystem collector.
# -collector.ipvs.procfs="/proc": procfs mountpoint.
@ArsSirek
ArsSirek / instruction.markdown
Last active April 28, 2018 15:10
docker windows for monolith app, for development environment with general use (without dockerfile)

Docker on Windows LAMP general setup

description

"docker monolith" approach helped me to switch from WSL to docker, I decided to create 1 image, that I will be useing with most of my local developed projects.

  1. prepare project files (/PATH/TO/PROJECT) that would be the folder we mount from our host system.

  2. prepare apache2 config for docker (/PATH/TO/WEB/ROOT/CONSIDERING/PROJECT) / /PATH/TO/APACHE_CONFIG/FODLER We will mount this configuration from host as the image should be ready to be used with many projects. In my case, I use yii2 and mount project folder to /var/www/mserver, so in the config file I use document root as /var/www/mserver/frontend/web e.t.c

@ArsSirek
ArsSirek / ~.bash_aliases
Created April 6, 2018 08:42
php xdebug remoute cli phpstorm sample with different php.ini
# credits:
# @link https://confluence.jetbrains.com/display/PhpStorm/Debugging+PHP+CLI+scripts+with+PhpStorm
# @link https://stackoverflow.com/questions/2288612/how-to-trigger-xdebug-profiler-for-a-command-line-php-script
# just escaped the row, to be able to add it to bash aliases and added a part to separate debug cli php.ini from production one
alias xphp="XDEBUG_CONFIG=\"idekey=PHPSTORM\" PHP_IDE_CONFIG=\"serverName=serverD\" php -c /etc/php/7.2/cli/php.debug.ini -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=`echo $SSH_CLIENT | cut -d \"=\" -f 2 | awk '{print $1}'` -dxdebug.remote_connect_back=0"
<?php
$status = null;
$output = "";
exec( "apachectl configtest", $output, $status );
if ( $status === 0 ) {
// allow apache2 reload to needed user
// (add - "username ALL = (root) NOPASSWD: /etc/init.d/apache2" to /etc/sudoers)
// http://serverfault.com/questions/69847/linux-how-to-give-a-user-permission-to-restart-apache
exec( "sudo /etc/init.d/apache2 reload");
}
@ArsSirek
ArsSirek / mysql_cmd_import_from_sql.txt
Last active May 4, 2017 21:10
command line mysql database import from file (like phpmyadmin export)
mysql -u username -p -h localhost
# > in sql command line
# Attention!! this will ERASE database from server
# Be sure that you know what are you doing
DROP DATABASE database_name;
CREATE DATABASE database_name;
ALTER DATABASE database_name charset=utf8mb4;