Tutorial

Preparing a Django development workflow between Ubuntu and OSX

By | Tutorial | No Comments

After a few years in the development world I think I finally find a workflow I am confortable with. I started with Flash and some PHP long time ago, but I must say that Python and HTML/Javascript are my favorite couple right now. The problem On the left side of the Ring… OSX! I really like working with OSX, coding stuff it’s much easier in richer environments rather than in vi or emacs, although I have been learning some interesting shortcuts on vi lastly, It’s almost impossible to match the speed I can get on Sublime Text (2) or TextMate for example ( I do also understand that speeding up the workflow on vi will come with the experience and time which I not really aimed to spent :) ) On the right side of the Ring… Ubuntu! On the other side most of the servers are running unix based operative systems, in this environments there’s no rich visual interface in order to take advantage of every cycle to the CPU to to backend stuff and the editors ( vi, nano, emacs ) are really minimal stuff ( yes, yes, you can add some cool plugins and stuff, but at the end, wanting or not, you are getting any simple editor you could find on a richer visual interface ) The solution The solution is pretty simple :) This post is about how I managed to develop a Python Django + MySQL – NginX based Backend, coding from OSX Sublime…

Read More

Drupal 7: Adding related block / view content based on URL or context

By | Drupal, Tutorial | One Comment

Today I was creating a block, and I wanted to fill it with contextual content based on the URL, I’ve been searching around but I didn’t found anything so I started testing. Finally I got this really, really easy configuration that solved everthing: 1. Go to Structure > Views > Add new view 2. Create view / block / both 3. “Uncollapse” the third column ( a.k.a Advance ) 4. add > Content: nid 5. Get inside the “Content: nid” configuration view ( you should be there automatically once you have created a filter but you can always come back by clicking on the recently created item ) 6. WHEN THE FILTER VALUE IS NOT IN THE URL Provide default value > Type: Content ID from URL 7. WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED Specify validation criteria > Validator: Content > Select the type of content you want to show. Screenshot: Hope it saves some time!

Read More

Drupal site migration / copy errors & solutions

By | Drupal, Tutorial | No Comments

Today I had to copy a Drupal site on my computer to make some changes in a local environment. I know I know, this is totally the opposed way things would be, in a normal world you would start creating a preproduction server and then a production server ( I will skip stagings and stuff ) Let’s say I just inherited a Drupal site. Please before continue you should know :) : – I am a Drupal Newbie – In this exercise I will be considering the migration will be between to sites with the same version of Drupal ( 7 ) – I’m using MAMP and OSX During this process I found some problems I would like to share with you: 1. I created a tar of everything I got in /sites/all/* tar cvzf all.tar.gz path/to/drupal/sites/all/ This tar will contain all modules and themes 2. I created a tar of everything I got in /sites/default/files/* tar cvzf files.tar.gz files This tar will contain all the images uploaded by the users, modules, etc… Take into account you may have a different configuration and this directories paths may vary. 3. Then I created a backup of the database ( I recommend Backup and Migrate module although you it can be done by hand using mysql command-line ) I simply downloaded the *.mysql, *.sql file and I saved to my computer. Finally I copied the tar files to their proper place and things didn’t went as expected :) The first thing I…

Read More

OSX Lion and Nginx – Installation Tutorial

By | Tutorial | 14 Comments

Note: If you see something wrong,  please tell me and I will be glad to correct anything Today I had some problems installing nginx on Lion and looking around the internet all I got was some deprecated tutorials so, somehow I decided to contribute with this post in order to save some time to someone. 1. Download and install PCRE: The first thing you gotta do is install Perl Compatible Regular Expressions, I’m not really sure but I would say this are the libraries nginx will use to resolve the urls. curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz > pcre-8.10.tar.gz tar xvzf pcre-8.10.tar.gz rm pcre-8.10.tar.gz cd pcre-8.10 ./configure –prefix=/usr/local make sudo make install cd .. If you have some problems finding the tarball here is a complete list of available versions This tutorial is an update of a great tutorial made by Kevin Worthington 2. Download and install nginx curl  http://nginx.org/download/nginx-1.1.2.tar.gz > nginx-1.1.2.tar.gz tar xvzf nginx-1.1.2.tar.gz cd nginx-1.1.2 ./configure –prefix=/usr/local –with-http_ssl_module –with-cc-opt=”-Wno-deprecated-declarations” make sudo make install –with-http_ssl_module –with-cc-opt=”-Wno-deprecated-declarations” is an instruction that will avoid some deprecation warning that will prevent you from installing nginx successfully, showing this errors as a result: cc1: warnings being treated as errors src/core/ngx_crypt.c: In function ‘ngx_crypt_apr1’: src/core/ngx_crypt.c:76: warning: ‘MD5_Init’ is deprecated (declared at /usr/include/openssl/md5.h:113) src/core/ngx_crypt.c:77: warning: ‘MD5_Update’ is deprecated (declared at /usr/include/openssl/md5.h:114) …. I found this solution thanks a great post from Austen Conrad 3.Finally you may need add nginx to your path: export PATH=/usr/local/nginx/sbin:$PATH 4. execute Nginx sudo nginx And you are good to go: Welcome to nginx! If you…

Read More

Flex & Drupal login ( Actionscript remoteObjects )

By | Actionscript 3, Drupal, Flex 3, Flex 4, Tutorial | 16 Comments

Hello People! It has been a long time since my last post so I’ve decided to post something found interesting. Long ago, seeking a faster way to create my websites I found CMS called Drupal, this CMS provides a lot of very important aspects of a web, such as content creation, scalability and robustness. But as you know this blog is basically based on the Flash platform technologies, not Drupal, But I was interested in joining the two sides and make a login. To follow this tutorial is recommended that you have some knowledge of Drupal and Flex Requirements Have a server ( local or remote ) with Drupal Note: This tutorial was mad with Drupal 6.x but I think you can do it perfectly with the previous version 5.x To complete this tutorial you will need some modules that do not come with the core ( amfphp and services ) as well as the amfphp server. To install the modules simply unzip them inside drupal_folder/modules but i recommend creating a folder drupal_folder/sites/all/modules and copy them inside. Then it¡s imperative you download the amfphp server and copy the the folder inside the amfphp. ( You should have something like this drupal_folder/modules/amfphp/amfphp, the first amfphp is the module logic and the second is the server. Now we must activate some options of the modules we just install – In Services activate Services ( it’s the only option, you can fail here xD ) – In Services – servers activate AMFPHP – In Services…

Read More

Creating your first BlazeDS project

By | Actionscript 3, BlazeDS, Flex 3, Flex 4, Tutorial | No Comments

Now we’ve got Adobe Flex configured to work with BlazeDS let’s start with our first project. We will do this: We will create the front-end logic in Actionscript and MXML. We will create the back-end logic in JAVA We will create the needed config files to establish a bridge or a connection between the front-end and the back-end. So let’s start creating a new project, this time we want to use a Server technology. Here we must select J2EE because tomcat / BlazeDS uses this language / technology and we won’t touch anything you can see the results in the next image: At the bottom of the image you’ll see a check box with this text: Create combined Java / Flex project using WTP. In the java source folder will be placed all the raw java files, the logic of the back-end, once you execute the project this logic will be compiled and placed to the server automatically, don’t worry about that. Next we must configure the J2EE settings, the target runtime will be BlazeDS we created in the last post. I always put the same in the Context root and the Content folder, the project name, but in this example I will put context_root and content_folder to show you how the folders and files are created. The project is structured like this: Inside the content_folder to folders has been created: META-INF, and WEB-INF ( this is the important one now… ) inside WEB-INF we’ve got 4 folders: classes: This…

Read More

Setting up your BlazeDS (tomcat) server on Eclipse ( local )

By | BlazeDS, Examples, Flex 3, Flex 4, Tutorial | No Comments

BlazeDS is a “server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real-time“, in other words if you want to write chat applications, or maybe optimize the communications between front-end and back-end this is a great OPEN SOURCE option. There’s the enterprise version called LCDS ( Livecycle Data Services ) which offers some more features like Data-Synchronization, Offline applications, RIA-PDF generation, etc… You can find a comparison between the features of BlazeDS and LCDS here: Requeriments: – You must download and install JDK ( Java Development Kit ) – You must download and copy BlazeDS ( Copy to the folder you wish, for example C:Program filesBlazeDS, this is the folder I’ll be using all the tutorial ) – Obviously you must have installed Eclipse or Flex Builder – You must must/have install/ed the plugin for Java Development on Eclipse / Flex Builder ( Help -> Software Updates ) 1. Create an environment variable called JAVA_HOME pointing to the JDK installation. To create this environment variable you can right-click on MyPC and follow this images ( Remember to change the folder if necessary ): Now you must restart in order that changes take effect. 1,5. Showing Servers tab You may want to view the servers tab in order to run it from any perspective. In this case: from Flex Builder go to Window -> Other Views… -> Server -> Servers from Eclipse go to Window -> Show View ->…

Read More
Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: