Author: admin

  • Vagrant error Failed to mount folders in Linux guest “vboxsf” file system is not available

    Error when ‘vagrant up’:

    Failed to mount folders in Linux guest. This is usually because
    the “vboxsf” file system is not available. Please verify that
    the guest additions are properly installed in the guest and
    can work properly. The command attempted was:

    mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`
    SSH /SSH
    mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` SSH /SSH

    The error output from the last command was: /sbin/mount.vboxsf: mounting failed with the error: No such device

    Solution:

    vagrant plugin install vagrant-vbguest

    vagrant up

  • google-chrome symbol lookup error undefined symbol: gtk_widget_get_scale_factor

    Error:

    google-chrome-stable: symbol lookup error: /usr/bin/google-chrome-stable: undefined symbol: gtk_widget_get_scale_factor

    Solution:

    yum update
    yum install gtk3-devel

    apt-get update
    apt-get install gtk3-devel

     

  • Increase upload size in your php.ini

    Drupal’s limits on upload file size are determined by your server’s PHP settings (as well as Drupal specified settings that can be set at Admin > Site Configuration > File Upload). The default values for PHP will restrict you to a maximum 2 MB upload file size.

    On the settings page for the upload module, Drupal calculates and displays the maximum file size that you can set based upon two PHP settings: ‘post_max_size’ and ‘upload_max_filesize’. Since ‘post_max_size’ is the limit for all the content of your post, many people choose ‘post_max_size’ to be a multiple of ‘upload_max_filesize’ to allow multiple files to be uploaded, but this is not essential. The upload module limits the size of a single attachment to be less than either post_max_size, or upload_max_filesize, whichever is smaller. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.

    Depending on your host, changing these two PHP variables can be done in a number of places with the most likely being php.ini or .htaccess (depending on your hosting situation).

    For example, to increase the limit on uploaded files to 10 MB:

    • Add the below to the relevant php.ini file (recommended, if you have access). Note that for some hosts this is a system-wide setting. However, for hosts running PHP as a CGI script with suexec (for example) you may be able to put these directives in a php.ini file in your Drupal root directory.
      • upload_max_filesize = 10M
      • post_max_size = 10M
    • Add the below to your .htaccess file in your Drupal root directory.
      • php_value upload_max_filesize 10M
      • php_value post_max_size 10M

    The PHP documentation states that the memory_limit setting also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size. If this is an issue, see the page on how to Increase memory available to PHP (3 methods)

    Drupal also allows/enforces its own size limits, independently of what PHP allows. These are found in Drupal 6 at “Administer » Site configuration » File uploads” ( /admin/settings/uploads ). In Drupal 7 size limit is controlled on per-field basis. The Drupal settings cannot be larger than those permitted by PHP, but may be smaller if you haven’t updated them, so remember to check there also, after updating the php.ini.

    Increasing PHP upload size is different from increasing PHP memory limit. You can learn to increase memory limit here.

  • npm ERR! git clone git:// fatal: unable to connect to github.com

    Error when running npm install behind a proxy

    npm ERR! git clone git:// fatal: unable to connect to github.com

    Workaround:

    1. Configure git to use https for github

    git config –global url.https://github.com/.insteadOf git://github.com/

    2. Configure npm to use proxy:

    npm config set https-proxy http://proxy:port
    npm config set proxy http://proxy:port

  • PHP install Error: xml2-config not found. Please check your libxml2

    Soultion:

    Ubuntu

    sudo apt-get install libxml2-dev

    Centos:

    sudo yum install libxml2-devel

  • ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

    By default, MySQL try to connect localhost using Unix socket if there is no -h option or -h localhost:

    mysql
    mysql -h localhost

    Force MySQL to use tcp connect instead of unit socket:

    mysql -h 127.0.0.1

  • Force redirect to HTTPS

    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}

  • Git Pull is not possible because you have unmerged files

    Git Error: Unmerged path path/file.php, cannot checkout or pull

    Solution: reset, then checkout

    git reset path/file.php
    git checkout path/file.php

  • Laravel Lumen Fatal error: Class ‘Illuminate\Redis\RedisServiceProvider’ not found

    Error message:

    Fatal error: Class ‘Illuminate\Redis\RedisServiceProvider’ not found in /vendor/laravel/lumen-framework/src/Application.php on line 219

    Solution:

    composer require illuminate/redis

  • Splunk max min avg group by date

    Data:
    _time Value
    11/24/13 10:00:00 8
    11/25/13 10:01:00 6
    11/26/13 10:02:00 4

    Query:
    … | rename _time as Date | convert timeformat=”%F” ctime(Date) | stats max(Value) as Max, min(Value) as Min, avg(Value) as Avg by Date