Saturday, August 14, 2010

giving write access to apache2

Giving write access for apache2 (probably this is a quick fix) I would not recommend this in production. Apparently, suPHP is the norm. But for what I am doing, this should suffice:

chgrp -R www-data /var/www
chmod -R g+w /var/www

Thursday, June 3, 2010

when you need to download the web! or a very small part of it....

wget is your friend.
I needed to download the web version of one of my courses for records, wget did the trick!

This article is pretty good at showing some examples:

Go beyond your limits

Awesome life example from Bruce Lee:

Bruce had me up to three miles a day, really at a good pace. We’d run the three miles in twenty-one or twenty-two minutes. Just under eight minutes a mile [Note: when running on his own in 1968, Lee would get his time down to six-and-a half minutes per mile]. So this morning he said to me “We’re going to go five.” I said, “Bruce, I can’t go five. I’m a helluva lot older than you are, and I can’t do five.” He said, “When we get to three, we’ll shift gears and it’s only two more and you’ll do it.” I said “Okay, hell, I’ll go for it.” So we get to three, we go into the fourth mile and I’m okay for three or four minutes, and then I really begin to give out. I’m tired, my heart’s pounding, I can’t go any more and so I say to him, “Bruce if I run any more,” —and we’re still running-“if I run any more I’m liable to have a heart attack and die.” He said, “Then die.” It made me so mad that I went the full five miles. Afterward I went to the shower and then I wanted to talk to him about it. I said, you know, “Why did you say that?” He said, “Because you might as well be dead. Seriously, if you always put limits on what you can do, physical or anything else, it’ll spread over into the rest of your life. It’ll spread into your work, into your morality, into your entire being. There are no limits. There are plateaus, but you must not stay there, you must go beyond them. If it kills you, it kills you. A man must constantly exceed his level.”
-From The Art of Expressing the Human Body
By Bruce Lee, John Little

Wednesday, June 2, 2010

converting videos with ffmpeg

I had to work on some video conversion and I found a good post from the Linux Journal on commands and tips for converting videos.

A command example:
ffmpeg -i eSeetrackFlash.flv -b 20000k -s 896x536 target_0.7.avi

explanation to be continued

Thursday, May 6, 2010

adding new source to repository

Just a quick command to add a new source to the repository:

sudo add-apt-repository "deb lucid partner"

Interesting quotes !

From Antoine de Saint-Exupery:
"A designer knows he has arrived at perfection not when there is no longer anything to add, but when there is no longer anything to take away"

Thursday, April 1, 2010

Nexus one tethering with ubuntu 9.10

Need to Tether from Nexus One to ubuntu?

I followed the steps in this blog:

and I can use my 3G cell connection from the nexus one to ubuntu 9.10.
Presented on the blog are the steps for the HTC Magic, so configuring adb for the nexus one is slightly different:

I edited udev permissions and created a new file:
# /etc/udev/rules.d/99-android.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", SYMLINK+="android_adb", MODE="0666"
# sudo restart udev
# adb devices
List of devices attached
HT036P901270 device

Here's a screenshot of the speed I get with FIDO:

Monday, February 15, 2010

retrieve voice videos from IPhone using scp

if you ever need to retrieve your voice memos from you IPhone, you can do it by scp:

Voice memos are found at: /User/Media/Recordings/

Friday, January 29, 2010

Grub2 in ubuntu karmic

This is a good thread on info about the new grub in karmic

Saturday, January 23, 2010

remove all *~ files with one command

This one handles files with white spaces:

find . -name "*~" -type f -print0|xargs -0 rm

Just learned about rsync

I just learned about the rsync command which is amazingly useful.
I have been using scp to copy folders from one machine at home to a machine in the lab back and forth and so far it's been good, and dead simple, but always involved extra work like making
moving directories around.

Now that I learned rsync, I can simply back up my work from the lab to my machine and vice versa using a simple command.
Here is the command I use:

rsync --delete -ravuzn -delete-excluded --exclude=*~ --rsh=ssh ~/work/

and then, (notice I remove the n flag)

rsync --delete -ravuz -delete-excluded --exclude=*~ --rsh=ssh ~/work/

so what does this command do:
--delete: if I have removed files from my local computer, they are also deleted on the server
r: recursively go through the folders and subfolders
a: archive
v: verbose mode
u: update
z: compress files
--delete-excluded: deletes excluded files passed as parameter (next flag)
--exclude=*~ : tells to exclude files ending with tilda (~)

there is also -b, which is for backup. It will create a file with ~, whenever we delete a file on the machine to which we are syncing. That might be useful if you don't want to delete some important work.
Also, there is flag n, which runs the rsync command as a dry run. This way, you can see what will happen when you run the same command without the n flag. This is the one I will always use first so that I am sure I know what will happen!

Thanks to this website: