Monday, January 28, 2019
Is there anybody out there?
Tuesday, May 19, 2015
Hello!
Let’s assume you have a complex performance issue on a couple of linux servers. Usually you may try using iostat to try to catch the issue when it’s happening and see which performance item is creating the bottleneck.
To catch the performance issue I’ll recommend to use iostat to send the info to a file and then process it. You can try something like this:
rightnow=$(date +%Y%m%d%H%M%S)
thishost=$(hostname)
sudo iostat -c -d -x -t -m 1 1200 > iostat.out.$thishost.$rightnow
egrep "^[sd].*" iostat.out.$thishost.$rightnow > iostat.out.$thishost.$rightnow.csv
head iostat.out.$thishost.$rightnow | grep "D" >head.csv
{ cat head.csv ; cat iostat.out.$thishost.$rightnow.csv ; } > iostat.out.$thishost.$rightnow.txt
sed 's/ \{1,\}/;/g' iostat.out.$thishost.$rightnow.txt >iostat.out.$thishost.$rightnow.csv
Now you have a file that can be opened using R.
I’ll give you a couple of examples that can be quite useful for analysis. This will assume you have two files: each one from a different host.
´´´ R
xx <- read.table(“/temp/wegalihs01.csv”, header=TRUE, sep=”;”, quote=”\”“, na.strings = “NA”, as.is = TRUE)
yy <- read.table(“/temp/wegalihs02.csv”, header=TRUE, sep=”;”, quote=”\”“, na.strings = “NA”, as.is = TRUE)
await1 <- xxawait < 1000 & xx$Device. == “dm-8”]
await1 <- await1[rep(1:length(await1))]
plot(as.vector(time(await1)), as.vector(await1), type = “l”)
await2 <- yyawait < 1000 & yy$Device. == “dm-8”]
await2 <- await2[rep(1:length(await2))]
plot(as.vector(time(await2)), as.vector(await2), type = “l”)
times1 <- ts(await1,freq=60*1)
times2 <- ts(await2,freq=60*1)
plot(stl(times, “periodic”))
par(mfrow=c(1,1))
plot(stl(times1, “periodic”)$”time.series”[,”trend”], col=”red”)
par(new=TRUE)
plot(stl(times2, “periodic”)$”time.series”[,”trend”], col=”blue”)
Check Reads & Writes
await1 <- xxDevice. == “dm-8”]
await1 <- await1[rep(1:length(await1))]
plot(as.vector(time(await1)), as.vector(await1), type = “l”)
await2 <- xxDevice. == “dm-8”]
await2 <- await2[rep(1:length(await2))]
plot(as.vector(time(await2)), as.vector(await2), type = “l”)
times1 <- ts(await1,freq=60*1)
times2 <- ts(await2,freq=60*1)
plot(stl(times, “periodic”))
par(mfrow=c(2,2))
plot(stl(times1, “periodic”)”time.series”[,”trend”], col=”blue”)
´´´
Monday, December 15, 2014
More bluemix!
- Always check the logs/staging_task.log. You can find interesting stuff when the Bluemix controller try to instantiate your app. There are a few things that are not quite well documented and may save your life. One example is on my next tip.
- Add a start script into your package.json. Even when the application will start if you set up the manifest.yml, the Bluemix Controller needs this info to be able to instrument your app, which leads to my next tip. In the meantime, here you have a sample package.json with a start script:
{ "name": "sample", "version": "0.1.0", "description": "sample", "main": "sample", "scripts": { "test": "echo \"Error: no test specified! Configure in package.json\" && exit 1", "start": "node app.js" }, "dependencies": { "express": "3.4.7", "jade": "1.1.4", "log4js": "^0.6.21", }, "author": "", "license": "BSD", "readmeFilename": "README.md", "devDependencies": { "grunt": "^0.4.5", "grunt-env": "^0.4.2", "grunt-git": "^0.3.2", "grunt-shell": "^1.1.1", "js-yaml": "^3.2.3" } }
- Using the IBM Monitoring and Analytics for Bluemix Add-On is free, so I highly recommend to use it. It may help you a lot to find some issues in your apps.
Thursday, October 2, 2014
Best practices to run GNU Octave in a Windows box
So, usually you will run this on a Linux box but if you're like me, who has a preference for Windows desktops, you may have a few issues running it. So here is a small recipe that may help:
Install Cygwin (you have to install this lovely piece of software even if you don't want to run Octave)
Choose at lease the following packages:
- octave (and all the packages that you think you will want to use)
- xorg-server
- xinit
- xterm
and let Cygwin setup to select all the dependencies for you.
After you've installed this you can open a Cygwin terminal and then run:
# X
# export DISPLAY=:0.0
# xterm
# octave (inside xterm)
# sombrero(51) (inside octave)
This previous commands will:
- Run the XServer
- Let every X application to run on the local XServer that you've just started, you can add this into your ~/.bash_profile
- Open a new terminal inside this XServer
- Start Octave
- Execute a beauty graph inside the XServer window
Enjoy you maths!
Monday, July 14, 2014
Using Android Studio with the Samsung Galaxy S4
- Install the corresponding Samsung USB Driver. You can click here to get it from the official Samsung Page.
- Activate the hidden developer options on you S4 (or any Android 4.2+). Check this link for more info but basically you have to:
- Go to Settings & About Device and scroll down to the Build Number.
- Now, tap on your "Build Number" 7 (seven) times, and you should see a toast notification pop up saying "Developer mode has been enabled."
- Back out of the About Device menu and you'll see Dev options back where it belongs, so you can turn on USB debugging and whatever else you want to.
Sunday, May 4, 2014
BlueMix + Android Development + IBM Mobile Data - First Steps
Notice: I'm using the sample code found here as a start
While doing this I've found a couple of issues so here is a quick list of tips & tricks:
Issues with Application Id
At this point in time, properties.json is having precedence over the more specific code:IBMBaaS.initializeSDK(context, "95569b05-5f16-421a-a9e4-xxxxxxx");
So bear this in mind and check that your properties.json has the appropriate information.
More info here
Issues with "strange" URLs being called
The IBMBaas API will call https://mobile.ng.bluemix.net/data/helo as part of its normal operation. I think you may be interested in this info as it is not yet document.Issues regarding "cannot find symbol variable IBMBaaS" or some other
Not sure who is at fault here but I've had several issues with the ADT not being able to resolve symbols associated with the IBM libraries. Copying the libraries again nor restarting the ADT didn't work neither. I've found that calling Gradle to clean up the project solved the issues most of the times, so you may try that first before recreating the project.More to come...
Friday, March 21, 2014
Trying Bluemix! - First steps
I've just tried to give it a shot and this is my recommended approach to make a sample run and have an understanding of some of the basics to create a larger app:
First of all you'll need CloudFoundry tools, which oyu can get from: http://docs.cloudfoundry.org/devguide/installcf/install-go-cli.html
Once you have this installed you can follow this sample here: http://www.ibm.com/developerworks/cloud/library/cl-bluemix-nodejs-app/
But you'll need to make some changes as that document has a couple of things that has changed since it was published:
git clone https://github.com/ibmjstart/bluemix-node-mysql-upload.git
cd bluemix-node-mysql-upload\app
"\Program Files (x86)\CloudFoundry\cf.exe" create-service mysql 100 mysql-node-upload
move manifest.yml.v5 manifest.yml
---
applications: #Reference http://docs.cloudfoundry.com/docs/using/deploying-apps/manifest.html
- name: whatevername #Application Name. Unique to the user's Space
memory: 256M #The maximum memory to allocate to each application instance
instances: 1 #The number of instances of the application to start
--- url: pcolazurdo-test-${random-word}.${target-base} #deprecated, kept for temporary compatibility
host: whatevername #Hostname for app routing. Unique to domain
--- domain: ${target-base} #Bluemix Parent Domain Name
path: . #Path to the application to be pushed
command: node app.js #The command to use to start the application
"\Program Files (x86)\CloudFoundry\cf.exe" push runtime-name
After this you have to go to the console and assign the Mysql service to the Application Runtime and restart the Runtime
Tuesday, September 3, 2013
Playing with Vagrant - Fixing issues with Virtual Box
cd ~/.vagrant.d/boxes/BoxName/virtualbox
openssl sha1 *.vmdk *.ovf > box.mf
More info at: https://github.com/mitchellh/vagrant/issues/1850
Hope it helps
Friday, April 5, 2013
Playing with Ruby on Windows --- Fixing SSL issues when running bundle install
"Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/mime-types-1.22.gem)
An error occured while installing mime-types (1.22), and Bundler cannot continue. Make sure that `gem install mime-types -v '1.22'` succeeds before bundling."
Where the gem name maybe different, it will be helpful to have a look at this solution:
cacert.pem
file from http://curl.haxx.se/ca/cacert.pem. Save this file to C:\dev\cacert.pem
or whatever directory you can use for this.SSL_CERT_FILE
. To set this in your current command prompt session, type:set SSL_CERT_FILE=C:\dev\cacert.pem
More info at: https://gist.github.com/fnichol/867550
It worked like a charm for me!
Hope it helps
Monday, April 4, 2011
Humans: "The most remarkable species of all"
more info at: bbc.oc.uk/humanplanet