I use my smartphone regularly to login on servers of mine with SSH. This works really well, but obviously you have less width than with a normal computer screen.

Some tools, like w, will not work with this limited width and give you a message like 

w: 60 column window is too narrow

Being a sysadmin, I don’t like to be told something just can’t work. So, a little trick to make it work:

 w | cat

This will have w output it’s text through stdout to cat and cat just outputs the text to the console, no questions asked.

Yesterday I have installed Ubuntu 16.04 LTS on my laptop to try it out.
While overall the experience is quite good, I found that notifications were broken for apps like slack and atom.
Following the issue found on github, I have found the following workaround to work for me:

Add the following line to /etc/environment ( edit as root ) and reboot ( or logout and login )


Here’s how I managed to install the memcached module for php 7.0 running on a server running CentOS with DirectAdmin.

Install the remi repo and install the latest version of memcached and libmemcached

yum -y install http://rpms.remirepo.net/enterprise/remi-release-$(awk -F 'release ' '{print $2}' /etc/system-release| head -c 1).rpm
yum --enablerepo remi install memcached libmemcached-last libmemcached-last-devel git

Now configure and install the memcached extension:

cd ~
git clone https://github.com/php-memcached-dev/php-memcached.git
cd php-memcached
git checkout php7
./configure --disable-memcached-sasl --with-php-config=/usr/local/php70/bin/php-config
sudo make install

Add the extension to the php config:

echo "extension=memcached.so" | sudo tee /usr/local/php70/lib/php.conf.d/60-memcached.ini

And finally, restart php-fpm:

service php-fpm70 restart

Or if you run mod_php:

service httpd restart

I have a system running several docker containers with httpd, mariadb and redis. The httpd containers are running with names like ‘site1tld_httpd_1’.
Each httpd container writes the access_log and error_log to a host volume in /srv/volumes/<vhost>/httpd/logs . Just easy to have them accessible.

For these containers, I needed to run logrotate to keep those files from getting too large. Of course, these docker containers just run httpd as pid 1 and do not have logrotate installed.
The solution for me was to have logrotate on the host rotate every log, and then reload every docker container running httpd. A httpd reload is just done by sending a kill signal 1 to the httpd process.

This is done as follows ( a file in /etc/logrotate.d ):

/srv/volumes/*/httpd/logs/*log {
  rotate 7
    docker ps -f name=httpd -q | xargs docker kill -s 1 >/dev/null 2>&1

So the postrotate section is simple but effective: give me the ids of docker containers with “httpd” in the name and feed those ids to docker kill and use signal 1 to notify each process.