Skip to main content

Posts

Automated Testing with Behat & Mink on Linux

Have time to read my introduction. Behat + Mink + Selenium Server will do the automatic testing for your website. Behat handles your test cases in a form of a sentence which consist of the following Feature - which is a description of your test case. Example is "Title Checking" Scenario - Feature consist of Scenario's Conditions - Scenario's consist of condition using the following tags "Given", "When", "Then", "And", "But" Example feature:  Feature: Google Search @javascript Scenario: Check Google Site When I go to " http://www.google.com " Then Capture a ScreenShot @javascript Scenario: Search Efren on Google Given I am on " http://www.google.com " When I input "Efren" in " gbqfq" element When press " Google Search " Then print current URL Then Capture a ScreenShot You need t...

Skipfish for CENTOS

#yum install openssl-devel #yum install pcre-devel #yum install libidn-devel #wget https://skipfish.googlecode.com/files/skipfish-2.10b.tgz #tar xzvf skipfish-2.10b.tgz #cd skipfish-2.10b #make #touch dict.wl #./skipfish -o output_dir -W dict.wl http://192.168.1.254

Initial Installation of RoR Centos, Fedora, Redhat

# yum install ruby # y um install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel # yum install ruby-rdoc ruby-devel # y um install rubygems # mkdir ~/src # cd ~/src # wget http://production.cf.rubygems.org/rubygems/rubygems-2.2.2.tgz # cd rubygems-1.3.6 # ruby setup.rb Install Rails # gem update # gem update --system # gem install rails # gem install rails -V -----DONE

Git to SVN Command Mapping

Initial checkout from existing repo for a given branch git clone http://github.com/sonatype/sonatype-tycho.git; cd sonatype-tycho; git checkout origin/tycho-0.10.x svn checkout http://anonsvn.jboss.org/repos/jbosstools/branches/jbosstools-3.2.0.Beta1/ Update locally checked out files from central repo git pull svn update List locally changes files/folders git status svn stat Diff locally changed file git diff somefile.txt svn diff somefile.txt Revert locally changed file * git checkout somefile.txt svn revert somefile.txt Revert ALL local changes (except untracked files) * git reset --hard HEAD svn revert . -R Add new file git add file.txt svn add file.txt Add new folder recursively git add folder svn add folder Delete file git rm file.txt svn rm file.txt Delete folder git rm -r folder  (non-recursive by default; use -r to recurse) svn rm folder  (recursive by default; use -N to not recurse) Commit changed file to central repo git commit -m "message" file.txt; git ...

How to Git

I assume that your are using linux Redhat flavor Fedora Centos Suse yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel yum install git-core git config --global user.name "Efren Valdez" git config --global user.email crokodz@gmail.com git config --global core.editor emacs git config --global core.editor SciTE git config --global merge.tool vimdiff git config --list || to view all list git log || to view version git ls-files || to view files git add folder name or files git commit -m 'Hris 1.0' || for the version name

Trac Project Management Monitoring Installation

This guide assumes that you know how to install python packages Requirements sqlite backend: python sqlite and devel pysqlite genshi Installation: Install all the requirements add user by  #htdigest -c /path/to/your/passwordfile.txt realname username enter password  create you project #trac-admin /path/to/your/project enter information to remove sample wiki  #trac-admin /path/to/your/project wiki remove '*' to start your trac tracd -p 8080 --auth=*,/path/to/your/passwordfile.txt,realname /path/to/your/project

MongoDB example using pymongo on Linux

1. Install Mongodb      #yum install mongodb      #yum install mongodb-server 2. Install pymongo 3. Sample Script from pymongo import Connection import datetime import time import os, sys reload(sys) sys.setdefaultencoding("latin1") connection = Connection("localhost", 27017) db = connection.sample_db #Insert a record on a table (sample_tb) post = {"author": "Mike","text": "My first blog post!","tags": ["mongodb", "python", "pymongo"],"date": datetime.datetime.utcnow()} posts = db.sample_tb posts.insert(post) #Select a record on a table (sample_tb) posts = db.sample_tb posts.find_one() posts.find_one({"author": "Mike"}) for post in posts.find():  print post['author'] #Delete a record on a table (sample_tb) posts = db.sample_tb posts.remove({"author": "Mike"})

crokodz Photograpy

Entering to a new different Path. Palawan Puerto Prinsesa August 28, 2011   Testing my New Tamron 10-24mm

How to Configure Squid Proxy

1. Install Squid 2. edit squid.conf 3. #vi /etc/squid/squid.conf (Readhat Version) 4. add this line acl mynet src 192.168.1.0/24 http_access allow mynet 5. enable memory_replacement_policy lru 6. enable cache_replacement_policy lru 7. enable cache_dir ufs /var/spool/squid 100 16 1024 8. add this line visible_hostname your.domain 9. start squid using port 3128

How to Configure Vsftpd

1. Install vsftpd 2. #groupadd ftp 3. #useradd -d /var/www/html/"home folder of the user" -s /bin/bash -g ftp user 4. #passwd user 5. edit vsftpd.conf, for redhat version its located in vi /etc/vsftpd/ 6. #vi /etc/vsftpd/vsftpd.conf 7. set anonymous_enable=NO 8. #service vsftpd start 9. cheers
Java Script Request Handler var xmlHttpRequestHandler = new Object(); var requestObject; xmlHttpRequestHandler.createXmlHttpRequest = function(){ var XmlHttpRequestObject; if(typeof XMLHttpRequest != "undefined"){ XmlHttpRequestObject = new XMLHttpRequest(); } else if(window.ActiveXObject){ var tryPossibleVersions = ["MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp", "Microsoft.XMLHttp"]; for(i=0;i try{ XmlHttpRequestObject = new ActiveXObject(tryPossibleVersions[i]); break; } catch(xmlHttpRequestObjectError){ // Ignore Exception } } } return XmlHttpRequestObject; } function puthtml(url){ requestObject = xmlHttpRequestHandler.createXmlHttpRequest(); requestObject.onreadystatechange=onReadyStateChangeResponseCo...

PDF Chinese PHP and Python

The power of python release on its multi-lingual Capability, limitless generation of report. When I was newbie in PHP I've tried to create a pdf using EZPDF, after years of experience, one of my project needs a report with Chinese font, I tried googling PHP PDF CHINESE, but I didn't find and correct output. I remember my python experience generating a report using reportlab in python known to be the powerful pdf generating tools. And it works fine I can generate Chinese PDF without hassle. Wow it was great. For those who need some guide line on how to do it just dron an email to me. Needs Python 2.0 or higher Reportlab

take a snapshot online via your webcam

I'm fully newbie on flash but I manage to mix php and flash, i had a client which prefer a web cam app online, well that was 2007 ago, but when i notice y flash had this feature accessing a client web cam i was thinking if i can do some snapshot on it. well I've done it. to those who needs my app email me or leave you email here. well i might come out with free version but maybe with some banners on just for the just for a credit on my own. and also to those who wants some sample I can update my site upon your request.

javascript Grid list with key up and down

Java Script Code function inkey(event,count){ count = parseFloat(count) -1; var existing = parseFloat(document.getElementById("id").value); var add = parseFloat(document.getElementById("id").value) + 1; var minus = parseFloat(document.getElementById("id").value) - 1; if(event.keyCode == 40){ document.getElementById("id").value = add; if(existing == count){ document.getElementById("id").value = 0; } document.getElementById("botx" + document.getElementById("id").value).click(); } if(event.keyCode == 38){ document.getElementById("id").value = minus; if(existing == 0){ document.getElementById("id").value = count; } document.getElementById("botx" + document.getElementById("id").value).click(); } }

Python Send SMS via Cellphone

I'm Impressed with Python-gammu, after gammu was released i was building a python program passing to the hole via AT Commands trough Com ports of a computer to a mobile phone but it was a messed spending hours every day, although got a success in learning AT Commands it was a headache. What do you need: Mobile Phone(of course) i used SE T230, you ca use SE T series, or Nokia Old Models or the best is the benq S series You need a Python 2.4 or 2.5 runs with Linux or Windows(headache) Python-gammu 1.6 to 2.0, ei dont use 2.1 up for those who use fedora 7 or suse 10.2, it will give you a headache A bluetooth if you require a bluetooth transmission than a cable. Assuming you installed gammu successfully edit /etc/gammurc port = ttys0: model = se T230 connection = at Note port if located at /dev/ to know what device is that got to /dev ls the folder remember all the files, plugin your phone to usb then a file will come out, that would be you port finish This Will be your code in py...