↓ Skip to main content

Devops

Update all local branches in Git repo

·693 words·4 mins
Update all local branches in Git repo # Issue: The git pull updates just one current branch. In DevOps I am following many Git repos and need to keep up to date for all local branches. git ffwd-update command # Source: http://stackoverflow.com/questions/4318161/can-git-pull-all-update-all-my-local-branches Create file named git-ffwd-update somewhere on the path (in my case ~/bin)

Learning resources for Linux and Command line

·342 words·2 mins
This quick summary to answer Megha Maiya’s question - I am adding to the Wiki in case it can be expanded later useful for somebody else: expanded later useful for somebody else Free resources # There is HUGE amount of resources available for Linux and Unix out there. The issue is select those reasonably good List of lists: https://github.com/learnbyexample/scripting_course/blob/master/Linux_curated_resources.md http://ryanstutorials.net/, specially http://ryanstutorials.net/linuxtutorial/ and http://ryanstutorials.net/linuxtutorial/ http://www.tutorialspoint.com/unix/unix-getting-started.htm (bash scripting) - https://bash.cyberciti.biz/guide/Main_Page free book - http://unixmages.com/ufbm.pdf - very beginner friendly list of free books: http://www.dailyartisan.com/news/open-source-e-books-for-linux/ Eli The computer guy - https://www.youtube.com/playlist?list=PLD6B6473ACF32C59D (I like this one) YouTube channel - ultimate Linux tutorials - https://www.youtube.com/channel/UCn58SGUDUnUHRYKyNffHQrQ (from a generous Indian guy sharing his experience with the world for free. Not ideal audio quality, could use some editing - bot has lots of content) EDX courses - https://www.edx.org/school/linuxfoundationx http://www.tutorialspoint.com/listtutorials/linux/basic-concepts/1 Wikibooks - https://en.wikibooks.org/wiki/LPI_Linux_Certification Hands On # Reading books and watching videos will have very little impact without trying things out.

Native OS-X Docker (Beta) - not quite there yet

·644 words·4 mins
I was intrigued by convenience of using Docker natively on Mac, without dealing with differences localhost != dockerhost, so I subscribed for Beta and installed it. Good news 1 # It can coexist with previous Docker installation (mostly) - see the note at the end. As long as you do not try to run native Docker and docker-machine at the same time, things coexist.

Starting ACC (ATG Control Centre) on OS-X

·102 words·1 min
Copy the installation of ACC for respective version from a Linux VM: The startup script in bin/startClient will fail, because it cannot determine which Java to use to run the app. It is trying to determine Unix flavour, failing that defaults to Solaris and ends up with invalid settings. Fix # Set the variable JAVA_VM to path to executable command on your system.

Git project statistic tool

·756 words·4 mins
Git project statistic tool # Python based, requires Python 2.6+ Works OOTB on Mac Installation # Download TAR from Github unzipped to /opt ➜ ll /opt/gitinspector-0.3.2 total 52K -rw-r--r-- 1 miro 999 Jul 29 2013 DESCRIPTION.txt -rw-r--r-- 1 miro 32K Jun 14 2013 LICENSE.txt -rw-r--r-- 1 miro 78 Jul 2 2013 MANIFEST.in -rw-r--r-- 1 miro 681 Jan 13 2014 README.txt drwxr-xr-x 45 miro 1.5K Mar 20 2015 gitinspector -rw-r--r-- 1 miro 1.9K Jan 14 2014 setup.py -rw-r--r-- 1 miro 110 Jul 27 2013 stdeb.cfg create symlink from ~/bin (or from whatever directory on $PATH) ln -s /opt/gitinspector-0.3.2/gitinspector/gitinspector.py ~/bin/gitinspector.py ➜ ~ ll ~/bin | grep gitin lrwxr-xr-x 1 miro 52 Mar 20 16:06 gitinspector.py -> /opt/gitinspector-0.3.2/gitinspector/gitinspector.py Example # Look at scala sources - git@github.com:scala/scala.git

Fixing docker-machine error after upgrade

·388 words·2 mins
I had to upgrade docker toolbox on Yosemite to get latest docker-compose additions. After installing the new package, I was not able to connect to docker machine: ➜ ~ docker-machine status Stopped ➜ ~ docker-machine start default Starting "default"... (default) Check network to re-create if needed... (default) Waiting for an IP... Machine "default" was started. Waiting for SSH to be available... Detecting the provisioner... Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command. ➜ ~ docker-machine env default Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": tls: DialWithDialer timed out You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'. Be advised that this will trigger a Docker daemon restart which will stop running containers. Regenerating the certificates did not solve the problem. Neither did reboot.

Accessing internal AWS servers directly from Mac

·729 words·4 mins
Motivation for this hack is my unwillingness to suffer the pain of using Windows UI just to access BCC, ACC or other ATG tools requiring non command-line interface. The credit for finding out about approach is blog post by James McOrmond - VPN over SSH - who is using this neat trick from Linux for quite some time. The software mentioned https://github.com/apenwarr/sshuttle supposedly works on OS-X, however, it has not been updated for 4-5 years and would not function for me (OS-X Yosemite).

Docker - getting started

·201 words·1 min
After the reboot # docker version Client: Version: 1.9.1 API version: 1.21 Go version: go1.4.3 Git commit: a34a1d5 Built: Fri Nov 20 17:56:04 UTC 2015 OS/Arch: darwin/amd64 Cannot connect to the Docker daemon. Is the docker daemon running on this host? ➜ gitolite-admin git:(master) docker-machine active No active host found ➜ gitolite-admin git:(master) docker-machine env default Error checking TLS connection: default is not running. Please start it in order to use the connection settings ➜ gitolite-admin git:(master) docker-machine start Error: Expected to get one or more machine names as arguments ➜ gitolite-admin git:(master) docker-machine start default (default) Starting VM... Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command. ➜ gitolite-admin git:(master) docker-machine env default export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/Users/miro/.docker/machine/machines/default" export DOCKER_MACHINE_NAME="default" # Run this command to configure your shell: # eval "$(docker-machine env default)" ➜ gitolite-admin git:(master) eval "$(docker-machine env default)" ➜ gitolite-admin git:(master) docker version Client: Version: 1.9.1 API version: 1.21 Go version: go1.4.3 Git commit: a34a1d5 Built: Fri Nov 20 17:56:04 UTC 2015 OS/Arch: darwin/amd64 Server: Version: 1.9.1 API version: 1.21 Go version: go1.4.3 Git commit: a34a1d5 Built: Fri Nov 20 17:56:04 UTC 2015 OS/Arch: linux/amd64 Useful guide # See https://viget.com/extend/how-to-use-docker-on-os-x-the-missing-guide

Starting ACC in VM

·179 words·1 min
The ACC is installed in default location: ~/ATG/ACC11.1 This does not work OOTB. You must set 2 additional ENV properties cd ~/ATG/ACC11.0 export ACC_HOME=`pwd` export JAVA_VM=/usr/java/jdk1.7.0_51//bin/java bin/startClient & Starting from dyn/admin # The start in separate VM works OK. Start in server VM brings errors message very often complaining of malformed Help URL. The issue is documented here: http://stackoverflow.com/questions/20868244/how-to-fix-malformed-help-url-while-opening-acc-atg - for JBOSS.

How to truncate Git history

·650 words·4 mins
The general idea # #!/bin/bash # Parameter: tag or sha1 git checkout --orphan temp $1 git commit -m "Truncated history" git rebase --onto temp $1 master git branch -D temp Requires Git 1.8+ Works well for mostly linear history (aka Git used for diff-ing of the catalog feeds). How it works # Starting repo (training):