Showing posts with label howto. Show all posts
Showing posts with label howto. Show all posts

Thursday, 19 August 2010

Install phploc on openSuSE 11.3 [HOWTO]

Once you've got PEAR installed, run these commands (as root):

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear install phpunit/phploc


At first I was getting errors:

phpunit/File_Iterator requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
phpunit/phploc requires package "phpunit/File_Iterator" (version >= 1.2.0)
No valid packages found
install failed


But running:

pear upgrade-all


fixed all the errors.

Monday, 9 August 2010

Use ssh-copy-id on a non-default port

ssh-copy-id has known problems with handling non-standard ports (e.g. connecting to a different port than 22). To overcome this issue, use a command like:

$ ssh-copy-id "user@host -p 6842"

Source:http://it-ride.blogspot.com/2009/11/use-ssh-copy-id-on-different-port.html

Friday, 14 May 2010

HOW TO Install MetaTrader 4 on Linux

How to run Meta Trader 4 on Linux using WINE.
  1. Sign up for an account at a forex broker, and download their MT4 installer. I used Easy-Forex, but this procedure should work for any version of Meta Trader 4.x.
  2. Install wine on your linux machine (I used wine 1.1.44 on an openSuSE 11.2 machine). Also download winetricks (used to install additional libraries required by MetaTrader).
  3. If you haven't used wine before, run 'winecfg' to create your installation directory. You can then click 'OK' to exit the dialog, or have a look around at the options (I used the defaults).
  4. Start up a Windows computer, and copy all the files in C:\WINDOWS\Fonts into the wine directory (/home/username/.wine/drive_c/windows/Fonts)
  5. Run winetricks to install mfc40 and mfc42:
      sh ./winetricks mfc40 mfc42
  6. Run the MetaTrader installer executable.
       wine ./mt4setup.exe
That's it! You should now be able to run MetaTrader4 by clicking on the icon on the desktop, or running the following command in your Linux shell:

wine /home/username/.wine/drive_c/Program\ Files/yourmt4installdirectory/terminal.exe

If you have any more problems or questions, please contact me by leaving a comment. MetaTrader is running fine for me under openSuSE 11.2 with the latest WINE from the repositories, once MFC40, MFC42 and the correct fonts had been installed.

More information:
http://appdb.winehq.org/objectManager.php?sClass=version&iId=2893
http://www.aboutcurrency.com/university/metatrader/installing_metatrader4_under_linux.shtml
http://easyforextrading4u.com/metatrader-linux/

Appendix:
When you first start MetaTrader4, it might take a while to initialise. You'll see something like the following in the shell output:

fixme:reg:GetNativeSystemInfo (0x58c4c8) using GetSystemInfo()
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.

Exp file "Z:\home\david\.wine\drive_c\Program Files\MT4 at easy-forex\experts\MACD Sample.ex4" produced - 0 error(s), 0 warning(s)
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
fixme:reg:GetNativeSystemInfo (0x58c4c8) using GetSystemInfo()
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.

Exp file "Z:\home\david\.wine\drive_c\Program Files\MT4 at easy-forex\experts\Moving Average.ex4" produced - 0 error(s), 0 warning(s)
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
fixme:reg:GetNativeSystemInfo (0x58c4c8) using GetSystemInfo()
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.

Exp file "Z:\home\david\.wine\drive_c\Program Files\MT4 at easy-forex\experts\indicators\Accumulation.ex4" produced - 0 error(s), 0 warning(s)
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
fixme:reg:GetNativeSystemInfo (0x58c4c8) using GetSystemInfo()
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.


Some errors I was encountering before installing the mfc40 and mfc42 libraries:

err:module:import_dll Library KERNELBASE.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Debug-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-ErrorHandling-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-File-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Handle-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Interlocked-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-LibraryLoader-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Localization-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-LocalRegistry-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Memory-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Misc-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-ProcessThreads-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Profile-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-String-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Synch-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-SysInfo-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library MFC42.DLL (which is needed by L"Z:\\home\\david\\.wine\\drive_c\\Program Files\\MT4 at easy-forex\\MetaEditor.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\home\\david\\.wine\\drive_c\\Program Files\\MT4 at easy-forex\\MetaEditor.exe" failed, status c0000135

Thursday, 4 March 2010

Mounting Filesystems by UUID - Ubuntu

Ubuntu 9.10 automatically mounts hard drives by UUID when it's installed. This means that if you insert a new hard drive, which changes all the /dev/sdxx numbers, your system will still function normally. Linux by examples has a good tutorial on common fstab commands for uuid.

To find all UUIDs:

ls -l /dev/disk/by-uuid/

To check the UUID for a known device:


sudo vol_id /dev/sda1

or this:

blkid /dev/sda1

Tuesday, 9 February 2010

How to extract / unzip a .tar.gz file into a different directory

What happens if you need to extract a .tar.gz file, but don't have enough free disk space in the directory? It might show you an error like this:

tar: Wrote only 9216 of 10240 bytes
tar: Skipping to next header
tar: Error exit delayed from previous errors


Tar and Gunzip will only extract into the current directory. Here is a command that will unzip a .tar.gz archive into a new directory.

cd /new-directory
gzip -dc /path/file.tar.gz|tar xvf --