Google Apps Review blocked sign-in attempt problem and solution

When using SMTP Pro’s Self Test function against our development Google Apps inbox, I noticed it repeatedly blocked outgoing emails, with the slightly cryptic error “5.7.14 Please log in via your web browser and 5.7.14 then try again” I logged into the inbox to find an email with the subject “Review blocked sign-in attempt” telling me I was using “an app that doesn’t meet modern security standards”. I’m not sure what these modern security standards are (it talks about them here) but lo and behold all of Google’s apps are apparently compliant. Read On →

Magento 2 - Creating a New Blank Template Block

If you want to insert some custom HTML into a page in Magento 2, you’ll need to add some layout XML and a template file. The equivalent in Magento 1 is a <block type="core/template" template="path/to/template.phtml" name="block_name" /> In Magento 2 you achieve this by adding a <container> in your default.xml (or other layout file) with the following: <referenceContainer name="container_name"> <!-- the name of the container you want to insert into --> <container name="new_container" htmlClass="container_css_class" htmlTag="div"> <block class="Magento\Framework\View\Element\Template" template="Magento_Theme::path/to/template.phtml" name="block_name" /> </container> </referenceContainer> Then create a template in app/design/frontend/<your_vendor>/<your_theme>/Magento_Theme/path/to/template.phtml Remember to flush all caches.

Php Cli Progress Bar

I’ve been doing a lot of data manipulation on the command line recently, and one of bugbears that I ran into was that my commands gave no indication of how long they were going to take to complete. Sick and tired of just looking at the blank screen I put together a small progress bar class that can be used indicate how many items have been processed. class ProgressBar { protected $_spinners = ['|', '/', '-', '\\', '|', '/', '-', '\\']; /** * This is used to echo the progress of a task on the command line. Read On →

'command failed: tar' when running 'npm install phantomjs'

As part of installing phantomjs when buoilding a development environment for Magento 2 I encountered a problem where it failed to install. The error presented to me was Error: Command failed: tar jxf /usr/lib/node_modules/phantomjs/phantomjs/phantomjs-{version}.tar.bz2 I was able to run tar, and tar was in my $PATH, so I was confused about the problem. Turns out because the file was a bzip one, it was trying to execute bzip2 within tar, hence why it seemed like tar was failing. Read On →

Lxc Bash Completion For Fedora

LXC is great, I’m really loving it. However I also love Fedora and work almost exclusively in the Red Hat, Centos, Fedora ecosphere - so the Ubuntu centric nature of LXC is sometimes a bit of a hindrance. One thing is that the LXC implementation on Ubuntu and Fedora differs in how the commands are run, eg Ubuntu: lxc start -n containerName and Fedora: lxc-start -n containerName This means that I can’t easily use the LXC bash completion I found here I love bash completion, it’s awesome and really quite easy to get working Here is something quick I threw together for working with LXC on Fedora: #!/usr/bin/env bash _lxc-containers(){ local cur local -a toks cur="${COMP_WORDS[COMP_CWORD]}" toks=( $( ls /var/lib/lxc | grep "$cur" )) COMPREPLY=( "${toks[@]}" ) return 0 } complete -F _lxc-containers -o nospace lxc-start complete -F _lxc-containers -o nospace lxc-stop complete -F _lxc-containers -o nospace lxc-attach I also use the following aliases to make life a bit easier: alias lxc-start="sudo lxc-start -n " alias lxc-stop="sudo lxc-stop -n " alias lxc-attach="sudo lxc-attach -n " And now if I add both of the above to my ~/.bashrc file, I get completion on start, stop and attach. Read On →

Fedora 24 Lxc Multiple /dev/pts Instances: Missing

If you are finding that when you run lxc-checkconfig then you will probably get output like: Kernel configuration not found at /proc/config.gz; searching... Kernel configuration found at /boot/config-4.7.3-200.fc24.x86_64 --- Namespaces --- Namespaces: enabled Utsname namespace: enabled Ipc namespace: enabled Pid namespace: enabled User namespace: enabled Network namespace: enabled Multiple /dev/pts instances: missing --- Control groups --- Cgroup: enabled Cgroup clone_children flag: enabled Cgroup device: enabled Cgroup sched: enabled Cgroup cpu account: enabled Cgroup memory controller: enabled Cgroup cpuset: enabled --- Misc --- Veth pair device: enabled Macvlan: enabled Vlan: enabled Bridges: enabled Advanced netfilter: enabled CONFIG_NF_NAT_IPV4: enabled CONFIG_NF_NAT_IPV6: enabled CONFIG_IP_NF_TARGET_MASQUERADE: enabled CONFIG_IP6_NF_TARGET_MASQUERADE: enabled CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled FUSE (for use with lxcfs): enabled --- Checkpoint/Restore --- checkpoint restore: enabled CONFIG_FHANDLE: enabled CONFIG_EVENTFD: enabled CONFIG_EPOLL: enabled CONFIG_UNIX_DIAG: enabled CONFIG_INET_DIAG: enabled CONFIG_PACKET_DIAG: enabled CONFIG_NETLINK_DIAG: enabled File capabilities: enabled Note : Before booting a new kernel, you can check its configuration usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig The good news is that the error about dev/pts is a false alarm. Read On →