Making Vines on OSX

I recently got a few questions on how I make and upload my screencaps to Vine. Here’s the recipe!

1. Screencap using QuickTime

QuickTime on OSX has support for video screencaps. Open QuickTime and go to File / New screencap. Pick a part of your screen and press record. Make sure that your screen selection is nearly square for the best vine experience! Also, make sure that width >= height, otherwise Vine won’t accept it.

To get an almost square selection, I resize my browser window with Chrome devtools open until I see that the inner browser width equals the inner height. Then I make the screen selection for the video.

Making a square screencap

2. Trimming

It’s easy to trim the video in QuickTime. Just press command+t and you can use the UI to trim your video. Make sure that the total time of the video is less than 6.5 seconds.

QuickTime trimming

3. Exporting

Usually it’s okay to export in 1080p, but make sure that you don’t pass the max file size of 5Mb. Click File / Export / 1080p… and see what you get.

Note that if you choose to remove the sound from the video (see next step), the file size will be very small.

4. Optional: removing sound

Sometimes sound is not needed in the Vine. I use ffmpeg with the following command to lower the volume to zero:

ffmpeg -i in.mov -af 'volume=0' -strict -2 out.mov

5. Upload to Vine using VineClient

You can upload the Vine using the VineClient add-on for Google Chrome. Install, log in, press Upload and follow the instructions.

Note that if you check the “Keep aspect ratio” checkbox, you’ll get black stripes at top and bottom of your Vine. Uncheck it if you know that your video is nearly square.

6. Sharing on Twitter

Don’t make the mistake of sharing to Twitter via VineClient. In that case your Vine will not get displayed inside your tweet. The reason for that is because VineClient uses an own Vine URL that Twitter doesn’t recognize. Instead, go to vine.co, find your Vine there and share it.

Vine in Twitter

Note that the Vine URL in the tweet got hidden! This only happens if you put the URL last in your tweet.

That’s all! Now go make some awesome Vines.

Upgrading to OSX 10.10 Yosemite

When upgrading my Macbook Pro 15″ Retina to Yosemite, Homebrew, Postgres and RabbitMQ broke. But, they were quite easy to get running again.

Homebrew

If you didn’t upgrade homebrew before you upgraded to Yosemite (why should you?), you might have a broken homebrew. None of the brew commands work. To get it working again, follow these steps.

First, update homebrew via git:

cd /usr/local/Library;
git pull origin master;

Next, use homebrew to update and clean your installed packages:

brew update;
brew prune;
brew doctor;

Homebrew should now work.

[Source]

Postgres

When installing Yosemite, some Postgres folders are removed for some reason, and these folders are required for Postgres to run.

$ postgres -D /usr/local/var/postgres
FATAL: could not open directory "pg_tblspc": No such file or directory

To fix this, and prevent Yosemite to remove the folders again, run:

mkdir -p /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp}/
touch /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp}/.keep

[Source]

RabbitMQ

RabbitMQ would not start for me, for some reason.

Status of node 'rabbit@xxx' ...
Error: unable to connect to node 'rabbit@xxx': nodedown

Checking the broker log, it said “cannot_delete_plugins_expand_dir”:

Error description:
   {error,
       {cannot_delete_plugins_expand_dir,
           
["/opt/local/var/lib/rabbitmq/mnesia/rabbit@schmac-plugins-expand",
            {cannot_delete,
                "/opt/local/var/lib/rabbitmq/mnesia/rabbit@schmac-plugins-expand",
                eacces}]}}

This was clearly a permission problem, easily solved by setting the rabbitmq user as owner for the directory.

chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

[Source]

Server-side pattern rendering

I’m getting closer to the core of friendship-bracelets.net… Pattern rendering. It is the most vital part. This is what almost all users go to the site for. I’m going to make it as good as I can.

One advantage with doing this in Node.js and JavaScript is that if there is a need for client side rendering, the same code could be used. An example could be to change the colors in the pattern interactively, to check whether a set of colors are good looking together or not.

Many things are falling into place now. I want to launch a beta testing site soon but before that I need generators and server-side rendering for all types of patterns… And probably a lot of other stuff that has nothing to do with patterns at all. I hope you can wait.

How to create a central git repository

I’ve been working a lot with git lately and one of the problems I had was to create a central git repository that two people could push and pull to. It’s a simple problem, and it’s got a simple solution. Run this in a terminal:

mkdir code; # Make an initial working directory
cd code;
git init;

Now add some files, and run “git add” on them. Then commit.

echo "Hello git!" > testfile;
git add testfile;
git commit -am 'first commit';

The next thing you want to do is creating the “central” repository. You do this by cloning your current working directory with the “–bare” flag:

cd ..;
git clone --bare code central;

The working directory does not yet know of this central directory called “central”. To fix this, one could either go through the config for the folder or just make a clone of the central directory. We will do the latter, and therefore we will not need the current “code” directory.

rm -Rf code;
git clone central code; # make new coding dir

All done! You can now edit files in “code” and run “git push” or “git pull” as you like. Good luck!

Making Spotify for Linux work in Ubuntu

The Spotify for Linux software is a great initiative, but it is a little buggy. As I am a music freak, I had to make it work on my favorite operative system Ubuntu.

The solution that worked for me was deleting the spotify cache before the program start. It can be done by running the following in a terminal:

rm -Rf ~/.cache/spotify

Doing this every time you want to launch Spotify is too much of a trouble, therefore I made a small shellscript to do this for me. Start a text editor by executing the following:

gedit ~/spotify.sh

Enter the following code:

#!/bin/bash
# Remove spotify cache
rm -Rf ~/.cache/spotify;
# Start spotify
spotify;

This code removes the spotify cache and starts Spotify. Save the file.

Now, to make the file executable, run the following in a terminal:

chmod +x ~/spotify.sh

To run this script, execute

~/spotify.sh

If you want to make Spotify quick started, make an own program starter for it in the Ubuntu panel:

If you want the Spotify icon on your program starter, it is located at /usr/share/pixmaps/spotify-linux-512×512.png.

Now lean back and enjoy your music.

Lost and found

image

Found this original Game Boy system at my parents house while visiting them last week. The console is fully functional and I have four games to play: Super Mario Land, Battletoads, Ducktales and Pokemon yellow version.

Birthday!

As always, my closest relatives showed up at my parents’ house to wish me a happy birthday and have some fika. You guys are the best, thanks 🙂

So… Now I’m 24. Still young.

image

Tommy and Emma.

image

Sofia and Martin, my brother.

image

Coffee time.