Indie gaming

If you haven’t seen the Indie Game documentary, I totally recommend it. It gives a great view of the videogames industry and how difficult is for small startups to develop and publish a videogame. And it gives you an idea of the huge amount of work behind any game.

The thing is that, even though I don’t play much, I’ve been trying lately to play some indie games both to support small companies and to see how are those games. The first one that I tried is Game Dev Tycoon. I read this post in HN and found their idea amazing, so I decided to buy the game. The game is simple: it’s the Theme Park of the videogames industry. You have to build your own videogames company from scratch. The graphics are simple, and the game has some minor bugs, but is still worth the price: 8$.

The second one was this weekend. I played Journey and, as the reviewer on the video says, Journey is probably the most beautiful game I’ve ever played. It’s a really short and simple game, you don’t have lives, you cannot be killed, you don’t have to fight, there are no coins… It’s just a Journey with amazing landscapes and an outstanding music. And it’s collaborative, you’ll meet other players during the game, but you cannot talk, type any text or know their name. You can only communicate through musical notes.

You can see the review here:

Posted in Uncategorized | Tagged , | 1 Comment

Setting up the “perfect” terminal in OS X

These days I’ve been playing with the new version of ITerm: ITerm2. I totally recommend it. It has many amazing features such as: full screen terminal, vertical/horizontal split (not tabs), Growl notifications, etc.

After that I’ve configured Solarized as my color scheme in both IntelliJ Idea and ITerm, and is really clear, light and clean.

Besides that, with a couple of lines in some config files I’ve configured bash to show colors in the prompt. You just need to edit the file /etc/profile and add:

alias ls=’ls -G’

and the file /etc/bashrc:

PS1=”\[33[35m\][\u@\h:\w]$ “

Instead of those, you can edit your local files .bashrc and .profile but it will apply only to your user.

If you want more details about the prompt configuration or the colors, please check this.

Posted in Scripting | Tagged , | Leave a comment

Bash script with an embedded file

In the last months I’m getting used to do some of the tasks at my job using shell scripting, specially tasks that are done repeatedly.

Sometimes I’m lazy to write the script for a simple task that, manually, would take only a few minutes. But if you think about the time that you can save when you have to repeat that task over and over then it’s worthy to write a script.

In this case I wanted a script that generates a defined structure of folders (a Subversion local repository), but it was not as easy as using mkdir command. I had a folder structure that I wanted to replicate but I wanted to distribute only the script in my project. The solution for that was using the uuencode and uudecode commands.

Imagine that you have a folder that contains all your structure called “workspace”, you could create a tar.gz file with that and then, using uuencode, you could embed that file into your shell script:

> tar -zcvf workspace.tar.gz workspace/
> uuencode workspace.tar.gz workspace.tar.gz > generate_workspace.sh

 

That would generate a file with the following content (in this case, workspace is a folder with a text file inside):

begin 644 workspace.tar.gz
M'XL(`*42KDP``^W170K",!!&T3Z[BJR@.C&I&W$#P09:_*6)U.4;*RJ(%1]:
M1+R'P`S,0`:^=M^LP\&M_#0;S2Q96'NM1='5Y%:[7L38N1'1.LU%2UI3=KR3
M'HXAND:IK'2[VF_Z]]K*OQO_JO:>?^-=N?5Y/,6A_[@$7!C3G[]^SM^(-9F:
K#7W(*W^>_[*J@TK/J>A#S"??O@<```````````````#`Y\YXW]L2`"@`````
`
end

Then, you could edit the same file to add the code necessary to extract the file, uncompress it and move it somewhere:


#!/bin/sh
# validate command line arguments
if [ "$1" = "" ]
then
echo "$0: Generates an empty workspace"
echo "Usage: $0 [Workspace path]"
exit
fi
uudecode $0
tar -zxvf workspace.tar.gz > /dev/null
rm workspace.tar.gz
mv workspace $1
echo "Generated empty Workspace in $1"
exit 0
begin 644 workspace.tar.gz
M'XL(`*42KDP``^W170K",!!&T3Z[BJR@.C&I&W$#P09:_*6)U.4;*RJ(%1]:
M1+R'P`S,0`:^=M^LP\&M_#0;S2Q96'NM1='5Y%:[7L38N1'1.LU%2UI3=KR3
M'HXAND:IK'2[VF_Z]]K*OQO_JO:>?^-=N?5Y/,6A_[@$7!C3G[]^SM^(-9F:
K#7W(*W^>_[*J@TK/J>A#S"??O@<```````````````#`Y\YXW]L2`"@`````
`
end

Executing the script to extract the folder structure somewhere:


> chmod +x generate_workspace.sh
> ./generate_workspace.sh /tmp/myWorkspace

And that’s all. I hope that this helps somebody.

Posted in Scripting | Tagged | 2 Comments

Android Unveiled (I)

This is a presentation that I’ve made to my colleagues at my company these days. It’s a short introduction to Android. I’m planning to write the second part soon.

I would be very grateful if you could point out any mistakes on it.

Thanks!

Android_Unveiled

Posted in Android | Tagged , | Leave a comment

Shutdown the system from Plex

I’ve tried several mediacenter applications in Mac and the one I prefer is definitively Plex. There are lots of plugins (even for Spotify, if you are premium) and it has a complete integration with Apple Remote (nobody wants to see a movie from his chair).

If you are using Mac and you are looking for a mediacenter application, I would encourage you to give a try on Plex. At the beginning it’s a little complicated to setup everything and to get used to it, but I thing it’s worth it.

If you are running Windows you can try XBMC.

Many times I’ve been watching some episode or a movie from my bed and, when I was falling asleep, I had to get out of the bed to switch off my computer. That’s not very comfortable. So, what I’ve done is creating two scripts called “Plex Shutdown” and “Plex Sleep” that can be executed directly from Plex with my Apple Remote. The scripts have to be edited with the AppleScript Editor and saved to an application.

The code for the shutdown script is quite simple:

do shell script "shutdown -h now"
password "yourpass" with administrator privileges

And the sleep script:

tell application "System Events" 
sleep
end tell

Notice that you need to specify the user password to shutdown the computer, and the user has to be administrator. If not, a dialog will appear asking for the password and the script will be useless (remember, you want to sleep 😉 ).

A screenshot of the AppleScript editor and how to save to an application:


The last step is to execute the script from Plex. To run it, you’ll only need to navigate with your Apple Remote to Programs, then select your drive and browse into your Applications folder and select the application.
And even more, if you sleep your computer, you’ll be able to wake it up with the remote control.

That’s all, enjoy your movies!

Reference: Plex Forums

Posted in Scripting | Tagged , , | 2 Comments

Hello… IT

This may be my… fifth or sixth attempt to write a blog.

The previous ones where a mixture of opinions, news, knowledge and personal stuff, but that leads to a typical personal-blog where there is no main subject or purpose.

This will be a typical tech-blog 🙂 But the difference is that I will write when I feel to do it and when I have something interesting to share.

I hope you enjoy.

Posted in Uncategorized | Tagged | Leave a comment