Category Archives: Linux Soft

Run two dropbox account at a time on Ubuntu


I started from a position of having a working first account (mine).

First step is to move the existing account, and get it working …

So you can probably replace “me” and “other” in the commands below with “personal” and “business” or whatever you want to call them.

1] Stop the existing dropbox daemon running.

2] rename existing account .dropbox folder

Code:
mv ~/.dropbox ~/.dropbox-me

3] create a new bash script ‘start-dropbox-me.sh’, containing the following:

Code:
#!/bin/bash
HOME=/home/me/.dropbox-me /home/me/.dropbox-dist/dropbox start -i

Note that I found that pointing to /home/me/.dropbox-dist/dropbox made the difference – using the one in /usr/bin caused the same error you are seeing. I’m not really sure why, I was just experimenting and it worked.

4] and make it runnable:

Code:
chmod 775 start-dropbox-me.sh

5] use “system->preferences->startup applications” to add this script as a startup application. (actually, I edited the existing dropbox startup application to point at this script).

I now had a running dropbox after restart (or just running the bash script).

Second step is to configure the new account (for “other”):

6] create a new bash script ‘start-dropbox-other.sh’, containing the following:

Code:
#!/bin/bash
HOME=/home/me/.dropbox-other /home/me/.dropbox-dist/dropbox start -i

7] and make it runnable:

Code:
chmod 775 start-dropbox-other.sh

8] run this script, and follow usual registration (or existing account) process, to get it configured. Using a different location that the first account.

[at this point I had two working dropbox accounts]

9] use “system->preferences->startup applications” to add this other script as a startup application.

Restarted the PC and it all came back with the two dropbox Icons on the panel, etc.

Hope this works for you.

Advertisements

How to Cross Compiling with codeblocks using linux


The following is how I did this on Ubuntu ‘Precise Pangolin’ Linux:

Step 1:

Install MingW32 for linux

Code:
# sudo apt-get install mingw32

Step 2:

Settings->Compiler and debugger settings

Code:
 Select GNU GCC Compiler and click the Copy button.
 Name this: MingW32 Compiler

Step 3:

Click the Compiler tab and then click the #defines tab.
Add the following:

Code:
  WINVER=0x0400
  __WIN95__
  __GNUWIN32__
  STRICT
  HAVE_W32API_H
  __WXMSW__
  __WINDOWS__

Click the Linker tab and the following under “Other Linker Options”:

Code:
-lstdc++
-lgcc
-lodbc32
-lwsock32
-lwinspool
-lwinmm
-lshell32
-lcomctl32
-lctl3d32
-lodbc32
-ladvapi32
-lodbc32
-lwsock32
-lopengl32
-lglu32
-lole32
-loleaut32
-luuid

*Note: Not all of these are REQUIRED… As I have been recently messing with compiling apps for windows with ogl and dx9 support I have realized that there are some additions I have needed to add here… I will update accordingly when I know more.

Step 4:

Click the Directories tab and the Compiler tab.

Code:
 Modify the path to read the following (where ix86 is your architecture type):
 /usr/i586-mingw32msvc/include

Click the Directories tab and the Linker tab:

Code:
 Modify the path to read the following (where ix86 is your architecture type):
 /usr/i586-mingw32msvc/lib

Click the Directories tab and the Resource Compiler tab:

Code:
 Modify the path to read the following (where ix86 is your architecture type):
 /usr/i586-mingw32msvc/include

Step 5:

Click the Programs tab:

Code:
 C compiler: i586-mingw32msvc-gcc
 C++ compiler: i586-mingw32msvc-g++
 Linker for dynamic libs: i586-mingw32msvc-g++
 Linker for static libs: i586-mingw32msvc-ar
 Debugger: i586-mingw32msvc-gdb    **** MORE ON THIS LATER ****

Click OK and save your changes.

Step 6:

Ubuntu’s mingw32 package and from what I can tell, MingW32 in general doesnt really have a solid gdb option for debugging natively in linux so we’re going to work around this using wine and mingw32’s latest insight build for windows

Install Wine

Code:

# sudo apt-get install wine

Step 7:

Download Insight here:

Code:
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82725&release_id=371590

http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82725&release_id=371590

Step 8:

Once you download insight.exe, extract the archive using wine:

Code:
wine insight.exe

I extracted this to my desktop

Step 9:

Move the insight folder to /opt

the path should now look like

Code:
/opt/insight/bin/gdb.exe

Step 10:

create a shell script in /usr/bin:

(note: shell scripts should start with a hash (#) bang (!), ie: “# ! / bin / sh ” [with no spaces] but when I add that the forum post tanks)

Code:
# sudo gedit /usr/bin/i586-mingw32msvc-gdb

and add the following:

Code:
wine /opt/insight/bin/gdb.exe "$@"

Save the file and quit gedit

Step 11:

Code:
# sudo chmod +x /usr/bin/i586-mingw32msvc-gdb

Now we have a way to execute the windows version of mingw32’s gdb for windows in linux using our shell script wrapper

Step 12:

Create a new console application project in Codeblocks…

Using the wizard select the MingW32 Compiler option.

Step 13:

Right click the project and go to properties. Click the Targets tab and set the Output Filename to be whatever you want with a .exe file extension. Make sure the Type is a Console Application.

Step 14:

Hit F9 in codeblocks and the hello world application runs!! YAY!

Set a breakpoint on line 5 and hit F8 and the application breaks in the debugger!! Woot!

Now you can successfully compile, execute, and debug windows applications in linux using codeblocks!!!

Source post:  Click here

(C/C++) How to make windows executable file(.exe) from GNU/Linux


To make windows executable file(.exe) from GNU/Linux you need a Cross-Compiler named ” mingw32

  • Installation

If you using Ubuntu  then install “mingw32".You can install it many ways but if you are lazy as like me then you can use terminal.Give this command on terminal.

sudo  apt-get  install  mingw32

Replace “apt-get” with “yum” or whatever your linux distro uses.

 

To compile C  source code give below command on terminal

i586-mingw32msvc-cc  main.c  -o  main.exe

here main.c is your c source file and main.exe is you desire .exe file name.

To compile C ++  source code give below command on terminal

i586-mingw32msvc-c++  clock.cpp  -o  clock.exe

here clock.cpp  is your c++ source file and clock.exe is you desire .exe file name.

Now you can run those main.exe and clock.exe on Windows OS. if you want to run those .exe file on linux you need wine or  other software that can run windows executable file. I prefer to use wine its  free.

to install wine on Ubuntu give this command on terminal

sudo  apt-get  install  wine

Replace “apt-get” with “yum” or whatever your linux distro uses.

now type on terminal

wine  main.exe