MyThinkPond

On Java, Python, Groovy, Grails, Spring, Node.js, Linux, Arduino, ARM, Embedded Devices & Web

Archive for the ‘Uncategorized’ Category

CentOS 7 - How to open ports in firewalld?

Posted by Venkatt Guhesan on March 23, 2016

Prior to CentOS 7, “iptables” and “shorewall” were the two options avaiable. Since CentOS-7, the default firewall tool is “firewalld”.

Here is a short-guide on how to open two ports in the firewalld application:

firewall-cmd --get-active-zones
# Lets open Jetty Web Server port
firewall-cmd --zone=public --add-port=8080/tcp --permanent
# Lets open some other port 4242 for TCP
firewall-cmd --zone=public --add-port=4242/tcp --permanent
# Commit changes
firewall-cmd --reload
firewall-cmd --list-all

Cheers.

Posted in CentOS7, Linux, Uncategorized | Tagged: , , , , | Leave a Comment »

Kairosdb - Cassandra - localhost:9160 - connection refused

Posted by Venkatt Guhesan on March 14, 2016

If you install the latest KariosDB and Cassandra, when you try starting KariosDB pointing to the Cassandra storage, you will see the following exception:

03-14|14:24:42.331 [main] ERROR [HConnectionManager.java:71] - Could not start connection pool for host localhost(127.0.0.1):9160
03-14|14:24:42.331 [main] INFO  [CassandraHostRetryService.java:68] - Host detected as down was added to retry queue: localhost(127.0.0.1):9160
03-14|14:24:42.332 [Hector.me.prettyprint.cassandra.connection.CassandraHostRetryService-1] DEBUG [HThriftClient.java:152] - Creating a new thrift connection to localhost(127.0.0.1):9160
03-14|14:24:42.334 [Hector.me.prettyprint.cassandra.connection.CassandraHostRetryService-1] DEBUG [HThriftClient.java:183] - Unable to open transport to localhost(127.0.0.1):9160
03-14|14:24:42.334 [Hector.me.prettyprint.cassandra.connection.CassandraHostRetryService-1] WARN  [CassandraHostRetryService.java:217] - Downed localhost(127.0.0.1):9160 host still appears to be down: Unable to open transport to localhost(127.0.0.1):9160 , java.net.ConnectException: Connection refused
03-14|14:24:42.348 [main] ERROR [Main.java:315] - Failed starting up services
com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting constructor, org.kairosdb.core.exception.DatastoreException: me.prettyprint.hector.api.exceptions.HectorException: All host pools marked down. Retry burden pushed out to client.
at org.kairosdb.datastore.cassandra.CassandraDatastore.<init>(CassandraDatastore.java:114)
at org.kairosdb.datastore.cassandra.CassandraModule.configure(CassandraModule.java:66)
while locating org.kairosdb.datastore.cassandra.CassandraDatastore
at org.kairosdb.datastore.cassandra.CassandraModule.configure(CassandraModule.java:65)
while locating org.kairosdb.core.datastore.Datastore
for parameter 0 at org.kairosdb.core.datastore.KairosDatastore.<init>(KairosDatastore.java:69)
at org.kairosdb.core.CoreModule.configure(CoreModule.java:74)
while locating org.kairosdb.core.datastore.KairosDatastore
for parameter 1 at org.kairosdb.core.jobs.CacheFileCleaner.<init>(CacheFileCleaner.java:41)
at org.kairosdb.core.CoreModule.configure(CoreModule.java:79)
while locating org.kairosdb.core.jobs.CacheFileCleaner
1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987) ~[guice-3.0.jar:na]
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013) ~[guice-3.0.jar:na]
at org.kairosdb.core.scheduler.KairosDBScheduler.start(KairosDBScheduler.java:68) ~[kairosdb-1.1.1-1.jar:1.1.1-1.20151207194217]
at org.kairosdb.core.Main.startServices(Main.java:451) ~[kairosdb-1.1.1-1.jar:1.1.1-1.20151207194217]
at org.kairosdb.core.Main.main(Main.java:304) ~[kairosdb-1.1.1-1.jar:1.1.1-1.20151207194217]
Caused by: org.kairosdb.core.exception.DatastoreException: me.prettyprint.hector.api.exceptions.HectorException: All host pools marked down. Retry burden pushed out to client.
at org.kairosdb.datastore.cassandra.CassandraDatastore.<init>(CassandraDatastore.java:225) ~[kairosdb-1.1.1-1.jar:1.1.1-1.20151207194217]
at org.kairosdb.datastore.cassandra.CassandraDatastore$$FastClassByGuice$$ccf4844f.newInstance(<generated>) ~[guice-3.0.jar:1.1.1-1.20151207194217]

This happens with Cassandra 3.3.0 and above. The reason for this error is that by default Cassandra turns off the RPC service. To fix this edit “/etc/cassandra/default.conf/cassandra.yaml” and toggle the “start_rpc” flag from “false” to “true”:

start_rpc: true

Restart Cassandra (service cassandra restart #For CentOS 6.7 or below) or (systemctl restart cassandra #For CentOS 7.0 or above)

 

Posted in Uncategorized | Tagged: , , | Leave a Comment »

Massive Floods in Chennai - 2 million people displaced - How can you help?

Posted by Venkatt Guhesan on December 3, 2015

Hello All:

I am writing today’s blog filled with tears and a sad heart to let the readers know that there are about 2 million people that are displaced in the city of Chennai, India today due to the recent massive floods. This flood is the worst seen in over 100 years in Chennai’s history. The last time this happened, Chennai (ancient city called Madrasapatinam) was not as densely populated as today (although we do not have actual numbers because census data is not available from 100 years ago). And to make matters worse the rainy season has just begun. It is anticipated that the rains may continue for another month or so.

The gravity of the situation down in the city of Chennai can be understood by these two examples:

  1. The Hindu, one of India’s largest print newspaper has for the first time not published it’s morning edition, since 1878. (Yes - 1878 - One Hundred and Thirty Seven years)
  2. All flights to and from Chennai have been suspended. Only limited set of emergency fights for critical people. All other flights have been diverted.

My attempt at this blog is to record the event and to bring awareness to others so that we can all help in our own ways to improve the human condition suffered by people of the world. And unless we all unite and build a better tomorrow not only for us but our next generation, we the people that live among the wealthy nations of this world will suffer the same fate and demise as nature unravels it’s fury. For the people of Chennai, India - the worst is yet to come as the after effects of flood such as increase in diseases from food borne viruses, lack of clean drinkable water, lack of clean sanitary conditions, lack of proper drainage systems to move the human waste.

Below are some pictures of today’s condition as I write this:

And for people who do not know where this is here is a map of India with the area that’s being impacted.

(pictures are not mine and I have taken these from the internet (and news) to share the story of the devastation suffered)

Here are some links where you can read about the current situation and ways you can help support the cause (I am not affiliated with any):

Ways you can help

  1. Share the link to this and other articles on your Facebook, Twitter and other social media. As more people become aware of the problems facing humanity, the more government organizations will move towards supporting causes that makes an impact on humanity today. Right now the floods in Chennai are mentioned as a footnote in the daily news by the big news medias of the world.
  2. Support organizations that are working towards making an impact such as the following:
    • New Delhi Television (NDTV) has partnered with Fever 91.9 FM Chennai to coordinate relief and rescue efforts via phone, messages and on Twitter with the hashtag #NDTVFeverFMChennai. The SOS messages are being shared with relevant authorities.
    • If you are a person in Chennai and you need a quick recharge on your phone (Airtel/Aircel/Vodaphone sites are down for recharge) for making emergency calls, PayTM (a local Chennai tele company) is offering a free recharge of Rs.30. Please call 1-800-103-0033 and they will recharge your phone free of cost so that you can make the needed emergency calls.
    • Google Crisis Website
    • Facebook, has activated its Safety Check feature for the Chennai floods. The page helps people mark themselves or others as ‘Safe’ on the social network letting their friends and relatives know that they are alright.
    • Twitter has also officially endorsed a list of hashtags that are being used for help and rescue during the crisis including #ChennaiRainsHelp #ChennaiVolunteer #ChennaiRescue.
    • Restaurant App Zomato (popularly known as Urbanspoon in the USA) has also launched and announced ‘Meal for flood relief‘ with which people can order free meals for flood victims. For every order placed, Zomato will match the same amount. #ChennaiRains #MealsForChennai
  3. When you consider donating during the holidays (and year-end), consider donating to organizations that help people in these areas that have a USA charter (for tax-deduction purposes). Please make sure you thoroughly research the charity before making a contribution. There are a lot of charitable scams going around. Here are some I am familiar with:
  4. Most big organizations such as Google, Amazon, Zappo, Facebook, IBM, US Federal Government, Microsoft (and many others I have not mentions because the list will go on and on) have donation programs that match dollar for dollar. Please consider nominating one of the charitable trust that can directly help with the flood victims.
  5. Google & Amazon Drones: If you or someone you know at Google or Amazon that’s working on the drone project. Talk to the project team to see if you can use these drones to help identify people in crisis. You may be able to provide live feed to critical areas of impact while testing the prototypes. In my view this is the best place to test one of those drone projects to see how it can be leveraged to help humanity in crisis while getting some well needed PR. This will also benefit the companies because the air and FAA regulations will be nonexistent in this crisis situation in Chennai, India. If you’re someone from Google or Amazon Droid project, reading this, I am willing to volunteer my time to help with the logistics and in test driving your drones on the ground in Chennai while we help the folks up there. :-) This is a great way Google & Amazon can make a positive impact to humanity while furthering science and technology!
  6. Donate Portable Chargers: At this time, about 2 million people are without electricity to charge their cell-phones. Companies manufacturing portable battery chargers can help organize efforts to distributing USB portable charge units. This is beyond my capability but large companies can organize and mobilize this. Hopefully there is a reader out that who works for one of these companies that can make this happen.
  7. To the Google’s, Amazon’s and Facebook’s of the world: deploying portable mobile floating units for the following is essential:
    1. Rescue emergency folks
    2. Distribution of bottled water
    3. Distribute food and medical supplies
    4. Dysentery and antibiotics supplies
  8. Long Term Global Needs:
    1. Innovations in building portable, low-cost water filtration systems for drinking
    2. Portable solar cells for charging bare essentials
    3. Mobile-Floating Cell Towers for areas in crisis

If I have missed or if you come up with other means to help, send me an email and I will add the information on this page.

List of Emergency Contacts in Chennai and Surrounding Areas

Tree Fall, Water Logging: 1913
Sewage Overflow: 45674567,2200335
State Emergency: 1070
District Emergency:1077
Electricity: 1912
Fire & Rescue: 101

Here are the regional office numbers:
Tiruvottiyur:
9445190001
Manali: 9445190002
Madhavaram:9445190003
Tondiapret: 9445190004
Royapuram: 9445190005
Thiru. Vi. Ka. Nagar: 9445190006
Ambattur: 9445190007
Annanagar: 9445190008
Teynampet: 9445190009
Kodambakkam: 9445190010
Valasaravakkam: 9445190011
Alandur: 9445190012
Adyar: 9445190013
Perungudi: 9445190014
Sholinganallur: 9445190015

#————————

Please share this article with others you may know so that we can bring more awareness to this crisis.

And for the folks in Chennai, India - Live and Stay Strong!

#ChennaiRainsHelp
#ChennaiVolunteer
#ChennaiRescue
#NDTVFeverFMChennai
#ChennaiRains
#MealsForChennai

Posted in Humanity, Uncategorized | Tagged: , , , , , | 1 Comment »

View from Mount Titlis, Switzerland

Posted by Venkatt Guhesan on July 8, 2015

View from Mount Titlis, Switzerland

20150705_120523

Posted in Uncategorized | Leave a Comment »

Switching back to wordpress site

Posted by Venkatt Guhesan on June 17, 2014

For the past year, I’ve tried to use my own hosted WordPress blog but I’ve noticed that my hits seems to be much higher on WordPress hosted site than my personal site. So I’ve decided to make my switch back to the WordPress hosted blog.

So starting today, both MyThinkPond.com and MyThinkPond.wordpress.com link back to the same blog site.

 

Posted in Uncategorized | Leave a Comment »

MyThinkPond has moved… www.MyThinkPond.com

Posted by Venkatt Guhesan on October 31, 2012

MyThinkPond has moved… www.MyThinkPond.com

Dear Readers,

I felt that it was high-time to move the blog to it’s own domain. I will continue to focus on topics of interest on the new blog.

Please update your bookmarks (if needed) and I’ll see you at the new site…

http://www.mythinkpond.com/

Venkatt

Posted in Uncategorized | Leave a Comment »

Grails - Groovy - Alternative to HttpBuilder - adding headers to your HTTP request

Posted by Venkatt Guhesan on October 24, 2011

Developing with Grails and Groovy can be a blessing and and pain all at the same time. The development moves at a rapid rate but when you decide to include libraries that depend on other libraries, your pain starts to build up. For example, when you include the module “HttpBuilder”in your project you may run into issues with Xerces and xml-apis, especially when you attempt to deploy the WAR file under Tomcat. These libraries are included as part of Tomcat and so an older version of those classes may give you a heartburn.

If your objective is to use some raw HTTP classes to create your requests and responses, then you can use the basic URL class to do most of the raw connection options. Although using HttpBuilder makes it a clean implementation, the URL class gives you very similar power without all the overhead of including the dependency classes.

def urlConnect = new URL(url)
def connection = urlConnect.openConnection()
//Set all of your needed headers
connection.setRequestProperty("X-Forwarded-For", "<your ip address>")
if(connection.responseCode == 200){
responseText = connection.content.text
}
else{
println "An error occurred:"
println connection.responseCode
println connection.responseMessage
}

So the trick to the Groovy URL class is to use the “openConnection()” method and then gain access to some of the raw functionality.

Cheers.

Posted in Grails, Groovy, Uncategorized | Tagged: , , , , | 7 Comments »

IntelliJ - serialVersionUID - enabling

Posted by Venkatt Guhesan on February 18, 2011

If you are wondering why when you make a POJO bean to implement Serializable, IntelliJ does not throw any warnings to create the serialVersionUID variable… It’s because you need to enable it. Here’s how:

Cheers!

Posted in intelliJ, Uncategorized | Tagged: | Leave a Comment »

How to extract public key from certificate?

Posted by Venkatt Guhesan on February 15, 2011

How to extract public key from certificate?

Recently I had to extract the public key from a certificate. Each time I do this I end up looking up the man pages for openssl and so I thought I’d blog it for myself and for others to use when needed.

$ openssl x509 -inform pem -in certificate.pem -pubkey -noout > publickey.pem

Enjoy

Posted in Programming, Uncategorized | 3 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 149 other followers