Docker credentials location

To see/manage your current login and other info, data is normally stored in:
~/.docker/config.json

Docker copy text file with exec

Copy a file via docker exec feature to work with running container:

docker exec -it <container_id> bash -c \
    'cat > /path/to/container/file' < /path/to/host/file/

thanks Mikl

Rackspace cloud server – create swap file

Most Rackspace cloud servers now have swap off by default and while it’s not a good idea to use it a lot, you also don’t want ugly stuff to happen once you get close to the physical memory limit, so in some cases, it’s good to allow for some swap. You can set a memory alert so you know how often you are using it and make changes as required.

see: http://www.rackspace.com/knowledge_center/article/create-a-linux-swap-file

sudo fallocate -l 1G /mnt/1GB.swap
 
# OR #
 
sudo dd if=/dev/zero of=/mnt/1GB.swap bs=1024 count=1048576
 
 
sudo mkswap /mnt/1GB.swap
sudo swapon /mnt/1GB.swap
 
# Add this line to the end of /etc/fstab to make the change permanent:
# 
sudo echo '/mnt/1GB.swap  none  swap  sw 0  0' >> /etc/fstab
 
 
# To change the swappiness value edit /etc/sysctl.conf and add/EDIT the following line.
# vm.swappiness=10
 
 
# Check that the swap file was created.
sudo swapon -s
 
# Reboot the server to ensure that the changes go into effect:
/sbin/shutdown -r now

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: cyberciti.biz/faq/ram-size-linux/

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

« Previous Entries