Protected: My Social Media Terms of Service ~ bêta

September 12, 2009

This post is password protected. To view it please enter your password below:



The definitive guide to FFmpeg complete linux installation

September 12, 2009

Wanna use FFmpeg binaries or its library (aka libavcodec) ? Then a long way is ahead to have the right packages and compilation commands.

If you’re already in, but facing one of the following issues and errors (and more):

Makefile:633: *** missing separator. Stop.

/ tools /bin /gcc -shared -o libavformat .so utils .o cutils . o
os_support .o allformats .o mpeg.o mpegts .o mpegtsenc .o ffm .o
crc .o img .o raw .o rm.o avienc .o avidec .o wav .o swf .o au.o
gif .o mov .o mpjpeg .o dv.o yuv4mpeg .o 4xm.o flvenc .o flvdec .o
movenc .o psxstr .o idroq .o ipmovie .o nut .o wc3movie .o mp3 . o
westwood .o segafilm .o idcin .o flic .o sierravmd .o matrosk a .o
asf .o asf -enc .o amr .o pnm .o yuv .o png .o jpeg.o gifdec .o
sgi .o avio.o aviobuf .o file.o framehook .o grab.o dv1394 .o
audio .o udp .o tcp .o http.o rtsp.o rtp .o rtpproto .o -lm
-lz -ldl amr .o: In function ‘amr_init ’:
/root / Transcoder /ffmpeg -0.4.9 – pre1 / libavformat /amr . c :239:
multiple definition of ‘amr_init ’
amr .o:/ root / Transcoder / ffmpeg -0.4.9 – pre1 / libavforma t /amr .c :239:
first defined here collect2 : ld returned 1 exit status
make [1]: *** [ libavformat .so] Error 1
make [1]: Leaving directory
‘/ root/ Transcoder /ffmpeg -0.4.9 – pre1/ libavformat ’
make: *** [lib ] Error 2

error: <anonymous> has incomplete type: Remove “Void” in the implemen-
tation of setToZero(Void) and computeMV(Void): setToZero() and computeMV()

Incorrect conversion to Char

const char* instead of Char*: fatar_error(), noteStat(), errorHandler()

adobe_pdf_icon Then you’ll need to follow this step by step guide to fully install FFmpeg and Mpeg4IP with the following externals codecs (wich are not provided with FFmpeg): Lame, FAAC, FAAD, Xvid, x264, 3gp, AMR. Some hints are also given to deal with new releases of gcc.

The definitive guide to fully install FFMpeg with all featured codecs [PDF | 64 Kb]

Sorry for the PDF formatting and titling, it was extracted from a draft of a report I’ve written long time ago.


My Hitex USB-Prformance Stick!

June 23, 2008

Hi!

This is my new and fancy Hitex STM32 USB-Prformance Stick:

Shortly, my first examples, impressions, and tutorials will be posted, don’t miss’em!

Start up with those links:

  1. http://www.hitex.com/stm32-stick/
  2. http://www.ebv.com/en/products/highlights/stm32.html?PHPSESSID=53b1f80e7656

See you soon!


Run wget in background

June 23, 2008

In order to launch a download with wget in background and even when you quit the shell session, I found this useful tip here:

$ nohup wget http://your_url
$ exit

I used it to download openSuse11.0 from a remote server through SSH.


Launch a business to write applications or write an application to launch a business

June 8, 2008

I’m always thinking about this issue, what is the winning formula?

I know a lot of web agencies either here in Tunisia or elsewhere in the world. Some of them are just working on customers projects, no time for personal or community projects. Others, even highly skilled, are committed to only one project and make of it their business (LinkedIn, Facebook,..)

Some agencies launched portals and application, but when time is missing, these projects are let down, so the keyword is commitment. Therefore, here a small conclusion: Applications that fail are applications launched without commitment.

That’s a quite easy inference, but the tough question is why one of the two paths is chosen? It’s definitely not an entrepreneurship matter since the business owner has already launched a business, so no fear from self employment and all its risks.

We could ask also the question from a developer point of view, are motivations the same? Working for several projects at once could be stressful but it guarantees employment. In the other hand, working on a single project could be boring, or maybe it depends on the project it self and its evolution possibilities. I wonder how Google guys feel when users do not realize their hard work on the search engine, maybe results are better but it’s almost invisible to end-users. In contrast, working on a single project make you definitely famous and raises your notoriety and the credibility of your work. Moreover you learn a lot of stuff related to scalability, Customer care, etc.

I’m asking these questions since I just graduated 3 days ago (Telecommunications Engineering) and I’m wondering about the best career plan that I could have, therefore, advices and comments are more than welcome.


12 useful linux tips

June 7, 2008

1. Show the CPU temperature

more /proc/acpi/thermal_zone/THM/temperature

2. Show your network IP

All you network devices IPs:

/sbin/ifconfig

Show just you wired network IP (elegant display)

/sbin/ifconfig eth0|grep inet|awk {‘print $2′}|cut -d”:” -f2

3. SVN Checkout to FTP

I used this way to avoid checking out an svn release to my computer and then send it to our server by FTP. To do that, you need an ssh session:

# We can the export option to have a clean copy (without tracking files..)
svn export [repository] [local path]

# an example:
svn export svn://rubyforge.org/var/svn/redmine/trunk ~/public_html/railsroller/a_redmine_release/
# a_redmine_release/ will be created automatically

4. Killing a process (useful for daemon servers)

To kill a process, you need to know its Process ID (PID), to list all running processes/PID use:

ps

And then, just type

kill 4556

with 4556 is the process PID. This could not work if the process is a bad guy then use:

kill -9 4556

5. How to use vi to build rails application

For text use of rails, refer to those links:

http://cmgm.stanford.edu/classes/unix/vi_qref.html
http://www.tech-recipes.com/unix_tips219.html

For ruby/rails writing, several plugins are developed for coloring, autocompletition.. could be found on this link:

http://wiki.rubyonrails.org/rails/pages/HowtoUseVimWithRails

6. How to search your disk

To quickly find file.type in /a/path use this command:

find /a/path -name ‘file.type’

Look at this link for other samples: http://www.computerhope.com/unix/ufind.htm#03

7. How to decompress linux archives

To quickly decompress .tar.gz files, just type:

tar zxvf file.tar.gz/tar.bz2

To quickly archive a tree (.tar):

tar -cvf filename.tar tree/

refer to this page: http://www.redhat.com/docs/manuals/linux/RHL-7.2-Manual/getting-started-guide/s1-zip-tar.html

8. Mount an ISO file as a CD drive

After creating a cd1 directory in /mnt/, run this command:

mount -o loop -t iso9660 file.iso /mnt/cd1

9. Change the owner of a file

You have just to run this command:

chmod new_owner file_name
# It is better to su on the owner of the file to avoid permission problems

10. Find files containing some text

How to find in /your/tree files containing “Some text” ? Here the answer:

find /your/tree -type f -print | xargs grep “Some text”

You can look here for a grep version.
11. VI: Copy/Paste Stuff

The ability to duplicate text in an editor can be handy. vi and vim have several useful copy and paste commands.

The command ‘Y’ or ‘yy’ copies (yanks) one or more lines. To copy one line, two lines, 10 lines, and all lines to the end of the file, respectively:

Y
2Y
10Y
yG

To paste the text contained in the buffer above (uppercase P) or below the current cursor position (lowercase p), respectively:

P
p

It is also possible to yank text within a line. The following commands yank text from the current cursor position to the end of the word and the end of the line, respectively:

yw
y$

The same commands paste the text within a line. Lower case p pastes after the cursor position and upper case P pastes before.

Paste will also work with deleted text, either lines or parts of lines. Be careful not to execute any other commands prior to pasting as this will empty the buffer.

12. Which ruby are you using?!

When you are running on a linux box and you have installed your own ruby, so you may be using the preinstalled one, to check the path of the ruby (or any other symblic link your are using), just type:

which ruby


Deploy a Rails application after offline devolopement

June 7, 2008
  1. FTP the application to your server
  2. Change rights of public/dispatch.cgi and public/dispatch.fcgi to 755 (under windows, use your FTP client)
  3. Edit the first line of public/dispatch.cgi and public/dispatch.fcgi to make it look like this: #!/usr/local/bin/ruby
  4. Edit the config/database.yml and change database name and login parameters for all envirements
  5. That’s all, Viva rails!

If you have to setup ActionMailer, this is the smtp configuration:

# SMTP server configuration
config.action_mailer.smtp_settings = {
	:address => "localhost",
	:port => 25,
	:domain => "domain.com",
	:authentication => :plain,
	:user_name => "account@domain.com",       # You have to choose the mail account
	:password => "password"                   # And its password
}

RJS: $A is not defined error

June 7, 2008

This error has no effect on the page behavious since it occurs only when the page is loading. But you can remove it with patching the prototype.js: Here the bug record in the Rails trac: http://dev.rubyonrails.org/ticket/5393 but the given patch is not working. You have to copy paste the two functions from the patch writer blog into your proptotype.js, here the link: http://www.skybyte.net/articles/prototype.js/ And do not forget to comment old functions!


How to sort according to multiple attributes

June 7, 2008

You can say

sorted_tracks = tracks.sort_by { | track |
  [track.artist, track.album, track.track_number]
}

or even:

class Array
  def sort_by_att(*attributes)
    attributes = attributes.flatten
    self.sort_by { | e | attributes.map { | a | e.send(a) } }
  end
end

sorted_tracks = tracks.sort_by_att(:artist, :album, :track_number)

How to format time with ruby

June 7, 2008

You have just to call strftime or use this helper:

def GetTime
  milestone.date.strftime( "%a %b, %d %Y %H:%M" )
end

The argument syntax:

http://www.ruby-doc.org/core/classes/Time.html#M000139