Showing posts from 2017

Multiple SSH Keys settings for different github accounts

Say you have two keys. Add these two keys as following to ssh agent running on your local machine: $ ssh-add ~/.ssh/id_rsa_hacker $ ssh-add ~/.ssh/id_rsa_exchan You can check your saved keys $ ssh-add -l Sample ssh config settings, uses aliases in first line of blocks Host github-hacker HostName User git IdentityFile ~/.ssh/id_rsa_hacker Host github-exchan HostName User git IdentityFile ~/.ssh/id_rsa_exchan then use normal flow to push your code git clone set remote host from the default ( to match alias in the ssh config git remote set-url origin git@github-hacker:hacker/myrepo.git you can see the change in .git/config file if you look carefully
git add . git commit -m "your comments" git push

Docker training on Mac, 001

Take these steps, and, afterwards, try to understand how and why they worked, including flags/options "passed into" the command.
install Docker for Macverify installdocker --versionrun basic container testdocker run hello-worldinstall iTerm2open a terminal window and split horizontally, then closeopen a terminal window and split vertically, then closerun webserveropen a terminal window and split horizontalin bottom pane, run: watch -d -n7 docker ps -aas you take steps below, watch what changes occur in this windowin top window, run:docker run -d -p 8080:80 --name mywebserver001 nginxopen this in your web browserhttp://localhost:8080shut it downdocker stop mywebserver001docker rm mywebserver001

Linux boot process

There seems to be a strong interest when interviewing in this process.

biosstands for: basic input / output systemdoes system integrity checksfind and runs MBR boot loader programmbrlocated on first sector of bootable diskunder 512 bytes, 3 partsprimary boot loader info (446 bytes)disk partition info (64 bytes)mbr validation check (last 2 bytes)contains info on GRUBsummary: loads and exec GRUBgrubkernelinitrunlevel

System Services Migrating from Operations Teams to The Cloud

Done, or in process to some degree.
system installsdisk formattingvolume managementdatabase replicationmonitoring toolsservice start / stopservice start / stop scriptsbackup automation

fizzbuzz in ruby

#!/usr/bin/env ruby (1..100).each do |num| three = (num % 3 == 0) five = (num % 5 == 0) print 'fizz' if three print 'buzz' if five print num if (!three and !five) puts end

Docker: simple example, fast

See github link for instructions on how to run.
docker-compose.ymlversion: '2' services: app: build: context: ./ dockerfile: app.docker ports: - "80:80" app.dockerFROM silintl/ubuntu:16.04 RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections RUN apt-get update RUN apt-get install -y apache2 WORKDIR /var/www/humankind RUN echo " \n\ \n\ ServerName humankind \n\ DocumentRoot /var/www/humankind \n\ \n\ " >> /etc/apache2/sites-available/humankind.conf RUN a2dissite 000-default.conf && a2ensite humankind.conf RUN echo "Automation for the People" > /var/www/humankind/index.html EXPOSE 80 CMD ["apache2ctl", "-D", "FOREGROUND"]