Welcome

Pacific Simplicity is the home to my tech blog of sorts, aiming to assist and provide information easily to other Linux users and Open Source hackers out there.  It contains articles on Linux, system admin hints, scripting, programming embedded systems, OpenWRT and of course Drupal . Check it out and don't forget to comment!

Posted: Sat, 11/08/2014 - 08:49

One of the interesting things that I recently discovered was that the serial interface or at least the GPIO pins that would provide a serial console is NOT as straight forward as it should be (I mean really? Serial is somewhere around retirement age if electronics could age as humans).

I have learned that only thinking about a problem will not solve it; so I started digging into it by verifying that my brand new Raspberry Pi B+ was actually working. Here were my troubleshooting steps:

  • I installed a new clean image of Rasbian onto a brand new and working mini-SD card; I even verified the hash sums using sha1sum
  • Plugged it into my TV using HDMI & added a USB mouse/keyboard combo - it booted and worked

For the next few hours I hunted around the internet for reasons as to why it is not working; there are hundreds of posts stating no serial port or do this and that. However, before hunting around into the depths of configuration - I still need to verify two things:

  • The pins are actually working (I learned this in my brief stint in IT; check the cabling stupid)
  • Verify that the USB to TTL adapter is actually working (still unknown at this moment)

To verify the GPIO pins, I scouted through my hardware box and grabbed the following:

  • 3 female to male wires
  • 2 LEDs of different color
  • 2 330Ohm resistors
Posted: Fri, 10/31/2014 - 13:09

For awhile, I have wanted to write a simple tutorial of in-line patching of binaries and in particular, changing the assembly instructions and having a binary skip to whatever function we desire manually. This involves tweaking the callq instruction (call can be altered too, but it refers to a static address vs. a relative address).

Okay so lets get started - this tutorial is written to alter one specific thing and assumes that you have some basic knowledge of assembly & know how to compile basic programs. I am also assuming that you could find strings within binaries and know how to convert values in hexadecimal.

The example to be used in this test application contains a main function, and two functions (function1 and function2) which print different messages. The goal of this exercise is to modify the application AFTER it has been compiled so that function2() is executed instead of function1().

Posted: Fri, 10/24/2014 - 10:27

Assuming that you are like me and needed to jury rig something together to read a serial port on a Lannar 6020B industrial PC. Here is what I did

Step one, access the boards documentation and determine the pin-out diagram for the COM port.

Remove the board's shroud/case and find the serial/COM port on the board.

Posted: Fri, 10/10/2014 - 08:45

One interesting issue, I had encountered while using Java (and having seen many posts on various forums like StackOverflow) is an issue about, how do I remove all of my panels in a frame? or How do I change the rendered panel on the click of a button. Hopefully, this post will help and the complete project is attached as a zip file.

The concept is as follows:

Posted: Fri, 10/03/2014 - 17:05

If you have been following the previous examples, you will note that I have only been copying a file, but not editing a file. One way to do this is to use lseek (or a sister function fseek). The below code will take an input file as the first argument, the second a file offset and the third some text to add.