среда, 16 декабря 2015 г.

Which Intel graphics and chipsets support three independent displays?

Three independent displays are only supported with the following Intel products:

Intel® Processors:


  • 4th Generation Intel® Core™ Processors with Intel® Iris™ Pro Graphics 5200
  • 4th Generation Intel® Core™ Processors with Intel® Iris™ Graphics 5100
  • 4th Generation Intel® Core™ Processors with Intel® HD Graphics 5000/4600/4400/4200
  • 3rd Generation Intel® Core™ Processors with Intel® HD Graphics 4000/2500


вторник, 8 декабря 2015 г.

Git Default Editor to notepad

By configuring git config core.editor notepad, users can now use notepad.exe as their default editor.
Configuring git config format.commitMessageColumns 72 will be picked up by the notepad wrapper and line-wrap the commit message after the user edited it.

http://stackoverflow.com/a/773973/2564525

вторник, 24 ноября 2015 г.

Upwork Answers

Do you have any questions about the job description?

How many Drupal sites you have?

What service you use for Drupal hosting?

How organized development workflow?

Do you use any system for bug tracking?



Why did you apply to this particular job?
I think it'll be good experience for me

Have you taken any Upwork tests and done well on them that you think are relevant to this job?

Yes, some tests are passed. You can see them at my profile.

Cover Letter

I'm Drupal Ninja:) And will be very glad to participate your team.

If you choose me you will never regret it:)

четверг, 19 ноября 2015 г.

Git PUSH

git config --global push.default matching 
OR
git config --global push.default current

First will push all matched branches,
Second will push only current

пятница, 23 октября 2015 г.

Brewing cup: Alter path alias programmatically for an existing ...

Brewing cup: Alter path alias programmatically for an existing ...: Here's a method to alter the path alias (if you're using the pathauto module) of an existing taxonomy term programmatically. Here ...

пятница, 16 октября 2015 г.

Google Calendar event buttons — Mobile version

I've been doing some research on this myself and I've come close, but I'm not 100% there yet. Here's a sample URL of a mobile "share event" link:

http://www.google.com/calendar/gp#~calendar:view=e&bm=1&action=TEMPLATE&text=Halloween+Party+2011&dates=20111101/20111202&details=Description&location=Millennial+Media&trp=false

It opens up the mobile version of Google Calendar and pre-populates it with details about the event your sharing.

The only problem I've encountered is when you're not already logged into Google Calendar. It takes you to the log in page, which is fine, but then after you log in it takes you to the home screen instead of the event entry page.

If you find or already found an answer to this, let me know.

source

среда, 7 октября 2015 г.

Give a folder its very own drive letter

Pretend that you have a file folder called C:\data\word_docs, that you use it constantly, and that you would like to refer to it with a shortcut of W:. Open up a command prompt window and issue the following command:

SUBST w: C:\data\word_docs

SUBST is short for substitute. (DOS commands are case-insensitive, so you could enter it as "subst" as well.) So, now, W:\intro.doc is the same thing as C:\data\word_docs\intro.doc — two different ways to refer to the same file.

source

понедельник, 5 октября 2015 г.

No Index No Robots

a2enmod header



<IfModule mod_headers.c>

Header set X-Robots-Tag: "noindex, nofollow, noarchive, nosnippet, noimageindex"

</IfModule>
++++
<<<<

https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04


chown -R apache:apache sites/default/files
chmod -R 775 sites/default/files

воскресенье, 4 октября 2015 г.

Default

$S$Dy5ukPpN0hROOg1q0Y4X.5tK9K2ub5yaectmocvfjCL55zsE7sW/
987951

среда, 16 сентября 2015 г.

Apple Certificates to PEM

p12 => pem
openssl pkcs12 -in Certificates.p12 -out push.prod.crt.pem -nodes -clcerts

bin crt => pem
openssl x509 -inform der -in aps_production.cer -outform pem -out certificate.pem


While trying to update a certificate on a produciton enviroment I ran into the following issue, Apache only accepts certificates in PEM format, since my client provided me with his new certificate on a .cer file I had to find a way to convert it.
For x509 certificates this can be easily achieved using OpenSSL on Linux/Unix and OS X. First make sure you have OpenSSL (comes by default with OS X), open a terminal and issue the following command:
openssl x509 -inform pem -in certificate.cer -outform der -out certificate.pem
Where certificate.cer is the source certificate file you want to convert and certificate.pem is the name of the converted certificate.

The inform and outform options are reversed. The command should be:
openssl x509 -inform der -in certificate.cer -outform pem -out certificate.pem

https://github.com/richsage/RMSPushNotificationsBundle/issues/60#issuecomment-40174938
http://perrohunter.com/how-to-convert-a-cer-certificate-to-pem-on-linuxunix-and-os-x/#comment-4398

четверг, 6 августа 2015 г.

Drupal Dump Field Declaration

include_once DRUPAL_ROOT . '/includes/utility.inc';
$field_data = field_info_field('field_testimonial_portrait');
unset($field_data['id']);
pre(drupal_var_export($field_data));


$instance_data = field_info_instance('node', 'field_testimonial_portrait', 'testimonial');
unset($instance_data['id'], $instance_data['field_id']);
pre(drupal_var_export($instance_data));

Inspired by http://www.thecarneyeffect.co.uk/creating-custom-content-type-adding-fields-programmatically-drupal-7


include_once DRUPAL_ROOT . '/includes/utility.inc';
$field_data = field_info_field('field_specialty');
unset($field_data['id']);
echo "
" . (drupal_var_export($field_data)) . '
';


$instance_data = field_info_instance('node', 'field_specialty', 'doctor_cv');
unset($instance_data['id'], $instance_data['field_id']);
echo "
" . (drupal_var_export($instance_data)) . '
';

среда, 5 августа 2015 г.

Drupal Mudule Translation

  1. To generate the .pot file, install the module Translation template extractor
  2. Go to the "Extract strings" tab on the Locale administration interface, select your module and submit the form. You will get one single template file generated.
  3. Then you can translate the strings with a tool like Poedit (http://www.poedit.net).
  4. When you are done, files should be copied to a "translations" sub-folder in the module folder, so they are automatically imported by Drupal when installing your game module.

drush command to force translations loading: drush php-eval "locale_system_update(array('yourmodule_name'));drush_backend_batch_process();"

понедельник, 27 июля 2015 г.

Get Folders Sizes

du -chs ./*



0       ./proc
654M    ./root
232K    ./run
5.6M    ./sbin
4.0K    ./selinux
3.3G    ./sites
4.0K    ./srv
0       ./sys
4.1M    ./tmp
435M    ./usr
860M    ./var
0       ./vmlinuz
13M     ./work

четверг, 4 июня 2015 г.

Microsoft Visual Studio Emulators

Microsoft Visual Studio Emulator for Android :
http://go.microsoft.com/fwlink/?LinkID=530049
or
http://go.microsoft.com/fwlink/?LinkID=532868
190000000
500000000
http://go.microsoft.com/fwlink/?LinkID=517148


Emulators for Windows Mobile 10.0.10069
http://go.microsoft.com/fwlink/?LinkID=532802
 1084376
 2026385408

%programfiles(x86)%\Windows Kits\10\Emulation\Mobile\10.0.1.0\flash.vhd


http://codeshake.net/use-visual-studio-android-emulator-android-studio/


ToolsForWin81_WP80_WP81
WindowsPhone81Emulators

среда, 6 мая 2015 г.

Druapl 7 locale DOMAIN with Port

change includes/locale.inc

function locale_language_url_rewrite_url(&$path, &$options) {
  static $drupal_static_fast;
  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['languages'] = &drupal_static(__FUNCTION__);
  }
  $languages = &$drupal_static_fast['languages'];

  if (!isset($languages)) {
    $languages = language_list('enabled');
    $languages = array_flip(array_keys($languages[1]));
  }

  // Language can be passed as an option, or we go for current URL language.
  if (!isset($options['language'])) {
    global $language_url;
    $options['language'] = $language_url;
  }
  // We allow only enabled languages here.
  elseif (!isset($languages[$options['language']->language])) {
    unset($options['language']);
    return;
  }

  if (isset($options['language'])) {
    switch (variable_get('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX)) {
      case LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN:
        if ($options['language']->domain) {
          // Ask for an absolute URL with our modified base_url.
          global $is_https;
          $url_scheme = ($is_https) ? 'https://' : 'http://';
          $options['absolute'] = TRUE;

          // Take the domain without ports or protocols so we can apply the
          // protocol needed. The setting might include a protocol.
          // This is changed in Drupal 8 but we need to keep backwards
          // compatibility for Drupal 7.
          $host = 'http://' . str_replace(array('http://', 'https://'), '', $options['language']->domain);
          $port = parse_url($host, PHP_URL_PORT);
          $host = parse_url($host, PHP_URL_HOST);

          // Apply the appropriate protocol to the URL.
          $options['base_url'] = $url_scheme . $host . ($port?(80==$port?'':':'.$port):'');
          if (isset($options['https']) && variable_get('https', FALSE)) {
            if ($options['https'] === TRUE) {
              $options['base_url'] = str_replace('http://', 'https://', $options['base_url']);
            }
            elseif ($options['https'] === FALSE) {
              $options['base_url'] = str_replace('https://', 'http://', $options['base_url']);
            }
          }
        }
        break;

      case LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX:
        if (!empty($options['language']->prefix)) {
          $options['prefix'] = $options['language']->prefix . '/';
        }
        break;
    }
  }
}

среда, 1 апреля 2015 г.

Clear chrome downloads history using chrome console

var x = document.getElementsByClassName('control-remove-link'); for (i in x){if(x[i].click)
{x[i].click()}}

Chrome 46+
var x = document.getElementsByClassName('remove'); for (i in x){if(x[i].click){x[i].click()}}

пятница, 6 марта 2015 г.

Digger's Blog: BCDBOOT failure when attempting to copy boot files...

Digger's Blog: BCDBOOT failure when attempting to copy boot files...: If you, like me, tried to deploy Windows8 (maybe for 7 is the same) using a wim image and then used the command bcdboot c:\windows and y...

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

Symfony2 Forms and Doctrine Entity: Unique field values validation

Symfony2 Forms and Doctrine Entity: Unique field values validation

If you’re using Symfony2 forms paired with Doctrine entities, you might sometimes need to validate fields so that the values in that field is always unique. Say – “username” field or “email” field. Two users must not have the same username or email.
There is a form validation constraint – “Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity” which integrates nicely with your entity and allows unique values validation when the form is submitted. Let’s look at some code samples to see how it works:
Here, the email and username fields will be checked for duplicate values and the defined message will be displayed if duplicate values are found.

пятница, 16 января 2015 г.

Symfony2 Nginx and Apache2

Nginx Conf

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /PATH_TOSYMFONY_PROJECT/web;

        # Make site accessible from http://localhost/
        server_name localhost;

        location / {
            try_files $uri /app.php$uri$is_args$query_string;
        }

        #
        # Pass (app|app_dev|config).php to apache2
        #
        location ~ ^/(app|app_dev|config)\.php(/|$) {
                #DMZ Only
                #Default Port
                set $_port 80;
                if ($host = EXTERNAL_IP) {
                    set $_port 10880;
                }

                if ($host = INTERNAL_IP) {
                    set $_port 80;
                }
                #End For DMZ
                proxy_pass          http://127.0.0.1:81;
                proxy_set_header    X-Real-IP  $remote_addr;

                proxy_set_header    X-Forwarded-For $remote_addr;
                proxy_set_header    X-Forwarded-Proto $scheme;

                #
                # Нужно для того чтобы симфони могло генерировать урлы без "app.php"
                #
                proxy_set_header    X-Rewrite-URL $request_uri;
                proxy_set_header    X-Original-URL $request_uri;
                proxy_set_header    X-Original-Addr $remote_addr;

                proxy_set_header    Host $host:$_port;

        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
                deny all;
        }
}


Apache2 conf

<VirtualHost *:81>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/PATH_TOSYMFONY_PROJECT/web"
    DirectoryIndex app.php

    <IfModule env_module>
        SetEnv APPLICATION_ENV development
    </IfModule>

    <Directory "/PATH_TOSYMFONY_PROJECT/web">
        AllowOverride None
        Allow from All
        Require all granted
    </Directory>

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

среда, 14 января 2015 г.

Symfony Permissions

One common issue when installing Symfony is that the app/cache and app/logsdirectories must be writable both by the web server and the command line user. On a UNIX system, if your web server user is different from your command line user, you can try one of the following solutions.
1. Use the same user for the CLI and the web server
In development environments, it is a common practice to use the same UNIX user for the CLI and the web server because it avoids any of these permissions issues when setting up new projects. This can be done by editing your web server configuration (e.g. commonly httpd.conf or apache2.conf for Apache) and setting its user to be the same as your CLI user (e.g. for Apache, update the User and Group values).
2. Using ACL on a system that supports chmod +a
Many systems allow you to use the chmod +a command. Try this first, and if you get an error - try the next method. This uses a command to try to determine your web server user and set it as HTTPDUSER:
1
2
3
4
5
6
$ rm -rf app/cache/*
$ rm -rf app/logs/*

$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
3. Using ACL on a system that does not support chmod +a
Some systems don't support chmod +a, but do support another utility called setfacl. You may need to enable ACL support on your partition and install setfacl before using it (as is the case with Ubuntu). This uses a command to try to determine your web server user and set it as HTTPDUSER:
1
2
3
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
If this doesn't work, try adding -n option.
4. Without using ACL
If none of the previous methods work for you, change the umask so that the cache and log directories will be group-writable or world-writable (depending if the web server user and the command line user are in the same group or not). To achieve this, put the following line at the beginning of the app/consoleweb/app.php and web/app_dev.phpfiles:
1
2
3
4
5
umask(0002); // This will let the permissions be 0775

// or

umask(0000); // This will let the permissions be 0777
Note that using the ACL is recommended when you have access to them on your server because changing the umask is not thread-safe.