How I Get (& Stay) Good at Vim

Vim is one of those tools that most everyone who uses a computer for most things outside of “regular” computer use (email, web banking, facebook, etc.) should use. Now, I realize that there are more than a few people on the webs that will defend their opinion of a command-line text editor (Vim or Emacs) more “enthusiastically” than a Jehovah’s Witness will defend their church’s beliefs, but a solid and feature-rich text editor that is available on any non-Windows computer by default is about as important as a keyboard. I, like many “whiz kids” started using Vim over Emacs because Vim is baked into pretty much every Linux based distribution out of the box. It’s not that I don’t like Emacs, just that when I need to get into a server and make a quick configuration change I don’t want to have to install anything to do it.

Now, there’s a great argument now that config management tools (like Chef, Puppet, Ansible, etc.) can install Emacs from the rip but I just don’t have the time. Well, let me clarify: I don’t have the time to learn another text editor like I’ve learned Vim over the years. Any merit that can be said about Emacs applies to Vim, and vice versa. They are both excellent text editors, very powerful but very simple at the same time. Both have tons of plugins, can be modified simply to aid in just about any context, and have excellent automation facilities. So, now that I’ve got that bit out of the way and have avoided about half of the Emacs vs Vim comments, let’s get into why you’re here.

Like any other tool, you need to use it to be able to use it. The more you type in Vim (or Emacs), the better you are at it and the more you build the muscle memory that lets you type really fast. Now, if you’re not needing to edit text-based files like config files every day, then you’ll have an issue with becoming and staying proficient. And I have a simple solution to this problem, use the tool to write every day. Now, I don’t know many people that use a command-line text editor for many things other than config files so you have to give a bit of a think on what you’re going to do every day to stay sharp in your text editor.

The best task that I have come up with that everyone should do every day on a Linux based machine is to journal. Just a simple, you are the audience, journal. Of course, there’s a ton of other things you can do but journaling is something I recommend to everyone. This is for a few reasons: 1) It can be cathartic, 2) it gives you some time to organize your thoughts, & 3) it generates a “paper trail” of what you’ve done. Now of course for #3 you’ll need to write some on what you did, not just keyboarding exercises. It only took me about a week to get into the habit each time I started doing this.

What I propose for organization and format is simple. In your home directory create a new directory ($ mkdir journal) and then make a new text file ($ vim aug-22-19.md). Now, this is simply a suggestion for the file name and location so make it your own. Formatting is simple as well. Inside the file, I start off with the date and time marked with a leading asterisk, then on the next line I write – stream of consciousness style. Simply writing what I’ve done so far in the day. When I’m done I save & quit (:wq). Once you get a bit of practice, I bet you’ll hardly notice that your brain isn’t slowing down to figure out how to write what’s in your brain!

When I find that I need to add to the file, I simply leave a blank line after the last entry and repeat the entire block. So, when you log into your server or whatever try this and make a record of what you did (and maybe even how you did it!). If for nothing else, you’ll be creating a simple paper trail of what you did, when and where. There’s a ton more to this topic, which I intend to. Until then, leave us your favorite tips and tricks for your favorite text editor.

Board level repair?

Board level repair is simply repairing an electronics board by fixing broken traces and/or bad components. In years past this was done by simply unsoldering the bad parts and replacing them with new parts. But they were bigger and easier to see.

Nowadays, with the advancement of technology, the components are much smaller. Most can’t be seen clearly without a microscope!

 

So, when a part goes bad on a board like this most people have to just replace the whole board. This is not good for a few reasons:

  1. It creates more waste in our landfills. These boards not only contain precious metals, but also harmful materials, like lead, mercury, arsenic, cadmium, beryllium, and other harmful products that can contaminate our groundwater.
  2. It’s expensive. A whole circuit board may cost ten times more than a simple little component.
  3. It makes owning electronics more expensive in the long run. If you buy a phone, tablet, computer, or other electronic devices you’ll have to pay more to have it fixed when it breaks. Or throw it out and buy a new one!

Fixing your electronic devices make more sense, not only for the environment but also your bank account. If you’ve got a phone or tablet that doesn’t work anymore because it has a broken screen or something spilled on it, then let us fix it for you.

We’re a small family business that wants to help you save money and the environment. You get more life out of a large investment and the world is a better place for our kids! We make having your phone or tablet better, by getting more life out of it, and by using it better!

Contact us through our Facebook page, email us, or call Monday through Friday 9:00 am – 5:00 pm, if nothing more than to say hi and ask us questions. We love to help!

Our take on an affordable 3D Printer

TI’ve wanted a 3D printer since forever! Well, at least since the turn of the century. But, as we all know, they are not cheap! So I haven’t gotten one. However, recently the availability of open source hardware and software for 3D printing and CNC machines, along with the decreasing cost of components, has spurred me into wanting to build one myself – from design to final product!

So, what goes into designing and building a 3D printer – or anything for that matter? There’s a lot that goes into designing and building a 3D printer – let’s take a look:

  1. You have to decide that you want to and can build it!
  2. Have the means to purchase/build the components needed to build the printer.
  3. You need the mechanical, electrical, and design chops to put it all together!
  4. Have the time! – Depending on how fast you want to get to the actual printing, you can choose from several different paths.

That’s a short, but heavy list. Let’s get into it all a bit deeper.

You have to decide that you want to and can build it!

If you don’t really want it, you won’t do it – plain and simple! The world is riddled with half-finished ideas and projects – you need to commit to finishing it. This is my declaration to all of you that I am doing this!

Why am I doing this?

Why? Because it’s a cool project! Because it’s not easy, there aren’t really any detailed sources for this type of project, and because I like to teach and share! So, as part of this project, I am going to be building a lesson plan for teachers to use in a primary school setting – targeting the 3-6 grade level.

How do I know that I can do this? (And why anyone should listen to me)

I’ve worked in the aerospace maintenance field for over 20 years, been a professional software engineer for 10 years, and have been an electronics enthusiast for over 30 years. Combined, I feel that all of this background gives me a good solid foundation to take on this project – or at least learn what I need to!

You have to have the means to purchase/build the components needed to build the printer

You need certain tools and knowledge to accomplish a task such as this – all of which can be acquired. The tools you need for such a project are mostly basic tools, such as what can be found in the standard cheapy tool sets from the lower end retail stores. These sets can range from $100 – $200 and can be used for many other things – like basic automotive repair, home repair, and DIY, and so much more. But, if you’re reading this then you likely already have what you need in this area.

Other tools you’ll need are a soldering iron, solder, multimeter, wire strippers, and some wire of various gauges. The wire and other miscellaneous components can most likely be salvaged from old used appliances and such.

You have to have the mechanical, electrical, and design chops to put it all together!

Let’s face it, not everyone is cut out to build things. It’s a sad fact, but a reality! Don’t despair, if you’ve made it this far you’re likely to already know what you need to pull off a project such as this. Mainly the ability to learn and the wisdom to know when you need to learn.

You need the time!

Depending on how fast you want to get to the actual printing, you can choose from several different paths. If you don’t have the time to put into this kind of project (or need it completed in less than a month), you’d probably be better off just buying an assembled printer. If you can dedicate a few hours a week to this project, then you have all the time you need! Just make sure you have some space to have your project while you’re building it that won’t be in the way!

 

What we’re working from:

Every project needs to start somewhere, from a fixed point of requirements, to be successful. For most DIY projects this is just a pretty clear but rough idea in your head. That works for most things, but for something more complicated – like designing and building a 3D printer – you need to have something more concrete to work from. So I’ve put together my desired specifications that detail what I want to end up with. These project specifications need to describe what the finished product will be able to do, how it will do it, and any high-level constraints the project will operate under.

Let’s see, there are a few major points that this printer will need to hit. While we’re at it, let’s cover some of the details of the finished product’s capabilities.

  • Have a working area of at least 508 mm³ (20 in³)
  • Be able to switch between 1.75 mm and 3 mm filaments
  • Capable of switching between additive manufacturing and CNC operation relatively easily
  • Be extensible for:
    • Using different print media
    • Having a larger print/work area
    • Using Spray media, such as applying:
      • Lettering/images (like on a PCB)
      • Conformant coatings
      • Removal of conformant coatings
    • Composite/integrated assemblies – such as:
      • Conductive media
      • Be able to pause printing to add components to the print
  • Be as open source as possible
    • Apply and supply open source hardware
    • Apply and supply open source software
  • Have a total cost of less than $200
  • Allow construction without 3D printed parts

Next steps

So there we have it, the basis and background of this project. The next step is to source the parts and materials that we needed. That’s something I’ll save for the next post.

 

Until then…

How to Fix Bluetooth Network Unavailable on OS X 10.10.4

UPDATE:

In the comments a new workaround has been identified since my solutions don’t seem to be working anymore. Try making sure the hotspot is turned on on your phone! It’s a weird one, but it works!

The best way explanation I can come up with is because of the way hand off works in the Apple world, turning on the hotspot on an iPhone (Bluetooth being key for handoff to work properly) it triggers an update call to the Bluetooth stack. If anyone has any insight on my theory I’d welcome it in the comments!

Thanks for all who’ve commented with more info!
I love MacID, before I started using it I didn’t have a lock screen enabled nor a password. Bad, bad, bad; I know. Especially since this machine is my dev machine, and I obviously have the source code and design documents on it for all my projects. After a change in my circumstances that left my MBP in a situation that someone else could have accessed the computer (fortunately that didn’t happen) I enabled the lock-screen and started using a strong password; a bit of a pain in the ass. That’s when I found MacID, and soon forgot I had the lock screen enabled because I didn’t really even notice it.

After updating my MacBook Pro to the latest and greatest OS X 10.10.4, I had lost the ability to pair my iPhone 6+ using bluetooth. This, unfortunately, disabled MacID and left back at having to enter my password each and e-v-e-r-y time I opened my MBP!

 

Well, after a lot of digging and trying different solutions, I finally fixed the issue!

 

The Problem:

NetworkUnavailScreenCap

When attempting to reconnect by bluetooth from MBP to iPhone 6+ (both updated OS) I was greeted by the notification above. Poopie.

Handoff still worked, along with Airdrop. No MacID though.

The Solution:

Following several suggestions from around the web, even asking the MacID developer for help, yielded no success.

Now, I want to take a moment and point out that even though the gentleman behind MacID had no obligation to help me out, he still tried! And, he was speedy about the offered help as well!

So along I went, without the use of my MacID, depressed and forlorn. Until today!

This is what worked for me and my setup, this may not work for anyone else but is here for reference and a hope that someone else will be helped by this info. If it helped you out, then leave a comment/let me know here.

  1. Turn off bluetooth on the Mac
  2. Delete the iPhone pairing (I’m not sure if any other pairings will need deleting as the iPhone is the only pairing I have on my MBP)
  3. Delete the bluetooth plist file:
    1. Open the Finder app
    2. Navigate to the preferences directory by pressing CMD + SHIFT + G and typing /Library/Preferences/
    3. Trash the file com.apple.Bluetooth.plist
  4. Shutdown your Mac
  5. Power on your Mac and immediately hold down CMD + OPTION + P + R until you hear the startup sound three (3) times
  6. Open the bluetooth preferences and repair the iPhone

All is fine now, I had to set up MacID again as I had removed my iPhone there as part of a failed troubleshooting attempt.

 

Now all is right in the world!

 

If this worked for you, or lead you in the right direction, I would like to hear about it! If you find an error or missing step, do let me know and I will update this post.

Getting Android Studio Working On Mac OS X Yosemite

So, changing from a Windows development platform to a Mac OS X platform has been surprisingly smooth. While it has only been a few days, the only glitch I have encountered is when I started up Android Studio 1.0.1 for the first time.

Java Not Found Error from Android Studio
The “Java not found” error from Android Studio

 

tl;dr

Go and install this to fix it. Read on to find out why it happened.

 

Fixing Android Studio

Unfortunately, I got the dreaded “Java not found” error, which puzzled me because, of course I had already downloaded and installed JDKs 7 & 8, and verified that when I run the command “java -version” I saw the report that Java 7 was in use. A real head scratcher. So a few minutes of digging around brought me to this question on StackOverflow. Following the first link (the “Update”) brought me to the Android Tools Project site, which has a nice discussion about the BETA and Canary releases and issues with those versions along with the JDKs. The key areas I found to be the silver bullet for my issue was the commands:

The key command needed to temp fix the issue
A code snippet from the Android Tools Project Site

 

Once this command completed, I was in business and on my way! Unfortunately, this method only works when opening AS from a terminal window. I like things to work the way they are designed to work, so further research found more entries on StackOverflow and elsewhere about this issue but none really seemed to solve the real issue. After reading through a few more SO questions, articles, and support documents (along the way uninstalling Java and then reinstalling Java) I ended up back on the Android Tools Project site. Specifically the section titled “IDE JDK”, in this section is the fact that Android Studio defaults to running the IDE with JRE 6 because of font rendering. This page says that Android Studio will prompt you to install Java if it doesn’t find it, obviously not! A little trip over to the Apple support site to install Java 6 will fix things right up!

I hope this helps others the way it helped me, but is found faster than I found it!

What I did with Twilio

A few months back, a client asked me to look at and improve the SMS messaging ability of their Java program. After seeing that they were using an email to SMS gateway (and associated throttling requirements) I researched the options, and came to the inevitable conclusion that the answer to making the SMS messaging capabilities better and more robust in my client’s application was by adding Twilio.

After a very short “introduction” period, I had a prototype up and running, my client was so impressed that the original specification was expanded (I didn’t mind because the Twilio APIs are really easy to work with). A short time later, the final draft moved to production and there have been no regrets; in fact I look for ways that I can use the Twilio offerings in other projects because it was so easy.

Now mind you, the application using the Twilio service is used to run a form of silent auction, requiring as close to real time notifications to end users as possible. The application sends an SMS notification to a registered bidder (after an opt-in of course) when they have been outbid; then if the bidder wishes, they can respond to the outbid message indicating that they want to raise their bid. That simple! All thanks to the power of Twilio. Future planned improvements include the ability of the application to automatically call winning bidders after the auction is over to let them know what they have won! Of course, Twilio offers voice functionality as well, and it’s just as easy to implement!

I am very happy that I had the opportunity to use the Twilio service, and it seems that my client is happy with them as well!

Fixing a power problem

After being uber excited to get a brand new Nexus 7 for Christmas, I quickly realized that there was a problem with my new gadget! I found that no matter what I did the battery showed 0%, even after spending several hours on the factory charger. After a couple hours on el Goog finding some similar issues it was starting to look like my new friend was doomed to experience the exchange Charlie Fox of a process.

Finally I found the iFixIt writeup for replacing the battery and I decided I would try re-plugging the battery. Once I opened the back cover I found the problem right away, the battery plug was not inserted into the socket all the way! A quick and gentle push on the plug, then snapped the back cover on and upon a restart the issue was gone!

So, if your N7 is telling you that the battery is dead no matter how much you charge or clear the battery ini, try (at your own risk) checking the battery plug.

Let it be said that I am in no way a tech repair guy or an electronics guru, just a few years of experience working with my hands.

Included Bugs

I spent the better part of a day and a half beating the keyboard with my head over a very frustrating problem: “WTF! Where’s that cookie I set?!” in a PHP project that I was working on.

See, the problem came from abstracting all the cookie related functions to a separate PHP file. Easier to maintain, right? Only if one remembers to place a “require_once” call before making the function call! Together with disabling error out put on the server, and not setting up proper debugging, lead to a lot of wasted time.

Once I realized what happened, I had to physically smack myself on the forehead!

The lesson here is make sure you double check all you includes and requires, that and don’t code sleepy!

Having an “wow” moment

I was watching “Gremlins 2: The New Batch” with my kids today, and it is really neat to see my kids enjoy a movie that I enjoyed years ago. Without the CGI and special effects that we have come to enjoy and are accustomed to in modern movies, its refreshing to see some creativity of old find a new home in the imagination of today’s youth.

Another thing I realized is that there are things that we miss when watching movies, tomorrow stars in their beginnings. Maybe I am dense or have been under a rock, but I didn’t know that Howe Mandel was the voice of Gizmo!

Cleaning a Web Service. . .

So, after spending a fair amount of time building and debugging/testing a web service that I have built for a client I have come to the realization that not only is NuSOAP poorly supported, it is a great concept that has failed at a complete execution. I think the real problem is that one cannot Google anything having to do with SOAP without tripping over NuSOAP results. There are plenty of blog posts, tutorials, and guides that cover many aspects of the framework’s use. Additionally, there are plenty of questions asked on stackoverflow and the “.NET” forums regarding the use of NuSOAP.

It is kind of saddening really, the framework has great potential, a large following, and probably be considered a “Swiss Army Knife” of a SOAP framework. The problem is that it has not been in active development for quite sometime (2010 was the last reference I found) and the guides and tutorials lack in some areas (complex return types, wsdl customization). The tutorials out there are great, written by some great programmers that have obviously given some sizable time into creating the tuts, but they all lack completeness. Using the tuts out there I was able to build up a rather complex web service in a short amount of time and get it working great, until I needed to provide a web method that returned a complex data set. On top of the issues with complex data types (that SNAFU will be saved for a later post), the service was built for the sole purpose of being consumed by a client add on to an existing Windows application that was written in VB.NET.

The great turn for the worst happened  when I finally had gotten the web service returning the needed complex types properly (P.S. – I want my 10 days back that I spent chasing the cryptic configurations) that I found out that NuSOAP does not return conformant SOAP XML messages. The conformance is for the 1.0 standard, not the current standard that .NET requires to properly deseriralize a SOAP complex type response. See the response by John Saunders here for the skinny.

The short of it all is that NuSOAP is not compatible with a .NET client. Sad really, and I hope that I get the chance to use NuSOAP in the future because it was kind of fun to build a service with this framework, even with all the short comings.

I hope that a future me comes across this post about the point in a project when they are getting ready to put the rubber down, maybe I will save them some time in building something that won’t work in the end.