Add local Node JS module to CLI path

To run a local Node module as if it was installed globally, add this to your login profile (or set up a script to run/reset as needed):

export PATH=$PATH:./node_modules/.bin

Linux memory usage command

cat /proc/meminfo

particularly useful in cases where you can’t use top.

more see:

Docker: fix for “Cannot connect to the Docker daemon”

Mac OS X (or similar VM’d docker environment) if your docker command stops working, check that it indeed works inside boot2docker, and if so, then run:

sudo route -nv add -net 192.168.59 -interface vboxnet1

Docker search retrieve tag info

Docker CLI doesn’t show all tags for images, you can use the Docker API to search and retrieve tag names, then use that tag to pull the specific image.

curl | python -mjson.tool

CentOS 7 / RHEL firewalld settings

CentOS 7 has adopted firelwalld by default over the previous iptables, which will require some new steps to configure your firewall:

# new CentOS/RHEL 7 Firewall: 
	(see )
# create a new service e.g. for webmin:
$ cat /etc/firewalld/services/webmin.xml 
<?xml version="1.0" encoding="utf-8"?>
  <description>Server admin service. Do not leave running.</description>
  <port protocol="tcp" port="10000"/>
# add service to zone:
nano /etc/firewalld/zones/public.xml 
# OR
$ firewall-cmd --permanent --zone=public --add-service=webmin
# reload to add:
$ firewall-cmd --reload
# check:
$ firewall-cmd --zone=public --list-all
## apache / httpd:
$ firewall-cmd --permanent --add-service=http
$ firewall-cmd --permanent --add-service=https
$ systemctl restart firewalld

## more info: see:

Show Apache / httpd memory usage and process size

ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'

thanks S.G. Vulcan

« Previous Entries