Posts Tagged ‘scripts’

mrender: sendToAvconv 2014 update

Posted on: 1 Comment

It’s time for a new version of the sendToAvconv that takes into account the -start_number flag and xterm (two options that came out of comments from the last update from 2012).

Now called mrender, I add this to the afterRender callback in Nuke write nodes to send a subprocess call to avconv (or ffmpeg) and render a Quicktime. This is primarily meant for linux distros which don’t have great gui options for converting image sequences into movies.

Changelog

This update no longer requires image sequences output from Nuke to start at frame 0, or 1.

You can set xterm to show the output under the configuration options (request).

And if you have ffmpeg installed instead, you can set that to default

 

Remote Access over SFTP on Ubuntu 14.04

Posted on: 2 Comments

Today, I wanted to allow a remote user access to some files stored locally.

All together, it was about 8GB of files and I didn’t want to use any large file transfer websites.

Allowing SSH access on your LAN  is one thing, getting it working safely for a standard remote user is another. I wanted the user to have access to only his home folder.

  1. If you haven’t already, install ssh
    • sudo apt-get install ssh
  2. We are going to allow access based on user group, so lets create a new group for remote users.
    • sudo groupadd sftp
  3. Create a remote user and add them to our new group. I set their home folder to a secondary drive (but their home folder can be anything).
    • sudo adduser --home /media/storage/remote/username username
    • sudo usermod -aG sftp username
  4. Set the correct permissions on the remote user’s home folder. For the remote user to be restricted to their home folder, every directory above their home folder must be owned by root. We do this in step 3.
    1. sudo chown root:sftp /media/storage/remote/username
    2. sudo chmod 750 /media/storage/remote/username
    3. sudo chown root:root /media/storage/remote/
    4. sudo chmod 755 /media/storage/remote/
  5. Edit our SSH config
    • sudo nano /etc/ssh/sshd_config
      1. Enable SFTP only (don’t allow shell access)
      2. Deny any users we know shouldn’t access remotely
        • DenyUsers johndoe
      3. Allow our sftp group created above
        • AllowGroups sftp
      4. Add specific settings for this group. This has to go at the end of the sshd_config
  6. Test output
  7. Restart ssh service

If you wanted the user to have write permisions, create a subfolder of /remote/username/writable and chown username:username
Lastly, Ensure your router forwards port 22 to your LAN IP. And don’t forget to open part 22 incoming on your firewall.

Ubuntu mimetypes

Posted on: No Comments

Opening an unknown file type into a new default application is a bit of a pain in Ubuntu 13.10.

For example, getting .nk files to open by default in Nuke isn’t as obvious as it should be. Nuke uses plain text files with the .nk extension and always associate with gedit.

Ubuntu’s wiki page on adding mime types offers two solutions:

  1. modifying  /etc/mime.types
  2. add xml files in /usr/share/mime/application

Unfortunately, neither worked for me, for whatever reason. Option 2 however included the xml file information which was useful.

In the end, I used xdg-icon-resource and xdg-mime successfully.

With the Nuke for example:

install icon

install mime type

restart nautilus

The application-x-nuke.png  is just the launcher icon.

the mime type xml in the second step looks like this

More details at stackoverflow

client denied by server configuration error after upgrade to Apache 2.4

Posted on: 1 Comment

After an upgrade from Ubuntu 13.04 to 13.10,  my Apache virtual host configurations were returning a HTTP Forbidden error.

With the Ubuntu upgrade, I was now running Apache 2.4.6, which had a few changes made to access control.

The relevant one here was the move from  Allow from  to Require all .

Thanks once again to stackoverflow.

Importing VFX Plates with reference MOVs

Posted on: No Comments

This is an update to my previous post on using bash to shuffle files around into named folders.

The additions in this script take into account editorial giving us a reference Quicktime that should be filed accordingly.

Additionally, the script now takes an argument that is the folder to process. And prints the progress to the terminal.

 

Using MAC OS X launchd to schedule rsync

Posted on: No Comments

When reviewing VFX shots, loading EXR files into RAM for realtime playback goes much faster locally than over our network. I’ve set up our review station to sync shot files for review using the Mac’s launcher Agents (launchd) thanks to some good documentation on nathangrigg.net

Using his template, I’ve got a plist file set up  and saved to  ~/Library/LaunchAgents/com.rsgca.sync-comps.plist

The agent above runs the bash script below every 200 seconds

This rsync script above syncs all EXR files from our file server to the local RAID array.

The commands to load and run  launchd  are

 

Renumber an image sequence in bash

Posted on: No Comments

FFmpeg and Avconv required image sequences to start at frame 1. I have a number of sequences that start at frame 1001 and need to be renumbered.

Unfortunately, GUI apps tend to hang populating the list of files to rename because they are in the 1000s of frames.

Here’s a way to accomplish the renaming of image sequences in bash, adapted from a number of sources.

To use:

  • Save the above code to  ~/Desktop/resequence.sh 
  • cd into the directory containing the image sequence
  • bash ~/Desktop/resequence.sh

Move Image Sequences into Named Folders with Python

Posted on: 2 Comments

Sometimes we receive multiple image sequences in one folder.

These few lines of python will move each image sequence to its own folder.

To use:

  • Save this script to your Desktop,  ~/Desktop/sortSequences.py
  • Open terminal
    • cd /path/to/image_sequences/
    • python ~/Desktop/sortSequences.py

Importing VFX Plates

Posted on: 1 Comment

When we receive plates from editorial, we have to import them into our VFX directory structure.

We might get something like this:

And we want

Executing this bash shell script in the ingest directory will iterate over the folder contents to automate this process.

To run the command

  • save the above code into ~/Desktop/ingest.sh  extension.
  • cd into the directing containing the folders of plates
  • run  bash ~/Desktop/ingest.sh*

*NOTE that you use bash not sh. The latter won’t expand the folder names on line 13.