Wednesday, April 8, 2009

Productivity Script

I've seen the productivity script on Lifehacker for both Mac and Windows, so I decided to make a Linux version of it, here it is:

#!/bin/sh
zenity --question --text "Consider if this is really how I need to be spending my time. Continue?" --ok-label=Yes --cancel-label=No

while [ "$?" == "0" ] # while test "$var1" != "end"
do
sleep 12
zenity --question --text "Consider if this is really how I need to be spending my time. Continue?" --ok-label=Yes --cancel-label=No
done


Make sure you make it executable.

I hope you enjoy it.

Wednesday, April 1, 2009

What are you doing?

That sentence is starting to annoy me, every single website I join asks me what I'm doing, why on earth do they care?

Why can't they all just sync their status with facebook or twitter? Well, very few do but the majority just have their own field with no way of synchronising it with any other site.

As I've said before, the least thing the web needs today is another place to store your data and no site out there that aims at gathering all your information in one place does just that.

Every website that promises to "put all your social networks in one place" or "centralises your on-line identity", they all end up adding at least one thing: the net work part; they all ask you to add friends...

While I was thinking of this problem, I did come up with a solution that doesn't involve making friends to share things with your friends without having to make different friends... as a matter of fact, it even helps organize your contacts from the different places.

I might go for it one day, but I'm still working on Deskiyo and it's still interesting. So this is just a thought.

Thursday, March 19, 2009

Stretching Images in Flex

I needed to do this today and I had to search a lot before I found the right article that explained it so I decided to share it.

If you need to put an image in your application and you want it to stretch/shrink to the size of the Image component, just change the image's 'maintainAspectRatio' property to false.

You can see the article where I learned this along with an explanation here.

Sunday, March 8, 2009

Watchmen Sucks!

Five! That's the number of times I looked at my phone while watching Watchmen; I was checking the time, waiting for it to be 11 so I can leave.

The movie is utterly boring! It has no point, no time line, no clear story, and no plot! What's left? Graphics and special effects, I know, they were pretty awesome but that's it!

With all the buzz it's getting, I was expecting something extraordinary like Ironman, but oh no! I thought resident evil extinction was the worst movie but obviously not as bad as Watchmen, at least I didn't just wait for it to finish.

So, why does it suck? Humm... Let's see! As I said, first, there is no point behind it. The movie ended and I still don't get what the fuzz is all about.

Second, no time line, suddenly, they're showing some memories, then they're back to the future, without any indication like fading colors or something to show that it's a memory.

Third, no clear story, I still don't get how they started, who's against whom, why some left, why the comedian hates that other dude (the one he went to cry with), and many other things that I still don't get.

Fourth, no plot, well, where is it? There is no interesting part, everything is just dull.

And what made it worse is that every nude part is cut, even though, some has conversations in them that are crucial to the "story", they could have just blurred the part, but oh no! Just removing it is much easier.

All in all, it was just a waste of money and time.

Friday, February 27, 2009

The social web

I've been posting for a while about Connectiyo, which, basically, was supposed to be a social networking website and because of that, I've be abstaining from using many websites because I didn't want to make them grow and later compete against them.

Just recently, I abandoned Connectiyo so I'm starting to use a lot of websites that I didn't before.

And my fears were true: Things are messed up!

There are so many websites that do so many things, and the annoying thing is that it's hard to get them all to work together.

You'll say "There are websites like Plaxo and Mugshot that try to put everything together", that's right, they try to do that, but it's still not working; you still have your pictures scattered over flickr, facebook, and picasa, you still have your blogs posts scattered over blogger and facebook, you status is still hard to sync for every website you use has its own "What are you doing?" field and only few allow synchronising with other websites, and you still have your chat contacts scattered over yaho, msn, and gtalk.

Someone must do something about this, and one thing I'm sure of is that that someone is not going to be me; I don't want to create a website that'll end up to be another website to be merged with others rather than one that merges them all.

Monday, January 12, 2009

A better solution for A2DP

I posted a way to get bluetooth headsets working with Linux but that method has some flaws (doesn't work on sound effects, doesn't work with flash, etc).

There's a better way that I used to use, it's slightly longer to switch to bluetooth with that one, but I'm trying to find a way to make the switching easier (just a mouse click) and I believe there is a way to do that.

You can find the instructions here.

I'll update you once I find a solution.

Sunday, January 11, 2009

A2DP (Stereo Headsets) on Linux

I've never got it to work the first time, I always keep searching, trying, and failing until I finally find a way that works.

This time I decided to share it with people so they won't go through this, it's also easier than the rest, here's what you have to do:

First of all, pair your headset with your computer.

Create a file in your home directory called .toggle.sh

Inside that file put the following:

#!/bin/bash

state=`gconftool --get /system/gstreamer/0.10/default/musicaudiosink | cut -d\ -f1`

if [ $state = "autoaudiosink" ]; then
gconftool --type string --set /system/gstreamer/0.10/default/musicaudiosink "sbcenc ! a2dpsink device=XX:XX:XX:XX:XX:XX"
zenity --info --title="GStreamer" --text="Switched to BT headphones."
else
gconftool --type string --set /system/gstreamer/0.10/default/musicaudiosink "autoaudiosink"
zenity --info --title="GStreamer" --text="Switched to speaker output."
fi

echo musicaudiosink set to `gconftool --get /system/gstreamer/0.10/default/musicaudiosink`


replace XX:XX:XX:XX:XX:XX with the address of your headphone, you can get that by setting your headphone to be visible and running

hcitool scan


That's it :)

This script toggles between your bluetooth headset and your speakers and shows you a dialog.

You can add a launcher to your panel.

Right click on the panel, add to panel, custom launcher, and for the command enter:

sh /home/ljuwaidah/.toggle.sh


of course, replace ljuwaidah with your username.

To get your buttons (play, pause, prev, next, etc) to work, edit /etc/modules and add uinput to the end of the file.

Hope this helps :)

This is taken from this post on board4all: http://www.board4all.cz/showthread.php?t=134759.

PS: this is better 'cause it actually switches between the speakers and headphones unlike what's mentioned in that post where you have to go to your sound preferences to switch back to speakers (they had a bug in the script: they used == instead of =). Also, I found that you don't need the other files.