Skip to content

Commit

Permalink
many changes
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsiryk committed Feb 10, 2017
1 parent a6433d2 commit ffcb23e
Show file tree
Hide file tree
Showing 14 changed files with 600 additions and 115 deletions.
116 changes: 116 additions & 0 deletions Docker/1_docker_dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,122 @@ Clean up APT when done::

ARG var[=value] # переменные, которые используются при билде, можно инициализировать
docker build --build-arg var=value, только те что описаны в докерфайле



Old php in docker
-----------------


``Dockerfile``::

FROM debian:7.8

MAINTAINER Siryk Valentin <valentinsiryk@gmail.com>

RUN apt-get update \
&& apt-get install -y \
libbz2-dev \
libcurl4-gnutls-dev \
libpng12-dev \
libjpeg62-dev \
libmcrypt-dev \
libmhash-dev \
libmysqlclient-dev \
libxml2-dev \
libxslt1-dev \
make \
apache2 \
apache2-threaded-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV PHP_VERSION 5.2.9

# Download and unpack PHP
#COPY ./php-${PHP_VERSION}.tar.gz /tmp/
ADD http://museum.php.net/php5/php-${PHP_VERSION}.tar.gz /tmp/
RUN tar -xzf /tmp/php-${PHP_VERSION}.tar.gz -C /tmp

WORKDIR /tmp/php-${PHP_VERSION}

RUN ln -s /usr/lib/x86_64-linux-gnu/libjpeg.a /usr/lib/libjpeg.a \
&& ln -s /lib/x86_64-linux-gnu/libpng12.so.0.49.0 /usr/lib/libpng.so \
&& ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so /usr/lib/libmysqlclient.so \
&& ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so /usr/lib/libmysqlclient_r.so


# Configure
RUN ./configure \
--with-apxs2=/usr/bin/apxs2 \
--disable-cgi \
--with-mysql \
--with-pdo-mysql
#--with-mysqli \
#--enable-cli \
#--enable-discard-path \
#--enable-mbstring \
#--with-curl \
#--with-gd \
#--with-jpeg-dir \
#--with-mcrypt

# Install
RUN make \
&& make install

RUN rm -rf /tmp/php* /var/tmp/*

RUN a2enmod rewrite

COPY ./default.conf /etc/apache2/sites-available/default

#COPY ./php.ini /usr/local/lib/php.ini

#RUN echo "<?php phpinfo(); ?>" > /var/www/index.php

EXPOSE 80

CMD [ "/usr/sbin/apache2ctl", "-D", "FOREGROUND" ]


``default.conf``::

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www

<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>


<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>


DirectoryIndex index.php


ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>




Expand Down
98 changes: 93 additions & 5 deletions Elastic/elasticsearch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,98 @@ Start/restart Elasticsearch::
sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service



Curator
-------

::

# show elasticsearch indices
curator_cli show_indices


Installation
^^^^^^^^^^^^

- Ubuntu 16.04::

sudo sh -c "echo 'deb http://packages.elastic.co/curator/4/debian stable main' > /etc/apt/sources.list.d/elasticsearch-curator.list"
sudo apt update && sudo apt install elasticsearch-curator


Configuration
^^^^^^^^^^^^^

Configuration file ``/<HOME>/.curator/curator.yml``::

---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
client:
hosts:
- 127.0.0.1
port: 9200
url_prefix:
use_ssl: False
certificate:
client_cert:
client_key:
ssl_no_validate: False
http_auth:
timeout: 30
master_only: False

logging:
loglevel: INFO
logfile:
logformat: default
blacklist: ['elasticsearch', 'urllib3']


Delete old Elasticsearch indices
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Create action file. Example - ``del.yml``::

---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete indices older than 30 days (based on index name), for logstash-
prefixed indices. Ignore the error if the filter does not result in an
actionable list of indices (ignore_empty_list) and exit cleanly.
options:
ignore_empty_list: True
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: prefix
value: logstash-
exclude:
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 30
exclude:


Run action::

curator del.yml

Old indexes clear
-----------------
# curator --dry-run del.yml



- http://www.ragingcomputer.com/2014/02/removing-old-records-for-logstash-elasticsearch-kibana
- https://www.elastic.co/guide/en/elasticsearch/client/curator/current/singleton-cli.html
- https://www.elastic.co/blog/curator-tending-your-time-series-indices
37 changes: 37 additions & 0 deletions MacOS/create_iso.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
==========================
Create bootable Mac OS iso
==========================


Create ISO from DMG
-------------------

Create bootable Sierra.iso::

#!/bin/bash

# mount InstallESD.dmg to /Volumes/install_app
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app

# create Sierra.cdr.dmg
# hdiutil create -o /tmp/Sierra.cdr -size 6200m -layout SPUD -fs HFS+J
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J

# createmount Sierra.cdr.dmg to /Volumes/install_build
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build

# restore BaseSystem.dmg to /Volumes/install_build (will renamed to "/Volumes/OS X Base System")
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase

rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages

cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg

hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil convert /tmp/Sierra.cdr.dmg -format UDTO -o /tmp/Sierra.iso

mv /tmp/Sierra.iso.cdr ./Sierra.iso
rm /tmp/Sierra.cdr.dmg
9 changes: 9 additions & 0 deletions MacOS/index.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
======
Mac OS
======

.. toctree::
:maxdepth: 2
:glob:

*
21 changes: 21 additions & 0 deletions MacOS/mac_os.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
======
Mac OS
======


Create bootable flash
---------------------

Mac OS Sierra - http://www.macworld.com/article/3092900/macs/how-to-create-a-bootable-macos-sierra-installer-drive.html












0 comments on commit ffcb23e

Please sign in to comment.