This blog is subject the DISCLAIMER below.
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, September 29, 2008

Wine -- Windows Applications On Linux

Wine is a program that runs MS Windows applications on Unix-based systems by providing a compatibility layer by implementing some of the Windows APIs and wrapping the others to call native Unix functions, X server, and OpenGL. Wine implementation is all in userland (outside the kernel and doesn't need special privileges)[1].

Wine was originally short of WINdows Emulator, but I a am not sure about if that's still the case. "Wine" is originally a recursive acronym "Wine Is Not an Emulator"[A]. (Update) Wine is more of a compatibility layer than of an emulator. An emulator usually emulates hardware, like a Playstation emulator (offtopic: I know a good one called pSX).

Wine doesn't only implement Windows system calls, but also most of the DLLs that comes with
Windows. Most notably DirectX (which is one of the top reasons to use Wine; playing Windows games on Linux). If you are a windows license owner you can use some of the native Windows DLLs instead (but others can't be used).

ReactOS[8] is to Windows as Linux is to Unix. A free and open source alternative. It uses Wine code. Several other commercial projects uses Wine too, like TransGaming Cedega and CodeWeavers CrossOver (and others). The former is a fork of Wine specially for gaming, they do NOT send their patches to the main-stream Wine. The latter is both a general-purpose and gaming-purpose dedicated development for Wine. Unlike the former, the latter sends it patches instantly to the main-stream Wine. It relies mostly on support for profit (as for what I understood).

Google have paid CodeWeavers to make Wine able to run Photoshop CS 2 on Linux[2]. CodeWeavers also have acted quickly to to make Wine able to run Google Chrome on Linux, and they made it in 11 days[3]. Google has actively encouraged Wine development through their interns [4] and through student participation during the Summer Of Code 2008 [5].

The only Microsoft acknowledgment about Wine, is to state it is not Genuine Windows and therefore deprived from Windows Genuine Advantage (some downloads). [6] Generously, Microsoft still allows some updates, like Office updates to Wine users. [same source]. (See [7] for instructions how to install Office 2003 on Linux.)

Wine is not small at all. WINE 1.0 have over 1.8 million lines of C code (with blank lines and comments), ~300,000 of which are tests, and ~87000 are related to Direct3D (a subset of DirectX) implementation[original research]. I am not sure how big is the Micorsoft Subsystem for Unix-based Applications (SUA)[9](*1), but I am sure it is much less. That's because what a Unix program assumes to find in a system is much less that what a Windows application assumes to find (which are thousands of Windows APIs[10]).

(Update)
Due to the large amount Wine has to implement, it doesn't implement all of the Windows APIs yet. A program that depends on an unimplemented API might not function correctly. Wine developers try to implement high-priority APIs first. Those are the ones used by the most popular applications. (For a list of which programs are compatible with Wine check Wine AppDB[11])

(Update)
Wine have been in development for more than 16 years (since 1992); even before Linux was born[12]. Wine's still not complete, because it faces the problem with catching up with more recent Windows systems. For example (not saying that this have actually happened), when they completely supported Windows 95 applications, they were struck by XP, and then XP SP 1 and Windows 2000 (just an example, I know there are several editions in the middle). Wine development is indeed much slower than the real development pace of the real Windows (thousands of organized developers vs. hundreds of random contributers - ~700 have contributed to Wine somehow [12]).

(*1)
Wine is binary compatibility layer, which means the binary executable can be executed both on Windows and Linux without modifications. While MS SUA is source compatibility layer, which means the same program will have two executables, compiled differently, but from the same source, in order to run on both platforms.

Wine's web page: http://winehq.org/ .

Other references and links:

[1] Linux Unified Kernel is a project to implement Windows system calls (only, not the entire set of APIs) natively in Linux kernel.
[2] http://apcmag.com/google_behind_photoshops_new_linux_compatibility.htm
[3] http://www.heise-online.co.uk/news/CodeWeavers-bring-Chrome-to-Mac-and-Linux--/111535
[4] http://code.google.com/opensource/wine.html
[5] http://wiki.winehq.org/SummerOfCode
[6] http://www.microsoft.com/genuine/downloads/faq.aspx
[7] http://www.wine-reviews.net/microsoft/running-ms-office-2003-under-linux-with-wine-0952.html
[8] http://www.reactos.org/en/index.html
[9] http://mohnabil.blogspot.com/2008/09/microsoft-subsystem-for-unix-based.html
[10] Unlike Windows system calls (http://www.metasploit.com/users/opcode/syscalls.html), which are less than 400 in Windows Vista, the entire set of the windows APIs are much more (http://www.codase.com/windows.html)
[11] http://appdb.winehq.org/
[12] http://www.winehq.org/site/history
[A] http://wiki.winehq.org/FAQ?action=recall&rev=217#head-8b4fbbe473bd0d51d936bcf298f5b7f0e8d25f2e

.. more.

Sunday, February 10, 2008

Fedora 9 alpha release

Fedora 9 Alpha have been released a minutes ago here is the link of the page and for downloads

http://fedoraproject.org/get-prerelease

.. more.

Friday, November 23, 2007

The solution of the fedora 8 shock (swing doesn't work)

In this post we gonna show why does swing components? most of us tried netbeans ,but it awfully doesn't work with it. The reason is that , netbeans and swings are using the libx11 and there some thread safety operation the new version of this lib is doing that's why if you downgraded to the last version of libx11 you will find swings works will but of course it's not the ideal solution but of course there is another solution. The solution is to change the path of the libx11 in the libmawt.so which have shared native functions that calls libx11. we change the place of the used lib from the XINERAMA to the FAKEEXTN
using the sed command like this :

sed -i 's/XINERAMA/FAKEEXTN/g' libmawt.so

but where is libmawt.so this is different from jvm to jvm especially after the icedtea(icedtea is an implementation of the jvm by redhat ) so if you are using the jdk's jvm you will find the file in

/usr/jdk1.6.0_03/jre/lib/i386/xawt/libmawt.so
and after that you can run your net beans setup of any program that runs with java

.. more.

Friday, October 19, 2007

Tuesday, October 16, 2007

Ubuntu 7.10 after two days

The official site of Ubuntu promise all Linux lover to a new version of Ubuntu, Kubuntu, Edubuntu, Gobuntu, and Xubuntu codenamed "Gutsy Gibbon" throw version 7.10 .

They consider this new release candidate to be complete, stable, and suitable for testing by any user.

The new version 7.10 is scheduled for 18 October 2007 (after two days ) and will have supporting for 18 month only so from users want support for longer time using Ubuntu 6.06 LTS, with security support until 2011 .

.. more.

Sunday, August 26, 2007

Best Linux Distribution for Java Development

I've spent the last few weeks learning the basics, coding and database development, source control...etc on Linux, as I want to completely transfer to it, that's why I'm trying as much Linux distros as I can these days (@ home and @ work, trying to spread the open-source word); I tried Ubuntu 7.04 and Fedora 7, and currently downloading openSUSE 10.2, and till now I love Ubuntu and prefer GNOME to KDE, although KDE seems to have nicer visual effects, but I feel much more comfortable with GNOME, anyway, have you got any ideas that might help me find the best distro for development especially with Java? I need a fast and reliable system that doesn't require much configuration, I'd be grateful if you could provide me with help in that, thanks!

By the way, I have a small - yet annoying - problem in Ubuntu that occurred on my laptop and home PC, and will try to trigger that problem on my work PC tomorrow to help me in choosing my primary Linux distro; when I shut my computer down improperly (e.g. by unplugging the power cable or pressing the Reset button), Ubuntu's response became much slower than it used to (not just after the following restart, but always)!! Sometimes it returns back to normal (but usually after leaving the computer on for some time), but mostly it makes me want to SMASH MY PC!! I click any icon such as Firefox, Terminal or Thunderbird, gives no response for about 5 seconds and then starts execution!! Any ideas?? I don't think I'm in the mail group yet, so I'd be grateful if you reply to my post here or e-mail me at aamr@fcih.net, thanks again.

.. more.

Friday, August 24, 2007

MySQL Server on Ubuntu 6.06 Server and Client on Ubuntu 7.04 Desktop Setup & Configuration For Remote Access

Hello Linux & MySQL users :), this is my first article here, and hope it's useful! Here's the scenario I'm trying to achieve: Using VMWare, I set 2 images up, one containing Ubuntu Server 6.06 and MySQL Server, and the other containing Ubuntu Desktop 7.04 and MySQL Client tools, and I wanted to access the server remotely (on the same LAN). Note: you can do the same using 2 separate machines on the same LAN, it's not different at all. Ubuntu Server doesn't have a Desktop Manager by default and I used the command line to achieve everything (I set an X-Server and a desktop manager called Icewm up later using this tutorial: https://help.ubuntu.com/community/Installation/LowMemorySystems )

  • MySQL Server

    1. Create a root account password: sudo passwd

    2. login with your root account: su

    3. if you didn't set a LAMP (Linux, Apache, MySQL, PHP/Python...etc) server, you can download the mysql-server:
      sudo apt-get update
      sudo apt-get install mysql-server

    1. create the root account on mysql-server: mysqladmin -u root password 'yourpassword'

    2. login to mysql using the root account: mysql -p

    3. create an administrator account that has all privileges of root, e.g.

        GRANT ALL ON *.* TO aamr@'%' IDENTIFIED BY 'yourpassword'

    4. exit from mysql: exit

    5. Edit the configuration file of MySQL (/etc/mysql/my.cnf ) to enable remote access to it using any text editor such as vi: vi /etc/mysql/my.cnf

    6. go to the line “bind-address”, press INSERT and change the IP to the IP of the server, e.g. From 127.0.0.1 to 10.10.11.113

    7. After you complete editing, press Escape, then type :w to save and :q to quit


  • MySQL Client

    1. You can use the Synaptic package manager in System->Administration and search for mysql-client, mysql-query-browser, and mysql-admin and install them.

    2. Launch any of both, enter the username and password of the user you created, and there you go :)

.. more.

Thursday, June 28, 2007

Silverlight for Linux [Moonlight Project]

Posted by: Jack Vaughan on June 25, 2007 DIGG
Miguel de Icaza and his Mono project cohorts have quickly produced an implementation of Silverlight for Linux. The effort is called Moonlight.

Silverlight is an extended subset of the 2.0 .NET framework that can support rich media on multiple browsers and platforms.

Various developers worked intensely to create the first version of Moonlight, which de Icaza demonstrated at a European Microsoft MIX event last week.

de Icaza blog on Moonlight


Moonlight Project page

.. more.

Saturday, March 10, 2007

Linux Tip #4 : Virtual CD

Indeed sometime you have faced the situation that you have an ISO image and you want to use it as an actual CD but without burning it to a real CD. In windows you need to get some software to do that for you that usually create a virtual device etc.

In Linux you can do with a single line, mounting it to a folder.

Here's the command:
sudo mount -o loop -t iso9660 CD_IMAGE.ISO /path/to/folder

You give it the ISO file name and the path to the folder where you want to access it and it's all done for you! No device naming (A: G: I:...) required, no max number of virtual CD-ROM devices, none. Just that simple.

Enjoy.

http://www.linuxhelp.net/linux_downloads/

.. more.

Sunday, March 04, 2007

Linux Demo Week @ FCIH by SU

Students United is proud to announce the launch of Linux Demo Week. Hope that you all come and see Linux live in action


SU_Linux

.. more.

Tuesday, February 27, 2007

Linux Tip #3 : Using Arabic keyboard

It is really simple to use Arabic in Linux. This command enables it:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ar

You can make this command run each time the computer starts by adding to ~/.bashrc .

This command in short, set the switch keys to alt-shift (left alt and left shift), the mode of this key is to toggle, and it specifies that the state of the scroll-lock LED will show the language currently used. Use 'man setxkbmap' for more details on advanced use.

.. more.

Installing JDK6 On Ubuntu

Ubuntu is a great linux distribution. I have been using it for some time and it has never failed me. I have tried to use JDK6 with it but i didn't find a .deb package neither on sun's website nor ubuntu repositories. Fortunately, there is a way around that.

First, you need to download the JDK binary from here. I have downloaded jdk-6-linux-i586.bin the one suitable for my computer and most of us.

Second, chmod it to make it executable:

chmod 755 ./jdk-6-linux-i586.bin

Third, run the binary you have downloaded using this command:

./jdk-6-linux-i586.bin

then press yes to agree to the licence. After that you will find a new folder called jdk1.6.0

Then, you need to move this folder to use/lib/jvm using this command:

sudo mv jdk1.6.0 /usr/lib/jvm

You will need to enter the root password to do that.

sudo update-alternatives --config java

Selection    Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
*+ 2 /usr/lib/jvm/java-gcj/jre/bin/java

Press enter to keep the default[*], or type selection number:
Those are the JVM's that currenlty exist.

Now we have moved the JDK to the folder where JVM's exists, but we need to enable the system to recognize it really exists

This command will finish all these thing:
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0/jre/bin/java 60 \
--slave /usr/share/man/man1/java.1.gz java.1.gz /usr/lib/jvm/jdk1.6.0/man/man1/java.1

Check the JVM's again:

sudo update-alternatives --config java

There are 3 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
*+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
3 /usr/lib/jvm/jdk1.6.0/jre/bin/java

Press enter to keep the default[*], or type selection number:
Now JDK 1.6 exists but it's not the default.
sudo update-alternatives --config java

There are 3 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
* 3 /usr/lib/jvm/jdk1.6.0/jre/bin/java

Press enter to keep the default[*], or type selection number:
Now, select the one that contains JDK1.6.0, which will be 3 in this case.

You are done.

References:
http://trac.centricware.org/wiki/2007/01/28/21.58

.. more.

Sunday, February 25, 2007

Running Netbeans on XGL

If you tried to use Netbeans on XGL before, you probably know that you can't do it. It shows like an empty window. The solution being around is that you use a nested X server and so on. Other solutions include recompiling the JRE.

Well, I ran into a simple solution. You can add this to /etc/environment, and viola, it is working:
AWT_TOOLKIT="MToolkit"

For command line guys:
sudo echo 'AWT_TOOLKIT="MToolkit"' >> /etc/environment

Have fun ;)

http://ubuntuforums.org/showpost.php?p=1687890&postcount=4

.. more.

Enabling Dual-core/Hyper-threading in Ubuntu

Ubuntu 6.10 (Edgy) doesn't enable dual-core out-of-the-box. Maybe the next one will. Anyway to enable it, you have to use a different kernel.
I started to hear people screaming. I can see you clicking away of this article right now!

Well, don't be afraid, it is as easy as a single click nowadays. All you need to do, if you have Intel (non-AMD) processor is this:
From synaptic package manager choose these 2 packages:
kernel-686-smp
kernel-restricted-modules-686
And then reboot.
For command-line people just type:
sudo apt-get install linux-686-smp linux-restricted-modules-686
and reboot.

To make sure your kernel now sees the both processor type:
cat /proc/cpuinfo | grep -i '^processor' | wc -l
This command will show you how many processors is recognized by the kernel.

For AMD users, the packages are not named 686, they are named k7.
Good luck.

A last hint: (thanks to my dear friend Shereef Sakr)
To speedup the booting process, you might want to enable concurrency in the booting processes.
In the /etc/init.d/rc file, there is a line called CONCURRENCY=none, it is probably the first un-commented line. Change 'none' to 'shell' or to 'startpar'.

Shell and startpar both are concurrent but shell cares about the order or the printed output. I used startpar and it didn't work, so I used shell and it is working fine, although not as fast as startpar; startpar booted in a blink, but shell just cuts few seconds off.

.. more.

Wednesday, February 21, 2007

Linux Shell Tip #2

In the previous post, I mentioned a case when you have run a program through the shell and you want to close the shell without closing your program.

So before you close the shell, you may notice that you can't type any other command untill you close the running program.

What if you need to use the shell for another purpose?

This is when you need to place an ampersand "&" at the end of the command. so for the gedit example i have mentioned before, the command would be like this:

gedit &

The ampersand (&) placed at the end of the command starts the process as a background process which means that this process will not capture your keyboard input in the shell, so you can use the shell for typing any other commands.

Remember that if u close the shell the programs you have run will close. To overcome this situation you will need to use nohup in association with the "&". So if you want to run gedit the command will:

nohup gedit &

and the general form of it would be:

nohup "your command" &

Now you can:

# Use the shell for any purpose after running the programs you want.
# Close the shell without disrupting the operation of the programs you have run.

.. more.

Sunday, February 18, 2007

Linux Shell Tip #1

As you use linux you will have to type commands into the shell. In this series of posts i am going to tell you how to overcome some annoyances when using the linux shell.

If you open gedit (a simple text editor) through the command line (by typing gedit) you will find that the terminal is still open. And if you close the terminal gedit will be closed too.

To override this behaviour you can type :
nohup gedit

This way if you close the terminal gedit will not be closed.

So what happens and how does nohup solve it??

When you run any program through the shell, this program is opened as a child process to the shell process. That means that the shell is a parent process to the program you have just run. So when you close the parent process(The shell in our case), a hangup signal is sent to the child process (Your program) which closes as a result.

nohup (means "no hangups") lets your program ignore those hangup signals, so that you can close the shell safely without mistakenly closing the program you have run.

Ofcourse, nohup is not constrained to gedit only. You can use it for any other program:
nohup "Your command"

.. more.

Thursday, February 01, 2007

Linux How to: Install Speedtouch ADSL modem

In this article, i am going to explain how to install your Speedtouch ADSL modem on linux, so that you can start a new experience with linux and open source.

At first, you need to download the firmware for the modem from here. it contains many files for different versions of speedtouch. The file we need specifically is ZZZL_3.012. You also need to download the firmware extractor from here. Ofcourse you have to dowload them from Windows :D.

Extract the firmware

After downloading those files, you need to open a terminal and copy and paste these commands:

unzip SpeedTouch330_firmware_3012.zip &&
chmod +x firmware-extractor &&
./firmware-extractor ZZZL_3.012

Secrets

Then, open a text editor and copy n' paste this line:

"username@isp" "*" "password"

Ofcourse, you need to substitute the username and password with the ones given by your ISP. Then save this file in your home folder and call it secrets

If your ISP uses PPPoE skip down to PPP over Ethernet

PPP over ATM

Open a text editor again and copy and paste this:

noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin pppoatm.so
0.00

### If the firmware loads and pppd won't
### connect uncomment this option to make
### pppd be more verbose in the system log

# debug

### For more details (and more options)
### read man pppd

Replace the username and ISP with the real values. Also you need to replace the 0.00 with VP/VC value (determined by your ISP, In case you have subscribed with Tedata the value is 0.35).

Save this file in your home folder with the name speedtch

Go to "We are almost done"

PPP Over Ethernet

Open a text editor again and copy and paste this:

noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin rp-pppoe.so
nas0

### If the firmware loads and pppd won't
### connect uncomment this option to make
### pppd be more verbose in the system log

# debug

### For more details (and more options)
### read man pppd

You have to substitute the username and ISP for the real values.

Save this file in your home folder with the name speedtch

We are almost done

You need to become root(log on as root or type su then enter the root password), open a terminal and copy and paste those commands:

cp speedtch-{1,2}.bin /lib/firmware &&
install -m400 speedtch /etc/ppp/peers &&
install -m400 secrets /etc/ppp/chap-secrets &&
install -m400 secrets /etc/ppp/pap-secrets

Now reboot and you are done :)

Connect to the internet

Open a terminal and type this command:

pppd call speedtch

Congratulations, you are finally connected :)

Notes:

  • I have performed this tutorial in OpenSUSE 10.2. The link mentioned in the references below mentions the steps for other distros, although it should be almost the same.

  • This tutorial applies to Speedtouch 330 version, other versions may need other firmware. If so replace "ZZZL_3.012" with the firmware you want to try in the script that extracts the firmware. You may try other firmware files from the same zip file you have downloaded above.
References:
http://www.linux-usb.org/SpeedTouch/index.html

.. more.