Creative, techie, musician, linguist, traveler, husband, father, believer.

Not necessarily in that order.

Hidden Lisbon

Check out my other blog Hidden Lisbon. It’s about some of our favorite places and hidden gems in the beautiful city of Lisbon, Portugal.

Visualize.me

Are you looking for a fun new way to spice up your resume/qualifications? I just stumbled across this site which makes a pretty cool infographic from your LinkedIn profile. Check out my infographic here....

Xojo and load balancing with Haproxy

I have previously written a post on load balancing for Xojo web app developers using Nginx. You can see the post here. This is an update to that post focusing on Haproxy instead of Nginx. You can learn more about and download Haproxy here. Why choose Haproxy over Nginx? There are pros and cons to each of these solutions – but Haproxy offers better options for sticky sessions than the standard free Nginx package. If you get the Nginx “plus package” ($1350) then Nginx would be the better overall solution. But for free, Haproxy beats it for pure load balancing capability. Specifically, Haproxy includes cookie injection and routing which allows you to tag each user with a cookie indicating what back-end Xojo process to route them too – which maintains the session. Without the “Plus package” the best Nginx can do is IP hashing which will route an entire office of users (if behind one NAT IP) to the same single instance of your app. If you have multiple users in the same location (ex. employees of the same business) then the load balancing is defeated. If that is not your circumstance, then check out the Nginx post – it may be a better choice for you. Nginx can also offer the power of serving non Xojo web pages and static content such as images.   Haproxy Configuration global log 127.0.0.1 local0 maxconn 4096 daemon defaults log global mode http option httplog option dontlognull retries 3 option redispatch maxconn 2000 contimeout 5000 clitimeout 50000 srvtimeout 50000 frontend http-in bind *:80 acl is_myapp1 hdr_end(host) -i myapp1.mydomain.com acl is_myapp2 hdr_end(host) -i myapp2.mydomain.com use_backend myapp1pool if is_myapp1...

Cycles – the app.

Check out Cycles! Cycles is a super-simple time and focus management utility for MacOS. It is SURE to make your life better immediately upon first use or your money-back…. GUARANTEED! (It’s free). I made this because I wanted a easy way to break down my work-time into 20 minute chunks where I can focus entirely on one task. Open up Cycles and it displays a small 20 minute count-down timer in the corner of your screen. When time is up it displays an alert (including FREE bonus motivational quote). Act now and I’ll thrown in a settings window where you can adjust the timer length.   Download the installer...

Black and White Lisbon

Lisbon is a beautiful and warm town with an old and somber soul. Take a look inside – Saudades. Gonsalo Jude Linha Portugrunge Umbrella Tree A Ponte Rua Tejo Chiado...

Mercado da Ribeira

We are in this awesome place every other day. It has a continual supply of some of the best produce, meat, fish and flowers in the city and is one of our favorite spots to shop. It doesn’t hurt that it is only a few minutes walk away, either. When you are in Lisbon, you should check out this market located right across from the Cais do Sodré train station. It has been under renovation for quite a while and recently re-opened with an expanded gourmet restaurant section, which is awesome! There is even a new playground for the kids with a refreshment kiosk outside underneath the Jacaranda trees. Here is a link to some more pics:...

Xojo and load balancing with Nginx

The following post is the results of some tests I did running a small cluster of Xojo apps on a CentOS server and load balancing them with Nginx. I am putting the summary in this post but there is additional discussion on the Xojo forum here and here. …… OK – so the results are in. Nginx load balancing made a MAJOR difference in usability, if an app is likely at all to get temporarily locked up (processing a large file or something). In the end, this works pretty much as I hoped and allows you to run separate instances of standalone apps across different processors and still keep the connections xojo needs to maintain sessions. Nginx Conf: upstream myproject { ip_hash; server 127.0.0.1:8080; server 127.0.0.1:8081; server 127.0.0.1:8082; #add a listing for any port you are running an instance on } server { listen 80; location / { proxy_buffering off; proxy_read_timeout 5m; proxy_pass http://myproject; } } ip_hash; is required to maintain session, app fails to launch without it. proxy_buffering off; needed to keep data flowing from app to client through proxy proxy_read_timeout 5m; keeps connection open for app “pings”. If left at default the app will disconnect after 60 seconds. I tried several settings between 1-10 minutes and this was the lowest setting that worked consistently. The app remains open. In order to start the app instances, I used upstart. I am on CentOS but this should also work on RHEL and possibly Fedora and many others. This is my method of choice because it will automatically respawn instances when they fail, allows easy starting and stopping of the whole group and can exec your app...

Batch Processing Images on Mac with SIPS

SIPS must be one of the simplest and most underrated ways to process images on the mac. I mean, that’s what it’s there for, but it’s like no one thinks about it. I was trying to resize about 500 jpegs today with automator and then I remembered it. SIPS is simpler and faster FTW! SIPS doesn’t do EVERYTHING, but it does some common functions quickly and nicely and it’s accessible from the command line right in the terminal. Here are some things SIPS can do: #Resize a batch of images to 250px (largest side) sips -Z 250 * #Resize only .jpg files in a folder to 500px x 500px - ignores aspect sips -z 500 500 *.jpg #Rotate a batch of images 90 degrees clock-wise sips -r 90 * #Resize down to fit 250 pixels and pad with white to make them square, add finder icon sips -Z 250 -p 250 250 --padColor FFFFFF -i * There are more things you can do with SIPS – be careful, don’t hurt yourself – SIPS modifies your files without apology so experiment on copies or live a life of regret. You can see the man page for more info. Of course, you could mogrify with ImageMagick, and that is truly wonderful, but not everyone needs or has IM and SIPS works out-of-the-box on any OSX Mac. BTW, SIPS stands for Scriptable Image Processing System, in case you were...

Appcelerator and Node.js

I hadn’t build an app in Titanium lately because I had been focusing on some other projects that were Xojo based. Some time had passed and I hadn’t even opened the IDE. Then a project came a long and I needed to pull out Appcellerator again and dust it off. I opened up a project where I had left it off. There was an update to Titanium to install – did that – cracked open my project and initiated a build to the iphone simulator – and ran into the following error: /usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:181 throw e; The app wouldn’t build – the command line tools would not work – total chaos. …turns out I had updated my Node.js installation for another project I was working on and Titanium did not like it. They prefer you use something in the 0.8.x family and I was at 0.11.4 so this was definitely not going to work. Luckily, there are already two very cool utility which make managing which version of node you are using really easy: n and nvm. I personally prefer n but nvm worked better in this case because my preferred shell is tcsh but Titanium’s is bash… nvm works great in bash, and for Titanium. Solution So – in a nutshell – the solution is install nvm, install Node.js v0.8.25 using nvm, make it the default node version and THEN run Titanium. Voila – back to normal! Something like this under bash: #get nvm curl https://raw.github.com/creationix/nvm/master/install.sh | sh #get an older node version nvm install 0.8.25 #use the new old version and set it as default nvm use 0.8.25...

Casa de Xisto

There is something about the scent of the earth, the trees, the leafy things, reaching through the unspoiled mountain air and the song of that small river free running in the distance. There is a gentle mist falling, settling into my bones, and these stones. The place is at once alive, yet centuries old – not at all dead and buried but breathing softly, warmly. Oleiros whispers with the quiet, ancient, humble heart of a grandfather. Unusually silent, my young son stands beside me. I take his...

Timeline JS

I was asked by a client recently to explore online timeline solutions for a website project. I found many, most of them decent. This one I thought stood out from the crowd though. I really like the ease of setup and ease of embedding links to external media of different types (YouTube, Wikipedia, etc). I also like that it is an open-source project. I haven’t used it yet, but if this project goes forward I will followup here – this is the direction I will recommend.   Check it out here:...

Press-This 404 Issue

I keep coming across an annoying issue with WordPress’ “Press-This” feature and I know I am not the only one. I am not sure of what the root cause of this is – if it is a Safari issue, a wordpress issue or a server configuration issue. Regardless, if you have been having difficulty with wordpress throwing a 404 whenever you use the bookmarklet you can try this simple fix which worked for me. javascript:var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://john-joyce.com/wp-admin/post-new.php',l=d.location,e=encodeURIComponent,u=f+'?u='+e(l.hostname+l.pathname)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';a=function()%7Bif(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=810,height=570'))l.href=u;%7D;if%20(/Firefox/.test(navigator.userAgent))%20setTimeout(a,%200);%20else%20a();void(0) To use this, create a new bookmark and paste the above code into the URL or Location field.What’s different, you ask? All I changed is the encoding of the url, originally e(l.href) to the following e(l.hostname+l.pathname). This eliminates the “http://” portion which is what was causing the problem for...

Portfolio

OK – so today I posted a bunch of portfolio stuff on my BeHance portfolio. Feel free to check it out and comment here. http://be.net/johnfjoyce