All posts in Sistemes

Darrerament s’ha publicat un webminar a la secció IBM i de Zend sobre l’adopció de PHP com a llenguatge de propòsit general per a la gestió de negocis i producció.

Es tracta de la implementació d’un ERP escrit en PHP per a Aalberts Industries.

Resulta força interessant l’arquitectura desplegada per integrar l’ERP i el MES amb la producció, tot en PHP amb algunes crides RPG a codi legacy.

L’ERP s’executa sobre l’IBM i i el MES sobre una Debian. El MES requeria accés des de fora de la companyia i interconnexió amb tota la maquinaria de la fàbrica.

Les conclusions resulten força interessants:

• PHP is a universal platform independend programming language
• It’s fast and comprehensive
• Beside WEB programming it can be used for interfaces and processes
• Even real time data analysis is possible
• Zend Server provides the same environment on all platforms
• It’s easy to develop, to trace and to maintain
• It makes fun and provides fast success

Podeu veure aquesta presentació en aquest enllaç

http://static.zend.com/topics/GroupMT-PHP-20120919.pdf

The next chapter of the Internet starts here.

Google Fiber starts with Internet speeds 100 times faster than what most Americans have today. In this video, we see the evolution of the Internet represented in three different stages. It started with Dial-Up, grew with Broadband — and with Google Fiber, the possibilities are endless. Pre-register now at http://www.google.com/fiber … if you live in Kansas City, Kansas or Kansas City, Missouri :)

Developer Tools

⌥-⌘-I Opens Developer Tools.
⌥-⌘-J Opens Developers Tools and bring focus to the Console.
⌥-⌘-C Toggle Inspect Element mode.

Tab and window shortcuts

⌘-N Opens a new window.
⌘-T Opens a new tab.
⌘--N Opens a new window in incognito mode.
Press ⌘-O, then select file. Opens a file from your computer in Google Chrome.
Press and click a link. Or click a link with your middle mouse button (or mousewheel). Opens the link in a new tab in the background .
Press ⌘- and click a link. Or press and click a link with your middle mouse button (or mousewheel). Opens the link in a new tab and switches to the newly opened tab.
Press and click a link. Opens the link in a new window.
⌘--T Reopens the last tab you’ve closed. Google Chrome remembers the last 10 tabs you’ve closed.
Drag a tab out of the tab strip. Opens the tab in a new window.
Drag a tab out of the tab strip and into an existing window. Opens the tab in the existing window.
Press ⌘- and the right arrow together. Switches to the next tab.
Press ⌘- and the left arrow together. Switches to the previous tab.
⌘-W Closes the current tab or pop-up.
⌘--W Closes the current window.
Click and hold either the Back or Forward arrow in the browser toolbar. Displays your browsing history in the tab.
Press or ⌘-[ Goes to the previous page in your browsing history for the tab.
Press - or ⌘-] Goes to the next page in your browsing history for the tab.
Press while clicking the + button in the top left corner of the window. Maximizes the window.
⌘-M Minimizes the window.
⌘-H Hides Google Chrome.
⌘-⌥-H Hides all other windows.
⌘-Q Closes Google Chrome.

Google Chrome feature shortcuts

⌘--B Toggles the bookmarks bar on and off.
⌘-⌥-B Opens the bookmark manager.
⌘-, Opens the Preferences dialog.
⌘-Y Opens the History page.
⌘--J Opens the Downloads page.
⌘-- Opens the Clear Browsing Data dialog.
⌘--M Switch between multiple users.

Address bar shortcuts

Use the following shortcuts in the address bar:

Type a search term, then press . Performs a search using your default search engine.
Type a search engine keyword, press Space, type a search term, and press . Performs a search using the search engine associated with the keyword.
Begin typing a search engine URL, press when prompted, type a search term, and press . Performs a search using the search engine associated with the URL.
Type a URL, then press ⌘-. Opens the URL in a new background tab.
⌘-L Highlights the URL.
⌘-⌥-F Places a ‘?’ in the address bar. Type a search term after the question mark to perform a search using your default search engine.
Press and the left arrow together. Moves your cursor to the preceding key term in the address bar
Press and the right arrow together. Moves your cursor to the next key term in the address bar
Press - and the left arrow together. Highlights the preceding key term in the address bar
Press - and the right arrow together. Highlights the next key term in the address bar
⌘- Deletes the key term that precedes your cursor in the address bar
Select an entry in the address bar drop-down menu with your keyboard arrows, then press-Fn-. Deletes the entry from your browsing history, if possible.
Press Page Up or Page Down in the addess bar menu. Selects the previous or next entry in the menu.


Webpage shortcuts

⌘-P Prints your current page.
⌘--P Opens the Page Setup dialog.
⌘-S Saves your current page.
⌘--I Emails your current page.
⌘-R Reloads your current page.
⌘-, Stops loading of your current page.
⌘-F Opens the find bar.
⌘-G Finds the next match for your input in the find bar.
⌘--G or - Finds the previous match for your input in the find bar.
⌘-E Uses selection for find
⌘-J Jumps to selection
⌘-⌥-I Opens Developer Tools.
⌘-⌥-J Opens the JavaScript Console.
⌘-⌥-U Opens the source of your current page.
Press and click a link. Downloads the target of the link.
Drag a link to the bookmarks bar. Saves the link as a bookmark.
⌘-D Saves your current webpage as a bookmark.
⌘--D Saves all open tabs as bookmarks in a new folder.
⌘--F Opens your page in full-screen mode. Press ⌘--Fagain to exit full-screen.
⌘-+ Enlarges everything on the page.
⌘ and - Makes everything on the page smaller.
⌘-0 Returns everything on the page to normal size.
⌘--H Opens your home page in your current tab.
Space bar Scrolls down the web page.
⌘-⌥-F Searches the web.

Text shortcuts

⌘-C Copies highlighted content to the clipboard.
⌘-⌥-C Copies the URL of the page you’re viewing to the clipboard.
⌘-V Pastes content from the clipboard.
⌘--⌥-V Pastes content without source formatting.
⌘-X or - Deletes the highlighted content and copies it to the clipboard.
⌘-Z Reverts your last action.
⌘--Z Repeats your last action.
⌘-X Deletes highlighted content and saves it to your clipboard (cut).
⌘-A Selects all the text on your current page.
⌘-: Opens the Spelling and Grammar dialog.
⌘-; Checks your current page for spelling and grammar

Taskwarrior is a command-line todo list manager.

In a world with a lot of virtualized and remotes servers, we need a Post-It alternative ;-)

To install Task Warrior, execute:

sudo add-apt-repository ppa:ultrafredde/ppa
sudo apt-get update
sudo apt-get install task

Quick steps in task:

List tasks
task

Add a task
task add "task to do"

Add a note to a task
task #n annotate "a note"

Done a task
task #n done

There are a lot of commands, you can found them at task warrior wiki

Example:

task
[task next]

ID Project Pri Due A Age Urgency Description
2 4m 0.9 Instal·lar OrientDB
6/15/2012 http://www.orientdb.org
6/15/2012 PHP connector https://github.com/congow/Orient
1 5m 0.8 Instal·lar doophp
6/15/2012 http://doophp.com/

2 tasks

There are plans to release a task warrior server, interesting.

PHP-wich-2Bpublic-2Bcloud-2B2012

A l’enquesta el·laborada per Zend el novembre del 2011 a 3.335 desenvolupadors de PHP, que podeu trobar a aquest enllaç:

http://venturebeat.com/2012/01/11/what-developers-will-be-doing-learning-listening-to-in-2012-survey-results/

Developer Pulse (PDF)

Observem que un 3% dels enquestats respon que durant el 2012 emprarà regularment RPG, el llenguatge de programació per excel·lència del sistema IBM i (AS/400).

 

Coincideix en número amb el percentatge de desenvolupadors que indiquen que el 2012 faran servir la cloud pública d’IBM, la recent IBM Smart Cloud.

 

Era previsible, els desenvolupadors d’IBM i som poquets, però incodicionals d’IBM :)

infographic

In a single minute there are over 695,000 status updates on Facebook. That’s just one example of the mind boggling scale of online activity.

The following infographics show a bunch of other incredible things that happen in 60 seconds (via Barry Ritholtz).

Read more: http://www.businessinsider.com/incredible-things-that-happen-every-60-seconds-on-the-internet-2011-12#ixzz1iOTof7Qj

  1. Ensure you’re up to date with latest release:

    sudo apt-get update

    sudo apt-get upgrade

  2. Install update-manager-core if it is not already installed:

    sudo apt-get install update-manager-core

  3. edit /etc/update-manager/release-upgrades and set Prompt=lts

Note: The minumum contents of /etc/update-manager/release-upgrades should be

[DEFAULT] Prompt=lts

  1. Launch the upgrade tool:

    sudo do-release-upgrade

  2. Follow the on-screen instructions.
  3. At the end of the upgrade process you will be required to restart the server in order to boot into the new kernel. If you do not have access to the console of the system you are upgrading, you may need to edit /boot/grub/menu.lst and change the default boot kernel to the newly installed 10.04 kernel. If this step is not performed your server may attempt to boot into the 8.04 LTS kernel and will hang.

Captura-phpinfo-2528-2529-2B-2BGoogle-2BChrome-1

I finalment, instal·lem PHP. Al tractar-se d’una màquina de desenvolupament, instal·larem PHP 5.4 Release Candidate 1 i així podrem provar les noves opcions de PHP 5.4 com els traits per a evitar algunes limitacions de les herències úniques pròpies de PHP. Aquestes novetats s’integraran properament a l’IDE NetBeans.

Recuperarem el codi font de PHP:

svn checkout https://svn.php.net/repository/php/php-src/branches/PHP_5_4 php-src-5.4

Preparem llibreries i programes que necessitem per a crear el PHP 5.4 com a mòdul per a l’Apache instal·lat a l’apartat 3 d’aquesta sèrie.

apt-get install aspell curl libaspell-dev libbz2-dev libc-client-dev libcurl4-openssl-dev libfreetype6 libfreetype6-dev libjpeg62 libjpeg62-dev libmcrypt4 libmcrypt-dev libmhash2 libmhash-dev libming-dev libmysqlclient15-dev libncurses-dev libpng3 libpng12-dev libpspell-dev libreadline-dev libsasl2-dev libsnmp-dev libt1-5 libt1-dev libtidy-dev libxml2 libxml2-dev libxml2-utils libxpm4 libxpm-dev libxslt1-dev make build-essential autoconf bison

Configurem el PHP

cd php-src-5.4

./buildconf

./configure --with-apxs2=/usr/bin/apxs2 --disable-short-tags --with-openssl --with-zlib --enable-bcmath --with-bz2=/bin/bzip2 --enable-calendar --with-curl --with-curlwrappers --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-xpm-dir=/usr/lib --with-t1lib --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --enable-mbstring --with-mcrypt --with-mhash --with-ibm_db2=/opt/ibm/db2/V9.7 --with-pspell --with-readline --with-snmp --enable-soap --enable-sockets --with-tidy --enable-wddx --with-xmlrpc --with-xsl --enable-zip --with-pear --with-kerberos

I procedim a compilar, en una màquina amb 4GB de RAM i 2 processadors a 2,6GHz hem trigat 16 minuts.

make && make install

Instal·lem el php.ini preparat per a desenvolupament

cp php.ini-development /usr/local/lib/php.ini

Instal·lem el mòdul ibm_db2


pecl install ibm_db2

Indicant /opt/ibm/db2/V9.7 com a carpeta on tenim instal·lat el DB2, o allà on pertoqui.

afegim la secció ibm_db2 al php.ini

extension=/usr/local/lib/php/extensions/no-debug-zts-20100525/ibm_db2.so
ibm_db2.instance_name=db2inst1

Arrenquem l’apache

/etc/init.d/apache2 restart

I certifiquem que funciona fent

echo "" > /var/www/index.php
rm /var/www/index.html

I obrint un navegador que apunti al servidor obtindrem

Si volem tenir també opcions de MySQL:

./configure --with-apxs2=/usr/bin/apxs2 --disable-short-tags --with-openssl --with-zlib --enable-bcmath --with-bz2=/bin/bzip2 --enable-calendar --with-curl --with-curlwrappers --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-xpm-dir=/usr/lib --with-t1lib --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --enable-mbstring --with-mcrypt --with-mhash --with-ibm_db2=/opt/ibm/db2/V9.7 --with-pspell --with-readline --with-snmp --enable-soap --enable-sockets --with-tidy --enable-wddx --with-xmlrpc --with-xsl --enable-zip --with-pear --with-kerberos --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd

Per tal de servir planes web i interpretar PHP al vol, instal·larem l’IHS, l’IBM HTTP Server, que és un Apache millorat i assegurat. Pel que es veu, no s’integra dins del WAS i cal instal·lar-ho separat. És a dir que si no tenim intenció de servir aplicacions Java, ens podem saltar el pas 1.

El descarregarem del web d’IBM: IBM HTTP Server i procedim a instal·lar-ho com indica el document Hosting PHP applications on the IBM HTTP Server (gràcies Francisco) :


tar -xvf ihs.7000.linux.ia32.tar /root
cd IHS

Copiem responsefile.txt a opcions.txt editem aquest darrer i acceptem la llicència i modifiquem altres valors per omissió i esborrem la secció de windows:

-OPT silentInstallLicenseAcceptance="true"
-OPT disableOSPrereqChecking="true"
-OPT installLocation="/opt/IBM/HTTPServer"
-OPT createAdminAuth="true"
-OPT adminAuthUser="ihsadmin"
-OPT adminAuthPassword="xxxx"
-OPT adminAuthPasswordConfirm="xxxx"
-OPT runSetupAdmin="true"
-OPT setupAdminUser="ihsadmin"
-OPT setupAdminGroup="www-data"
-OPT washostname="blue.corretge.ct"

I executem la instal·lació en mode silenci, doncs no tenim instal·lades les X al servidor:

java -cp `pwd`/setup.jar -Xms48m -Xmx384m run -options "opcions.txt" -silent

I a nosaltres ens ha cascat. Bé, el fet d’estar en una distribució no suportada per IBM deu haver generate els problemes, així que instal·larem un Apache, serà una màquina blava al 50%. A fi de comptes l’IHS s’arrenca amb la instrucció apachectl.


sudo apt-get install apache2 apache2-threaded-dev apache2-mpm-prefork apache2-utils

I obtenim fàcilment el It works! de la felicitat.

Més endavant ja enllaçarem WASCE amb Apache HTTP Server via mod_jk.