Elasticsearch and Curl

When I use the curl commands for my Elasticsearch, it outputs a bunch of garbage and messes up the output of the command. How can I turn that off?

The problem is that the curl command itself is emitting information into the stdout stream.

You can turn that off on a command-by-command basis by just adding a –silent flag on the command like this:

 curl 'localhost:9200/_cat/indices?v' --silent

or, if you’re on a bash like shell (e.g., MINGW64 on windows), you can do this to not have to think about it anymore:

alias 'curl'='curl -s'

Thanks to this post on stackoverflow for the solution above.

Quick DNS

Here’s a quick and easy way to get a domain name to resolve to an IP.

Type in the IP address and follow it with an .xip.io like this:

$ ping 192.168.1.144.xip.io

Pinging 192.168.1.144.xip.io [192.168.1.144] with 32 bytes of data:
Reply from 192.168.1.144: bytes=32 time<1ms TTL=128
Reply from 192.168.1.144: bytes=32 time<1ms TTL=128

Docker Security

Are Docker images and containers secure?

This was one of my first questions when I started using Docker. I saw commands that pulled images of OSes and containers of install software and saw output of even more software running as it installed and ran various images and containers on my box–no prompts . . . just installing and installing. It was then that I asked myself, “How do I know if anyone has put any malicious code in here or not? Yikes!”

The answer is, “I don’t!”

We place a tremendous amount of trust in these hubs and other hubs like NuGet and NPM. When working with enterprise applications, we have to be careful we aren’t inadvertently giving someone the keys to the kingdom.

So, I did some Googling and found this article which takes you through a few things that can help you in quickly checking out Dockerfiles and understand what they are doing and what to watch out for. These steps surely won’t give you absolute certainty. For that, you’d have to inspect ALL the code. Most of us don’t have the time for that. But, the steps he lays out sure are better than just blindly running images and containers.

Be careful out there . . .

Rails New Command Throws SSL_connect error

I just downloaded a fresh install of Ruby on Rails for Windows and when do a rails new projectName, I get an SSL_connect error! How do fix this?

Here’s the specific error that you will get:

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/rake-10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v ‘10.4.2’` succeeds before bundling.

After doing a big of Googling, I found this site that had a working solution. You can read the details there or just get this file, and put it in the folder:

C:\RailsInstaller\Ruby2.0.0\lib\ruby\2.0.0\rubygems\ssl_certs

Or similar location, and try again.

Hot Reloading in React

Can I debug / write a React application in real-time without having to reload the application every time I make a code change and losing my development state?

Yes.

Design Inspiration

Where’s a good place to get inspiration for mobile and web design components?

https://dribbble.com/

You can see and play with tons of ideas from around the world from everything having to do with graphics to controls to websites . . . and you can interact with the designers . . . and even hire them!

Pretty cool site!

Resetting Bluetooth on a Mac

I just turned on my Mac and now my bluetooth keyboard and magic pad won’t sync.

Sometimes, when I bring my laptop back in after taking it home from work at night, my wireless keyboard and magic pad won’t sync. Instead of rebooting my computer, I just unload the bluetooth in a terminal session.

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

and then

sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

to load it back again.