Friday, May 31, 2013

A simple VBA in Excel 2010 to import each CSV file as a tab in XLS

Sub ImportAllCsvInDirectory()
'
' Copied from: http://www.excelforum.com/excel-programming-vba-macros/504512-import-multiple-csv-files-into-current-workbook-as-separate-sheets.html
'
Dim MyPath As String
Dim FilesInPath As String
Dim MyFiles() As String
Dim SourceRcount As Long
Dim Fnum As Long
Dim mybook As Workbook
Dim basebook As Workbook

'Fill in the path\folder where the files are
'on your machine
'MyPath = "c:\Data"
MyPath = GetFolder("c:\")


'Add a slash at the end if the user forget it
If Right(MyPath, 1) <> "\" Then
MyPath = MyPath & "\"
End If

'If there are no Excel files in the folder exit the sub
FilesInPath = Dir(MyPath & "*.csv")

'If Not FilesInPath = False Then
If FilesInPath = "" Then
MsgBox "No files to consolidate"
Exit Sub
End If

On Error GoTo CleanUp

Application.ScreenUpdating = False
Set basebook = ThisWorkbook

'Fill the array(myFiles)with the list of Excel files in the folder
Fnum = 0
Do While FilesInPath <> ""
Fnum = Fnum + 1
ReDim Preserve MyFiles(1 To Fnum)
MyFiles(Fnum) = FilesInPath
FilesInPath = Dir()
Loop

'Loop through all files in the array(myFiles)
If Fnum > 0 Then
For Fnum = LBound(MyFiles) To UBound(MyFiles)
Set mybook = Workbooks.Open(MyPath & MyFiles(Fnum))
mybook.Worksheets(1).Copy after:= _
basebook.Sheets(basebook.Sheets.Count)

On Error Resume Next
ActiveSheet.Name = mybook.Name
On Error GoTo 0

' You can use this if you want to copy only the values
' With ActiveSheet.UsedRange
' .Value = .Value
' End With

mybook.Close savechanges:=False
Next Fnum
End If
CleanUp:
Application.ScreenUpdating = True

SaveAsNewFile

End Sub


'
' Copied from: http://www.mrexcel.com/forum/excel-questions/294728-browse-folder-visual-basic-applications.html
'
Function GetFolder(strPath As String) As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
    .Title = "Select a Folder"
    .AllowMultiSelect = False
    .InitialFileName = strPath
    If .Show <> -1 Then GoTo NextCode
    sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing

End Function

'
'
Sub SaveAsNewFile()
    Dim wb As Workbook
    Dim NewFileName As String
    Dim NewFileFilter As String
    Dim myTitle As String
    Dim FileSaveName As Variant
    Dim NewFileFormat As Long
  
    Set wb = ThisWorkbook
  
    'Use following code to set to workbook other than this one
    'Set wb = Workbooks("My Test Save As File.xlsm")
  
    If Application.Version >= 12 Then   'Version 12 is xl2007
      'Note: If file extension not included in B18 then concatenate it
      'NewFileName = wb.Sheets("Sheet1").Range("B18").Value & ".xlsm"
      NewFileFilter = "Excel Macro-Enable Workbook (*.xlsm), *.xlsm"
      'The value 52 is substituted in next line for the constant _
       xlOpenXMLWorkbookMacroEnabled because earlier versions of _
       excel will not recognize the constant and code will error.
      NewFileFormat = 52
    Else
      'Note: If file extension not included in B18 then concatenate it
      'NewFileName = wb.Sheets("Sheet1").Range("B18").Value & ".xls"
      NewFileFilter = "Excel 97-2003 Workbook (*.xls), *.xls"
      'Because xlNormal is an earlier version constant, later versions _
       of excel will recognize it.
      NewFileFormat = xlNormal
    End If
  
    myTitle = "Navigate to the required folder"
  
    FileSaveName = Application.GetSaveAsFilename _
            (InitialFileName:=NewFileName, _
             FileFilter:=NewFileFilter, _
             Title:=myTitle)
    If Not FileSaveName = False Then
      wb.SaveAs Filename:=FileSaveName, _
                    FileFormat:=NewFileFormat
    Else
      MsgBox "File NOT Saved. User cancelled the Save."
    End If

End Sub

'
'
Sub OpenFile()
Dim sFilename As String

sFilename = Application.GetOpenFilename("Excel files (*.xls), *.xls")
If Not sFilename = False Then
Workbooks.Open sFilename
Else
      MsgBox "File NOT Saved. User cancelled the Save."
    End If
End Sub

Thursday, May 30, 2013

Creating the SD image for Raspberry Pi using Mac OS X

1. Download the image: 2013-02-09-wheezy-raspbian.img from 2013-02-09-wheezy-raspbian.zip into /Users/alexm/Downloads and unzip it.


2. Insert the SD card into the slot on Mac

3. Verify the disk number assignment of the SD card

ALEXs-MacBook-Pro~$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            419.0 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   4:       Microsoft Basic Data BOOTCAMP                80.2 GB    disk0s4
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *16.0 GB    disk1
   1:             Windows_FAT_32                         58.7 MB    disk1s1
   2:                      Linux                         1.9 GB     disk1s2

4. Unmount the sd card
ALEXs-MacBook-Pro~$ umount /dev/disk1
umount: /dev/disk1: not currently mounted

5. Unmount again using the diskutil
ALEXs-MacBook-Pro:~$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful

6. Write the image into the sd card, note, it may take several minutes, take a coffee break.
ALEXs-MacBook-Pro:~$ sudo dd bs=1m if=/Users/alexm/Downloads/2013-02-09-wheezy-raspbian.img of=/dev/disk1

106+0 records in
105+0 records out
110100480 bytes transferred in 75.611085 secs (1456142 bytes/sec)

7. Once completed, eject the sd card.
ALEXs-MacBook-Pro:~$ diskutil eject /dev/disk1
Disk /dev/disk1 ejected

8. Remove sd card and insert into the raspberry pi.

9. Connect all accessories on the raspberry pi and power on.

10. After reboot, you may be able to modify the configuration by opening a terminal and using
the rasp-config:

pi@raspberry$ raspi-config



How to enable X11 Forwarding with SSH on Mac OS X Lion for Raspberry Pi

Steps in getting an X-terminal from Raspberry Pi Using Mac OS X

1. Enable X11 Forwarding with the “X11Forwarding yes” option set in “/private/etc/sshd_config” for your SSH daemon on Mac in order to receive X11 client request back from  raspberry pi through ‘ssh‘ with the -X option set.
    user@mac~$ vi /private/etc/sshd_config
    uncomment and set to yes "X11Forwarding yes"

2. Allow remote client to use Mac's display
    user@mac~$ xhost +

3. Login into the raspberry pi with -X option to install packages
     user@mac~$ ssh -X pi@192.168.1.10

4. Install packages on the raspberry pi
     pi@raspberrypi ~ $ sudo apt-get install libnss3
   pi@raspberrypi ~ $ sudo apt-get install x11-apps

5. Set display
 
 pi@raspberrypi ~ $ export DISPLAY=192.168.1.12:0

6. Open x11 terminal from raspberry to the Mac
  
 pi@raspberrypi ~ $ x-terminal-emulator
 
 OR
   pi@raspberrypi ~ $ lxterminal

7. Test xclock or xeyes
 
 pi@raspberrypi ~ $ xclock
 
 OR
   pi@raspberrypi ~ $ xeyes

8. From another terminal on Mac, you may directly execute

user@mac~$ ssh -X -f pi@192.168.1.10 xcalc -bg yellow -fg blue
pi@192.168.1.10's password:
user@mac~$ ssh -X -f pi@192.168.1.10 xeyes -bg white -fg blue
pi@192.168.1.10's password:


                 

Tuesday, May 28, 2013

Oracle sqlplus and instant client on Mac OS/X without DYLD_LIBRARY_PATH

Oracle sqlplus and instant client on Mac OS/X without DYLD_LIBRARY_PATH

URL: http://blog.caseylucas.com/2013/03/03/oracle-sqlplus-and-instant-client-on-mac-osx-without-dyld_library_path/

Posted on
I recently needed to get sqlplus (11.2) running on a mac (10.8.2). Oracle supports this via their instant client. For basic sqlpus, you need the lite oracle instant client and oracle sqlplus instant client packages. If you try to run sqlplus after unzipping the files, you probably will see an error message similar to:
$ ./sqlplus
dyld: Library not loaded: /ade/b/2649109290/oracle/sqlplus/lib/libsqlplus.dylib
Referenced from: /Users/clucas/apps/instantclient_11_2/./sqlplus
Reason: image not found
Trace/BPT trap: 5
This error can be fixed using one of the following methods:
  1. Move all the executables and supporting library files to locations which are searched by default (/usr/lib and /usr/bin.)  See this stackoverflow answer.
  2. Set your DYLD_LIBRARY_PATH environment variable so that the sqlplus executable can find required oracle libraries and so that those libraries can also find their dependencies.
Both of these will work, but I didn’t really like them because (1) I’m not a fan of installing (and having to remember how to clean up) various files into /usr/* and (2) DYLD_LIBRARY_PATH can affect everything else you run.
You can use otool to see the library locations embedded in the executables and libraries. Ex:
$ otool -L sqlplus
sqlplus:
/ade/b/2649109290/oracle/sqlplus/lib/libsqlplus.dylib (compatibility version 0.0.0, current version 0.0.0)
/ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
/ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
I assume those /ade/… paths are from the machine oracle used for building the instant client software.  We can replace these with @executable_path in order to have the dynamic loader find the libraries in the same directory where the executable is found. We want to end up with something like:
$ otool -L sqlplus
sqlplus:
@executable_path/libsqlplus.dylib (compatibility version 0.0.0, current version 0.0.0)
@executable_path/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
@executable_path/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
Assuming you also adjust the libraries in the same directory, you’ll be able to run sqlplus just by having it in your PATH.  You can run the following script in the directory where sqlplus is located.  It will change all of the oracle dynamic library references to use @executable_path instead of the /ade/… full path:
#!/bin/sh
# script to change the dynamic lib paths and ids for oracle instant client
# exes and libs

# proces all the executable files in this directory
find . -maxdepth 1 -type f \( -perm -1 -o \( -perm -10 -o -perm -100 \) \) -print | while read exe
do
    echo adjusting executable $exe
    baseexe=`basename $exe`
    otool -L $exe | awk '/oracle/ {print $1}' | while read lib
    do
        echo adjusting lib $lib
        baselib=`basename $lib`
        if [ "$baseexe" = "$baselib" ]
        then
            echo changing id to $baselib for $exe
            install_name_tool -id $baselib $exe
        else
            echo changing path id for $lib in $exe
            install_name_tool -change $lib @executable_path/$baselib $exe
        fi
    done
done
Once the script is run and it changes the libs and executables, you can just add the directory holding sqlplus to your path and run sqlplus. No need to set any other oracle environment variables like ORACLE_HOME. Here’s the whole thing:
$ mkdir example
$ cd example
/Users/clucas/apps/example
$ unzip ~/dl/instantclient-basiclite-macos.x64-11.2.0.3.0.zip 
Archive:  /Users/clucas/dl/instantclient-basiclite-macos.x64-11.2.0.3.0.zip
  inflating: instantclient_11_2/BASIC_LITE_README  
  inflating: instantclient_11_2/adrci  
  inflating: instantclient_11_2/genezi  
  inflating: instantclient_11_2/libclntsh.dylib.11.1  
  inflating: instantclient_11_2/libnnz11.dylib  
  inflating: instantclient_11_2/libocci.dylib.11.1  
  inflating: instantclient_11_2/libociicus.dylib  
  inflating: instantclient_11_2/libocijdbc11.dylib  
  inflating: instantclient_11_2/ojdbc5.jar  
  inflating: instantclient_11_2/ojdbc6.jar  
  inflating: instantclient_11_2/uidrvci  
  inflating: instantclient_11_2/xstreams.jar  
$ unzip ~/dl/instantclient-sqlplus-macos.x64-11.2.0.3.0.zip 
Archive:  /Users/clucas/dl/instantclient-sqlplus-macos.x64-11.2.0.3.0.zip
  inflating: instantclient_11_2/SQLPLUS_README  
  inflating: instantclient_11_2/glogin.sql  
  inflating: instantclient_11_2/libsqlplus.dylib  
  inflating: instantclient_11_2/libsqlplusic.dylib  
  inflating: instantclient_11_2/sqlplus  
$ export PATH=$PATH:~/apps/example/instantclient_11_2
$ sqlplus 
dyld: Library not loaded: /ade/b/2649109290/oracle/sqlplus/lib/libsqlplus.dylib
  Referenced from: /Users/clucas/apps/example/instantclient_11_2/sqlplus
  Reason: image not found
Trace/BPT trap: 5
$ cd instantclient_11_2/
/Users/clucas/apps/example/instantclient_11_2
$ changeOracleLibs.sh 
adjusting executable ./adrci
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing path id for /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 in ./adrci
adjusting lib /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib
changing path id for /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib in ./adrci
adjusting executable ./genezi
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing path id for /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 in ./genezi
adjusting executable ./libclntsh.dylib.11.1
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing id to libclntsh.dylib.11.1 for ./libclntsh.dylib.11.1
adjusting lib /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib
changing path id for /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib in ./libclntsh.dylib.11.1
adjusting executable ./libnnz11.dylib
adjusting lib /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib
changing id to libnnz11.dylib for ./libnnz11.dylib
adjusting executable ./libocci.dylib.11.1
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libocci.dylib.11.1
changing id to libocci.dylib.11.1 for ./libocci.dylib.11.1
adjusting executable ./libociicus.dylib
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing path id for /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 in ./libociicus.dylib
adjusting executable ./libocijdbc11.dylib
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing path id for /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 in ./libocijdbc11.dylib
adjusting lib /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib
changing path id for /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib in ./libocijdbc11.dylib
adjusting executable ./libsqlplus.dylib
adjusting lib /ade/b/2649109290/oracle/sqlplus/lib/libsqlplus.dylib
changing id to libsqlplus.dylib for ./libsqlplus.dylib
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing path id for /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 in ./libsqlplus.dylib
adjusting lib /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib
changing path id for /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib in ./libsqlplus.dylib
adjusting executable ./libsqlplusic.dylib
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing path id for /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 in ./libsqlplusic.dylib
adjusting lib /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib
changing path id for /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib in ./libsqlplusic.dylib
adjusting executable ./sqlplus
adjusting lib /ade/b/2649109290/oracle/sqlplus/lib/libsqlplus.dylib
changing path id for /ade/b/2649109290/oracle/sqlplus/lib/libsqlplus.dylib in ./sqlplus
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing path id for /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 in ./sqlplus
adjusting lib /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib
changing path id for /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib in ./sqlplus
adjusting executable ./uidrvci
adjusting lib /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1
changing path id for /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 in ./uidrvci
adjusting lib /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib
changing path id for /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib in ./uidrvci
$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Sun Mar 3 22:38:28 2013

Copyright (c) 1982, 2012, Oracle.  All rights reserved.

Enter user-name: ^C
$ cd ..
$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Sun Mar 3 22:38:40 2013

Copyright (c) 1982, 2012, Oracle.  All rights reserved.

Enter user-name: ^C

Wednesday, May 22, 2013

Updating GNU packages in Mac OS X

The Mac OS X 10.7.5 (Lion) may not have the latest version of the GNU tools like bash, sed, etc. However, they can be updated by downloading the source and compiling them on Mac.

The first step is to download the command_line_tools_for_xcode_4.5_os_x_lion.dmg and install it on your Mac OS X. Login here: Developer's Login.  After that, you can update the following:

1. The bash from 3.2 to 4.2.
    1.1. Download source here: bash-4.2.tar
    1.2. Untar and open a terminal
    1.3. Compile and install using: ./configure; make; make install

2. The sed from 3.2 to 4.2.
    2.1. Download source here: sed-4.2.2.tar
    2.2. Untar and open a terminal
    2.3. Compile and install using: ./configure; make; make install


Friday, February 22, 2013

RSA Client Failed - Error loading desktop client?

Source: https://community.emc.com/message/634487 

RSA Client Failed - Error loading desktop client?
SecurID.exe is trying to load desktopclient.dll, which is depending upon QtGui4.dll, which by itself is depending upon QtCore4.dll, both usually installed in C:\Program Files (x86)\RSA SecurID Token Common (on a 64-bit Windows). Under certain circumstances (don't know exactly when and why) another copy of QtCore4.dll might get installed in C:\Windows\SysWOW64, which is missing one entry point (in my case there was a version 4.8, copyright by Nokia, but SecurID.exe build 4.1.1.836 is using version 4.4 of this library). Obviously there is a bug in desktopclient.dll causing the attempt to load the version in SysWOW64 instead the one in its own Common directory, which causes the client to fail...

But the good news, I found a work around:

Copy QtCore4.dll from C:\Program Files (x86)\RSA SecurID Token Common into C:\Program Files (x86)\RSA SecurID Software Token and voila, SecurID.exe runs perfectly fine.

Please RSA/EMC dev guys, fix this issue. Actually, there is a flag in LoadLibraryEx called LOAD_WITH_ALTERED_SEARCH_PATH… You might want to read this article, too: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx ;-)

Tuesday, December 11, 2012

Mounting a Windows Drive Remotely in a Linux Machine


1. Create a local user in the Windows machine (IP=10.253.99.19)
      Ex. Account name = user123 and password = abc123%

2. Set the drive E:\ shareable to user123 with READ / WRITE privileges on Windows machine (IP=10.253.99.19)

3. Make a mounting point directory on the Linux machine (IP=10.253.99.20)
    Ex. $ mkdir -p /usr/local/pub/mnt/svr19

4.  Make a bash script named remountServers.sh  on the Linux machine (IP=10.253.99.20)
  

#/bin/bash

#Unmount
sudo umount /usr/local/pub/mnt/svr19

#Mount
sudo mount -t cifs //10.253.99.19/e -o username=user123,password=abc123% /usr/local/pub/mnt/svr19

5. Make the script executable
    Ex. $ chmod a+x remountServers.sh 

6. Execute the script
   Ex. $ ./remountServers.sh 

Thursday, November 15, 2012

Removing ^M characters in bash scripts for Mac OS X

When your bash script you copied from unix/linux to your windows machine and then copied it to Mac doesn't work, and you see an error like this:

bash: ./unixScript.sh: /bin/sh^M: bad interpreter: No such file or directory

probably because your source code contains annoying Control+M (^M) characters when saved in a Windows machine. There are two (2) ways to remove this.

1. Create a bash script dos2unix.sh in Mac terminal 
1.1 Using vi, create the file below
   #!/bin/bash
   file=S1
   cat $1 | col -b > temp
   mv temp $1
   chmod a+x $1


1.2 Make the script executable 
      $ chmod a+x dos2unix.sh
1.3 Execute the script
     $ ./dos2unix.sh myshellscript.sh


2. Rremove the ^M in Mac using tr. 
   2.1. First view the file using
         $ cat -e unixScript.sh 
         $ od -tc unixScript.sh
  2.2. Remove using the command below
         $ tr -d '\r' < unixScript.sh > macScript.sh

Tuesday, July 26, 2011

Play MP3 on Fedora 15

How to setup Fedora 15 to be able to play MP3
Links: Reference


Yay! If you are reading this, it’s because you make a fresh install of the new Fedora 15, then import your library music, open banshe/rhythmbox and no mp3 plugin detected, ok, click on search, but! nothing is found…Wow..what can I do now? I can’t live without my music!!!!

No worries, me too ;-)

First, we need to check if we have rpmfusion repository:

ls /etc/yum.repos.d/ | grep rpmfusion



1. Install rpmfusion

[root@localhost alexm]# yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm


2. Install gstreamer plugins

[root@localhost alexm]# yum install gstreamer-plugins-bad gstreamer-ffmpeg -y

Here is the installation log.



[root@localhost alexm]# yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Local Package Process
rpmfusion-free-release-stable.noarch.rpm | 18 kB 00:00
Examining /var/tmp/yum-root-PKi4lB/rpmfusion-free-release-stable.noarch.rpm: rpmfusion-free-release-13-4.noarch
Marking /var/tmp/yum-root-PKi4lB/rpmfusion-free-release-stable.noarch.rpm to be installed
rpmfusion-nonfree-release-stable.noarch.rpm | 18 kB 00:00
Examining /var/tmp/yum-root-PKi4lB/rpmfusion-nonfree-release-stable.noarch.rpm: rpmfusion-nonfree-release-13-4.noarch
Marking /var/tmp/yum-root-PKi4lB/rpmfusion-nonfree-release-stable.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rpmfusion-free-release.noarch 0:13-4 will be installed
---> Package rpmfusion-nonfree-release.noarch 0:13-4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version
Repository Size
================================================================================
Installing:
rpmfusion-free-release
noarch 13-4 /rpmfusion-free-release-stable.noarch 12 k
rpmfusion-nonfree-release
noarch 13-4 /rpmfusion-nonfree-release-stable.noarch 12 k

Transaction Summary
================================================================================
Install 2 Package(s)

Total size: 23 k
Installed size: 23 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : rpmfusion-free-release-13-4.noarch 1/2
Installing : rpmfusion-nonfree-release-13-4.noarch 2/2

Installed:
rpmfusion-free-release.noarch 0:13-4 rpmfusion-nonfree-release.noarch 0:13-4

Complete!

[root@localhost alexm]# yum install gstreamer-plugins-bad gstreamer-ffmpeg -y
Loaded plugins: langpacks, presto, refresh-packagekit
rpmfusion-free | 3.3 kB 00:00
rpmfusion-free/primary_db | 315 kB 00:00
rpmfusion-free/group | 9.8 kB 00:00
rpmfusion-free-updates | 2.7 kB 00:00
rpmfusion-free-updates/primary_db | 154 kB 00:00
rpmfusion-nonfree | 3.3 kB 00:00
rpmfusion-nonfree/primary_db | 109 kB 00:00
rpmfusion-nonfree/group | 4.7 kB 00:00
rpmfusion-nonfree-updates | 2.7 kB 00:00
rpmfusion-nonfree-updates/primary_db | 43 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gstreamer-ffmpeg.i686 0:0.10.11-2.fc15 will be installed
--> Processing Dependency: libavformat.so.52 for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libswscale.so.0 for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libavformat.so.52(LIBAVFORMAT_52) for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libpostproc.so.51 for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libavcodec.so.52(LIBAVCODEC_52) for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libavutil.so.50 for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libswscale.so.0(LIBSWSCALE_0) for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libpostproc.so.51(LIBPOSTPROC_51) for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libavutil.so.50(LIBAVUTIL_50) for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
--> Processing Dependency: libavcodec.so.52 for package: gstreamer-ffmpeg-0.10.11-2.fc15.i686
---> Package gstreamer-plugins-bad.i686 0:0.10.22-1.fc15 will be installed
--> Processing Dependency: libdca.so.0 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Processing Dependency: libmimic.so.0 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Processing Dependency: librtmp.so.0 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Processing Dependency: libmpeg2encpp-1.9.so.0 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Processing Dependency: libmms.so.0 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Processing Dependency: libxvidcore.so.4 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Processing Dependency: libfaad.so.2 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Processing Dependency: libmjpegutils-1.9.so.0 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Processing Dependency: libmplex2-1.9.so.0 for package: gstreamer-plugins-bad-0.10.22-1.fc15.i686
--> Running transaction check
---> Package faad2-libs.i586 1:2.7-1.fc11 will be installed
---> Package ffmpeg-libs.i686 0:0.7-0.3.20110612git.fc15 will be installed
--> Processing Dependency: libva.so.1 for package: ffmpeg-libs-0.7-0.3.20110612git.fc15.i686
--> Processing Dependency: libmp3lame.so.0 for package: ffmpeg-libs-0.7-0.3.20110612git.fc15.i686
--> Processing Dependency: libx264.so.114 for package: ffmpeg-libs-0.7-0.3.20110612git.fc15.i686
---> Package libdca.i686 0:0.0.5-5.fc12 will be installed
---> Package libmimic.i686 0:1.0.4-4.fc12 will be installed
---> Package libmms.i686 0:0.6.2-1.fc15 will be installed
---> Package librtmp.i686 0:2.3-2.fc14 will be installed
---> Package mjpegtools-libs.i686 0:1.9.0-2.fc14 will be installed
--> Processing Dependency: libquicktime >= 0.9.8 for package: mjpegtools-libs-1.9.0-2.fc14.i686
--> Processing Dependency: libSDL-1.2.so.0 for package: mjpegtools-libs-1.9.0-2.fc14.i686
--> Processing Dependency: libquicktime.so.0 for package: mjpegtools-libs-1.9.0-2.fc14.i686
---> Package xvidcore.i686 0:1.3.2-2.fc15 will be installed
--> Running transaction check
---> Package SDL.i686 0:1.2.14-11.fc15 will be installed
---> Package lame-libs.i686 0:3.98.4-1.fc14 will be installed
---> Package libquicktime.i686 0:1.2.2-2.fc15 will be installed
---> Package libva.i686 0:1.0.13-2.fc15 will be installed
---> Package x264-libs.i686 0:0.0.0-0.29.20110227.fc15 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
gstreamer-ffmpeg i686 0.10.11-2.fc15 rpmfusion-free 186 k
gstreamer-plugins-bad
i686 0.10.22-1.fc15 rpmfusion-free-updates 148 k
Installing for dependencies:
SDL i686 1.2.14-11.fc15 fedora 201 k
faad2-libs i586 1:2.7-1.fc11 rpmfusion-free 169 k
ffmpeg-libs i686 0.7-0.3.20110612git.fc15 rpmfusion-free-updates 2.9 M
lame-libs i686 3.98.4-1.fc14 rpmfusion-free 245 k
libdca i686 0.0.5-5.fc12 rpmfusion-free 101 k
libmimic i686 1.0.4-4.fc12 rpmfusion-free 28 k
libmms i686 0.6.2-1.fc15 rpmfusion-free 47 k
libquicktime i686 1.2.2-2.fc15 rpmfusion-free 288 k
librtmp i686 2.3-2.fc14 rpmfusion-free 55 k
libva i686 1.0.13-2.fc15 updates 51 k
mjpegtools-libs i686 1.9.0-2.fc14 rpmfusion-free 232 k
x264-libs i686 0.0.0-0.29.20110227.fc15 rpmfusion-free 345 k
xvidcore i686 1.3.2-2.fc15 rpmfusion-free-updates 244 k

Transaction Summary
================================================================================
Install 15 Package(s)

Total download size: 5.2 M
Installed size: 15 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 5.2 M
http://fedora.mirrors.pair.com/linux/releases/15/Everything/i386/os/Packages/SDL-1.2.14-11.fc15.i686.rpm: [Errno 12] Timeout on http://fedora.mirrors.pair.com/linux/releases/15/Everything/i386/os/Packages/SDL-1.2.14-11.fc15.i686.rpm: (28, '')
Trying other mirror.
(1/15): SDL-1.2.14-11.fc15.i686.rpm | 201 kB 00:01
(2/15): faad2-libs-2.7-1.fc11.i586.rpm | 169 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 00a4d52b: NOKEY
Public key for faad2-libs-2.7-1.fc11.i586.rpm is not installed
(3/15): ffmpeg-libs-0.7-0.3.20110612git.fc15.i686.rpm | 2.9 MB 00:02
Public key for ffmpeg-libs-0.7-0.3.20110612git.fc15.i686.rpm is not installed
(4/15): gstreamer-ffmpeg-0.10.11-2.fc15.i686.rpm | 186 kB 00:00
(5/15): gstreamer-plugins-bad-0.10.22-1.fc15.i686.rpm | 148 kB 00:00
(6/15): lame-libs-3.98.4-1.fc14.i686.rpm | 245 kB 00:00
(7/15): libdca-0.0.5-5.fc12.i686.rpm | 101 kB 00:01
(8/15): libmimic-1.0.4-4.fc12.i686.rpm | 28 kB 00:00
(9/15): libmms-0.6.2-1.fc15.i686.rpm | 47 kB 00:00
(10/15): libquicktime-1.2.2-2.fc15.i686.rpm | 288 kB 00:00
(11/15): librtmp-2.3-2.fc14.i686.rpm | 55 kB 00:00
(12/15): libva-1.0.13-2.fc15.i686.rpm | 51 kB 00:00
(13/15): mjpegtools-libs-1.9.0-2.fc14.i686.rpm | 232 kB 00:00
(14/15): x264-libs-0.0.0-0.29.20110227.fc15.i686.rpm | 345 kB 00:00
(15/15): xvidcore-1.3.2-2.fc15.i686.rpm | 244 kB 00:00
--------------------------------------------------------------------------------
Total 109 kB/s | 5.2 MB 00:49
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-15-i386
Importing GPG key 0x00A4D52B:
Userid : RPM Fusion free repository for Fedora (15)
Package: rpmfusion-free-release-13-4.noarch (@/rpmfusion-free-release-stable.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-15-i386
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:faad2-libs-2.7-1.fc11.i586 1/15
Installing : lame-libs-3.98.4-1.fc14.i686 2/15
Installing : x264-libs-0.0.0-0.29.20110227.fc15.i686 3/15
Installing : xvidcore-1.3.2-2.fc15.i686 4/15
Installing : librtmp-2.3-2.fc14.i686 5/15
Installing : SDL-1.2.14-11.fc15.i686 6/15
Installing : libdca-0.0.5-5.fc12.i686 7/15
Installing : libmimic-1.0.4-4.fc12.i686 8/15
Installing : libmms-0.6.2-1.fc15.i686 9/15
Installing : libva-1.0.13-2.fc15.i686 10/15
Installing : ffmpeg-libs-0.7-0.3.20110612git.fc15.i686 11/15
Installing : libquicktime-1.2.2-2.fc15.i686 12/15
Installing : mjpegtools-libs-1.9.0-2.fc14.i686 13/15
Installing : gstreamer-plugins-bad-0.10.22-1.fc15.i686 14/15
Installing : gstreamer-ffmpeg-0.10.11-2.fc15.i686 15/15

Installed:
gstreamer-ffmpeg.i686 0:0.10.11-2.fc15
gstreamer-plugins-bad.i686 0:0.10.22-1.fc15

Dependency Installed:
SDL.i686 0:1.2.14-11.fc15
faad2-libs.i586 1:2.7-1.fc11
ffmpeg-libs.i686 0:0.7-0.3.20110612git.fc15
lame-libs.i686 0:3.98.4-1.fc14
libdca.i686 0:0.0.5-5.fc12
libmimic.i686 0:1.0.4-4.fc12
libmms.i686 0:0.6.2-1.fc15
libquicktime.i686 0:1.2.2-2.fc15
librtmp.i686 0:2.3-2.fc14
libva.i686 0:1.0.13-2.fc15
mjpegtools-libs.i686 0:1.9.0-2.fc14
x264-libs.i686 0:0.0.0-0.29.20110227.fc15
xvidcore.i686 0:1.3.2-2.fc15

Complete!
[root@localhost alexm]#

Saturday, July 16, 2011

Setting Maven2 and Subversion in Ubuntu

Setting up Apache Maven 2.2.1 (rdebian-4) and Subversion version 1.6.12 (r955767) in
Linux ubuntu 2.6.38-8-generic on VMWare Player 3.1.4 build-385536

1. Install maven 2
root@ubuntu:/etc# apt-get install maven2

2. Check version of maven2 install
root@ubuntu:/etc# mvn --version

3. Install subversion
root@ubuntu:/etc# apt-get install subversion

4. Check subversion version
root@ubuntu:/etc# svn --version

Saturday, July 9, 2011

Updating the root password in Ubuntu after install

1. Open a terminal window
alexm@ubuntu:~$

2. Change the default root password
alexm@ubuntu:~$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully


3. Try to login as root
alexm@ubuntu:~$ su root
Password:

root@ubuntu:/home/alexm#