Pstack

All

Intro

Debug using gdb for Apache

Pstack

pstack is this quite an interesting tool for debugging in case you don’t want to trace the server.  Basically this command command shows a stack trace for each process!! Similar to gstack but for RHEL.

pstack <pid>

Example stolen from Oracle to demonstrate nfsd

243:    /usr/lib/nfs/nfsd -a 16
 ef675c04 poll     (24d50, 2, ffffffff)
 000115dc ???????? (24000, 132c4, 276d8, 1329c, 276d8, 0)
 00011390 main     (3, efffff14, 0, 0, ffffffff, 400) + 3c8
 00010fb0 _start   (0, 0, 0, 0, 0, 0) + 5c

 

On this case we can see that last function is pool, called from ??? – without ELF info – which was called by main.

Reading

The reading follows the simple rule:

 The bottom is the start –> the top is the last call 

REFs

  inline

Chaos Engineering

All

Intro

Although I already talked about this before, I think it worth mentioning – I talked before about Chaos Monkey and the Simian Army, but there are actually some interesting principles around Chaos Eng actually worth mentioning.

CHAOS ENGINEERING

It is the discipline to run several tests on production in order to make it robust and foresee issues – the first is basic for any scientific experiment. This has started on Netflix, but it’s quite interesting and now has spread all over.

The main principles are the following ones:

Build a Hypothesis around Steady State Behavior

Vary Real-world Events

Run Experiments in Production

Automate Experiments to Run Continuously

Minimize Blast Radius

Large scale

I think for large scales application, those kinds of tests are very important and even Forbes made a report about it. Minimizing the blast radius of the issues that the system might face is quite an interesting highlight here.

Reference Book

I didn’t read it but it’s on my reading list: Chaos Engineering – by Ali Basiri, Nora Jones, Aaron Blohowiak, Lorin Hochstein, Casey Rosenthal

REFs

inline.

Beautifulsoup + googleapi

All

Intro

I recently posted that with some python libs. I think beautifulsoup is on this list.

Beautifulsoup

Beautifulsoup is this very nice thing treat html content, quite nice.  The code below takes the the content from hmtl and returns the content without html tags.

from bs4 import BeautifulSoup
#Get Content
def get_content(url="test\solution.html"):
    #content = urllib.request.urlopen(url).read()
    #soup = BeautifulSoup(content, features="html.parser")
    soup = BeautifulSoup(open("test\solution.html"), "html.parser")
    return soup.text

Google Search

To do queries on google search is quite simple, with this lib – the query is done as below:

query

domain

number of results

search(query, tld="com", num=n_result, stop=1, pause=2):

REFs

inline

Helper parser

All

Intro

I have created a small server.log parser for JBoss with Gabriel A., my wingman.

It’s small and growing on demand, contributors are more than welcome.

Helper parser

This helps to parse server.log files to find exceptions and faster. Actually any file with errors, indeed.

Very small stuff, but we will improve upon that.

 

REFs

[1]https://github.com/FranciscoMeloJr/Python-Tests/tree/master/helper

Working with Java in Toronto

All

I started to work in Toronto some months ago with Java and it’s quite interesting.

I can’t say if it is better or worse than Montreal, it’s quite different though, because in Montreal I used to work in Python.

I miss Python sometimes, very very flexible. So cool.

That’s not my first time working in Java, my master was implemented in java, my honour thesis as well, and at All App start up I worked with some java android also. But, this time I’m working with JVM very specific tuning, EAP, and JDG, so then the framework changed and the city too.

Design Doc

All

Intro

I remember starting developing my own tools, like some python scripts like Mazeltov and stop with the issues. So this time, for Log Helper I have created a Design Doc, following what Techled suggested – btw, he is very funny.

Design Doc

There are many good templates for Design Doc, and Angela Zung is able to describe here very well some details about it – though I might disagree on the comedy part though.

I think this model here is very to the point, but seems almost like a read.me kind of thing.

This reference here, from Klariti.com, is the one I’d think it’s the complete solution. Too big for a small script as Log Helper though.

Remember that:  The design doc is written as part of the development of the software design

REFs

inline