Jan
19
Lightroom4 Smart Collection : photos without collections
January 19, 2014 | Leave a Comment
If you wish to display all the photos you didn’t sort by collection, you can create a Smart Collection with the folowing rule :
Collection – doesn’t contains – {a e i o u}
I had a collection named USA, so I actually made the rule
Collection – doesn’t contains – {a e i o u A E I O U}
Jan
15
Martin Scorsese’s open letter to his daughter
January 15, 2014 | Leave a Comment
Dearest Francesca,
I’m writing this letter to you about the future. I’m looking at it through the lens of my world. Through the lens of cinema, which has been at the center of that world.
For the last few years, I’ve realized that the idea of cinema that I grew up with, that’s there in the movies I’ve been showing you since you were a child, and that was thriving when I started making pictures, is coming to a close. I’m not referring to the films that have already been made. I’m referring to the ones that are to come.
I don’t mean to be despairing. I’m not writing these words in a spirit of defeat. On the contrary, I think the future is bright.
We always knew that the movies were a business, and that the art of cinema was made possible because it aligned with business conditions. None of us who started in the 60s and 70s had any illusions on that front. We knew that we would have to work hard to protect what we loved. We also knew that we might have to go through some rough periods. And I suppose we realized, on some level, that we might face a time when every inconvenient or unpredictable element in the moviemaking process would be minimized, maybe even eliminated. The most unpredictable element of all? Cinema. And the people who make it.
I don’t want to repeat what has been said and written by so many others before me, about all the changes in the business, and I’m heartened by the exceptions to the overall trend in moviemaking – Wes Anderson, Richard Linklater, David Fincher, Alexander Payne, the Coen Brothers, James Gray and Paul Thomas Anderson are all managing to get pictures made, and Paul not only got The Master made in 70mm, he even got it shown that way in a few cities. Anyone who cares about cinema should be thankful.
And I’m also moved by the artists who are continuing to get their pictures made all over the world, in France, in South Korea, in England, in Japan, in Africa. It’s getting harder all the time, but they’re getting the films done.
But I don’t think I’m being pessimistic when I say that the art of cinema and the movie business are now at a crossroads. Audio-visual entertainment and what we know as cinema – moving pictures conceived by individuals – appear to be headed in different directions. In the future, you’ll probably see less and less of what we recognize as cinema on multiplex screens and more and more of it in smaller theaters, online, and, I suppose, in spaces and circumstances that I can’t predict.
So why is the future so bright? Because for the very first time in the history of the art form, movies really can be made for very little money. This was unheard of when I was growing up, and extremely low budget movies have always been the exception rather than the rule. Now, it’s the reverse. You can get beautiful images with affordable cameras. You can record sound. You can edit and mix and color-correct at home. This has all come to pass.
But with all the attention paid to the machinery of making movies and to the advances in technology that have led to this revolution in moviemaking, there is one important thing to remember: the tools don’t make the movie, you make the movie. It’s freeing to pick up a camera and start shooting and then put it together with Final Cut Pro. Making a movie – the one you need to make – is something else. There are no shortcuts.
If John Cassavetes, my friend and mentor, were alive today, he would certainly be using all the equipment that’s available. But he would be saying the same things he always said – you have to be absolutely dedicated to the work, you have to give everything of yourself, and you have to protect the spark of connection that drove you to make the picture in the first place. You have to protect it with your life. In the past, because making movies was so expensive, we had to protect against exhaustion and compromise. In the future, you’ll have to steel yourself against something else: the temptation to go with the flow, and allow the movie to drift and float away.
This isn’t just a matter of cinema. There are no shortcuts to anything. I’m not saying that everything has to be difficult. I’m saying that the voice that sparks you is your voice – that’s the inner light, as the Quakers put it.
That’s you. That’s the truth.
All my love,
Dad
Aug
25
Sublime Text : check PHP syntax on build
August 25, 2013 | Leave a Comment
In Sublime Text, go to Preferences -> Browse packages.
Go to the PHP folder and create an empty file PHP.sublime-build.
Edit this file and enter :
1 2 3 4 5 | { "cmd": ["php", "-l", "$file"], "selector": "source.php", "file_regex": "^Parse error: .* in (.*?) on line ([0-9]*)" } |
Now, when editing a .php file, press Cmd+B to run php-l on your file and check for syntax error
Aug
25
SVN AUTO UPDATING A DEV SERVER ON COMMIT
August 25, 2013 | 1 Comment
My goal here was to update a dev server anytime I commit a file. The simpliest way to do that seemed to create a post-commit hook. The difficulty though, came from file ownership and user issues. Basically, the post-commit script is executed as Apache : www-data on debian. And this user, on my setup, didn’t have the rights to update … I tried to use su but that failed with “su can only be run in the terminal”. I installed and tried with sudo and that failed with “sudo no tty present and no askpass program specified”.
So, here is the solution.
Go to your repository (ie /var/repository/) and cd into the hooks directory
1 | cd /var/repository/my_project/hooks |
You will see a post-commit.tmpl file. That is an example Create a post-commit file and enter the following
1 2 3 | vi post-commit #!/bin/sh sudo -u your_user /usr/bin/svn update /var/www/project/ --username your_svn_user --password your_svn_password |
Now, make sure this file can be executed by Apache
1 2 | chown www-data:www-data post-commit chmod 744 post-commit |
Time to check the sudo part of this
1 | aptitude install sudo #if you do not have it already |
And give Apache the right to sudo to use svn without password
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #as root cd /etc/ # give root editing rights chmod 740 sudoers vi sudoers #add this line %www-data ALL=(ALL) NOPASSWD:/usr/bin/svn # exit :wq #restore the rights chmod 440 sudoers |
That was it for me.
An interesting alternative solution.
Jul
15
Run CAS Server on OS X
July 15, 2013 | Leave a Comment
After working with SAML (ADFS and SimpleSAML) these past few months, I’m now testing CAS Server.
Here is how to install CAS Server on OS X for developers needing to integrate an app with such an auth. system.
First, we need Tomcat :
1 | brew install tomcat |
Now, we will need the JAVA mysql connector. Download it from mysql site and copy the .jar file to /Library/Java/Extensions/
Make sure Tomcat runs
1 2 3 4 5 6 7 8 9 | cd /usr/local ./catalina # Tomcat should display info on how to use catalina ./catalina run # Now tomcat runs and http://localhost:8080 should respond |
Second, now let’s get to CAS
Unzip it
Copy the CAS module to the Tomcat webapps folder
1 | cp -R cas-server-3.5.2/modules/cas-server-webapp-3.5.2.war /usr/loca/Cellar/tomcat/7.0.41/libexec/webapps/ |
Restart catalina and go to http://localhost:8080/cas-server-webapp-3.5.2
Now you can login using any login and password as long as they are the same 😉
I gathered help on how to install tomcat and how to get going with CAS here and here.
You can find some CAS literature here.
Jun
30
Notify readers of a private tumblr blog by email
June 30, 2013 | Leave a Comment
These past two months, I’ve helped two people start a tumblr blog. One of them is just a place for my daughter’s day care to share pictures of children with the parents. For obvious reasons, this blog is private. Tumblr is simple to use and the day care had no problem posting their photos and parents loved it. As I would find out, though, it is not possible to notify parents when a new set of pictures is published. So, I set out to write a quick code to do just that.
The Tumblr API is based on Oauth1.0a though you do not have to worry about OAuth to use it, the Tumblr PHP API does a lot of the work for you.
Since my script (called daily with a simple crontab) is windowless, I needed to generate a one time pair or tokens.
Tumblr provides the following Python script to do just that : callback.py.
So, first, let’s get some API keys :
You must register an app with Tumblr and, doing so, obtain a consumer_key and consumer_secret.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # I didn't have Python oauth module so sudo easy_install pip sudo pip install oauth2 # Log in Tumblr (with the account you'll need to be authenticated as for your API calls, in my case, day care admin # Edit the callback script vi /path/to/callback.py # Edit the consumer_key and consumer_secret to put your own. python /path/to/callback.py # Open the URL provided by the script in a browser # Click on Accept Press y # Enter the redirect parameter value (as copied in the URL in your browser) Press Enter # The script displays your oauth_token and oauth_token_secret, copy and save them |
Great, so, at this point, we have all we need to use the Tumblr API.
Get the PHP class from Git Hub and place it in your project directory.
CD in the tumblr project directory and, using composer, obtain the PHP dependencies
1 | composer install |
In your own project, inclue de composer/autoload.php file so that all other include to the dependencies work out of the box
1 | require_once composer/autoload.php |
Now, you can use the Tumblr API to get your blog’s list of post
1 2 3 4 5 6 7 8 |
Tomorrow, day care should post some great photos from last week field trip by a lake and all the parents will be happily notified 😉
In addition, I’ve tested the tumblr API and Composer. Not bad
Jun
30
Pear, pecl and php-oauth on OS X
June 30, 2013 | Leave a Comment
Today, I was needing to use the Tumblr API which PHP class uses the php-oauth extension.
So, before I could get started with Tumblr itself, I had to set a few tings up :
Install Pear :
1 2 3 | curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar |
Once the pear install script starts, I decided to place pear in /usr/local/pear so
1 2 3 4 5 6 7 8 9 | Press 1 Enter /usr/local/pear Press 4 Enter /usr/local/bin Press return to finish Install |
Thanks to this blog post by Jason McCreary for getting me this far.
Validate it all works typing pear version.
Now, using Pecl, install the oauth-extension :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | sudo pecl install pecl_http sudo pecl install oauth # Install failed as I was missing pcre brew install pcre # or sudo port install autoconf sudo port install pcre sudo cp /opt/local/include/pcre.h /usr/include/ # Again sudo pecl install oauth # Edit php.ini and add extension=http.so extension=oauth.so # Restart Apache sudo apachectl restart |
The Tumblr API requires a couple of other PHP packages and uses Composer so, after hearing about Composer for many months, I decided to get going with that, too.
1 2 3 | curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer |
All the prerequisites in place, back to the tumblr project
Jun
20
Listing the day’s reminders using Apple Script
June 20, 2013 | 1 Comment
I use Geek Tool and enjoy displaying the day’s todos and other information right on my desktop.
I wanted to display my upcoming Reminders (those I have fun creating with Siri) but didn’t want the future ones showing up.
With some inspiration from this script, I came up with the following gist :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | tell application "Reminders" set output to "" set output to output & "Reminders for " & weekday of (current date) & ":" set myList to "Reminders" set hasOne to false if (count of (reminders in list myList whose completed is false)) > 0 then set todoList to reminders in list myList whose completed is false repeat with itemNum from 1 to (count of (reminders in list myList whose completed is false)) set reminderObj to item itemNum of todoList set nameObj to name of reminderObj set compDateObj to due date of reminderObj if (compDateObj is not missing value) then set dayInt to day of compDateObj set monthInt to month of compDateObj as integer set yearInt to year of compDateObj if (dayInt = day of (current date) and monthInt = month of (current date) as integer and yearInt = year of (current date)) then if hasOne is false then set output to output & linefeed & "Reminders:" & linefeed set hasOne to true end if set output to output & "• " & nameObj end if end if end repeat else --set output to output & "No Reminders for Today" end if return output end tell |
Jun
20
Use Alfred to rip a DVD to an iso
June 20, 2013 | Leave a Comment
<myLife>While boyfriend is busy ripping and sorting our CDs into an amazing music collection, I try and reduce our DVD collections to a reasonable amount of shelves. In the end, it should fit on a large amount of 2Gb hard drives and I’ll stack discs in the attic.</myLife>
To make my ripping job easier, I created an Alfred command :
1 2 | echo <mypassword> | sudo -S diskutil unmount /dev/disk4 echo <mypassword> | sudo -S hdiutil makehybrid -o /Users/<myuser>/DVDRips/{query}.iso /dev/disk4 |
And now, all I have to do is insert a DVD, call Alfred and type Rip <Title>. Clean and simple. <myLife>i Like Alfred </myLife>
Jun
19
Samsung Slim External DVD Drive region free on OS X
June 19, 2013 | Leave a Comment
Just a quick quick how to on this (my drive is the Samsung SE-S084F)
- Download the firmware [see all : http://www.samsungodd.com/eng/Firmware/FWDownload/FWDownload.asp]
- Download the flash tool
- Open the flash tool, load the modified firmware and run the tool, reboot
- Use DVD Info X to make sure your drive is region free
- Use Region X to change DVD zones time and again
Source : http://club.myce.com/f105/howto-flash-firmware-samsung-dvd-writer-231217/