Using ssh as proxy/tunnel between Mac OS and Linux

How to connect to remote computer with private key by using ssh:

#register private key
ssh-add ~/dev/Private/ludek_vodicka_dsa.openssh

#connect to computer and forward local port to remote computer and remote port
ssh my-computer.com -p PORT -lUSER -L LOCAL_PORT:REMOTE_COMPUTER:REMOTE_PORT

#connect to computer and create SOCKS proxy on port SOCKS_PORT
ssh my-computer.com -p PORT -lUSER -D SOCKS_PORT

Note:

If your private key was created for Windows, it will probably not work on linux/mac. It’s necessary to convert it by using puttygen (on mac or windows). You need to open it by puttygen and choose “Save as openssh” from menu.

Additional resources

42 interesting wireframing tools

These days we are working on new ORM Designer websites and with it comes a problem: find ideal wireframing tool which will help us with designing the structure of new web. Our requirements were an intuitive multiplatform system that is freeware or low cost. So we’ve done a researche and made a list of 42 wireframing tools.

What are actually the wireframes? Wireframes are basic illustrations of the structure and components of web site or application and they are also called blueprints or skeletons.  If you are creating some web project, you need to attract users not only by design, but also with intuitive functionality and user-friendly solution.

Facebook wall wireframe example from Flairbuilder
Facebook wall wireframe example from Flairbuilder

Wireframes also improve communication between developers and clients, because clients can be provided with a series of sketched screenshots or a mock interface they can try before they’re coded so it eliminates misunderstandings on both sides.

You can create wireframes by hand on real paper, but there are plenty of tools for creating them. Here is list of 42 interesting tools for wireframing:

Axure RP

www.axure.com
Axure RP gives you the wireframing, prototyping and specification tools needed to make informed design choices, persuade any skeptics, get your design built to spec… and maybe win a few fans along the way. Choose the Standard edition for prototyping or go Pro to add documentation and collaboration features.

Available for platforms: Windows, Mac OS X
Price: from $289
Free Version: 30 day free trial

Balsamiq

www.balsamiq.com
Balsamiq is a wireframing and mock up tool with a high focus on usability. You can quickly come up with mock ups and easily share them with your clients.

Available for platforms: Windows, Mac OS X, Linux, On-line, plugin for Google Drive
Price: Desktop $79, On-line $12/Month, Google Drive plugin $5/Month
Free Version: Desktop 7 day free trial, on-line 30 day free trial, Google Drive 30 day free trial

Cacoo

www.cacoo.com
Free and user friendly online drawing tool that allows you to create a variety of diagrams such as site map, flowchart, mind map, wire frame, UML diagram and network diagram

Available for platforms: On-line, Google Chrome extension
Price: from $4.95/Month, $49/Year
Free Version: Free limited version (only 3 PNG exports, only 25lists)

FlairBuilder

www.flairbuilder.com
FlairBuilder is a prototyping tool that lets you create interactive wireframes for websites and mobile applications. It’s easy to learn and use, and comes with lots of options.

Available for platforms: Windows, Mac OS X, Linux (requires Adobe AIR)
Price: $99
Free Version: 15 day free trial

ForeUI

www.foreui.com
ForeUI is an easy-to-use UI prototyping tool, designed to create mockup / wireframe / prototypes for any application or website you have in mind. With ForeUI, your prototype project will be skinnable, since you can easily change the style of your prototype by simply switching the UI theme. You can even design the behavior of prototypes by defining intuitive flow charts to handle specific events. Your prototype can then be exported to wireframe images, PDF documents or HTML5 simulation.

Available for platforms: Windows, Mac OS X, Linux, Solaris
Price: $150
Free Version: 15 day free trial, on-line demo

FrameBox

framebox.org
Lightweight online tool for creating and sharing mockups (wireframes). Easy, fast and free to use.

Available for platforms: On-line
Price: FREE

Gliffy

www.gliffy.com
Professional-quality flowcharts, org charts, UML diagrams, network diagrams, wireframes, technical drawings and more. Gliffy is an online application that makes it easy for you to create, share, and collaborate with diagrams. It looks and feels like a desktop application, but it works through your web browser, so there is nothing to install or maintain.

Available for platforms: On-line, Google Chrome extension
Price: from $4.95/Month or $47.88/Year
Free Version: Free limited version (5 diagrams, 2 MB storage space, no Visio Import, no Google Drive Integration, no private diagrams)

HotGloo

www.hotgloo.com
HotGloo is an online, interactive wireframing & prototyping tool. HotGloo makes it easy to wireframe web and mobile sites and to cooperate with team members. HotGloo is web-based and therefore platform and terminal independent. The program has a user-friendly style and a high standard of interactivity.

Available for platforms: On-line
Price: from $7/Month
Free Version: 15 day free trial

iMockups for iPad

www.endloop.ca/imockups
iMockups for iPad is the premiere mobile wireframing and mockup app for your web, iPhone and iPad projects. The ease and mobility of an iPad app with the power of a desktop app at your fingertips.

Available for platforms: iOS
Price: $6.99
Free Version: –

Indigo studio

www.infragistics.com/products/indigo-studio
Indigo Studio – the fastest UI prototyping and interaction design tool – helps you quickly and simply explore and create functional, animated UI prototypes while maintaining the focus on user experience at every step. With Indigo Studio you can create storyboards with over 100 different scenes, wireframes with built-in interactive controls, and prototypes for your desktop, web, and mobile apps – all with no coding necessary!

Available for platforms: Windows, Mac OS X
Price: from $495
Free Version: 30 day free trial

InVisionApp

www.invisionapp.com
InVision lets you transform your designs into beautiful, interactive web & mobile mockups and prototypes

Available for platforms: On-line
Price: from $15/Month
Free Version: Free limited version (1 project)

iPlotz

iplotz.com
iPlotz allows you to rapidly create clickable, navigable mockups and wireframes for prototyping websites and software applications. Create a project, add wireframe pages with design components and discuss your creations with others.

Available for platforms: On-line, Desktop (requires flash)
Price: On-line from $15/Month, $99/Year; Desktop $75
Free Version: Free limited version (Online use of 1 project, limited to 5 wireframe pages)

JustInMind

www.justinmind.com
Justinmind Prototyper is an authoring tool for software prototypes and high-fidelity website wireframes.

Available for platforms: Windows, Mac OS X
Price: $29/Month
Free Version: Free limited version (Export to interactive HTML is not allowed), 30 day free trial

Lovely charts

lovelycharts.com
Online diagramming application that allows to create professional looking diagrams, such as flowcharts, sitemaps, organisation charts, …

Available for platforms: On-line, Windows, Linux, iOS, Google Chrome extension
Price: Desktop: 59€, On-line: 29€/Year, iOS: 4.99€
Free Version: Desktop demo (saving and opening options are disabled), On-line demo (save one editable diagram at the time within your account, create and export as many diagrams as you need)

Mockflow

www.mockflow.com
MockFlow WireframePro is a web-based tool to design and collaborate user interface blueprints for websites and software. Its helps to visualize the website’s interface, navigation and structure in short time.

Available for platforms: On-line, Mac OS X, Windows (requires Adobe AIR)
Price: from $69/Year (for all apps)
Free Version: Free limited version (1 Designer License, 1 Project in each App, 2 Co-Editors per Project, 1 GB of Cloud Storage, Project Restrictions)

Mocking pal

play.google.com/store/apps/details?id=com.sharkear.penmockups
Mocking Pal is a mobile app that allows you to create mockups/wireframes of a website or an application. You can create wireframes on the run, share them with colleagues and get early feedback. It saves you a lot of time, so you can iterate even faster and try new concepts before committing to a design.

Available for platforms: Android
Price: FREE

Mockingbird

gomockingbird.com
Online tool that makes it easy for you to create, link together, preview, and share mockups of your website or application

Available for platforms: On-line
Price: from $ 9/Month
Free Version: Free limited version (1 project with 10 pages; 2 users; no archived project)

Mockup Builder

mockupbuilder.com
Mockup Builder is a prototyping solution that helps design software or websites while reducing the time and cost spent on the negotiation stage. Identify your requirements and get the job done right!

Available for platforms: Windows, Google Chrome extension
Price: $7/Month
Free Version: On-line demo

Mockup Designer

fatiherikli.github.io/mockup-designer
The mockup tool that uses your local storage as backend.

Available for platforms: On-line
Price: FREE

Mockups for Android

play.google.com/store/apps/details?id=com.welant.mockups
Mockups for Android is a vector-based sketch wireframing tool for website prototyping and creating UI design concepts. With Mockups for Android editor you can experiment with concepts and sketch visual prototypes in minutes on your Android tablet or phone! Share mockups with your team, development community or clents.

Available for platforms: Android
Price: $4.99
Free Version: Free Lite version

Mockups.me

mockups.me
A collaborative, interactive UI wireframing application for any device and platform. Mockups.Me enables you to sketch, review, and iterate your application user interfaces – fast.

Available for platforms: On-line, Mac OS X, Windows, Linux, Android, iOS
Price: Desktop $49, On-line  from $99/Year, Android $19.99, iOS $19.99
Free Version: Desktop 30 day free trial; On-line live web demo (cannot create files but can view and edit files shared with you by others); Android free lite version (no save and export functionality)

MockupScreens

www.mockupscreens.com
Easy mockup tool. Create five screens in ten minutes without any programming knowledge or prior training!

Available for platforms: Windows, Mac OS X
Price: $99.95
Free Version: 30 day free trial

Moqups

moqups.com
On-line HTML5 App for creating high fidelity, resolution independent SVG mockups and wireframes. Realtime Collaboration, PDF/PNG Export, …

Available for platforms: On-line, Google Chrome extension
Price: from 9€/Month, 99€/Year
Free Version: Free on-line version (2 active projects and 5 MB of image storage)

MS Visio

visio.microsoft.com
Microsoft Visio is a diagramming and vector graphics application and is part of the Microsoft Office suite. The main focus aren’t wireframes, it is a universal tool.

Available for platforms: Windows
Price: from $599.95
Free Version: 30 day free trial

OmniGraffle

www.omnigroup.com/omnigraffle
OmniGraffle can help you make eye-popping graphic documents quickly by keeping lines connected to shapes even when they’re moved, providing powerful styling tools, importing and exporting Microsoft Visio files, and magically organizing diagrams with just one click. Whether you need a quick sketch or an epic technical figure, OmniGraffle keeps it gorgeously understandable.

Available for platforms: Mac OS X, iOS
Price: Mac OS X $99.99, iOS $49.99
Free Version: 

Pencil Project

pencil.evolus.vn
Pencil is built for the purpose of providing a free and open-source GUI prototyping tool that people can easily install and use to create mockups in popular desktop platforms.

Available for platforms: Linux, Windows, Mac OS X, Firefox extension
Price: FREE

Pidoco

pidoco.com
Web-based prototyping software for rapidly creating clickable wireframes and UI prototypes for web, mobile and enterprise applications. It’s easy to use with smart sharing and collaboration features, a convenient specification generator, exports and much more.

Available for platforms: On-line
Price: from $4.49/Month
Free Version: 31 day free trial

POP (Prototyping on paper)

popapp.in
Hand-drawn wireframes to tappable app prototypes! POP helps you make interactive prototype with ease. If you can draw, you can design apps.

Available for platforms: Android, iOS
Price: FREE

Power Mockup

www.powermockup.com
PowerMockup provides templates and tools for building wireframes right in PowerPoint.

Available for platforms: Powerpoint extension
Price: from $59.95
Free Version: Free trial version

PowerWIREFRAME

power-story.com/create-wireframes-in-powerpoint-with-powerwireframe
PowerWIREFRAME is a plugin for PowerPoint that makes it easy to create UI Wireframes in PowerPoint, by dragging and dropping UI Controls from a robust searchable library onto your slides.

Available for platforms: Powerpoint extension
Price: $59.99
Free Version: Free trial version

Proto.io

Proto.io
Proto.io is a UI prototyping tool specifically tailored for mobile and tablet applications. The web based environment allows you to start off by creating a project for iPhone, iPad, Android phones or tablets.

Available for platforms: On-line
Price: from $24/Month
Free Version: 15 day free trial

ProtoShare

www.protoshare.com
ProtoShare is an easy-to-use, collaborative prototyping tool that helps teams visualize requirements with website wireframes and interactive prototypes while working together in real-time.

Available for platforms: On-line
Price: from $29/Month
Free Version: 30 day free trial (without export functionality)

QuirkTools – Wires

quirktools.com/wires
Wires lets you build interactive wireframes right in your web browser

Available for platforms: On-line
Price: $10/Month, $84/Year
Free Version: Free limited version (3 total projects across all Quirk apps)

Realizer

realizerapp.com
The Realizer lets you easily create interactive presentation prototypes of iPhone and iPad apps. By transforming the traditional app presentation into an interactive one, you can better communicate your vision with a rewarding user experience.

Available for platforms: iOS
Price: FREE

RWD Wireframes

www.lifeishao.com/rwdwire
This tool is made so designers can more easily design for responsive web pages. You can save and share your wireframe, or export it to html and css. It’s completely free and open source.

Available for platforms: On-line
Price: FREE

SketchyPad

sketchyapp.com
App for website sketching and apps interface making, including iPhone and iPad apps. This app will make designers, programmers and interface designers life much easier. Easy-to-use interface and a lot of various stencils will help you to mockup any web sites and soft interfaces.

Available for platforms: iOS
Price: $4.99
Free Version: 

Solidify

www.solidifyapp.com
Solidify lets you create clickable prototypes from sketches, wireframe, or mockup. Validate user flows on any device by performing user tests in person, remotely or on your testers own time to get the feedback you need.

Available for platforms: On-line
Price: from $19/Month
Free Version: 30 day free trial

UXpin

uxpin.com
Complex tools for UX designers – Notepads full of sticky notes for rapid paper prototyping. Wireframing App able to auto-convert paper prototypes into digital wireframes.

Available for platforms: On-line
Price: $14.99/Month
Free Version: 30 day free trial

UXToolbox

www.softandgui.co.uk
The all-in-one rapid Wireframing and Application Prototyping solution. Designed for beginners and experts alike, UXToolbox has all the tools and features you need to create great looking and fully functional Wireframes and Mock-ups all within one easy-to-use solution.

Available for platforms: Windows
Price: L159
Free Version: 14 day free trial

Wireframe.cc

wireframe.cc
Smart, swift and minimal app, extremely easy to use. All created wireframes get a unique URL, that you can easily bookmark, share and edit later.

Available for platforms: On-line, Google Chrome extension
Price: from $12/Month or $120/Year
Free Version: Free limited version (can save, but can’t export; without multi-page wireframes and some other features); 7 day trial of full version

WireframeSketcher

wireframesketcher.com
WireframeSketcher is a wireframing tool that helps designers, developers and product managers quickly create wireframes, mockups and prototypes for desktop, web and mobile applications. It’s a desktop app and a plug-in for any Eclipse IDE.

Available for platforms: Windows, Mac OS X, Linux, Plugin for Eclipse IDE
Price: $99
Free Version: 14 day free trial

Wirify

www.wirify.com
Wirify is a bookmarklet that lets you turn any web page into a wireframe in one click.

Available for platforms: On-line
Price: $7/1 credit
Free Version: Free limited version (Export and edit wireframes not allowed)

The end result

Every tool is useful for something and someone else. For cooperation with global project manager you will choose different tool than for individual work of UX specialist freelancer. Also each of us have different personal preferences as operating system, price, appearance and more. So the best choice is yours.

None of the above listed tools fit our requirements. Only Mockups.me is multiplatfom tool, but costs a lot (especially if you want to use it for Android, Windows and OS X at the same time). So, we decided to lower our requirements and now we are testing some free online tools.

Do you use wireframes or think that work is easier without them? Which tools do you recommend? Do you know another interesting tool that missing?

VS2010 always rebuilding moc files on Qt

My VS2010 on every build always recreate all .moc files and associated .cpp files. Problem was in incredibuild clausule during compilation of my Qt libraries.

 

      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Rem;axApplication\axAppException\dialogUnhandledException.ui;%(AdditionalInputs)</AdditionalInputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Rem IncrediBuild_AllowRemote &#x000D;&#x000A;if errorlevel 1 goto VCEnd&#x000D;&#x000A; Rem IncrediBuild_OutputFile ..\GeneratedFiles\ui_dialogUnhandledException.h &#x000D;&#x000A;if errorlevel 1 goto VCEnd&#x000D;&#x000A; Q:\ExternalLibraries\qt-git-32bit\bin\uic.exe axApplication\axAppException\dialogUnhandledException.ui -o ..\GeneratedFiles\ui_dialogUnhandledException.h</Command>
      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">UIC axApplication\axAppException\dialogUnhandledException.ui</Message>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\GeneratedFiles\ui_dialogUnhandledException.h;%(Outputs)</Outputs>

instead of

      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Q:\ExternalLibraries\qt-4.8.2-32bit\bin\uic.exe;axApplication\axAppException\dialogUnhandledException.ui;%(AdditionalInputs)</AdditionalInputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Q:\ExternalLibraries\qt-4.8.2-32bit\bin\uic.exe axApplication\axAppException\dialogUnhandledException.ui -o ..\GeneratedFiles\ui_dialogUnhandledException.h</Command>
      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">UIC axApplication\axAppException\dialogUnhandledException.ui</Message>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\GeneratedFiles\ui_dialogUnhandledException.h;%(Outputs)</Outputs>

Although qmake added all these incredibuild defines to my VS project, Incredibuild still doesn’t compile it in parallel so it was totally useless. The most simply way is edit incredibuild_xge.prf and turn-off it.

mkspecs\features\incredibuild_xge.prf 

contains(TEMPLATE, "XXXvc.*") {

How to enable VS2010 logging

Qt on OSX Maverick – Undefined symbols for architecture x86_64

The problem is that starting with OSX 10.9 Apple changed default standard c++ library from libstdc++ to libc++.

Qt binary distribution compile with -stdlib=libstdc++ to be compatible with 10.6, Xcode 5 on 10.9 will select -stdlib=libc++ by default (for OS X 10.7 and better only). So symbol using classes from the standard library (like std::string in this case) will not resolve correctly at link time.

Undefined symbols for architecture x86_64:
"boost::filesystem::path_traits::convert(char const*, char const*, std::basic_string&lt;wchar_t, std::char_traits&lt;wchar_t&gt;, std::allocator&lt;wchar_t&gt; &gt;&amp;, std::codecvt&lt;wchar_t, char, __mbstate_t&gt; const&amp;)", referenced from:
boost::filesystem::path::wstring(std::codecvt&lt;wchar_t, char, __mbstate_t&gt; const&amp;) const in filePath.o
boost::filesystem::path::wstring(std::codecvt&lt;wchar_t, char, __mbstate_t&gt; const&amp;) const in fileEnumerator.o
boost::filesystem::path::wstring(std::codecvt&lt;wchar_t, char, __mbstate_t&gt; const&amp;) const in directoryHelper.test.o

So it’s necessary to compile all libraries with one type of libstdc++ (or libc++). Because I need to keep 10.6 compatibility, it’s necessary to compile boost and other libraries with libstdc++ dependency.

To check which library is used, use otool tool:

otool -L library.dylib

As result you will get something like this (check /libc++1.dylib):

otool -L boost/lib/libboost_filesystem.dylib
boost/lib/libboost_filesystem.dylib:
	boost/lib/libboost_filesystem.dylib (compatibility version 0.0.0, current version 0.0.0)
	boost/lib/libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

How to fix it for boost

it’s necessary to recompile boost (and don’t forget to remove ./bin.v2 directory) with these params:

  ./b2 cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" ...

and run otool again:

boost/lib/libboost_filesystem.dylib:
	boost/lib/libboost_filesystem.dylib (compatibility version 0.0.0, current version 0.0.0)
	boost/lib/libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

How to fix it for CMake libraries

In case you’re using library which is built by CMake system, you  need to add following flag:

cmake -DCMAKE_CXX_FLAGS="-stdlib=libstdc++"

How to fix other libraries

For any other library it’s necessary to pass libstdc++ flag in any available way, for example modify makefile and add :

CXXFLAGS = -stdlib=libstdc++

Second way how to fix it, compile app using latest compiler

Another way is to update mkspecs to compile for latest MacOS version, after that, compiler will be the same like compiler used on all other libraries. To do that, it’s necessary to update file:

/usr/local/Qt-5.3.1/mkspecs/macx-clang/qmake.conf

and change following line:

QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6

to latest 10.9 version:

QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9

More info about this process check here:

http://stackoverflow.com/questions/20342896/solved-qt5-1-qt5-2-mac-os-10-9-mavericks-xcode-5-0-2-undefined-symbols

And that’s all

Hope this post saves you a lot of time I have to spent by searching these answers 😉

External links:

Useful Mac OS tools for developer

System Tools

External articles:

Programming

  • SmartSVN (free for personal use,  $69/license) – svn gui tool
  • SmartGit/Hg  (free) – git / hg gui tool

File Manager

Customize OSX terminal prompt

How to customize default terminal prompt which looks like this?

ComputerName Directory UserName$

simply define PS1 variable with required format. To display only full path, use following:

export PS1="\w $"
  • \d – date
  • \t – time
  • \h – hostname
  • \# – command number
  • \u – username
  • \W – current directory (e.g.: Desktop)
  • \w – current directory path (e.g.: /Users/Admin/Desktop)

External links:

TF201 – update to custom rom

This is list of my notes when updating my Asus Transformer Prime (TF201) to latest custom rom.

Unlock TF201 with asus tool

nvflash

twrp

hairy bean

energy rom

stock jelly bean

Other

nginx and fast-cgi – tips and tricks

How to pass full path to fast-cgi app

It’s necessary to configure which parameters are passed to fast-cgi application from nginx server. For this purposes serves fastcgi_param keyword. It’s a good practice to keeps all fastcgi params together. For this purposes nginx has fastcgi.conf file. This file already contains most of useful fastcgi_param bindings.

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
...

To include this file use include statement:

location / {
   include fastcgi_params;
   fastcgi_pass 127.0.0.1:9345;
 }

How to pass custom headers to fast-cgi app

Default configuration pass only default headers to fast-cgi. It’s necessary to add few more configurations statements:

fastcgi_pass_request_headers on;

After that headers are passed as HTTP_* parameters:

HTTP_HEADER1=2222

External links

How to run fastcgi and nginx on windows

Step by step guide how to configure nginx on windows….

Download and installation

Download nginx package from nginx site. Unpack it and installation is done 😉

Example of fast-cgi application

No create and complie fast-cgi application. (How to compile fast-cgi on windows)

    #include "fcgi_stdio.h"
    #include &lt;stdlib.h&gt;

    void main(void)
    {
        int count = 0;
        while(FCGI_Accept() &gt;= 0)
            printf("Content-type: text/html\r\n"
                   "\r\n"
                   "&lt;title&gt;FastCGI Hello!&lt;/title&gt;"
                   "&lt;h1&gt;FastCGI Hello!&lt;/h1&gt;"
                   "Request number %d running on host &lt;i&gt;%s&lt;/i&gt;\n",
                    ++count, getenv("SERVER_NAME"));
    }

How to connect fast-cgi with web-server

There are two ways. When web-server supports fast-cgi you will be able to connect fast-cgi directly with web-server via configuration files. In all other cases fast-cgi offers cgi-fcgi  executable as bridge between webserver and your app. More info about both these approaches you can find here http://www.fastcgi.com/devkit/doc/fcgi-devel-kit.htm#S4.

Working way how to get fastcgi apps working

None of two ways described in previous article and in official documentation works for me on windows. I wasn’t able to get cgi-fcgi or spawn-fcgi running. First mentioned crashed everytime app tries to initialize STD_OUT, the second one isn’t possible to compile it because of missing unistd.h header.

Fortunately there is one more way. FCGI library offers one more way how to utilize FCGI mechanism. It’s necessary add two more lines to example above and everything works perfectly.

    #include "fcgi_stdio.h"
    #include &lt;stdlib.h&gt;

    void main(void)
    {
        //initialize library &amp; open listening socket at port 9345
        FCGX_Init();
        FCGX_OpenSocket(":9345",500);

        //rest is the same as in example above
        while(FCGI_Accept() &gt;= 0) ...
    }

After this change application initialize listening port and waits for incoming data. All you need to do is directly execute the app.

Configure nginx to connect with fast-cgi

This step compared to previous ones is pretty easy. You need to tell nginx server what and where to pass. Open file nginx.conf and add following statement:

http {
  server {
    location / {
      fastcgi_pass 127.0.0.1:9345;
     }
  }
}

fastcgi_pass statement forward all requests to localhost:9345 address. Now when you start your nginx server, everything should work as expected.

nginx server cfg

Troubleshooting

bind() to 0.0.0.0:80 failed

This error is caused by another application which uses port 80. In my case it was Skype which automatically uses port 80.

nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)

External links

How to compile FastCGI library in Visual Studio 2010 C++

FastCGI comes with Win32 project for VisualStudio6. Unfortunately when you try to open it in VisualStudio2010 the project will be corrupted. To correctly compile it for VS2010 it’s necessary to download library sources, get patches from cybozu.co.jp site and apply it.

Download library

Download latest version of Development Kit here and extract it to standalone directory.

FastCGI

Get and update patches

Download all five patches from Cybozu site. Now when you have patches it’s necessary to convert all files to correct windows-ending format. This can be done for example in Notepad++.

Convert to windows EOL

Get patch.exe application

Now you need some application capable to apply the patches. Unfortunately windows doesn’t contain any application for this task and also lot of comparing/merging applications can’t do that.

The simplest way is to download windows conversion of linux patch.exe app. Get it from gnuwin32 site – patch for windows.

Apply patch to project files

Apply patches

Open directory with fastcgi library, copy all patch files to this directory and open command line. As next run patch command for all fives patches:

...\fcgi-2.4.1-SNAP-0311112127>patch -Np1 < 4-vc9.patch
patching file Win32/FastCGI.sln
patching file Win32/authorizer.vcproj
patching file Win32/cgifcgi.vcproj
patching file Win32/config_h.vcproj
patching file Win32/echo-cpp.vcproj
patching file Win32/echo.vcproj
patching file Win32/echox.vcproj
patching file Win32/libfcgi.vcproj
patching file Win32/logdump.vcproj
patching file Win32/size.vcproj
patching file Win32/threaded.vcproj

In case you will see following error message:

patching file Win32/FastCGI.sln
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

it’s necessary to convert ALL patch files to correct Windows format (correct EOL) as mentioned in previous section.

More patches…

When you apply patches by cybozu it’s time to apply my own patches ;-).

Manually updated rejected file

As first, it’s probably that you will see following message:

1 out of 26 hunks FAILED -- saving rejects to file libfcgi/os_win32.c.rej

It’s because original patch is for older version of library and file os_win32.c  is slightly different. To fix that, edit this file at line 841 and manually update following line:

//original
int len = p - bindPath + 1;

//updated line
intptr_t len = p - bindPath + 1;

Update VS project file

Now turn off generating the Map Files in project configuration. These files aren’t necessary and it isn’t possible to compile project correctly with this settings.

Turn off .map files

DONE

And that’s all. Now you will be able to sucesfully compile fast-cgi library.

Compilation complete

External links

FastCGI c++ library for all platforms (Windows, Mac and Linux)

List of existing libraries

Snippets

Stackoverflow articles

Tutorials

Other links

CGICC – how to update it for VS2010 COMPILATION

  •  error C2668: ‘cgicc::copy_if’ : ambiguous call to overloaded function – add cgicc:: to all cgicc::copy_if instances
  •  error LNK2019: unresolved external symbol – add compiled .lib path (…Debug\cgicc.lib) to all dependend projects