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: 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.

Posted: Tue, 09/23/2014 - 12:44

Thanks to some interesting input, I decided that I should extend upon my file copy previous example. In case, you are wondering, I chose to use fwrite, fread etc.. on this application, but the same is possible with read/write to copy a "sparse file" or a file with "file holes"

As per input, here is how I create my sparse file using the dd command:

Posted: Fri, 09/19/2014 - 08:54

Interestingly enough, Ubuntu 14.01 was unable to recognize my all-in-one SD card reader (Nextech is the brand) despite working in Windows land. Dmesg output was stating errors and assuming that this is just a generic USB device, I wondered if there was something at play, such as SCSI. I was correct and here are the two changes that are needed to make it work.

sudo apt-get install udisks sg3-utils

Then add the following to /etc/modules.conf

Posted: Fri, 09/12/2014 - 19:01

Here is a simple C example that demonstrates using stat(), posix_fadvise() and assert() for a file copy, not that its not great for sparse files, but this example is! ;)