Skip to content

Instantly share code, notes, and snippets.

@innyso
innyso / docker-machine-tls.md
Last active December 21, 2015 01:11
Enable tls for docker-machine
  1. Add cert to /var/lib/boot2docker/certs/ so that it wont be remove everytime we restart docker-machine
  2. create dir sudo mkdir -p /etc/docker/certs.d/<registry-name>
  3. create sudo ln -s /var/lib/boot2docker/certs/<registry-name>/ca.crt /etc/docker/certs.d/<registry-name>/
  4. restart docker sudo /etc/init.d/docker restart

reference

@innyso
innyso / linux_check_user_exist.md
Last active May 3, 2020 12:10
#linux #cmd #usermangement

check user exist

id <username>

or

grep /etc/passwd

@innyso
innyso / puppet_create_resource_checklist.md
Last active December 23, 2015 11:56
puppet create_resources checklist
  1. make sure the hiera value has the following structure
users:
  mary:
    group: admin
    alias: m123
  mark:
    group: user
    alias: m456
@innyso
innyso / docker_remove_all_none_images.md
Last active May 9, 2020 11:54
#docker #cmd #remove #images

Remove all images

docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi
@innyso
innyso / docker_remove_all_containers.md
Last active May 9, 2020 11:55
#docker #cmd #containers #remove

Remove all docker containers

docker ps -a | sed '1d' | awk '{print $1}' | xargs docker rm
@innyso
innyso / ruby_object_methods.md
Created January 5, 2016 05:55
print method for ruby object
object_name.methods
object_name.inspect
@innyso
innyso / yum_show_all_version.md
Last active May 9, 2020 12:02
#linux #yum #package #show #versions

Get all version for a particular package in yum

yum --showduplicates list <package name> | expand
@innyso
innyso / escape_percentage_hiera.md
Last active May 16, 2020 05:29
#hiera #escape #percentage

In hiera, when encounter a percentage symbol, it will try to interpolate it. In order to stop it from happening, make sure you quote the value

TIME_FORMAT: '%d/%m/%Y %H:%M:%S'
@innyso
innyso / splunk_config_table.md
Created January 29, 2016 00:52
Useful table for splunk configuration
@innyso
innyso / setting_up_ssh_keys.md
Last active May 9, 2020 11:52
#ssh #setup #config

This is something that I do all the time but I always get it wrong....

  • Navigate to ~/.ssh/

  • Run below command and follow the prompt

ssh-keygen -t rsa
  • Make sure the permission are as follow