Codedrop™ Weblog

Drop’n some code and other tech tidbits…
  • Home
  • Google Shared
  • About Me
  • Reference Links
Rss feed Subscribe

How to playback .mt2s (Blueray / AVCHD) files on Mac / Linux

Mar.12, 2009 in General Comments Off

After recently purchasing a new Sony Hybrid Plus (HDR-UX10/UX20) video camera I found myself spending alot of time trying to figure out how to pull the video files off the camera and play them back on my Mac or Linux computers.

M2TS files are used primarily with Sony hardware. Camcorders make use of M2TS in the form of AVCHD, a recording format made specifically for camcorders. Some camcorder models from Canon also use M2TS files. These files are also present on Blu-ray disc compilations, therefore they are capable of storing quite a large amount of information and data tracks. Software called the “Picture Motion Browser” is distributed with Sony camcorders and can play these kind of files, but in the event you don’t have this software what other options are there?

So far, the best option I’ve found has been the VLC software that is available for mac,linux and windows.  Although I was able to yum install vlc on my linux fedora 8 install without a hitch, I found the hardware requirements were more then my meager p4 could bear and I ended up with sound, but a frozen video frame.   Turning to my much more powerful mac book pro I once again installed a mac version of VLC and was able to playback the video.  Although somewhat ‘clippy’ it still played.  At present the software available for playback of these files is quite limited so if I find a better option I’ll be sure to post it.

My next task is to figure out how to convert these files to something that can be viewed through a standard web video player so that I can post them on my blog or share them on the internet.  If you have any insight into how to do this, I’d love to hear from you….

Post to Twitter Tweet This Post

Tags: video sony m2ts vlc

jQuery Tooltips

Mar.11, 2009 in Programming, Ruby, jQuery Comments Off

If your looking for a solid plugin library for doing tooltips jQuery style, check out cluetip.  This library is based on the original jTip library created by Codey Lindley.  Cluetip offers a solid set of customizable options and the dynamic positioning logic that is available through some of the reference libraries solves many of the problems I previously encountered with jTip, such as inaccurate positioning if you’ve scrolled a div containing a remote loaded tip resource.

Post to Twitter Tweet This Post

Tags: jQuery

Safari 4 Hidden Preferences

Mar.06, 2009 in Mac OSX Comments Off

I recently started using Safari 4 and found in incredibly disorienting having new tabs appear at the very top of the window frame.  To my suprise there’s a hidden setting that can change the location of the tab bar to something you might be more familiar with.  Check out this blog for a complete listing of hidden preferences.

Post to Twitter Tweet This Post

Tags: Mac OSX, Safari

Dynamic fields in YAML file.

Jan.26, 2009 in Rails Comments Off

Recently I had the need to setup environment specific .yml files for email configuration.  Normally this goes off without a hitch, however in my case I had the additional requirement of being able to dynamically substitute values in the yml file at runtime.   I thought it would be nice to allow configuration of email to, cc, bcc, subject and so forth through the yml file… thus allowing different environments to target different recipients.  I first tried to access the model from the yml file…


recipient: <%= user.email_address %>

but to no avail.  Seems like the mailer was loaded before the model so the user object was not yet available.  A solution that I came up with, though kind of hacky, was to tokenize the yml with placeholders that are dynamically replaced by the mailer at runtime.

My .yml file now looks like this:


email_notifications:
activate:
from: acct_activations@company.com
recipients: @USER_EMAIL@
bcc: devuser@company.com
subject: Activate your new account (@USER_COMPANY@)

and in my mailer I added a method to do the replacement:

def replace_yaml_tokens(yaml_doc, user)
yaml_obj = YAML::dump( yaml_doc )
yaml_obj.gsub!(/\@USER_EMAIL\@/, user.email_address)
yaml_obj.gsub!(/\@USER_COMPANY\@/, user.company)
YAML::load( yaml_obj )
end

finally it was a simple call after initializing the mailer to do the replacement.

mailer=replace_yaml_tokens(YAML::load( File.open( "#{RAILS_ROOT}/config/activation.yml" ) )['email_notifications']['activate'], user);

Like I said, maybe not the best solution, but one that worked for me!

Post to Twitter Tweet This Post

Tags: Rails, Ruby

Rails rake tests randomly generate ORA-12520 errors.

Jan.05, 2009 in Rails Comments Off

If you find your application randomly throwing “ORA-12520: TNS:listener could not find available handler for requested type of server” errors, then try to increase the number of available processes that you have allocated to your Oracle instance.

Logon to
Oracle using sys as sysdba and execute the following:

ALTER SYSTEM SET PROCESSES=150 SCOPE=SPFILE;

After changing the PROCESSES parameter restart your Oracle service.  I recently encountered this on a rails project I’m currently working on with an Oracle XE installation running in a Windows XP VM.  It seems like the default process level was set to 40 so running the rake tests consistently, but sporadically produced these errors at random intervals.

Post to Twitter Tweet This Post

Tags: Rails

Keyboard Shortcuts For MacOSX (screen capture)

Dec.23, 2008 in Mac OSX Comments Off

Here’s a neat shortcut for doing selectable screen captures on a Mac:
 
⌘⇧4 (Command – Shift – 4) – will change your cursor and allow you to select a region on the screen to capture. After highlighting the region release the mouse button and voila!.. a new image file will be saved to your desktop of the selected region.
⌘⇧3 (Command – Shift – 3) – will take a screen capture of your entire desktop.

Post to Twitter Tweet This Post

Tags: Mac OSX

How to install a specific software version using Mac Ports

Dec.08, 2008 in Mac OSX, Ruby Comments Off

MacPorts is the preferred way of installing, managing, and upgrading ports of some the software I have on my Mac.  Unfortunately mac ports does not let you specify a version.  To mediate this you can create a local repository that is checked out to a specific version and install from there.

This example is how to install ruby version 1.8.5-p12.

1) Find out the svn revision number of the Portfile by looking in:

http://trac.macosforge.org/projects/macports/log/trunk/dports/lang/ruby/Portfile

In my case it is 21127.

2) Set up a local port repository. In the file /opt/local/etc/macports/sources.conf, add this line before the rsync line:

file:///Users/Shared/dports and create that directory.

3) Install the port into your local repository.

cd /Users/Shared/dports && svn co –revision 21127
http://svn.macports.org/repository/macports/trunk/dports/lang/ruby/
lang/ruby/

4) Run portindex so that ports now finds your new (old) version of ruby.

portindex /Users/Shared/dports

5) Now you should be able to see ruby @1.8.5-p12 in addition to @1.8.6 by running:

port list

6) Install Ruby

sudo port install ruby @1.8.5-p12

You should be up and running now, so to check, run:

ruby -v

You will see something like this:

ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.10.1]

Post to Twitter Tweet This Post

Tags: Mac OSX

Mac OSX Script To Toggle Hidden Files

Nov.24, 2008 in Mac OSX, OS Comments Off

Working in a Mac environment I often find myself needing access to the system directories that are typically hidden by Finder.  I recently stumbled across the following script that I find quite useful for toggling back / forth between standard and full views.

Open ScriptEditor and save the following script:

try
set dotVisible to do shell script “defaults read com.apple.finder AppleShowAllFiles”

on error errorMessage number errorNumber
set dotVisible to 0
end try

if dotVisible = “0″ then
do shell script “defaults write com.apple.finder AppleShowAllFiles 1″
else
do shell script “defaults write com.apple.finder AppleShowAllFiles 0″
end if

tell application “Finder” to quit
delay 1

tell application “Finder” to activate
if dotVisible = “0″ then
say “VISIBLE”
else
say “HIDDEN”
end if

Post to Twitter Tweet This Post

Tags: Mac OSX

How to rename a vm (.vmdk) file for VMWare Server 1.0.4

Aug.28, 2008 in Linux Comments Off

In Vmware server 1.04, you can use the following process to rename the vmdk files:

1. Copy folder, rename vmx file
2. Edit machine, change hostname
3. Rename vdmk
4. Edit settings and add disk you just renamed as existing disk (remove old one)
5. Start vm and check it works (don’t forget to use newsid)

Post to Twitter Tweet This Post

Tags: VMWare

Oracle 10.2.0.1 installation on Fedora 8

Jul.22, 2008 in Linux, Oracle Comments Off

Below are the installation note’s I captured in installing Oracle
10.2.0.1 on a Fedora 8 workstation. For some reason installations of
Oracle on Fedora linux in past never went as smooth as hoped.. I was
however relatively happy with how things turned out on F8 and its nice
to see some of the old problems, like hanging during installation, went
away…

##########################################
# Oracle 10g Standard – Fedora 8 Linux Installation Instructions
# Author: Greg Roll
# Date: July 14th, 2008
#
# These instructions have been parsed down to the bare requirements to
# install Oracle 10g Standard on a typical Fedora 8 installation.
#
##########################################

##########################################
## Install / Update required system packages.
##########################################
yum install libaio
yum install libXp
yum update libxcb (must be 1.0-4 or greater!)

##########################################
## Configuring the Linux Kernel Parameters as per Oracle
## requirements.
##########################################

The Linux kernel is a wonderful thing. Unlike most other *NIX systems,
Linux allows modification of most kernel parameters while the system is
up and running. There’s no need to reboot the system after making
kernel parameter changes. Oracle Database 10g Release 2 requires the
kernel parameter settings shown below. The values given are minimums,
so if your system uses a larger value, don’t change it.

kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144

On my base fedora 8 installation I found I only had to change a 2 options:

—————-
/etc/sysctl.conf
—————
add:
net.ipv4.ip_local_port_range = 1024 65000
kernel.sem = 250 32000 100 128`

Execute the following command to change the current values of the kernel
parameters:
/sbin/sysctl -p

##########################################
## Setup required user / groups.
##########################################

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
passwd oracle

[root@uberdev14 ~]# id oracle
uid=2090(oracle) gid=4001(oinstall) groups=4001(oinstall),4002(dba) context=unconfined_u:system_r:unconfined_t:s0
[root@uberdev14 ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody) context=unconfined_u:system_r:unconfined_t:s0
[root@uberdev14 ~]#

##########################################
## Update user limits.
##########################################

Oracle recommends setting limits on the number of processes and open files each Linux account may use.

————————-
/etc/security/limits.conf
————————-
Add the following 4 lines before the end of file comment:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

—————-
/etc/pam.d/login
—————-
Add the following 2 lines before the pame_selinux.so open rule
session required /lib/security/pam_limits.so
session required pam_limits.so

##########################################
# Setup user profile.
##########################################

# Backup the original system profile.
[root@udev10lin01 etc]# cp -p profile profile.ORIG

# Modify the system files.
————
/etc/profile
————

Edit and add following to bottom:

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

————————–
/home/oracle/.bash_profile
————————–

Edit and add following:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

set -o vi
export ORACLE_SID=IVSD1
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=${ORACLE_BASE}/product/10.2.0/DB1
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/lib
export PATH=$PATH:${ORACLE_HOME}/bin:/sbin/:/usr/sbin

unset USERNAME

stty erase ^?

#LD_ASSUME_KERNEL=2.2.5; export LD_ASSUME_KERNEL
umask 022

##########################################
# Create directories for Oracle installation.
##########################################

¦ software directories:
cd /opt
mkdir -p app/oracle
chown -R oracle.oinstall app/oracle/
chmod -R 775 app/oracle/

ls -l app/
total 4
drwxrwxr-x 2 oracle oinstall 4096 Apr 13 13:16 oracle
[root@udev10lin01 opt]#

¦ Database file directory:
mkdir /u01/oradata
chown oracle:oinstall /u01/oradata
chmod 775 /u01/oradata

¦ Recovery file directory (flash recovery area):
mkdir /u01/flash_recovery_area
chown oracle:oinstall /u01/flash_recovery_area
chmod 775 /u01/flash_recovery_area

##########################################
# Install Oracle base software.
##########################################

[oracle@udev10lin01 ~]$ cd /opt/app/oracle/software/
[oracle@udev10lin01 software]$ ls -l
total 653712
-rw-r–r– 1 oracle oinstall 668734007 May 18 10:54 10201_database_linux32.zip

unzip 10201_database_linux32.zip

[oracle@udev10lin01 software]$ ls -l
total 653712
-rw-r–r– 1 oracle oinstall 668734007 May 18 10:54 10201_database_linux32.zip
drwxr-xr-x 6 oracle oinstall 4096 Jun 12 14:50 database
[oracle@udev10lin01 software]$

##########################################
# Run Oracle installer.
##########################################

** First disable X11 access controls by running xhost+ as your current gnome/kde
user.

cd /opt/app/oracle/software/database
./runInstaller -silent -responseFile /opt/app/oracle/software/uberdev-f8-oracle10.2.0.2-recorded.rsp
-jreLoc /opt/jdk1.6.0_06
-IgnoreSysPrereqs

– Select default inventory directory and ‘oracle’ user.
– Select typical install.
– Select Standard Edition.
– Accept remaining defaults.
– Accept warning on product specific prerequisite checks.
– Select create a database.
– Accept create general purpose database.
– enter dbname ‘sample’ sid ‘sample’, select Unicode format and enable create database with sample schemas.
– accept defaults until you get to the password definition screen
– define password of ‘password’ for all default accounts (SYS, SYSTEM,
SYSMAN, DBSNMP)
– setup ‘dba’ as privileged system groups.. if were not defined use
default oracle group.

** NOTES **

=======================================
Creating an Oracle Response File for Automated Installs
=======================================
Response
files can be created by running the software in record mode or by
manually editing a sample response file. Here’s a basic demo:

1. Start the OUI with this command to create the response file:
./runInstaller -IgnoreSysPrereqs
-jreLoc /opt/jdk1.6.0_06
-record
-destinationFile /opt/app/oracle/software/uberdev-f8-oracle10.2.0.2-recorded.rsp
2. Make all the selections you want to (source destination, home, home name, products).
3. When you get to the Summary screen, instead of clicking on Install, click on Cancel.

4. Examine the resulting response file created in tmp/recorded.rsp. If
desired, you can manually edit this file as long as you adhere to the
prescribed format (see documentation).
5. Now perform the silent installation like this:
./runInstaller -silent -responseFile /opt/app/oracle/software/uberdev-f8-oracle10.2.0.2-recorded.rsp

The progress of the installation will be reported as the script is being run.

If you have a problem with the installation due to incorrect entries in the response file, the installation will fail with a diagnostic message. Further information can be found in the oraInventory/logs directory. Logs with names in the format installActions-.log and silentInstall.log are created each time the OUI is run using a response file.

- Might need to increase available swap space.
Checking available swap space requirements …
Expected result: 8108MB
Actual Result: 2047MB

Post to Twitter Tweet This Post

Tags: Fedora, Oracle
« Previous Page — « previous entries  
next entries » — Next Page »
  • Tag Cloud

    Blackberry Capistrano certificate Configuration CSS DNS-323 DOS Dreamhost EMS Fedora firebug GMail Google Grails Groovy ie Java jQuery JSF Linux Mac Mac OSX MacPorts Memory Migrations Oracle PERL Rails Ruby Safari SOAP WebService Spring SSL Tibco Time Machine toolbar Trac UI video sony m2ts vlc VMWare Windows XMLDB

    WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.

  • Blogroll

    • A List Apart
    • Anassina
    • Just Be Kuz
    • Mashable
    • Poker Dreams Online
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Calendar

    May 2012
    M T W T F S S
    « Jan    
     123456
    78910111213
    14151617181920
    21222324252627
    28293031  
  • Tags

    Blackberry Capistrano certificate Configuration CSS DNS-323 DOS Dreamhost EMS Fedora firebug GMail Google Grails Groovy ie Java jQuery JSF Linux Mac Mac OSX MacPorts Memory Migrations Oracle PERL Rails Ruby Safari SOAP WebService Spring SSL Tibco Time Machine toolbar Trac UI video sony m2ts vlc VMWare Windows XMLDB
  • Categories

    • Databases (5)
      • Oracle (4)
    • Dreamhost (1)
    • General (26)
    • Google (1)
    • Mobile (1)
    • OS (19)
      • Linux (13)
      • Mac OSX (5)
      • Windows (2)
    • Programming (28)
      • Build Automation (4)
      • Grails (1)
      • Java (9)
      • JBoss (1)
      • jQuery (1)
      • JSF (1)
      • MySQL (1)
      • PERL (1)
      • Rails (4)
      • Ruby (3)
    • Security (1)
    • Spring (1)
    • Tibco (4)
  • Recent Posts

    • from your old 8mm video to TinyUDF to mp4
    • Use Java to disable certificate validation in an HTTPS Connection
    • Enable ssh on your D-LINK DNS-323
    • Crontab Reference
    • How to address TIBCO (Send HTTP Request) SSL Certificate Problems


Green Web Hosting! This site hosted by DreamHost.

© 2007 Codedrop™ Weblog - SafiTech Theme

Full RSS - Comments RSS

Twitter links powered by Tweet This v1.8.1, a WordPress plugin for Twitter.