..a dose of zero-day know-hows ..

10/07/2009

How to use 3G Phone/Modem to connect to the Internet on Fedora 11 (Linux)

Its been awhile since I attempted to connect to the internet via 3g using my phone (SGH-i550). The last time I did was several months ago with the help of wvdial. Now that there is a power outage in our area; and I forgot to install wvdial; and I just upgraded to Fedora 11, now is the perfect time to test the new features of the updated NetworkManager into action.

The following are the set of simple steps I have taken to connect to the internet using SGH-i550 via 3g on Fedora 11. I would assume that these steps will also work with other brands/models and most 3g modems around.

  1. Connect 3g phone/modem to the computer

  2. Right-Click on the NetworkManager Applet and select "Edit Connections"



  3. Select "Mobile Broadband" tab





  4. Select the 3g Device from the drop down list and click "Forward"





  5. Select the Country and click "Forward"





  6. Select a Provider and click "Forward"





  7. Select a Plan and click "Forward"





  8. Confirm the details and click "Apply"





  9. Leave the preset defaults and click "Apply"





  10. Close the Connection Settings Dialogue





  11. Right-Click on the NetworkManager Applet again and select the newly created connection





  12. The NetworkManager Applet will change its icon indicating a successful connection has been established





  13. And you are done.

10/03/2009

Web Developer tools for Opera 10 (switching from Firefox)

Just yesterday I decided to completely ditch Firefox and use Opera 10 as my default browser. The chronic issue of memory leaks and excessive CPU usage in Firefox appears to have gotten worse in their latest release and I just couldn't bear with it anymore.

As a recourse I decided to finally switch to Opera 10. I have been using it for awhile and noticed the vast difference in resource usage versus Firefox.

Below is a list of tools and widgets I found useful for web developers using Opera 10.

  • Dragonfly - is Opera's developer tool that is installed by default in Opera 10. It can be accessed via Tools -> Advanced -> Developer Tools. It offers functionalities such as DOM Inspector, CSS/Javascript Error Console, Javascript Console, Network Monitoring and more, it is pretty much like Firefox's Firebug.
  • phpManual - is an Opera Widget which provides the PHP manual. This widget is handy when looking up certain functions without having to search it up on php.net's website, the result just appears inline the widget.
  • CSS Help - provides an expandable CSS 2.1 mini-documentation.
  • Javascript Cheatsheet - as its name implies, provides an easy to browse Javascript Cheatseet.
  • Site Validator - This widget submits the current page to the W3C Markup Validation Service and returns the number of errors found and a link to the actual results. 

There are quite a number of other useful widgets for web developers in Opera's Widget home page. Dragonfly was the one which sold me entirely. I am still looking forward using Firefox again in the near future when the memory leak and high cpu usage issues are addressed.

8/06/2009

Getting "failed to open stream: HTTP request failed! HTTP/1.1 501 Method Not Implemented" When Passing Post Requests to JSON RPC Server

I spent some few hours trying to figure out how to go around the HTTP/1.1 501 error I am getting using the JSON Client Class from JSON-RPC_PHP (http://jsonrpcphp.org).

As it turns out the culprit was the modsecurity module for Apache2. The logs indicate that the JSON Server script is denying the JSON Client access.

[msg "Request content type is not allowed by policy"]


Instead of hacking the JSON-RPC library, what I did was disabled the restrictions inhibiting the JSON client from passing post request to JSON server by commenting out few lines in my /etc/httpd/modsecurity.d/modsecurity_crs_30_http_policy.conf, lines 68-70, specifically the following:


#SecRule REQUEST_METHOD "!^(?:get|head|propfind|options)$" \
#"phase:2,chain,t:none,t:lowercase,deny,log,auditlog,status:501,msg:'Request content type is not allowed by policy',id:'960010',tag:'POLICY/ENCODING_NOT_ALLOWED',severity:'4'"
#SecRule REQUEST_HEADERS:Content-Type "!(?:^(?:application\/x-www-form-urlencoded(?:;(?:\s?charset\s?=\s?[\w\d\-]{1,18})?)??$|multipart/form-data;)|text/xml)" "t:none"


After restarting apache, json server/client works fine. I hope this would spare someone from the hours of hair pulling.

6/22/2009

Migrating Workstations

I am currently migrating my work files, emails, skype logs, apache document root, firefox addons/settings/bookmarks, cached subversion passwords, wine apps to a new workstation. And how handy can the home directory be to move everything in few sweeps..


cd ~
scp -r root@192.168.0.198:/root/Documents .
scp -r root@192.168.0.198:/root/.thunderbird .
scp -r root@192.168.0.198:/root/.Skype .
scp -r root@192.168.0.198:/root/.mozilla .
scp -r root@192.168.0.198:/root/.subversion .
scp -r root@192.168.0.198:/root/.wine .
cd /var/www/
scp -r root@192.168.0.198:/var/www/html .


Now the only manual thing I have to do is do several mysqldumps and transfer it over (well i could hot copy /var/lib/mysql but i do not want to do that at this point as I have many innodb tables).. I think in no time i'll be finished and will be working my way as if im still using the old laptop.

Transferring the hidden files in my home directory using SCP works wonders, and also leaves you thinking how secure you are, as everything can be snap shot and copy your saved passwords/sessions/emails/chatlogs right from your home directory.

6/20/2009

Content Management Systems Unite

Original Article - http://miacms.org/index.php?option=com_content&task=view&id=55&Itemid=1

Written by MiaCMS Team
Jun 14, 2009 at 07:33 AM

We would also like to make a 2nd major announcement at this time and one that has long-term implications to the project itself. Anyone who has followed the MiaCMS, Mambo, and Joomla! projects over the last few years is all too familiar with forks. There are obviously advantages and disadvantages to forking an open source project; Mambo has actually been forked quite a few times over the years with varying degrees of success. Most of these forks have either faded away or simply gone dormant. However, two very successful projects have emerged from the ashes of their parent and even greatly improved upon the codebase they started with; MiaCMS and Joomla!. We do not wish to rehash the reasons for the MiaCMS fork several years ago (for those interested you can find that information here). Today, we are pleased to announce a step in the opposite direction... an open source CMS project merger. The MiaCMS and Aliro projects are joining forces to create a best of breed/next generation CMS.

While we are just announcing this news today, the two teams have already been working together behind the scenes for about 6 months now. Conversations started around creating a compatibility layer for extensions, but soon evolved into plans for a merger since we are tackling the same problems and have very similar end goals. These teams have a history of collaboration. Martin Brampton, founder of Aliro, was a huge contributor and former Core Development Team Leader on the Mambo project several years ago. He wrote much of what became Mambo 4.6, which eventually became the basis for MiaCMS. At Mambo he worked closely with Chad Auld who went on to become Mambo's Project Leader and Core Development Team Leader after Martin's departure, and eventually a co-founder of MiaCMS. Several other current MiaCMS core developers were also on the Mambo team at that time; Neal Thompson and Richard Peter Ong. These folks together with Ozgur Cem Sen, another former Mambo Core Development Team Leader, have decided to reunite. The emerging Aliro platform will serve as the basis for this new era. Much of the work done in MiaCMS since its inception will become part of Aliro, e.g., the YUI implementation, the JavaScript architecture, the WYSIWG editors, a number of extensions, etc. We will be using the name Aliro for the combined project. MiaCMS will remain a standalone project that is fully supported with major bug fixes and security updates for the foreseeable future. The MiaCMS core developers will begin focusing all new development efforts on the Aliro platform after the MiaCMS 4.9 release is out and stable. We will keep you updated as we have news to report. Aliro itself is already a fairly stable product, and we encourage everyone to download the latest beta and take it for a spin. We still have a good bit of work to do before the first official production release, but we are well on our way.

Why was this change needed?
* MiaCMS was created as a fork of the Mambo project, the grandfather of all open source CMS projects. Mambo either serves as the basis for or as an inspiration to most of the CMS systems in use today.
* Mambo is quite old at this point. Releases, developers, and svn activity are all but non-existent, as alluded to in a recent interview with Chad Auld. MiaCMS has given new life to the aging platform, but with the advancements in PHP and related frameworks over the last several years, the system is really in need of a full re-architecture building upon the lessons learned over the last 8 years. While still with the Mambo project we announced such an effort several years ago, before the fork. That effort was to be a Mambo rewrite on top of the CakePHP framework, but it never really got off the ground due to the political infighting that ultimately required the MiaCMS fork.
* So, here we are several years later with a much better system, MiaCMS, but still in need of a much larger architectural shift. While we have advanced the upper layers of the system, Aliro has been focused on the all-important foundation. Building on top of Aliro will allow us to better serve the community and put out a CMS that is even more impressive, efficient, secure, and flexible than the one you currently enjoy.

We hope the community is as excited about this news as we are. We look forward to continued success with you at our side. Thank you!

The MiaCMS team