Monthly Archives: May 2013

Extract MP3 from SWF files on Linux (Ubuntu)

We will use a tool called swfextract contained on the package swftools, so first we will install it

  1.  
  2. sudo apt-get install swftools
  3.  

Once installed first we will see wich media we can extract from our swf file.

  1.  
  2. rene@rene-desktop:~/Music$ swfextract test.swf
  3. Objects in file test.swf:
  4.  [-i] 5 Shapes: ID(s) 7, 14, 22, 23, 28
  5.  [-j] 16 JPEGs: ID(s) 1-6, 11-13, 16-21, 27
  6.  [-s] 1 Sound: ID(s) 29
  7.  [-F] 1 Font: ID(s) 8
  8.  [-f] 1 Frame: ID(s) 0
  9.  [-m] 1 MP3 Soundstream
  10.  

Then just use the option between brackets and the ID the element you want to extract, in our example we will extract the sound with ID 29, but you can extract also images if you want

  1.  
  2. rene@rene-desktop:~/Music$ swfextract -s 29 test.swf -o test.mp3
  3.  

How to disable directory listing in apache?

First option is to edit the file /etc/apache2/sites-avalible/default (i am using ubuntu), then look for the following lines:

  1.  
  2. <Directory /var/www/>
  3.     Options Indexes FollowSymLinks MultiViews
  4.     AllowOverride None
  5.     Order allow,deny
  6.     allow from all
  7.     # This directive allows us to have apache2’s default start page
  8.     # in /apache2-default/, but still have / go to the right place
  9.     #RedirectMatch ^/$ /apache2-default/
  10. </Directory>
  11.  

And then take out the word Indexes, then your file will look like

  1.  
  2. <Directory /var/www/>
  3.     Options FollowSymLinks MultiViews
  4.     AllowOverride None
  5.     Order allow,deny
  6.     allow from all
  7.     # This directive allows us to have apache2’s default start page
  8.     # in /apache2-default/, but still have / go to the right place
  9.     #RedirectMatch ^/$ /apache2-default/
  10. </Directory>
  11.  

Finally we just reload apache

  1.  
  2. sudo /etc/init.d/apache2 restart
  3.  

If you want to use .htaccess, you have two options:

  1.  
  2. # first one is to deny access to indexes
  3. Options -Indexes
  4.  

This option will show a forbidden message:

Forbidden

  1.  
  2. # the second option is to show the directory as empty
  3. IndexIgnore *
  4.  

empty

See a list of loaded apache modules

If you want to see wich modules are loaded by apache, just open a terminal and type:

  1.  
  2. apache2ctl -M
  3.  

And you will get something like this:

  1.  
  2. rene@rene-desktop:~$ apache2ctl -M
  3. Loaded Modules:
  4.  core_module (static)
  5.  log_config_module (static)
  6.  logio_module (static)
  7.  version_module (static)
  8.  mpm_prefork_module (static)
  9.  http_module (static)
  10.  so_module (static)
  11.  alias_module (shared)
  12.  auth_basic_module (shared)
  13.  authn_file_module (shared)
  14.  authz_default_module (shared)
  15.  authz_groupfile_module (shared)
  16.  authz_host_module (shared)
  17.  authz_user_module (shared)
  18.  autoindex_module (shared)
  19.  cgi_module (shared)
  20.  deflate_module (shared)
  21.  dir_module (shared)
  22.  env_module (shared)
  23.  mime_module (shared)
  24.  negotiation_module (shared)
  25.  php5_module (shared)
  26.  reqtimeout_module (shared)
  27.  rewrite_module (shared)
  28.  setenvif_module (shared)
  29.  status_module (shared)
  30. Syntax OK
  31.