Category: IT

  • In-place text editing in Chrome or Edge

    Right-click, inspect, then from the console tab:

    document.body.contentEditable=true
  • How to view Pages Feed on Facebook

    Facebook removed the Pages Feed link from the Business Manager sidebar in December 2018. You can still find it at:

    https://www.facebook.com/pagename/pages_feed/

    This shows your page as it would appear to a casual Facebook user. It actually takes some time to return the content, possibly because Facebook are deprecating the Pages Feed and so it isn’t cached.

    For example the Wye View pages feed would be:

    https://www.facebook.com/wyeview/pages_feed/

  • Magento Connect Manager – Access is locked. Please try again in a few minutes

    This is an indication that the site has been subject to a brute-force login attack, specifically on the Connect Manager (downloader) login.

    var/brute-force.ini should look something like this:

    brute-force-bad-attempts-count = 0
    brute-force-diff-time-to-attempt = 180
    brute-force-attempts-count = 3

    Any value for brute-force-bad-attempts-count > brute-force-attempts-count will result in the above error.

    Solution: edit the file to set the count back to zero, and remember to rename the downloader directory to something less obvious when not in use.

  • See All Failed or Successful SSH Login Attempts

    To list all failed SSH login attempts:

     cat /var/log/secure | grep 'sshd.*Failed'

    To list all successful SSH login attemps:

     cat /var/log/secure | grep 'sshd.*opened'
  • Error 500 applying upgrades in Magento Downloader

    Inspecting the error log, the 500 error embedded in the downloader console is the result of a php timeout:

    mod_fcgid: read data timeout in 45 seconds, referer: https://www.<omitted>
    (110)Connection timed out: mod_fcgid: ap_pass_brigade failed in  handle_request_ipc function, referer: https://www.

    According to Plesk Article ID: 127621, FcgidIOTimeout should be the same as PHP’s max_execution_time unless the latter is set to 0.

    From Plesk 12.5 control panel for a domain use Apache & nginx Settings to add the following directive to both http and https, which increases the FcgidIOTimeout from 45 to 120 seconds :

    <IfModule mod_fcgid.c>
        FcgidIOTimeout 120
    </IfModule>

    Simply OK this and re-run the Magento Downloader again.

    Note: at the time of writing the Magneto Connect site is very slow, which may be the cause of this timeout.

  • What is consuming my inodes?

    To find how many inodes are in use & available, you would issue the command:

    df -i

    but to find out the top ten directories consuming inodes issue the following from root:

    for i in `ls -1A | grep -v "\.\./" | grep -v "\./"`; do echo "`find $i | sort -u | wc -l` $i"; done | sort -rn | head -10
  • After upgrade to Magento Downloader to 1.9.2 no upgrades are available

    Following an upgrade to Magento Downloader 1.9.2 I found that the Magento Connect (Downloader) “check for upgrades” returned nothing (quickly) and the mage upgrade community [package name] gave the following error:
    Error:
    upgrade: Package community/[package name] failed: Unknown cipher in list: TLSv1
    This is caused by the OpenSSL library being out of date, so either update it, or comment out line 377 in downloader/lib/Mage/HTTP/Client/Curl.php like so:
    //$this->curlOption(CURLOPT_SSL_CIPHER_LIST, ‘TLSv1’)

    Adendum: for 1.9.3.2 and 1.9.3.3 the fix is different:

    in /downloader/lib/Mage/HTTP/Client/Curl.php line 371

    change:
    protected function makeRequest($method, $uri, $params = array(), $isAuthorizationRequired = false, $https = true)

    to:
    protected function makeRequest($method, $uri, $params = array(), $isAuthorizationRequired = false, $https = false)

    (Changing the connection method to HTTP in Magento Connect Manager does NOT work.)
    If the downloader is itself updated, this “fix” will need to be repeated.

  • Outlook Send/Receive error: 0x800CCC13 on Windows 10

    I got Send/Receive error: 0x800CCC13 on one IMAP mailbox when doing a Send & Receive on a fresh Windows 10 installation. The full error text is:
    Error message: ‘Robert – Sending’ reported error (0x800CCC13): ‘Cannot connect to the network. Verify your network connection or modem’
    Which is a little odd, when other IMAP mailboxes are working OK as part of the same Send & Receive.
    The solution is a system file scan & repair; from the command prompt run
    sfc /scannow
    Which just takes a few minutes to complete and resolves the problem.

  • Can’t receive Gmail messages on Plesk domains

    Google’s response to the Poodle email vulnerability seems to be to send using TLS where the server is properly configured, but queue messages where it isn’t. So to enable email receipt we need to tell qmail SMTP which encryption to use, and provide it with a valid certificate.

    Plesk supports SSL certificates, obviously, but also has a self-certified certificate for use with the control panel. This can be used for SMTP.

    Either for qmail:
    cp /usr/local/psa/admin/conf/httpsd.pem /var/qmail/control/servercert.pem
    or Postfix:
    cp /usr/local/psa/admin/conf/httpsd.pem /etc/postfix/postfix_default.pem

    IMAP:
    cp /usr/local/psa/admin/conf/httpsd.pem /usr/share/imapd.pem
    POP3:
    cp /usr/local/psa/admin/conf/httpsd.pem /usr/share/pop3d.pem

    And to make sure the certificate is used, create the TLS cipher rule files:
    openssl ciphers > /var/qmail/control/tlsserverciphers
    openssl ciphers > /var/qmail/control/tlsclientciphers

    (servercert.pem tlsserverciphers and tlsclientciphers were all empty in my installation)

    It may also be worth checking the integrity of the qmail installation:
    /usr/local/psa/admin/sbin/mchk

  • Finding big files in Unix

    Assuming Perl is running on the server, this is quite neat:
    find / -mount -noleaf -type f -size +10000k -print0 | xargs -0 ls -lhSr | perl -ne '/(\S+\s+){4}(\S+)\s+(\S+\s+){3}(.*)/ and printf("%*s %s\n",7,$2.":",$4);'