This section contains mostly articles migrated from my old Wordpress site. It was more of notes to myself that I hoped would help others. A few got quite popular. Who knew Oracle SQL was still so hot.
Anyway, I migrated them from wordpres to hugo, integrity suffered, Forgive the formatting please :)
You can check out my Adventure Riding Blog for something different.
I recently joined members of “the greatest hobby in the world” - an amateur radio operator. I earned my Technician class operator license about a month back, fulfilling an interest I had way back as child. My official FCC assigned callsign is KE2HOA.
Technician is the intial / entry level class for operators, allowing limited operation across lower frequency ranges. As my experience grows I plan to pursue the General class to expand my access to those larger bands. (Band size is inverse to Frequency)
As a volunteer firefighter I may be called to duty during work hours, and wanted a way to quickly notify my team with a calendar and slack status.
Yeah! Sorry that probably deserves it’s own post, why and when. But I’m a member of our local Volunteer Fire Department, which is staffed by a collection of local residents giving back. Honored to be amongst them. Also, fire departments across the country need more members, so considering joining your local department, there is a job for everyone!
I’ve been spending more time (and money) on ESP related projects, and recently solved the “how do I stop sensors from using battery power during deep sleep”
The impact of it may vary, but for a particular adafruit sensor module, which somereason has an led in it also, uses more energy (additional ~3ma) than I’d like. Shutting the sensor down should save about 3.2 milliamps of draw. For a 2500 mAh 18650 battery, that means 780 hours.
Wow.
I am just awed by the support and turnout from this community. You all just totally blew me away.
Thanks for everyone who voted, read, shared, attened, and asked. While the current board still needs to approve my election next month for my term beginning July I’m not going to lose any momentum. I already have a list of things to research and understand better, and I look forward to start building relationships with the team.
This is a reprint of my campaign email for School Board
Friends and neighbors,
When: Tuesday, May 17 from 12 noon to 9pm
Where: high school gym, 17 School St.
There are 4 propositions on the ballot as well as the vote for your next school board member. I’m hoping this email is an effective reminder to make the time Tuesday, and support me with your vote, but I also wanted to share a few resources to help your decisions.
This is a reprint of my campaign email for School Board
Hello Friends & Neighbors!
I’ve submitted my nomination to be on the ballot for School Board Member for the Peru Central School district. The vote is May 17th from 12:00 noon to 9:00 p.m. (want reminders?) in the High School Gymnasium. I am very excited for this chance to support of our community, and I need your help:
Did you know metric is the preferred system for all U.S. agencies, and required for interactions with commerce?
I feel fortunate that my employer is based in Australia. It’s continued to push me to re-evaluate my ethnocentric views of measure.
It started during a recent converation in our “Makers” channel discussing where and when we see imperial and metric measures used, some of them left the question there for us “Is the US really that averse to metric? Don’t they sometimes use both types of measures?”
Turns out the United States is already a “metric nation” and has been since 1880’s or 1970’s depending on your interpretation.
So if the U.S. Government is metric, why isn’t the nation?
Us. Me.
So read on to see how our household is moving forward!
I’ve pushed some changes to this site to reflect an important change - my name!
Moving forward I will be using the surname Webbinaro, which is the marriage of my wife’s family name and my own.
Webb + Rendinaro = Webbinaro
Now, despite the low-hanging joke for an SE and tech speaker it does not sound like webinar but rather Webb-i-nair-o, respecting the roots in my wife’s family surname.
Although COVID-19 has slowed our process with the courts a bit, after 4 months of paper pushing we did it.
I have a neat little trendnet that I got on sale a while back with the idle idea I could expand my google mesh already 3 nodes strong.

I tried a few times without much luck.
I Just could not find enough in the documentation to properly configure the repeater without hosing something.
What do I mean hosing? It was like roulette trying to get a few principles all working in tandem.
CircleCI is a premier SaaS solution for integrating Continuous Integration pipelines with any any GitHub repositories. The documentation is loaded with example integrations including Heroku and Cloud Foundry, but for Cloud Foundry are limited to simple cf push. This blog posts explores the full configuration required to enable Zero Downtime deployments with the Blue/Green pattern. The concept of a Blue/Green deployment is relatively simple, so long as you’re building stateless web apps or services. And that’s a well covered topic elsewhere. This post assumes your apps are stateless, and can run multiple versions in parallel.
Woah, is this thing on? It has been a while since I’ve ranted or shared anything, but I am trying to get back into regularly sharing my thoughts, however useless they may be.
The topic burning in my soul today is the monotony of long stand-ups, scrums, whatever you call the daily ceremony your agile team attends to discuss where the work stands. My opinion on this is simple Scrums are not status meetings!
For those familiar with ReCAPTCHA you know that Google acquired the ingenius tool some time ago. The service provides two features. Spam prevention for site owners, and nearly flawless OCR for Google. OCR is Optical Character Recognition, and is the difficult task of having computers read the words, letters and symbols in scanned text or images. ReCAPTCHA shows 2 words. One word it already knows, which provides the spam prevention. The second word it is trying to figure out. So it will use your input, and the input from thousands of other end users to build a consensus. Using this technology ReCAPTCHA has already digitized the entire NY Times archive. So what’s next?
The amount of users who rely on Google Calendars to organize their personal and professional lives is staggering. Seeing as most clients are comfortable and proficient with the technology, there is little reason to point them elsewhere when they ask for a custom widget to display upcoming events on their site. [caption id=“attachment_966” align=“aligncenter” width=“307” caption=“Google Calendars are easy and everywhere, with a robust API we can leverage”]
[/caption] In fact, the only trouble is that Google’s provided widget layouts are all - er, well they are all quite lame, and likely won’t match your current theme. No worries! We can easily leverage Google’s calendar API and Javascript to create a fully customized Calendar widget showing the next N upcoming events in chronological order. Let’s start by looking at the provided Google widgets.. [caption id=“attachment_967” align=“aligncenter” width=“300” caption=“Default “Agenda” layout for Google Calendar”]
[/caption] Wow, that would look great in a Google webpage somewhere. But it probably doesn’t meet the layout you were looking for. So we’ll use some basic HTML and JS to manipulate an Atom feed from Google. Getting the base URL for your Calendar
Checking the integrity of a file on a unix node is simple thanks to a confusingly named “checksum” utility. It, oddly enough gives you the checksum of a file. If your stuck on (or just love) windows, you can give yourself the ability to check any files checksum with the click of a mouse. [caption id=“attachment_956” align=“aligncenter” width=“421” caption=“Right-Click any file to validate the checksum integrity “]
[/caption]
Although still very new, and with much to learn I am loving Modx as a tool to quickly build out robust sites. Recently a client wanted to add Facebook Integration to their MODx site. I’ve used Facebook’s API before, and know it makes authentication pretty easy, but I had to figure out to insert that authorized user into Modx’s web context. And it was actually quite easy as well. The user becomes a full blown member, and can be treated the same as any user that registered. (you can also treat them differently) Read on to learn how two simple snippets allow Facebooks users to add themselves to your site in the provided member groups. The extra also creates a full user profile in modx based on Facebook’s info, complete with:
I recently implemented JQuery’s Tabs feature into a site I am building for a client. My first though was “wow, that was easy.” And then the usability issues starting making themselves apparent. ** I like stateless web. Everything is linkable and bookmarkable, and once you have something the way you want, you should be able to share it with nothing more then the unique and repeatable url.** WHat do I mean by usability issues, let me explain with a few scenarios.
MODx is a PHP based, mm.. tool, for publishing websites. I don’t want to call it a CMS, though If you read MODx documentation, they’ll call it a Content Management System. But in my experience products labeled CMS tend to be inflexible tools that require lots of effort to place widgets on custom templates. I remember using one tool in which you could not have a publicly accessible page not belong to a menu. We ended up building a hidden menu for all such pages - absurd! At the other end of the spectrum are highly flexible frameworks. These are much more flexible, and let you run wild, but leave a good chunk of work to setup decent content management, authorization, etc. before you even get to the site at hand. Well MODx sit nicely between a CMS and a framework in my opinion. You get user management, admin panel, powerful configuration, etc. But you are not forced into any mold. In face the default install (without sample content) is literally an empty page! Uncomfortable at first, but once you spend a few hours with it you begin to love the freedom. It is intended for sites that are heavy content focused, but provides full CRUD application abilities as well.
I am writing this as the release for Gingerbread (2.3) is being slowly released OTA, but the same steps apply regardless of the rom version you are eagerly awaiting. This is safe and repeatable, and I have done it for 3 updates on 2 devices now, so I am very confident nothing will go wrong. Even so, I waive any responsibility if something goes wrong. For the details and pictures, read below the fold.
I’ll admit before I go any further that I am a Google fan, and Android developer. When Google sent me the free Logitech Revue I was eager to dig in! But honestly, I’ll do my best to stay neutral. And before I go any further I want to make sure we’re all on the same page about what Google TV actually is or does.
We didn’t have room on our pages for individual message boxes, and also had the need to style specific fields on our JSF pages whenever validation failed on the server, with user friendly field names in the message. Example: “User Name is Required” , and the field for User Name is highlighted red. [caption id=“attachment_864” align=“aligncenter” width=“300” caption=“Custom field styling and nicer field names for JSF validation”]
[/caption] Unfortunately there are times when jsf insists on inserting field ids into the message.
I’ve had the recent pleasure/pain of implementing JPA a new Java web application. After reading many misleading blog posts and dead-end mailing list threads I have worked out the major kinks, and thought I would share. A few things first:
Topics
Yes, you read that right.
In celebration of Julygustember, and the Julygustember 2010 DreamHost Newsletter, I am offering a discount code to all of my readers. The coupon is good for $60 off 1 yr of DreamHost hosting, with a free domain for life!
of top-notch, full access, best support money can by hosting - WITH a free domain. Use the DreamHost promo code JAS2010 when you check out to receive the deal. [caption id="" align=“aligncenter” width=“468” caption=“Only 4.95 for all this! Normally 8.95”]
[/caption] That’s only $4.95 per month for:
You may have seen the news recently that Gmail can not place calls to your contacts through the use of a browser plugin, and google voice’s VOIP infrastructure. All you need is a headset or microphone for your PC to send calls. But the best part is the flip side – calls to my Google Voice number can reach me in Gmail chat ! So along with ringing my work extension and mobile phone, I will get your call in my (always open) gchat window ! [caption id=“attachment_829” align=“aligncenter” width=“300” caption=“Calls to google voice numbers can now also ring your gchat session”]
[/caption]
I recently had the need to get the ip address for a remote node. Wait, scratch that.. I had to get the IP addresses for about 60 remote nodes. You’re right… I probably could have typed
nslookup targetNode
60 times. But I am a programmer! SO I decided to pass my choir off to a shell script. If you have a similar need, read on! The script is simple, just add all target nodes as a space separated list, and run the file.
I have been growing fond of JSF as of late, but was stumped by the simplest task. How do I associate some value with a link? If I was using PHP I would just append a query parameter and grab the value. But with JSF it’s all done inside our xhtml files, so how do we set a value based on the link clicked? Just use
inside the commandAction. This stores any expression into the specified bean’s property. See below for a full faces example. Each Player link will set the backing Bean’s player object before calling the action.
Editing config files is the only certain thing above taxes and death (too lame?). Whether it’s your apache setup, or dns bindings its likely you use vi or another favorite editor to open your server’s files, make that needed update and save. If you were good you copied the file first to a backup tagged by date. .. But managing that process manually is just a workflow annoyance. So the script below backups the file, tags it with the date, and opens it for edit. Additionally you can set a maximum number of versions to track any given day. It adds no more effort than calling vi..
As many of you already know, Google announed during their second IO Keynote on Thursday that the latest version of Android (2.2 - Froyo) to start shipping will include WiFi tethering - or hotspots. This feature allows you to share your mobile phone’s connection with any nearby computer - and its completely legit Phone carriers can be none to pleased, as makers like Sprint already include a hotspot option on their latest EVO, but charge extra for the feature. Since I was fortunate enough to attend Google IO i received the new EVO along with its 30 day trial of Sprint’s service. I must say that I am in love, but paying ~$80 a month for one phone and data is just too much.. Maybe I will share the phone with a loyal reader after my plan expires next month..
Anyone who has been to this site more than once likely knows of my Android application for Netflix users. The application supports Android phones like the Motorola Droid, The HTC Incredible, and the Nexus One (among other devices). What none but a few “power users” know is that I am feverishly working to entirely refactor QueueMan in order to introduce long awaited features. The newer version will still be wicked cute, and simple to use, but there are some critical features lacking in the current version I need to address. Like what? Keep reading…
More and more clients are asking for dynamic sites that allow them to edit specials and pages at will. This is great because it surely means they will come back for more questions and changes as they use the site. (read : more income). What they want are CMS, or content management systems. What I give them is usually wordpress loaded with useful plugins. (If custom business logic is needed i turn to CakePHP). ANd why not? The Wordpress engine provides post and page management, RSS feeds and discussion features, and customizable “widgets.” But a few key features are needed to make the leap to a decent CMS. Read This (Update: FInally a CMS that clients can use! - found concrete5 CMS very recently, and first impression is wow!- trust me its worth a demo ) Besides, no matter how many times I explain creating a new page in drupal, or how to add a side box in joomla. There is just too many steps and switches for the average small business owner. (is that a huge stereotype? yes, I apologize..) But honestly, most non-technical users don’t think in terms of elements like footer, and side bars, and such. they think of pages! (and conrete5 does that in a spectaciular manner) ..but if you don’t want to give that a shot first, read on. The plugins handle 4 critical areas for any decent site:
I manage lots of domains, and offer my clients free backup and recovery service. Nice selling perk, but I best be damn sure I am backing things up regularly. Since there is no way my space-cadet brain would remember that, I rely on my ’nix friends: bash, cron and tar to neatly package every sub-directory of my webroot into their own little tarballs. The bash script included after the break reads all directories into an array that we can loop through and manipulate as needed**.**
So I purchased a G1 from t-mobile when they were reasonably new, and have since was kindly donated a nexus one (best phone ever). But what to do with my old G1? Obvi - turn it into an Android Developer Phone that I can run without a sim card, and test my apps on anything faster than the emulator. Not to mention the value of actual phone, accelerometer and leds. I know G1’s are locked, hence I took the action as a good citizen and called T-Mobile. Turns out if you have the phone for 90 days then they will just give you the Unlock Code. So I naively thought that would allow me to wipe the phone, and run sans sim. Wrong. Turns out that you only get the unlock prompt if you have a foreign sim card. But if I use a bunk sim, I wont have a data connection, and could not get past registration. I ended up with a useless piece of hardware that would do nothing but report the absence of a sim card. Let me share a few other highlights:
I was tempted to run with the Fedora 13 Alpha, but just found out this morning that Fedora 13 Beta RC1 is publicly available. Fedora 11 was still treating me fine. But I was curious to see the changes, so I ran a complete re-image of my machine. What did I find?
The installation looked good and went smooth. Still doesn’t support wlan authentication during install :(
[caption id=“attachment_696” align=“aligncenter” width=“300” caption=“And it begins..”]
[/caption] The installation lasted about 45 minutes start to finish. Ahhhh After the install the CD drive kicked open, and the screen slowly died, fading from color to black very slowly. It stayed totally black for several minutes before I restarted. 

That did not seem to be one of the issues listed on the known errors page, https://fedoraproject.org/wiki/Common_F13_bugs, so I will need to report that.
I recently read an article on Linux Magazine that suggested JSON is a better tool for data transfer than XML on Android phones. So I decided to try switching some of QueueMan’s queue retrieves over to JSON. Eliminating the verbose tags may be much quicker over wireless airwaves. The choir I tackled was to compare the performance of XML and JSON by downloading the user’s recommendations from the Netflix API. To make testing quick I would make a call to both XML and JSON classes in each loop, and repeat 10-30 times for each sample point. The sample points were 1,5,10,15,25,50, and 64 discs. (64 being the current # of recommendations Netflix is offering me) I used org.xml.sax, and org.json. JSON* as the libraries for my parsing.
I never posted the start of this story. To be honest I thought it was a scam, and didn’t want to boast about being burned. BUT alas it is not a scam! - The phone arrived as promised and ahead of schedule. [caption id=“attachment_682” align=“aligncenter” width=“300” caption="‘heres yer phone, thanks for rockin’"]
[/caption] So if you did not infer from the text of the letter, or just can;t read it in that tiny photo, here’s the background. I released QueueMan through the Android Market back in October, about 4 months ago. SInce then, thanks to lots of feedback I have grown from 46 users to 12,000 active users, and 20,000 downloads. Awesome! So that was reward enough, but Google wanted to call out some developers in an attempt to seed the market with high-end android devices, smart. But the initial email came from an address I was unable to reply to, and led me to a generic Google ‘Sites’ page. Anyone can make a page on Google Sites, and the tricky could likely spoof an email address. So there was my dilemma, do I give my name and address to a random web page that claims to be Google, or do I miss out on the sweetest phone ever!? I did neither, I tapped an engineer I had corresponded with at Google. His email came back:
As I mentioned in my article “Migrate form Apache to Nginx and keep rewrite rules intact”, Nginx is an awesome and lightweight web server. The only trouble I have ran into since the switch is Pligg. The htaccess file is ridiculously complex, and I suspect some of the rewrite rules to be repetitive or overlapping in areas. Using the rules from my past article though I was able to get nginx rules in place that seem to work.
nginx is a very fast and very lightweight web server that can handle static HTML blazingly fast, and does very well with dynamic (PHP) content as well. In fact the very site your viewing is running atop of nginx. nginx isn’t ideal for every server, and can’t handle SVN or WebDAV among other protocols. But for your average site running PHP, Ruby or Django, nginx is choice. The trouble was that I have lots of site (like this one!) that rely on a myriad of rewrite rules and logic to direct users properly. Because we lose the mod_rewrite provided by apache, we need to tell nginx about our rewrite rules. Luckily the logic is very similar, and all expression based as before…
Everyone is talking about Google’s Nexus One. Most people are saying that an unlocked phone for $529 just won’t fly here in America. We like our phones with a ridiculous amortization attached through 2 year contracts so we feel like we’re getting a deal. Sure we end up paying far more than the phone is worth - but we don’t pay it all at once. That’s the American way - defer. Now if you tell a company like Verizon that you don’t want their discount phones for new contracts they will say fine.. but you won’t save any cash. In fact you’ll pay more for unlocked phones plus an overpriced contract. However for those fortunate few who have escaped the new-every-2-until-your-dead plan there are other options - like a Google Nexus One for $49. If you’ve not had enough of my Verizon bashing, please read on.
I wrote a month or two ago about my Android application for Netflix subscribers. The application allows users to fully manage their instant and disc queues, browse recommendations and search all titles. The reason then for this post is to share an update and gloat a bit. QueueMan has a whole bunch of new features, has been downloaded nearly 5,000 times (Update: Over 10,000 times!), is tested and proven on Motorola’s Droid platform, and is getting quite positive reviews compared to other Netflix apps on the market. Oh yeah - and it’s all open source - Booyah! The first release of QueueMan was.. well wimpy to be honest - but it did the trick for me. Since then I have received lots of enhancement requests from Netflix users, and I am happy to report I have implemented a good number of those.
For sometime now Google has been offering its custom built mobile OS - Android - to various carriers and manufacturers. News has been released however that the company plans to offer its very own phone direct to consumers by Quarter 1 - 2010.
Here’s what seems to be the consensus among the community, mostly based on leaks, or supposed leaks from Googlers.
Analysts see this as a direct move against Apple, and their popular iPhone. With Eric Schmidt off Apple’s Board of Directors, there is no longer any conflict of interest with such a product line.
I just got up and running with Fedora 11 after Ubuntu finally pushed me over the edge. Every update seemed to break something else for me. But anyway Fedora is great, save one small caveat - I couldn’t run any 3rd party 32bit applications. Ok, make that one huge caveat. Consider some critical apps like Flash, or Android SDK that just wouldn’t fly. Rather than downgrade my distribution to the 32bit flavor (which too would solve this dilemma) I opted to keep my 64bit distribution and just add the needed 32 bit binaries. SO you want to install Android SDK, or another 32bit app on Fedora 64bit? Read on! Maybe you saw an error like;
QueueMan aims to be the Open Source Android application for Netflix subscribers. And it has already gotten some great reviews. [caption id=“attachment_628” align=“aligncenter” width=“256” caption=“Netflix application for Android devices (Nexus One, G1, Droid, Eris, others)”]
[/caption] Isn’t it adorable!
11/11/09 - QueueMan told me how it was, and he wants to be an open source droid. Well as a lowly developer I am in no position to argue. Please checkout QueueMan’s new home on Google Project Hosting. QueueMan is now licensed under the GPL version 3.
SAX, or Simple API for XML has grown to be the standard in Java XML parsing. Numerous studies show how its performance, in the majority of circumstances, beats others such as PULL. Does that mean you should just bang out a custom handler and expect solid performance, hardly. This article has only two tips, but it can have a huge impact.
In case it has been a while since you wrote your last SAX XML handler, below is a sample method for the start of each element in an XML stream. This method will be called each and every time a new element starts, no matter how nested or trivial.
So you host 13 domains on one server and want SSL certs for each domain. The cost of unique IPs is an obstacle indeed, but what if you didn’t need any unique IP addresses? IMpossible you say? Not with the release of Apache 2.2.13! I stumbled on this nice little feature called SNI (or Server Name Indication) that allows multiple domains to share an IP and implement SSL without showing warnings to users or confusing Apache. I found this beauty after reading another great article on Linux Magazine, Ten Things You Didn’t KNow Apache (2.2) Could Do So those of you running your own servers can take advantage by upgrading today! For those of you relying on a Host you should start bombarding them with requests immediately. DreamHost members can vote up the already created suggestion to implement this.
This is a response to a question on the DreamHost wiki posted by anonymous.
“I have a Contact page using form mail, and want to include a checkbox that enable visitors, to also subscribe to our Announce List when posting their form mail. Is there a facility for adding users to the Announce List without using form POST”
Without using POST? I am not sure about that.. but using a checkbox to subscribe users is a snap. Your resources;
A quick and dirty tutorial to get a new Ruby on Rails application running on your [DreamHost](http://www.dreamhost.com/r.cgi?488244/hosting.html|EDDIESAVES “Save $50 off the yearly cost of hosting with Promo Code “EDDIESAVES””) server. In am going to concentrate on the easiest method, which is to use the Phusion Passenger module, a.k.a. ‘mod_rails’.
Some wise warnings from the DreamHost Passenger Wiki page;
Alright, so without further adue I will jump into the process of getting a Ruby on Rails application to run on DreamHost servers.
As an avid Beta tester I must admit that the excitement of receiving that new product invitation email never dulls. That is very true for the email I received earlier this week inviting me to Google Voice. The service is particularly sweet for any Android users that are already syncing their Google contacts with their phone. Google Voice can see these contacts as well and label all your incoming calls. The Google Voice interface looks very much like gmail. There has been a lot of buzz about the product and its features, so I wanted to share my findings to anyone who may care, so here it goes. [caption id=“attachment_531” align=“aligncenter” width=“300” caption=“A snapshot of a Google Voice inbox”][/caption]
Many cell phone carriers are moving to implement a circle of friends that you can call for free. T-Mobile has MyFaves™, Alltel has My Circle ™, even Verizon offers a discount on the ten numbers you call most. This begs the question; “Who do I call Most?” Well you can be subjective about it and decide you like Danny better than Mary-Lou, but the truth is that Mary-Lou calls you constantly, and that’s going to put a dent in your anytime minutes. The more objective and scientific method is to actually count the minutes you spend on each number and rank the accounts in order of use. Hmm, I am already thinking AWK. Read on to get the awk script to sort your monthly calling logs into facts you can use!
More and more sites require you to verify an account by receiving an email.. fair enough. But then 2 months later you start getting the newsletters and updates that you no longer care about. Enter Gmail ! To be honest, other mail servers may do the same, it may be standard, but I have not seen it used outside of gmail domains. Anyway, I digress. The Alias ability in Gmail lets you create a unique address for a site(s) and then set filters on those addresses, my favorite being send to trash..
Before I get into the details of this article (that will explain how to download and customize ringtones for free) let us take a moment to respect the complete awesomeness that is the G1. Why is the G1 so awesome?
How do we get free ringtones? Free custom Ringtones? It’s easy! First off I’ll admit that the G1 comes pre-loaded with several really snazzy ringtones. The community and Google have done a really great job with Android. The phone works fast and smooth. Not your standard and annoying beeps or midi ringtones, but harmonic and catchy rings. nice. With that said I still like to add a few of my own, my favorite standard is Bob Marley’s Sun is Shining.
Tools like PuTTY and Cygwin allows users trapped in a window’s world to retain some of the power and functionality of ’nix platforms. Together or independently they allow users on windows machines to SSH, SCP and interface with Linux, Unix, Solaris, or even AIX nodes. The absolute best part? You can generate a pair of keys to make remembering passwords a thing of a the past. This is especially important to one’s sanity if you work in an environment with 10s or 100s of different nodes that all have rotating IDs on different schedules. So my goal in the article that follows is to setup a powerful workstation that includes Cygwin, PuTTY, and WinSCP. WinSCP is not a necessary tool, but I’ll admit I like to resort to a graphical SCP tool every now and again. Unlike a few other articles I have read I will not encourage you to use passphrase-less keys, just too risky in my mind. Instead we will just limit the number of times we need to enter that password to say about…. 1. To recap, our Goals are;
Wow, that title is a mouthful. Basically i figured out how to use SYSDATE and some other temporal methods to automatically determine the first and last day of the previous month, or previous year. I needed this to hand off a canned query that can be used by many users without the need to constantly update the date parameters of the query. For instance “Show me sales totals for the previous month!” or " What was the total number of transactions last year?" You could just type something like
This article started as a footnote to an article I wrote yesterday, using ACL in CakePHP. I wanted to outline how the hierarchy structure of the Aro and Aco tables worked, and just what lft and rght columns provided over parent_ID. I soon realized that my topic, although used by ACL was much broader. Not only is it a standard practice in referential DB’s requiring a hierarchal structure, but it is used by Cake’s Tree behavior as well. So in order to keep some..order in my site I broke it out into its very own article.
The ACL component of CakePHP can be a daunting undertaking for those new to CakePHP or ACLs. Once you take the plunge though you’ll never look back. The flexibility and power of the ACL component are worthy of your site, I promise. In order to help some fellow bakers into the water I wanted to offer some advice.
ACL, or Access Control List is a common means to control access to applications or sites at a granular level. The basic premise is simple, you have ‘whos’ and ‘whats’. The combination determines who can access what.
This solution allows you to purge all tables from a database without actually deleting the database. This may not seem practical to those that have full rights and wonder.. “Why not just create a new DB?”. For others that are using a hosting plan or work for a large company with restrictive bureaucracy will appreciate this simple tip. The reason is that your account may only have specific rights on that Database and absolutely no rights on the hosting server. Even if you had permission to delete the old DB, you would have to jump through hoops to get a new one created. So in short, “Because we can’t” It has also been pointed out as a way to maintain the schema.
To backup a mysql database from a unix command line is relatively simple. It is equally easy to automate this task with a shell script and a crontab (cron jobs). In my case I needed to backup ~15 unique databases and I despise repetitious code, so here’s what I came up with. **Update Added means to allow different User and password based on current DB. ** ANother Update! - better error handling.
So I am proud to say I frequent the CakePHP group on Google, and try to offer my assistance when I can. A lot of times I see people asking how they can validate optional fields, or validate fields that are dependent on others. An example, sure: Imagine you have an employees model.. yeah all modeled up, that looks good, nice work. When you get to validation you realize…. To register they must enter either their PIN # or their First and Last Name. ..but not all three. THere are other scenarios you might think of… Cell or Work phone…. Email or mailing address.. etc..etc. What gets a little more interesting here is that we should provide unique errors for each possible situation. Initially we can just ask for PIN or names. If they enter just the PIN then they are all set, don’t bother them with either name. If the user enters only their first name we say OK, they are trying names, but we need to ask for their last name, and not worry about the PIN. Same for just their last name, a unique error asking for first name. As of yet I don’t believe CakePHP has a built in validation rule for such, but that’s no problem. Because CakePHP plays so nice, and is so extensible that it only takes a little bit of thought to make this a relatively simple feat. Curious? Read on!
Spam is bad agreed? Of course. But making readers painfully decode swirled letters and numbers is nearly as bad. That is why many sites will use logic questions to prevent spam and bot activity. Implementing logic questions on your mail forms and registration is easy for your readers and simple for you. This tutorial walks through the steps to create one using CakePHP. The solution will pick a random question and answer stored in the database and based on desired difficulty. Hooray!
When delivering an application that will be administered by clients I found it best to keep them out of the source code. THis means that any options, any at all, should be editable from a frontend. Site name, taglines and metadata are examples of such settings. Any constants that will be changed (Oxy-moronic I know) can also go here.
Letting your client edit site_details.php just to change the site’s tagline ends up in 500 errors or the like.
I was writing a pretty complex Log Recylcer script that handles rotation, purging and compression. I wanted to print a nice summary at the end with all the counts. I got incredibly frustrated when a simple variable increment seemed to have scope issue.** I can only re-create the issue using a pipe and read**.
For those of you familiar with Bash you know that a variable declared inside an if statement or loop can usually be accessed outside that block without issue. unlike other languages (PHP or Java for example) where a variable must be initialized outside the block first. In Bash anything declared inside a block is preserved for the life of the script. Except when that block happens to be a while loop using read from a piped command!
This is another article based on current search terms for my site. A good number of searches for “piwik + cakephp” are landing on various pages of my site. So if your one of those folks I’ll assume you want to use Piwik Analytics in your CakePHP site. Well your in luck, the solution is nice and easy. CakePHp provides some nice variables that we can use for detailed page tracking.
I recently developed a prototype for a client who insisted that the site include an RSS feed for the articles of the site. Not being one to turn down a challenge, and being aware of the Power of Cake, I assured them it could be completed with such a feature. The newsfeed would provide the latest articles to be consumed by an aggregation software or other feed reader. So in the text that follows I’ll outline what is involved to add news feed or rss feeds to a particular model of your CakePHP site.
Feedburner provides a simple Ticker applet for display in your pages and elsewhere. This always worked fine for me until I transferred my feed to Google. Now I love what Google is doing, like free-ifying all of the Pro services, but I really depended on that simple ticker to know where my feed stood. If you found that the Feedburner ticker is no longer working for you (make sure you add your feed’s uri to the end), I offer my solution as a replacement. At least until they update the applet. First I suggest you try the existing Feedburner Ticker before using this. If it shows 0 0, then keep on reading.
This is a horrible tittle, and I apologize. What I mean is that we can show nested items based on parent-child relationships that will expand and collapse with a simple, click. The trick requires prototype and scriptalicious. The reason is ease of use and aesthetics. If a user lands on a page, let’s say ‘Categories’ and sees all the categories sprawled out across the page they’ll retreat in horror. [caption id=“attachment_333” align=“aligncenter” width=“150” caption=“Defaulting to expanded trees is overwhelming to visitors”]
[/caption] Instead it would be much nicer to only show the top-most categories, and let them dive down where necessary. [caption id=“attachment_334” align=“aligncenter” width=“150” caption=“Showing the condensed tree is much more aesthetically pleasing”]
[/caption] We can take it a step further by adding a nice slide effect so the sub-items rolldown like a window shade, and retreat in the same manner. See the sliding tree items here.
So when I wrote the article that introduced a script to generate mysql backup files for multiple databases I mentioned the trouble that will occur if you don’t get a handle on some means to retire old files. This applies to log files, mysql backups, or just about any other type of file that is created on a recurring basis. You don’t need a error log from 134 days ago, but error logs for the past week could be very useful. So what do you do? Why recycle of course. This article shares a simple shell script to purge any files older than X days, where X is of course a number allowing for flexibility. It is very simple to use a shell script to delete log files, or in this example sql backups.
I recently upgraded my hosting provider to DreamHost on the advice of a co-worker. The reasons for the move are many, but the topic of this article is how I am to move the hundreds of files I host from one server to the other.
I knew there was no way I am going to torment myself by compressing, downloading, uploading and un-compressing the files. So what other options did I have? I thought about using ftp to transfer files directly between servers, and even plugged out a little automated bash script to handle this. I quickly realized the fact that ftp doesn’t work for folder structures, and unless I want to list, recurse, and create directories then this option would not suffice.
Hotlinking… one of the most dastardly crimes to hit the internet. This is especially concerning if your hosting plan caps your bandwidth. Hotlinking is when users insert a url to your images on their own site rather than linking to your page (or just uploading the image to their own servers) What is a simple webmaster like yourself to do with these hooligans that are chewing away at your bandwidth allocations? Well block them of course. The solution is simple and straightforward. Best of all you can even server up a humorous or fearful image to replace the one being hijacked.
Doesn’t matter whether it’s a CakePHP app for a client, your own personal CMS, or any other web based application. If your passing around passwords or other sensitive info you should really implement SSL. SSL provides 2 main perks to your visitors.
Once you implement SSL certificates on your server you’ll want to require secure connections using Apache’s rewrite module. Now I won’t dwell on the creation and signing of certificates, its already well documented. If your just starting out though,heres a few links I recommend;
If you work for a large enterprise you undoubtedly know the “features” of typical IBM Rational products. And if you work at a really large enterprise you likely have little freedom for deployments environments beyond Websphere. But that’s OK! For the first post in our cross-blog series “Escaping IBM Rational Products” we look at alternatives to IBM’s Rational Application Developer - keeping in mind that the result must be a file that can be easily deployed to a Websphere server once ready for production. But we can avoid having to deal with WAS in development (mostly). …not that constant crashes and consistent use of several gigabytes of memory isn’t desirable - no wait, that’s extremely undesirable. We can also save the recurring license costs associated with Rational development tools.
With version 1.2 we got a much more powerful validation feature. I think that many people migrating from version 1.1 may not realize how much it offers. I offer a simple Users model. It has fields like username, password and email that require special and perhaps multiple validation rules. Here’s how we’ll get tricky;
We can also set a unique error message to each rule, and it will apply to both our add and edit forms.
When making changes to your backend or user interface, it is nice to let users know just what is going on. Changing out your index page will only work for users who go to your main pages. In order to effectively block all pages, and redirect to a proper message, I recommend using apache’s .htaccess. The best part about this feature is you can still allow your development team to access the site while blocking everyone else.
Allowing users to create passwords is critical. But what happens when they want to change their password, or worse yet a user forgets their password. Will they be forever banned, unable to remember that hastily typed string?! Allowing users to send password reset tickets to their original email is a pretty good way to solve this, and is seen throughout the web. Its a snap in CakePHP as well. Here’s how it works.
There are many variations of a ‘complex password’ but most focus on having a minimum number of characters and must include at least 1 number. Others take it further and require upper case characters, or special characters (&-_!, etc). I will show you code to do all three. The basic concept ruses a regular expression. My examples will use php to compare the text to the regualr expression, but all major languages has some method to evaluate regular expressions, or regex. If your using CakePHP, check out this article . For PHP you can use the function preg_match to compare text to a regular expression; preg_match($pattern,$string); Detailed instructions for PHP users are at the foot of this article.
So I was checking my analytics (piwik of course ;-) ) today and I noticed a lot of folks landing on my page after searching this title, ‘multiple sites piwik’. Unfortunately they were landing on a page that only briefly discussed that it was a capability of piwik, so I felt alot of users were leaving with a bad taste in their mouths. To make amends Ill do my best to sum up this easy process.
This will walk through the process of adding sub domains to your local server ( onesite.localhost , twosite.localhost, etc ). To understand this need you are liekly working on multiple sites at once on your local development machine. So lets say you have an excellent CakePHP application, a gnarly JS sandbox, and your personal start page all belonging to different directories. Problem is, there is only one localhost. But just like your live server can have subdomains, you can skip DNS and use virtualhosts in Apache do the work. Imagine, unlimited sub domains all live at one on your localhost pointing to folders all across your machine. First off I will be be clear that this is instructions for a Linux device. If your not running Linux, then start today. You’ll be happy you made the switch to the ubiquitous LAMP architecture.
I have read many forum and mailing list posts that discuss troubles implementing an email component for Cake. To be honest I never tried to source a third-party component, and just decided to build my own using PHP’s mail function. NOTE: If you send batch emails accounting for hundreds our thousands messages, this would not be your best option. If you just want to notify admin or users about particular events, like welcome messages or lost password tickets, then this will suit you just fine. In order to add some flexibility I separated the mail functionality into 3 main functions.
When validating passwords for new users or changing passwords for existent users there are three main concerns.
*Strong in this case means a minimum of 8 characters with no whitespace. It must contain upper case and lower case letters, and at least 1 digit or special character.
The caveat there is obvious, if your using one way encryption like md5, you must validate before you encrypt. Using the built in var $validate will gooey this all up, forcing you to hash before you save and then trying instead to validate the hashed password. So instead I wrote a very simple function for use in the user model to validate against all three of these concerns. If you just want to get some regular expressions to use in PHP or other languages, read this article. Otherwise you may find this implementation useful.
Ok, well I’m not sure if anyone at Piwik has publicly directed the comment towards the internet giant Google. The group behind the open source visitor tracking and analytic software however openly contends “piwik aims to be an open source alternative to Google Analytics.”
And what a job they’ve done! Though the software is still in a beta phase, its features are impressive, the interface is smooth, and the graphing is truly beautiful. The Piwik project is the offspring of another open-source, but less hip, visitor tracking system, phpMyVisites.
This article is mostly in response to Daniel Hofstetter’s great article, File Upload with CakePHP which explains how to save uploaded files in their own database table. In his example (I assume for the sake of space and time in the article) he serves the files right from his controller. This is not true to the MVC format however, so I wanted to provide an alternative for those who were unsure how to separate the two. For those of you who ask, why store and serve files (pdfs, images, etc) from a database, and not just save it do a directory. Well I can’t speak for everyone, buts here is my reasoning;
Ever uploaded an image or iniated another timeful(slow) process on a webpage? Some sites appear to fade out the whole window while a small loading bar appears. [caption id=“attachment_62” align=“aligncenter” width=“300” caption=“Loading Bar translucent overlay”]
[/caption] This not only clearly indicates to users that the server is working in the background, but it is a great way to block the impatient click happy users as well. Its a pretty straightforward effect done with javascript and css. CakePHP users can let Cake handle the JS. The critical part is using CSS to create a translucent block that we can overlay on the page.
A good many people have hit the CakePHP group asking what needs to be done to upgrade from 1.1. to 1.2. I imagine the most painful changes are the loss of $html helper calls in the views, and $this->generateList calls in controllers. $form helper will handle all the deprecated html calls, and $this->Model->find(’list’); will handle select boxes. Of course most people notice immediately that templates and layouts no longer use .thtml extensions. If your running Linux, changing all the template extensions from thtml to ctp is a breeze. Just use the bash file below in your views directory. It is worth noting this script will rename any extension to any new extension on all matching files in a directory. It is not limited to CakePHP, that is merely the need that begat its creation. If no files match in a particular directory a message is printed; otherwise files are listed and renamed. renameExt
Sitemaps are although not critical, have been accepted as a standard way to let engines and users find the content on your site. You can generate those sitemaps on the fly in Cake, and show xml to engines, and formatted text to users. Sitemaps that are generated dynamically are always up to date, which is critical in achieving those top search results. How you may ask? Read on and I shall tell you. You need to decide what content goes in the sitemap. Most would agree that things like pages, posts are good choices. Others way want to add user profiles or other various model records. In this example I care about two models Info, which are like my static pages, and Post which are user posts.
The Clickheat software, rocks. Personally I use the plugin for phpMyVisites, but I could understand anyone adopting the standalone package too. CakePHP layouts can be setup to automatically print the most sensible url in each page it loads. This concept will work with any visitor tracking software that has a page or url attribute that is manually assigned. To learn how and see the code, continue reading.
In /views/layouts/default.ctp;
params; if(empty($params[‘url’][‘url’])) { //we need to concat our own url $pageWeSee=$params[‘controller’]; //only append action if not ‘info’ pages (‘index’ is hidden in url, and should be hidden here) if($pageWeSee!==‘info’) $pageWeSee.=’/’.$params[‘action’]; //any parmaeterrs we should know about? $ps=’’; foreach( $params[‘pass’] as $p){ $ps.=’/’.$p; }//end for each $pageUrl=$pageWeSee.$ps; }else{ //oh how sweet, a fully built url for us $pageUrl=$params[‘url’][‘url’]; } ?>
The newest version of phpMyVisites comes with an awesome ClickHeat plugin. Trouble is they have 0 documentation on how to implement the plugin. Below are those details as I discovered the process. Enjoy
For all the details in a step by step manner, read on. To make this easy to understand, there are 4 main parts: Activating the Plugin Configuring the Plugin Inserting the JavaScript / Debugging Javascript VIewing the Results
When developing applications it is wise to isolate development environments from live production environments. This is true of your code and your database structures For me this means my local SuSE server runs any developmental code before I push it off to a shared hosting account out on the real live web. The frustrating part for me was changing between two distinct database connections. Every time I uploaded the complete application I would need to manually change connection strings. Well no more! A simple logic switch can do the work for me (and you), hooray!.
That’s right! I have decided to publicize The GreenLife List on a small basis in order to gain critical user feedback. I hope you’ll visit The GreenLife List, register an account, add some products and generally test-drive the site. I also hope you’ll follow up that visit by dropping us a note on the contact page, or passing along your results here as a comment. The site provides us (consumers) with a quick and easy way to evaluate products and the companies producing them.
These are some small choirs I have built simple to moderate scripts to handle. Many of this is now found in classes in just about every language, relics if you will.
Small Java program recursively runs through your music folder printing all songs in an ordered and grouped xml file. Included xsl sheet gives it a nice look.
Java program builds xml files based on data from excel spreadsheets. Typically creates 1 xml file for each row, However, each xml file may span multiple rows, and workbooks if need be. No need to format the workbook in any special manner, completely customizable. (This project is not available for use.)
This works with CakePHP Version 1.1 Only ! Version 1.2 has paginate component built in. So I love using the Pagination Helper and Pagination Components because they are so sweet and so easy. The trouble I hit was in HABTM relationships. An example is product categories. A product like Apple may belong to many categories like Fruits and Food. The category Food may have several products, such as Apples, Pizzas and Burgers. So if our users view a Category page like ‘Fruits’ then we want to be able to restrict the items shown to the Fruit category, but keep our pagination. It can be done with little effort.
So I love using the Pagination Helper and Pagination Components because they are so sweet and so easy. The trouble I hit was in HABTM relationships. An example is products and categories. A product like Apple can belong to Fruits and Food. And of course Food can have more products than just Apple, like Pizza and Burgers. So if our users view a Category page like ‘Fruits’ then we shouldn’t show them pizza or burgers. Well if you want to do it using nice pagination helper, you can, read on.
Recently I have been attempting to build graphs in PHP. I was shocked by the lack of Object-Oriented classes to handle this. It just seems that dynamic graphing is a pretty common need, yet not much in the way of open source solutions. I have settled for a nifty flash solution called Open Fash Chart . The animations are smooth and will work, I just dislike loading sites with cumbersome applets that require plugins. I am still looking for an all server side / javascript solution.
JPA provides the ability to assign primary keys automatically out of the box. Unfortunately the only strategies JPA provides rely on the database, or sequence tables to manage ids. But if you want to assign your own ids from a id service, or cycles of the moon it can be done. Any possible way you can think of to get a unique ID, you can use with JPA. This article introduces a custom jpa sequence generator for JPA. My implementation is OpenJPA, but this is part of the standard JPA 1.2 specification.
Inspired by co-worker and fellow ADV rider’s blog, I’ve decided to start blogging about some rides or activites I’m found of.
Inspired by co-worker and fellow ADV rider’s blog, I’ve decided to start blogging about some rides or activites I’m found of.