Saturday, August 1, 2015

Beast on a Budget Section 1: Parts & Costs

So, I spent some of today posting the initial thread and a breakdown of the list prices, the shipping costs, the handling costs and the total costs for each.


Asrock Q2900M Motherboard
105.74P + 2.46S + 36.92H = 145.12
https://item.taobao.com/item.htm?id=35032832716

8GB DDR3 PC3-10600 1333MHz
39.99P + 0S + 0H = 39.99
http://www.amazon.com/gp/product/B0075U12H8

12V 6A 72W AC Adapter Power Supply
7.22P + 0S + 0H = 7.22
http://www.amazon.com/gp/product/B000VE7GQQ

12V DC 160W Pico PSU
18.98P + 0S + 0H = 18.98
http://www.amazon.com/gp/product/B00HLCT9HK

Intel PRO/1000 VT Quad Port Ethernet Card
29.99P + 0S + 0H = 29.99
http://www.ebay.com/itm/191634249417

2 (Two) Mini PCIe to PCIe Adapter with Three Antennas
10.23P + 1.70S + 0H = 11.93
http://www.dx.com/p/mini-pci-e-to-pci-e-pci-express-adapter-with-three-antennas-39267

Bplus MP2W-RPSMA : Full & Half mPCIe / minicard to PCIe Adapter with USB2.0 interface & 3pcs RP-SMA connectors for Wi-Fi & Bluetooth
29.99P + 0S + 0H = 29.99
https://www.amazon.com/gp/product/B00LBYVZZS
*This adapter works with the Atheros QCA9880 XB140 reference board based boards-- like the Compex WLE900VX, SparkLAN WPEA-352ACN, and AIRETOS AEX-QCA9880-NX --which do master mode among other state of the art 802.11ac things. Many other adapters do not.

Compex WLE900VX 802.11ac 2.4/5GHz Mini PCIe WiFi Card
55.00P + 0S + 0H = 55.00
http://www.ebay.com/itm/171865971474

Atheros AR5BXB112 802.11n 2.4/5GHz Mini PCIe WiFi Card
17.99P + 0S + 0H = 17.99
http://www.amazon.com/gp/product/B00881PHO2

MyDigitalSSD 64GB (60GB) 50mm Bullet Proof 4 BP4 50mm mSATA Solid State Drive SSD SATA III 6G - MDMS-BP4-060
20.00P + 0S + 0H
http://www.amazon.com/MyDigitalSSD-Bullet-Proof-mSATA-Solid/dp/B00B3X72TU

Syba mSATA SSD to 2.5-Inch SATA Adapter (SY-ADA40050)
10.99P + 0S + 0H
http://www.amazon.com/Syba-mSATA-2-5-Inch-Adapter-SY-ADA40050/dp/B007PPZ2I8

Grand Total 404.41

Getting ready to build the Q2900M beast router on a budget.

So, my faithful router is aging, badly. Time to let it "go to the farm" to live out it's days in peace. I've looked at what I can get out there to replace it. There is a lot of really neat networking tech out there these days, some more friendly to turbocharged 3rd-party firmware and some not.

A lot of really expensive hardware too. The most coherent and simple to set up thing to do would be to get a bunch of things that do one thing well-- as in one machine to do the thinking, a good switch, two access points. That was a pricey option and required several things.

I am willing to forgo some coherence to have it all in one unit that that the manufacturer expected me to load with third-party software. Having it all in one unit also gives me a lot of frugal upgrade options. Additionally, it is the least expensive way to meet all the criteria I have for such a device-- which has been missing in my current setup.

Having done a lot of reading, the software is the sticky part. Some of it is really great, but until you try it first hand and it works as expected then also is nice to use.

It was neat seeing what I had documented get shared so much when I wrote about my OpenSolaris/OpenIndiana ZFS file server build several years ago and I was kind of hoping to do the same with this-- maybe trying to do a better job this time with your help. Starting with that I have almost $400 of equipment to play with in the immediate future. What would you like to see me try? Are there any tests you would like to see?

I tried to not be ounce wise and pound foolish. What would it cost for me to build a router that I love? Turns out possibly $400 if everything works out as expected.

Yesterday I booted the motherboard for the first time.

I'm still waiting on the 802.11n package and a mini-PCIe to PCIe card converter (with antennae!) from dx.com. So, no wireless, but getting my USB flash drives loaded up with the installers will take some time and then there's the sitting down and doing it... They will be here in plenty of time.

Starting the documentation now.

The following sections are what I think I should compile to document this. Stay tuned while I write them. I have my ears open if you have any input.

5 Sections

  • -Parts (Where sourced from, part, shipping/handling, & total cost when I can make a line item break down).
  • -OpenWRT - Setup Notes & Bash Script (Not even sure if OpenWRT has bash, read ash through busybox-- I'll find out as I go.)
  • -pfSense - Setup Notes & Bash Script
  • -IPFire - Setup Notes & Bash Script
  • -My conclusion and thoughts, metrics and comparisons; the opinion part based on the metrics and a few days of use.

The build is in the context of the following reqs:

  • Use of Multi-Core 64-bit Processing. (Fanless Intel Quad Core J2900)
  • Use of DDR-3... or better. (8GB)
  • Use of Gigabit LAN Ports. (5, one onboard, four via Intel PRO/1000 VT)
  • Use of 802.11b/g/n/ac. (one 3x3 MIMO 802.11ac with AP Mode, one 3x3 MIMO 802.11n with AP Mode)
  • Use of USB for printing. (USB 3.0 -- and a paralell port...)
  • Use of mass storage possibly by PCI-E, SATA, MSATA, and/or SD-Card(micro || full-size). (two SATA2 ports)
  • Use of USB for mass storage. (two at the back plate, three via motherboard headers)
  • Low voltage and low power consumption. (72 W)

To the following ends:

I stream a lot of video via my Roku, the kids watch a lot of Netflix in the morning, I have a half dozen hardwired machines in my office that make fair use of gigabit speed file transfers, the router & two other machines use DDNS, SSH via NAT happens, a couple IP cameras store images & send MJPEG streams, an old HP LaserJet USB->Paralell network prints, and more and more wireless devices as time creeps on over g & n wireless adapters.


I am ~70% happy with my current setup. Preferably, I'd like to run a little web-server & file server right from my firewall/router as well as have more SSIDs. This is the missing 30%. I'm already serving a site from a separate machine-- but seriously, the traffic is so low that I feel guilty for burning the watts. And I also wouldn't even consider giving up my dedicated file server, but somewhere to quickly stash files I don't have too much care for would be nice.

I have my Roku on the same wireless as my own personal botnet I play with, I'd like separate APs so that my internal traffic doesn't affect my kid watching Netflix in the morning when I do need the TV to be a babysitter (I know, I know, just turn off the machines talking to each other... but, I don't).

I'll keep my eye on the reddit posts, hope to hear some words of wisdom or things I should do some heavy reading about that will make my task easier. Thanks.

Wednesday, July 29, 2015

My Favorite 3rd Level Subdomains


alpha
app
admin
api
beta
blog
dev
feed
files
forum
ftp
help
image
imap
img
info
lists
live
mail
media
mobile
mysql
news
photos
pic
pop
search
secure
smtp
status
store
support
videos
vpn
webmail
wiki
www

Friday, April 24, 2015

Not committing merge; use 'git commit' to complete the merge.

So, say you are leaving your current development branch in git to a standard base branch of your repository-- you checkout the branch in your local environment then you pull from the remote and lo and behold there is a merge conflict.

Not committing merge; use 'git commit' to complete the merge.

What I usually want to do is to:
git checkout remote/branch local/path/to/file

Here's to no more 'github shenanigans commit messages...'

Wednesday, April 22, 2015

How to make a SHA-2 2048 bit CSR for a SSL Certificate with OpenSSL

Long time, no write...

SHA-2 2048 OpenSSL command to generate a Certificate Signing Request(CSR) and Private Key (PK) -- which you need to get a SSL Certificate.

{REPLACE THESE VALUES}

openssl req -new -newkey rsa:2048 -sha256 -nodes -out {DOMAIN.TLD}.rsa.csr -keyout {DOMAIN.TLD}.rsa.pkey -subj "/C={US}/ST={STATE||PROVENCE}/L={CITY}/O={COMPANY-NAME}/CN={DOMAIN.TLD}


The code you run will likely not have any curly braces, {}. For instance, for my fictional company Example Inc. would make a certificate signing request as such:

openssl req -new -newkey rsa:2048 -sha256 -nodes -out example.com.rsa.csr -keyout example.com.rsa.pkey -subj "/C=US/ST=OHIO/L=EASTLAKE/O=EXAMPLE/OU=IT/CN=EXAMPLE.COM"

The Country is US, the STate is OHIO, and the City (L) is Eastlake.
The Organization is Example, the Organizational Unit is IT, and the Common Name is EXAMPLE.COM. If you were wondering what the pieces parts in the subject argument meant.

Thursday, August 7, 2014

One Way to Find Qualified Candidates



This is about data mining information about students, be patient I will get to my point.




I was talking with Dan, a friend of mine that works as a recruiter. He was complaining about the quality of applications he gets-- if he gets them.

Between the client asking for everything under the sun rather than the top five skills required and the applicant doing a poor job presenting himself when faced with the opportunity to just echo back the job requirements in the form of work history & formal training; he is in a tough place finding candidates to put forward even though in his gut he could match four to five satisfactory candidates to each of the jobs in his pool of opportunities.

I've had a little over a week to think about his dilemma. The good news is that I have had a decent related idea, the bad news is that Dan's employer may be too small potatoes to take advantage of it.

I've recently enrolled in an introductory Linux edX course over at edX.org. It got me thinking about how the Linux Foundation is sponsoring the largest free Linux educational offering for people willing to take the time to consume the content EVER.

The Linux Foundation via edX now has access to a wealth of data about all the people registered for the course-- their contact information and, if they wished, a lot of telling information about the student.

Some of the information may indicate whether they would be a good asset to an employer.

What if larger organizations put out quality, meaningful educational opportunities related to the technologies they wanted to gain some popularity? What is win-win about it is that they could create a larger audience and demand for their technology while also having the opportunity to find candidates to fill positions-- that specifically have studied the critical information from the curriculum they built. Allow people to gain skills and then have the chance to cherry pick the leaders of the pack-- assuming they warm to the idea of being employed by the sponsor of the class. Worst case scenario, it could still be called contributions to the greater good, making the world a better place through quality self improvement opportunities.

Let's do something sloppy and crazy-- possibly meaningless. Let's just search for IBM, Oracle, & SAP on dice. These are my raw quantity of otherwise unfiltered results for the respective searches:

3,498 - IBM
13,479 - Oracle
5,278 - SAP

So, clearly HR at these companies could use some help.

I am a great employee. Good luck getting me to spend 2 hours on a 'simple' application when I am already well employed. But, I know I would spend several hours across a few weeks learning new skills or even sharpening existing skills in a course put together by the right people. The Linux Foundation making a Linux course available has garnered a whole lot of attention.

Friday, July 25, 2014

Unknown class 'foo' -- Geppetto not recognizing dependencies in your puppet code?

Check your Modulefile. Update your dependencies there via the tab on the bottom and verify the change in your metadata.json .

Poof, your puppet include finally will be recognized as a valid class that was found and when someone installs your script, then it will dig up the dependencies if necessary.

Saturday, June 28, 2014

rebeccapurple, digging into mozilla firefox

Why? Digital-remembrance for a life taken too early and in support of a man that unbenknownst to me makes my life better and easier. But, also that we share friends, who tapped me. And I got on board.

My first two files ready for committing:

./aurora/content/base/test/test_html_colors_standards.html

./aurora/content/base/test/test_html_colors_quirks.html

However, I have no commit access to the mozilla firefox repos.

(Womp womp womp woaoamp. Play the sad music.)

The rest need tweaked still. Currently mulling over whether Mozilla Bug Report 456826 applies to my source editing task.

Friday, April 25, 2014

HP LaserJet 2015 Ethernet Conversion

So, I ordered a HP LaserJet 2015dn from ebay. The seller wasn't quite the worst at packing packages. (A contender, a close second for sure.) That in conjunction with the shipping company obviously using it for a few frames of bowling practice left it in the condition I received it in.

I obviously didn't learn anything from the encounter. After I got all my money back free and clear, I go ahead and order a second printer from the same seller. (Say it ain't so.) The second printer was a 2015d, i.e., no networking feature.

Feast your eyes on the photos below. The only changes are the stickers, a little removable plastic cover where the Ethernet plug gains entry to the device, and the formatter board. That last one being most important detail.

To save you a minute or two, pry the side panel off from the rear along the vertical edge. You'll need a #2 Phillips from there.




Wednesday, April 9, 2014

Spritz Reading

I read about Spritz a short while ago. And I thought it was really cool. The problem is that Spritz Inc., the innovators behind Spritz weren't going to provide an implementation or SDK or whatever that I could use in the timeframe I was interested in. I assume that their implementation is better, so definitely check on them as they said implementations are coming and they will possibly be free to use.

In the mean time, I have made a JavaScript implementation that you are free to use or modify under the MIT license. I will pencil in that it is the "don't ask me" license as well. You can use it more or less in any way you see fit if you don't ask me anything about it. My slowly evolving code will be posted to Github. I also have it on CodePen and jsFiddle.

Also, for the Android crowd, be sure to check out Glance. It is a neat project which also has it's source code that can be found on Github

Thursday, April 25, 2013

Census data for Zip Code Geolocation - MySQL inserts

I have extracted the data built by the US Census Bureau in regards to the general geolocation of a zipcode. This information is not exact-- but is exactly 'good enough for government work'.

MySQL-inserts-for-census-zip-code-geolocation on GitHub

Wednesday, April 10, 2013

Sorting columns on Netflix

So, it is 2013 and jQuery makes sorting elements in an HTML table a trivial matter (jQuery sorting examples, tutorials, etc.). Add to that the fact Netflix is already using jQuery on their site and, furthermore, the specific page I am referring to (Netflix Instant Queue).

My instant queue, why are the columns not sortable?


The eclectic viewing selections on my Logitech Revue aside, you can see my cursor on 'Star Ranking' in the image below. That is the text selection cursor indicating that it does not have the interactivity I think should be there-- i.e. sorting on a column.


Netflix Screen Capture Showing Unsortability

Monday, January 14, 2013

Change Permissions by File Type

I recently have had to figure out how to allow others, the slightly privileged masses, to traverse my directory structure even if they cannot see anything or do anything with most of it.

find /directory -type d -exec chmod 771 {} \;


Where the /directory is where you want your search to start.

Saturday, December 8, 2012

MySQL timestamp versus datetime

Storing a date according to UTC and automatically converting to the localized time upon retrieval, the way the MySQL database field type does, is something that appeals to me.

But, it looks as though the MySQL datetime type will store a date in excess of the UNIX 2038 date limit.

Friday, November 16, 2012

PHP Objects to XML

What worked for me was to populate object properties with other objects that have one or more of their own properties. (Credit goes to the venerable James Thompson for pointing this out to me.)

<?php

//So first we need an object of objects.

class rootObject {
    public $root;

    public function populateRoot() {
        $root=new singleFirstTierObject();
        $root->populateSingleFirstTier();
        $this->root=$root;
    }
    public function toXML() {
        $serializer = new XMLSerializer();
        return  $serializer->objToXML($this);
    }
}

class singleFirstTierObject {
    public $singleFirstTier;
    public $singleOtherFirstTier;

    public function populateSingleFirstTier() {
        $singleFirstTier=new singleSecondTierObject();
        $singleFirstTier->populateSingleSecondTier();
        $this->singleFirstTier=$singleFirstTier;
       
        $singleOtherFirstTier=new multipleSecondTierObject();
        $singleOtherFirstTier->populateSingleSecondTier();
        $this->singleOtherFirstTier=$singleOtherFirstTier;
    }
}

class singleSecondTierObject {
    public $singleSecondTier;

    public function populateSingleSecondTier() {
        $this->singleSecondTier='singleSecondTier';
    }
}

class multipleSecondTierObject {
    public $singleSecondTier;
    public $singleOtherSecondTier=array();

    public function populateSingleSecondTier() {
        $this->singleSecondTier='singleSecondTier';
        $argumentArray=array();
        for($i=0;$i<5;$i++) {
            $arrayComponent=new multipleThirdTier();
            $arrayComponent->populateMultipleThirdTier();
            $argumentArray[]=$arrayComponent;
        }
        $this->singleOtherSecondTier=$argumentArray;
    }
}

class multipleThirdTier {
    public $multipleThirdTier;
       
    public function populateMultipleThirdTier() {
        $this->multipleThirdTier='multipleThirdTier';
    }
}

$object = new rootObject();
$object->populateRoot();

echo "<hr />\n<pre>\$object: <br />\n";
echo print_r($object);
echo "</pre><hr />\n";

//Now we have an object that will translate into XML via the XMLSerializer class below using the toXML function in the rootObject class.

//http://www.akchauhan.com/php-class-for-converting-xml-to-object-and-object-to-xml/
class XMLSerializer {
    private static $xml;

    // Constructor
    public function __construct() {
        $this->xml = new XmlWriter();
        $this->xml->openMemory();
        $this->xml->startDocument('1.0');
        $this->xml->setIndent(true);
    }

    // Method to convert Object into XML string
    public function objToXML($obj) {


        $this->getObject2XML($this->xml, $obj);

        $this->xml->endElement();

        return $this->xml->outputMemory(true);
    }

    // Method to convert XML string into Object
    public function xmlToObj($xmlString) {
        return simplexml_load_string($xmlString);
    }

    private function getObject2XML(XMLWriter $xml, $data) {
        foreach($data as $key => $value) {
            if(is_object($value)) {
                $xml->startElement($key);
                $this->getObject2XML($xml, $value);
                $xml->endElement();
                continue;
            }
            else if(is_array($value)) {
                $this->getArray2XML($xml, $key, $value);
            }

            if (is_string($value)) {
                $xml->writeElement($key, $value);
            }elseif(is_numeric($value)) {
                $xml->writeElement($key, $value);
            }
        }
    }

    private function getArray2XML(XMLWriter $xml, $keyParent, $data) {
        foreach($data as $key => $value) {
            if (is_string($value)) {
                $xml->writeElement($keyParent, $value);
                continue;
            }

            if (is_numeric($key)) {
                $xml->startElement($keyParent);
            }

            if(is_object($value)) {
                $this->getObject2XML($xml, $value);
            }
            else if(is_array($value)) {
                $this->getArray2XML($xml, $key, $value);
                continue;
            }

            if (is_numeric($key)) {
                $xml->endElement();
            }
        }
    }
}

$xmlOutput1=$object->toXML();

echo "<hr />\n<pre>\$xmlOutput1: <br />\n";
echo $xmlOutput1;
echo "</pre><hr />\n";

//What if we want to add attributes or edit the XML object though?

$xmlObject = new SimpleXMLElement($xmlOutput1);

echo "<hr />\n<pre>\$xmlObject: <br />\n";
echo "Round 1: <br />\n";
echo print_r($xmlObject);
echo "</pre><hr />\n";

//$xmlObject->singleOtherFirstTier->singleOtherSecondTier[$child_count]->multipleThirdTier

$child_count=0;
foreach($xmlObject->singleOtherFirstTier->singleOtherSecondTier as $element){
    $xmlObject->singleOtherFirstTier->singleOtherSecondTier[$child_count]->multipleThirdTier->addAttribute('child-element',$child_count);
    $child_count++;
}

echo "<hr />\n<pre>\$xmlObject: <br />\n";
echo "Round 2: with new attributes <br />\n";
echo print_r($xmlObject);
echo "</pre><hr />\n";

//Sorry, I know you looked. But, you won't be able to see they are there. And what is worse if you want to access them similarly now that they exist, the attribute name will need encapsulated in {curly braces}.

//And we convert our SimpleXML object back into an XML string.

$xmlOutput2=$xmlObject->asXML();

echo "<hr />\n<pre>\$xmlOutput2: <br />\n";
echo $xmlOutput2;
echo "</pre><hr />\n";

//Also, whitespace is a waste of bandwidth if you are talking to a machine.
//The following code will enable us to fine tune how we want whitespace handled by converting our data in an XML string into a DOM document object.

$domObject = new DOMDocument('1.0');
$domObject->preserveWhiteSpace = false; //self explanatory
   
$domObject->formatOutput = true; //false = no whitespace, true = human friendly tabbed indenting

//Now that we have a DOM document object with the settings we like let's load the XML string into it.
$domObject->loadXML($xmlOutput2);

//Last thing to do is output our finished DOM document object as XML document using the saveXML method.

echo "<hr />\n<pre>\$domObject->saveXML(): <br />\n";
echo $domObject->saveXML();
echo "</pre><hr />\n";

?>
<hr />
<pre>$object: <br />
rootObject Object
(
    [root] => singleFirstTierObject Object
        (
            [singleFirstTier] => singleSecondTierObject Object
                (
                    [singleSecondTier] => singleSecondTier
                )

            [singleOtherFirstTier] => multipleSecondTierObject Object
                (
                    [singleSecondTier] => singleSecondTier
                    [singleOtherSecondTier] => Array
                        (
                            [0] => multipleThirdTier Object
                                (
                                    [multipleThirdTier] => multipleThirdTier
                                )

                            [1] => multipleThirdTier Object
                                (
                                    [multipleThirdTier] => multipleThirdTier
                                )

                            [2] => multipleThirdTier Object
                                (
                                    [multipleThirdTier] => multipleThirdTier
                                )

                            [3] => multipleThirdTier Object
                                (
                                    [multipleThirdTier] => multipleThirdTier
                                )

                            [4] => multipleThirdTier Object
                                (
                                    [multipleThirdTier] => multipleThirdTier
                                )

                        )

                )

        )

)
1</pre><hr />
<hr />
<pre>$xmlOutput1: <br />
<?xml version="1.0"?>
<root>
 <singleFirstTier>
  <singleSecondTier>singleSecondTier</singleSecondTier>
 </singleFirstTier>
 <singleOtherFirstTier>
  <singleSecondTier>singleSecondTier</singleSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier>multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier>multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier>multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier>multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier>multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
 </singleOtherFirstTier>
</root>
</pre><hr />
<hr />
<pre>$xmlObject: <br />
Round 1: <br />
SimpleXMLElement Object
(
    [singleFirstTier] => SimpleXMLElement Object
        (
            [singleSecondTier] => singleSecondTier
        )

    [singleOtherFirstTier] => SimpleXMLElement Object
        (
            [singleSecondTier] => singleSecondTier
            [singleOtherSecondTier] => Array
                (
                    [0] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                    [1] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                    [2] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                    [3] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                    [4] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                )

        )

)
1</pre><hr />
<hr />
<pre>$xmlObject: <br />
Round 2: with new attributes <br />
SimpleXMLElement Object
(
    [singleFirstTier] => SimpleXMLElement Object
        (
            [singleSecondTier] => singleSecondTier
        )

    [singleOtherFirstTier] => SimpleXMLElement Object
        (
            [singleSecondTier] => singleSecondTier
            [singleOtherSecondTier] => Array
                (
                    [0] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                    [1] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                    [2] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                    [3] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                    [4] => SimpleXMLElement Object
                        (
                            [multipleThirdTier] => multipleThirdTier
                        )

                )

        )

)
1</pre><hr />
<hr />
<pre>$xmlOutput2: <br />
<?xml version="1.0"?>
<root>
 <singleFirstTier>
  <singleSecondTier>singleSecondTier</singleSecondTier>
 </singleFirstTier>
 <singleOtherFirstTier>
  <singleSecondTier>singleSecondTier</singleSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier child-element="0">multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier child-element="1">multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier child-element="2">multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier child-element="3">multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
  <singleOtherSecondTier>
   <multipleThirdTier child-element="4">multipleThirdTier</multipleThirdTier>
  </singleOtherSecondTier>
 </singleOtherFirstTier>
</root>
</pre><hr />
<hr />
<pre>$domObject->saveXML(): <br />
<?xml version="1.0"?>
<root>
  <singleFirstTier>
    <singleSecondTier>singleSecondTier</singleSecondTier>
  </singleFirstTier>
  <singleOtherFirstTier>
    <singleSecondTier>singleSecondTier</singleSecondTier>
    <singleOtherSecondTier>
      <multipleThirdTier child-element="0">multipleThirdTier</multipleThirdTier>
    </singleOtherSecondTier>
    <singleOtherSecondTier>
      <multipleThirdTier child-element="1">multipleThirdTier</multipleThirdTier>
    </singleOtherSecondTier>
    <singleOtherSecondTier>
      <multipleThirdTier child-element="2">multipleThirdTier</multipleThirdTier>
    </singleOtherSecondTier>
    <singleOtherSecondTier>
      <multipleThirdTier child-element="3">multipleThirdTier</multipleThirdTier>
    </singleOtherSecondTier>
    <singleOtherSecondTier>
      <multipleThirdTier child-element="4">multipleThirdTier</multipleThirdTier>
    </singleOtherSecondTier>
  </singleOtherFirstTier>
</root>
</pre><hr />

 

Are there more compact and elegant ways to do this? Sure. But, this gets the job done.

Thursday, October 11, 2012

Automatic Touchpad Disable While Typing in Ubuntu (Kubuntu)

If you are running Ubuntu or an Ubuntu variant (like me using Kubuntu) then you can:

sudo apt-get install gsynaptics


to get additional options for the configuration of your Synaptics or Synaptics compatible touchpad. --I've been grazing the touchpad while typing, but there is a feature that disables the touchpad for a short while if a keyboard key is touched. Huge reduction in stupid and annoying accidental typo corrections.

Wednesday, September 26, 2012

Recursive String Replacement

find /recursive/replace/directory/ -type f -exec sed -i 's/properlyescapedsearchstring/properlyescapedreplacementstring/g' {} +

by properly escaped, I mean using the backslash character(\) before special characters ( \. \/  \\ )
I should make myself a tool for this.

Installing the Papyrus Eclipse Plugin

The software source you will need is:
http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/juno/main

Then you will need to install the modeling libraries from eclipse.org. I ended up just installing them all.

For whatever reason, I did not have a 'palette' tool box on my first model. It is there now, I created a new specific model (use case checkbox) with basic primitive types (checkbox) and they were magically there-- if you don't see any way to add diagram graphics via the 'palette'.

About Cloned Wordpress Servers and Logging In to the Wrong Server

So, I cloned an entire server as a development environment.

On that server was a wordpress installation.

The server was logging in to the wrong wordpress installation.

There is probably a 'correct' way to do this. But I found the wordpress options I needed to change in the wordpress database in the prefix_options table. (We have prefixes set to ON for multiple wordpress installations. Our tables are prefixed and referenced with prefix_ prepended in this post.)

SELECT * FROM prefix_options LIMIT 0,20;

From there, you should see why your new wordpress is logging you in to your old wordpress...

Hint:
mysql> select * from prefix_options limit 0,20;
+---------+-----------+-------------------------+--------+
|option_id|option_name|option_value             |autoload|
+---------+-----------+-------------------------+--------+
|        1|siteurl    |http://notdevelopment.com|yes     |


mysql> UPDATE prefix_options SET option_value='http://development.com' WHERE option_id=1;


Monday, September 24, 2012

Changing the default user and group for files in linux directories

Issue this command to have new files in the directory get set with the owner the same as the owner of the directory

chmod u+s

or issue this command to have new files in the directory get set with the group that is the same as the group of the directory

chmod g+s

also restricting deletion by any non-owner or privileged user is chmod +t to set the sticky bit

Capitalization is used to show whether the execute permission is set or not since these settings show up in the same spaces as the execute bit.

Here are a few examples that you might see if you ls -la:

rwSrwSrwT
(that means rwxrwxrwx with uid, gid, & sticky set)

rwxrwSrwt
(that means rwxrwxrw- with only the gid & sticky set)

Followers