вторник, 11 октября 2016 г.

Go Daddy Certificate Install

SOURCE : http://serverfault.com/a/478048


So when you generated your CSR you would have specified a CN (Common Name) that corresponds to the specific hostname that you want to use the certificate for.1 Where ever this hostname lives is where you want to install the certificate. For the sake of sane examples let's use www.example.com as the hostname for your certificate.
When you generated the CSR you would have created two files,
  1. A cryptographic key
  2. The CSR you shipped off to GoDaddy
So now that you have the signed certificate back from them you'll need to place the following three pieces of information on the webserver that hosts www.example.com
  1. The cryptographic key generated when you made the CSR
  2. The mysite.crt file provided by GoDaddy
  3. The sf_bundle.crt file provided by GoDaddy
Now go to the Apache config file for the www.example.com host. You'll want to add these lines
SSLEngine on
SSLProtocol -ALL +SSLv3 +TLSv1
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM

SSLCertificateFile /etc/httpd/ssl/mysite.crt
SSLCertificateKeyFile /etc/httpd/ssl/mysite.key
SSLCertificateChainFile /etc/httpd/ssl/sf_bundle.cer
Replace the paths as necessary, but just make sure you put them someplace safe with root only permissions. Restart httpd and, so long as you did everything right, it should work.
1: Not 100% accurate but let's ignore wildcards for the moment.

вторник, 4 октября 2016 г.

Global Composer Installation

SOURCE: https://akrabat.com/global-installation-of-php-tools-with-composer/

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:


$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
$ composer global require phploc/phploc
$ composer global require phpmd/phpmd
$ composer global require squizlabs/php_codesniffer

Or for ORO Projects
C:\Users\{CURRENT USER}\AppData\Roaming\Composer\composer.json
    "require": {
        "phpunit/phpunit": "4.8.*",
        "phpmd/phpmd": "2.4.*",
        "squizlabs/php_codesniffer": "2.7.*"
    }

and
composer global install

пятница, 16 сентября 2016 г.

PostgreSQL Rule The Permissions

CREATE DATABASE  {DATABASE_NAME} ENCODING 'UTF8' OWNER {USER_NAME} TEMPLATE template0;

psql {DATABASE_NAME} -tc "select 'grant all on '||relname||' to {USER_NAME};' from pg_stat_user_tables" | psql {DATABASE_NAME}

psql {DATABASE_NAME} -tc "select 'ALTER TABLE ' || table_name || ' OWNER TO {USER_NAME};' from information_schema.tables where table_schema = 'public';" | psql {DATABASE_NAME}

psql {DATABASE_NAME} -tc "SELECT 'ALTER SEQUENCE '|| sequence_schema || '.' || sequence_name ||' OWNER TO {USER_NAME};' FROM information_schema.sequences WHERE NOT sequence_schema IN ('pg_catalog', 'information_schema') ORDER BY sequence_schema, sequence_name;" | psql {DATABASE_NAME}

psql {DATABASE_NAME} -tc "SELECT 'ALTER VIEW '|| table_schema || '.' || table_name ||' OWNER TO {USER_NAME};' FROM information_schema.views WHERE NOT table_schema IN ('pg_catalog', 'information_schema') ORDER BY table_schema, table_name;" | psql {DATABASE_NAME}


pg_dump -c -U postgres --no-owner  > dump.psql

вторник, 30 августа 2016 г.

Cannot use Terminus on Windows 10

https://curl.haxx.se/ca/cacert.pem
Okay all--I seem to have done it. Here's what worked for me:
I opened the php.ini file in xampp, and found the line:
;curl.cainfo = 
I then searched for "cacert.pem", and added its full path to the end of the "curl.cainfo" line (in quotes) in php.ini, removed the ";" from the beginning of the line, and saved php.ini.
I tried to login to terminus again, and this time I got the welcome message.
@TeslaDethray Thanks for all your help here and elsewhere. I hope this is useful.

четверг, 14 июля 2016 г.

Server does not support diffie-hellman-group1-sha1 for keyexchange

Add the following to /etc/ssh/sshd_conf while logged in as root (same password as Admin if you are on a Synology NAS)
 
KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1

Ciphers 3des-cbc,blowfish-cbc,aes128-cbc,aes128-ctr,aes256-ctr

After adding these, run "ssh-keygen -A" to make it generate the keys not needed before the changes, and restart the SSHd service on the machine (reboot works fine, too) 


source: https://www.veeam.com/kb2061

mysql (mariadb) ERROR 1698 (28000): Access denied for user 'root'@'localhost'

sudo mysql -u root
use mysql;
update user set plugin='' where User='root';
flush privileges;
exit;
source: http://superuser.com/a/1077144/509195

пятница, 3 июня 2016 г.

PHP7

realpath_cache_ttl =9120
max_execution_time = 3600
max_input_time = 900
max_input_vars = 10000
memory_limit = 512M
error_reporting = E_ALL | E_STRICT
html_errors = On
post_max_size = 50M
extension_dir = "./../php/current/ext"
upload_tmp_dir = "./../temp"
upload_max_filesize = 50M
date.timezone = Europe/Minsk


;zend_extension  = ./php_xdebug-2.3.2-5.5-vc11-x86_64.dll
;zend_extension_ts = ./php_xdebug-2.3.2-5.5-vc11-x86_64.dll
xdebug.remote_enable=off
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.profiler_enable=0
xdebug.profiler_output_dir=./../profiling/xdebug
xdebug.profiler_output_name=php-5.5.24-web-%t-%H-%R.wcg
xdebug.var_display_max_depth=1
xdebug.max_nesting_level=1000

extension=php_openssl.dll
extension=php_curl.dll
extension=php_bz2.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_intl.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_memcache.dll
[COM_DOT_NET]
extension=php_com_dotnet.dll

extension=php_geoip.dll
extension=php_mongo-1.4.1-5.5-vc11-x86_64.dll
extension=php_soap.dll
extension=php_xsl.dll

вторник, 12 апреля 2016 г.

ORO CRM :Command Line

Code Style:

cmd /c phpmd src/ text codesize

cmd /c phpcs --encoding=utf-8 --extensions=php --standard=psr2 src/ -p

cmd /c php-cs-fixer fix "%cd%/src/" --level=psr2 --fixers=short_array_syntax,psr0,encoding,short_tag,braces,elseif,eof_ending,function_call_space,function_declaration,indentation,line_after_namespace,linefeed,lowercase_constants,lowercase_keywords,method_argument_space,multiple_use,parenthesis,php_closing_tag,trailing_spaces,visibility,-ordered_use,-single_line_after_imports

Dump-Installer

cmd /c app oro:migration:dump --migration-version=V1_0 --bundle AkumaAcademicBundle > src/Akuma/Bundle/AcademicBundle/Migrations/Schema/AkumaAcademicBundleInstaller.php

cmd /c php-cs-fixer fix "%cd%/src/Akuma/Bundle/AcademicBundle/Migrations/Schema/AkumaAcademicBundleInstaller.php" --level=psr2


Run Cron

cmd /c app oro:cron --env=dev && pause

CLank

cmd /c app clank:server --env=dev && pause

Clean Reinstall
cmd /c app oro:install --force --drop-database --application-url='http://academic.cw471.es/'  --organization-name=ORO --user-name=admin  --user-email=admin@example.com --user-firstname=INRI --user-lastname=SakiZ --user-password=admin --sample-data=y --env=dev

Reinstall Test Environment

cmd /c app oro:install --force --drop-database --application-url='http://academic.cw471.es/'  --organization-name=ORO --user-name=admin  --user-email=admin@example.com --user-firstname=INRI --user-lastname=SakiZ --user-password=admin --sample-data=y --env=test

cmd /c app doctrine:fixture:load --env=test --append --fixtures vendor/oro/platform/src/Oro/Bundle/TestFrameworkBundle/Fixtures

cmd /c phpunit -c .\phpunit.xml src\Akuma\Bundle\AcademicBundle\Tests\Functional


app .cmd
@ECHO OFF
php "%~dp1app/console" %*

вторник, 5 апреля 2016 г.

OroSearchBundle: Quick Tests

        $string = 'Admi';
        /** @var $resultProvider ResultStatisticsProvider */
        $resultProvider = $this->get('oro_search.provider.result_statistics_provider');
        var_dump($groupedResults = $resultProvider->getGroupedResults($string));
        die();

OroDatagridBundle: OPTIONS

options:
            entity_pagination: true
            toolbarOptions:
                hide: true
                pageSize:
                    items: [10]
#                    default_per_page: 10
            routerEnabled: false


entityHint -- ??
entity_pagination -- ??

toolbarOptions -- used to configure toolbar
hide -- default "false", visibility state of toolbar
pageSize -- options to configure items per page
default_per_page -- items per page
items -- count of items to display, array must be equal to "default_per_page"
routerEnabled -- ??

понедельник, 4 апреля 2016 г.

ORO-Platform: WorkFlowBundle + DataGridBundle : Workflow Step

If you'd like to hide from "DataGrids" "WorkFlow Step" column by default, then add to entity confing

/**
* @ORM\Entity()
* @ORM\Table(
* name="academic_issues"
* )
* @Config(
* defaultValues={


* "workflow"={
* "show_step_in_grid"=false
* }
* }
* )


)
*/
And never use in your "DataGrid" definitions any following columns:
  • "workflowStep"
  • "workflowStepLabel"
  • "step"
  • "stepLabel"
Because they added automatically here and if "show_step_in_grid" is FALSE they are removed here

ORO-Platform: Datagrid : Default Frontend Types

ORO Platform default frontend_type

protected $typeToFrontendTypeMap = [
'integer' => Property::TYPE_INTEGER,
'smallint' => Property::TYPE_INTEGER,
'bigint' => Property::TYPE_INTEGER,
'decimal' => Property::TYPE_DECIMAL,
'float' => Property::TYPE_DECIMAL,
'boolean' => Property::TYPE_BOOLEAN,
'date' => Property::TYPE_DATE,
'datetime' => Property::TYPE_DATETIME,
'time' => Property::TYPE_TIME,
'money' => Property::TYPE_CURRENCY,
'percent' => Property::TYPE_PERCENT,
'simple_array' => Property::TYPE_SIMPLE_ARRAY,
'array' => Property::TYPE_ARRAY,
'json_array' => Property::TYPE_ARRAY,
'row_array' => Property::TYPE_ROW_ARRAY,
];

воскресенье, 7 февраля 2016 г.

Drupal 7 Webform template suggestions

function qc_webforms_theme_registry_alter(&$theme_registry) {
 unset($theme_registry['webform_form']['pattern']);
}

function qc_webforms_preprocess(&$vars, $hook) {
  switch ($hook) {
    case 'webform_form':
      $vars['theme_hook_suggestions'][] = 'webform_form';
      if(isset($vars['theme_hook_suggestion'])){
        $vars['theme_hook_suggestions'][] = $vars['theme_hook_suggestion'];
        $vars['theme_hook_suggestion'] = null;
      }else{
        $vars['theme_hook_suggestions'][] = 'webform_form_' . $vars['form']['#node']->nid;
      }

      $vars['theme_hook_suggestions'][] = 'webform_form__' . $vars['form']['#node']->webform['machine_name'];
      break;
    case 'node':
      $view_mode = $vars['view_mode'];
      if(isset($vars['webform'])){
        $vars['theme_hook_suggestion'] = null;
        $vars['theme_hook_suggestions'][] = 'node__webform__' . $vars['webform']['machine_name'];
        $vars['theme_hook_suggestions'][] = 'node__webform__' . $vars['webform']['machine_name'] . '__' . $view_mode;
      }
      break;
  }
}

вторник, 19 января 2016 г.

When using Font-Awesome, prevent CKEditor 4.x from removing

https://www.drupal.org/node/1908696

среда, 13 января 2016 г.

htacess image not found resolver for modern frameworks



.htaccess :

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(gif|jpe?g|png|bmp) /image404.php [L]
</IfModule>


image404.php :

<?php
header("HTTP/1.0 404 Not Found");
exit;

вторник, 5 января 2016 г.

upwork cover letter

Generally I'm working with Drupal version 7 and usually I use pantheon service for development. I have a few my own modules, but due very weird Drupal's contributing mechanism they are not at Drupal.org, but you can find them at my bitbucket account https://bitbucket.org/inri13666
for example
https://bitbucket.org/inri13666/akuma_core
https://bitbucket.org/inri13666/akuma_metadata
https://bitbucket.org/inri13666/akuma_tokenfield

In my work I prefer to use Drupal's hooks standards to extend or override default functionality (:

Here the samples of my work:
https://reggieintheraw.com/
http://www.thestemnet.com/

Much of my works is private, and unfortunately I'm unable to share them

My Skype ID : makarov.nikita.13

Composer proc_open(): fork failed errors


proc_open(): fork failed errors#


If composer shows proc_open() fork failed on some commands:


PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar


This could be happening because the VPS runs out of memory and has no Swap space enabled.

free -m
total used free shared buffers cached
Mem: 2048 357 1690 0 0 237
-/+ buffers/cache: 119 1928
Swap: 0 0 0

To enable the swap you can use for example:
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1

or add to "etc/fstab"

/var/swap.1   none    swap    sw    0   0

php5dismod xdebug

http://www.coderblog.de/how-to-install-use-configure-xdebug-ubuntu/

понедельник, 4 января 2016 г.

Drefault Dev config for SF2

<VirtualHost *:80>
        ServerName irs-sf.akuma.in

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/irs-sf

        <Directory "/var/www/irs-sf">
            <IfModule env_module>
                SetEnv APPLICATION_ENV development
            </IfModule>
            <IfModule mod_headers.c>
                Header set X-Robots-Tag: "noindex, nofollow, noarchive, nosnippet, noimageindex"
            </IfModule>
            DirectoryIndex app_dev.php
            AllowOverride None
            Allow from All
            <IfModule mod_rewrite.c>
                RewriteEngine On

                RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
                RewriteRule ^(.*) - [E=BASE:%1]

                # Sets the HTTP_AUTHORIZATION header removed by apache
                RewriteCond %{HTTP:Authorization} .
                RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

                RewriteCond %{ENV:REDIRECT_STATUS} ^$
                RewriteRule ^app_dev\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,END]

                RewriteCond %{REQUEST_FILENAME} -f
                RewriteRule .? - [L]

                # Rewrite all other queries to the front controller.
                RewriteRule .? %{ENV:BASE}/app_dev.php [L]
            </IfModule>
        </Directory>


        LogLevel error
        ErrorLog ${APACHE_LOG_DIR}/irs-sf/error.log
        CustomLog ${APACHE_LOG_DIR}/irs-sf/access.log combined
</VirtualHost>