June 17, 2019

[SOLVED] Increase playback speed of online videos (e.g. Vimeo)


  1. Go to your video URL
  2. Open developer console (e.g. F12)
  3. Paste document.getElementsByTagName('video')[0].playbackRate = 1.5;
  4. Hit <Enter>

October 16, 2018

[SOLVED] Inject angularjs on elements added by innerHTML (e.g. magento 1.9 checkout)


function injectIbanValidation() {

    var ibanPlaceholder = document.getElementById('iban_placeholder');

    var ibanInput = '<input type="text" ng-model="iban" ng-iban/>';

    //emulate html injection in    ibanPlaceholder.innerHTML = ibanInput;

    var ibanElement = ibanPlaceholder.querySelector('input');

    /**     * inject angular component magic     */    var $injector = angular.injector(['ng', 'mpb.app', ['$provide', function($provide) {
        var $rootElement = angular.element(document.querySelector('body'));
        console.log('$rootElement', $rootElement);
        $provide.value('$rootElement', $rootElement);
    }]]);

    if (ibanInput) {
        $injector.invoke(['$rootScope', '$compile', function($rootScope, $compile) {
            console.log('invoke', $rootScope, $compile);
            $compile(angular.element(ibanInput))($rootScope);
        }])
    }

}

August 27, 2018

[SOLVED] Update google Cloud DNS A record to your local IP via bash



UpdateARecord.sh

#!/usr/bin/env bash
echo "My public IP:$(curl -s ipinfo.io/ip)"
ZONE_NAME='example-com'DOMAIN_NAME='somefacysubdomain.example.com.'

gcloud dns record-sets transaction abort -z=$ZONE_NAME
gcloud dns record-sets transaction start -z=$ZONE_NAME

#show current A record
gcloud dns record-sets list --zone $ZONE_NAME --name "$DOMAIN_NAME" --type=A

#remove old record
OLD_IP=$(gcloud dns record-sets list --zone $ZONE_NAME --name "$DOMAIN_NAME" --type=A | sed -n 2p | awk '{print $4}')
gcloud dns record-sets transaction remove -z=$ZONE_NAME \
   --name="$DOMAIN_NAME" \
   --type=A \
   --ttl=300 "$OLD_IP"

#add new record
gcloud dns record-sets transaction add -z=$ZONE_NAME \
   --name="$DOMAIN_NAME" \
   --type=A \
   --ttl=300 "$(curl -s ipinfo.io/ip)"

#check incoming changes
gcloud dns record-sets transaction describe -z=$ZONE_NAME

#make changes
gcloud dns record-sets transaction execute -z=$ZONE_NAME


#display updated DNS records
gcloud dns record-sets list --zone $ZONE_NAME

[SOLVED] magento package.xml to modman



https://gist.github.com/printminion/36bf4a948ac7e2faa23c

March 14, 2018

[SOLVED] Fatal error: Class 'Mage_Adminhtml_Helper_Help_Mapping' not found

After magento upgrade getting an error
Fatal error: Class 'Mage_Adminhtml_Helper_Help_Mapping' not found Solution: set proper rights to the parent folder app/code/core/Mage/Adminhtml/Helper/Help chmod a+x app/code/core/Mage/Adminhtml/Helper/Help chmod a+r app/code/core/Mage/Adminhtml/Helper/Help

February 28, 2018

[SOLVED] mysql identify big tables

mysql identify big tables
SELECT table_schema as `Database`, table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC;

November 22, 2017

[SOLVED][gitlab-ci-multirunner] Cannot connect to the Docker daemon at unix:///var/run/docker.sock




Two errors you can fix like that

#1 set privileged = true

2017-11-21T15:17:26.802822881Z mount: permission denied (are you root?)
2017-11-21T15:17:26.803090353Z Could not mount /sys/kernel/security.
2017-11-21T15:17:26.803107368Z AppArmor detection and --privileged mode might break.
2017-11-21T15:17:26.806984781Z mount: permission denied (are you root?)


#2 Mount /var/run/docker.sock as a volume

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?




/etc/gitlab-runner/config.toml


concurrent = 4
check_interval = 0

[[runners]]
  limit = 4
  name = "fancy name"
  url = "https://www.gitlab.com"
  token = "secret token"
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = "alpine:3.4"
    privileged = true
    disable_cache = false
    volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]
  [runners.cache]
    Insecure = false