↓ Skip to main content

Posts

2014

Tutorial on Elastic

·1677 words·8 mins
Running elastic # (see Elastic search and Kibana - getting started) Use case: building a employee directory for Megacorp each document - type of ’employee' everything in megacorp index Populating # # Delete the `megacorp` index in case it already exists DELETE /megacorp # Index document 1, type "employee", in the # "megacorp" index PUT /megacorp/employee/1 { "first_name" : "John", "last_name" : "Smith", "age" : 25, "about" : "I love to go rock climbing", "interests": [ "sports", "music" ] } # Index two more documents PUT /megacorp/employee/2 { "first_name" : "Jane", "last_name" : "Smith", "age" : 32, "about" : "I like to collect rock albums", "interests": [ "music" ] } PUT /megacorp/employee/3 { "first_name" : "Douglas", "last_name" : "Fir", "age" : 35, "about": "I like to build cabinets", "interests": [ "forestry" ] } In server

Elastic search and Kibana - getting started

·604 words·3 mins
#Installation: See curl -L -O http://download.elasticsearch.org/PATH/TO/VERSION.zip unzip elasticsearch-$VERSION.zip cd elasticsearch-$VERSION Marvel is management plugin - console about cluster. Install: ./bin/plugin -i elasticsearch/marvel/latest # disable data collection for local cluster echo 'marvel.agent.enabled: false' >> ./config/elasticsearch.yml Test # Startup log: ➜ elasticsearch-1.3.2 bin/elasticsearch [2014-08-27 11:17:08,325][INFO ][node ] [Joe Fixit] version[1.3.2], pid[59610], build[dee175d/2014-08-13T14:29:30Z] [2014-08-27 11:17:08,325][INFO ][node ] [Joe Fixit] initializing ... [2014-08-27 11:17:08,338][INFO ][plugins ] [Joe Fixit] loaded [marvel], sites [marvel, kopf] [2014-08-27 11:17:10,905][INFO ][marvel.agent ] [Joe Fixit] collecting disabled by settings [2014-08-27 11:17:11,020][INFO ][node ] [Joe Fixit] initialized [2014-08-27 11:17:11,021][INFO ][node ] [Joe Fixit] starting ... [2014-08-27 11:17:11,131][INFO ][transport ] [Joe Fixit] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.179.121:9300]} [2014-08-27 11:17:11,148][INFO ][discovery ] [Joe Fixit] elasticsearch/nNgRXlHARHCPutTq7dZXWg [2014-08-27 11:17:14,160][INFO ][cluster.service ] [Joe Fixit] new_master [Joe Fixit][nNgRXlHARHCPutTq7dZXWg][Miros-MacBook-Pro-2.local][inet[/192.168.179.121:9300]], reason: zen-disco-join (elected_as_master) [2014-08-27 11:17:14,181][INFO ][http ] [Joe Fixit] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.179.121:9200]} [2014-08-27 11:17:14,181][INFO ][node ] [Joe Fixit] started [2014-08-27 11:17:14,726][INFO ][gateway ] [Joe Fixit] recovered [4] indices into cluster_state [2014-08-27 11:18:00,491][INFO ][cluster.service ] [Joe Fixit] added {[logstash-Miros-MacBook-Pro-2.local-59618-4086][Eh5YjUFxSIWIn4xK45xu0w][Miros-MacBook-Pro-2.local][inet[/192.168.179.121:9301]]{client=true, data=false},}, reason: zen-disco-receive(join from node[[logstash-Miros-MacBook-Pro-2.local-59618-4086][Eh5YjUFxSIWIn4xK45xu0w][Miros-MacBook-Pro-2.local][inet[/192.168.179.121:9301]]{client=true, data=false}]) Installed some pluggins - marvel, kopf ... ➜ ~ curl 'http://localhost:9200/?pretty' { "status" : 200, "name" : "Sea Urchin", "version" : { "number" : "1.3.2", "build_hash" : "dee175dbe2f254f3f26992f5d7591939aaefd12f", "build_timestamp" : "2014-08-13T14:29:30Z", "build_snapshot" : false, "lucene_version" : "4.9" }, "tagline" : "You Know, for Search" } The sense console allows to avoid using curl and do it from browser: - <http://localhost:9200/_plugin/marvel/sense/ >

Finding out the class in ATG installation

·845 words·4 mins
Java approach # Use the real time search with this JAR - https://jarscan.com/ ➜ scripts git:(authoring) ✗ java -jar ~/bin/jarscan.jar ========================= JarScan written by Geoff Yaworski gyaworski@hotmail.com Version 2.0 ========================= Usage: java -jar jarscan.jar [-help | /?] [-dir directory name] [-zip] [-showProgress] <-files | -class | -package> <search string 1> [search string 2] [search string n] Help: -help or /? Displays this message. -dir The directory to start searching from default is "." -zip Also search Zip files -showProgress Show a running count of files read in -files or -class Search for a file or Java class contained in some library. i.e. HttpServlet -package Search for a Java package contained in some library. i.e. javax.servlet.http search string The file or package to search for. i.e. see examples above example

Third time is a charm

·364 words·2 mins
As part of “back to basics” software minimalism movement, I have exported the old Wordpress blog and loaded it into Jekyll with intention to publish it on my Github This contains almost 10 years worth of history of my posts, plus few not yet previously unpublished posts. It is based on Jekyll Clean theme, created by Scott Emmons - see it / get it from github. If you are interested in the Jekyll Clean theme:

ATG Groovy TDD

·63 words·1 min
Got it working. It is a bit rough around the edges, but functional. The two components http://localhost:8080/dyn/admin/nucleus/thinkwrap/twatg/script/GroovyDemoScript/ http://localhost:8080/dyn/admin/nucleus/thinkwrap/twatg/script/GroovyScriptRunner/ The are not started via Initial, but that is not a problem. The script tested: class ThatsGroovyDude implements com.thinkwrap.twatg.script.RunnableScript { atg.nucleus.Nucleus nuc = atg.nucleus.Nucleus.getGlobalNucleus(); public String run() { String s = ""; nuc.configPathNames.each { s += "${it}\n" } return "Hello World!\n\n" + s; } }

Folder action to autorename screenshots

·55 words·1 min
Move the location of the screenshots # I do not want to have ~/Desktop polluted with files. Thus mkdir -p ~/Documents/Screenshots defaults write com.apple.screencapture location ~/Documents/Screenshots killall SystemUIServer Test the screenshot - it does it Automator based auto-rename # Create Folder action for ~/Documents/Screenshots

How to install Chrome in Centos 6.5

·198 words·1 min
How to install Chrome in Centos 6.5 # Step 1. Add Google Yum Repository # Create a new yum repository using below instructions. sudo vim /etc/yum.repos.d/google.repo Add following content to this file [google] name=Google baseurl=http://dl.google.com/linux/rpm/stable/$basearch enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub Step 2: Install/Update Google Chrome # Richard Lloid provided an shell script to grab libraries from a more recent Linux distro, put them in a tree (/opt/google/chrome/lib) exclusively picked up by Google Chrome and then you can indeed run Google Chrome on CentOS 6.4 or later. Read More

Gitolite permissions setup

·1467 words·7 mins
This documents how to enforce the Gitolite permission to make LIVE branch writeable only by team leads How gitolite works # Repository permission structure # This is general format of repo definition REPO NAME rule line rule line for example @staff = dilbert alice wally bob repo foo RW+ = dilbert # line 1 RW+ dev = alice # line 2 - = wally # line 3 RW temp/ = @staff # line 4 R = ashok # line 5 The Rule line has format:

Installation of sshfs in the new VM

·82 words·1 min
Installation of sshfs in the new VM # On Centos 6, the fuse-sshfs is not part of default YUM repos. Get the ’epel’ repos # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm Validate $ ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/remi.repo It if good idea to enable the remi by default

2013

Difference between matching and simple Git push

·765 words·4 mins
I started to see this message in some of my Git environments Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple This is collection of information gathered from Stackoverflow, Git docs and various internet sources. Putting it together so that I do not have to google it again.