tag:blogger.com,1999:blog-66419742345498858442024-03-14T04:08:31.253-04:00Ubuntu user hacksAnonymoushttp://www.blogger.com/profile/16706788056533219446noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6641974234549885844.post-41741008006876890332014-06-05T11:21:00.002-04:002014-06-05T12:22:13.557-04:00Cross-compile C application for Win32/64 on Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
I used the MingW libraries to compile an application written in C (with makefile etc.) with Ubuntu-32bit as host and Win 32/64 as the target.<br />
<br />
<u>Installation</u><br />
sudo apt-get install mingw32 (for libraries with win32 as target ?)<br />
sudo apt-get install mingw64 (for libraries with win64 as target ?)<br />
<br />
<u>Compilation</u><br />
i686-w64-mingw32-gcc -o target.exe main.c // Compile for win32 target.<br />
x86_64-w64-mingw32-gcc -o target.exe main.c // Compile for win64 target.<br />
<br />
Since my application used makefile, I changed the variable<br />
CC = x86_64-w64-mingw32-gcc (previously CC = gcc)<br />
<br />
<u>Tips</u> <br />
The application I was working on had a subdirectory with a bunch of c files and a makefile to compile them. Sort of a library. My first mistake was that I hadn't removed *.o files from that directory, which means compilation of appln. was showing a ton of linker errors. So I removed the *.o, *.exe from all the folders. Then I changed the gcc command in this folder's makefile, so this library could be recompiled again with this application. <br />
<br />
Other than Ubuntu, I tried to compile this appln. using MinGW32 tools for Win7. I could get it to work to compile and install simple applications, but couldn't get mine to work. The reason was that my application compilation requires bison / flex libraries and I couldn't get it to work on MinGW32 tools for win7. <br />
<br />
References<br />
http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux<br />
http://www.mingw.org/wiki/MinGW_for_First_Time_Users_HOWTO <br />
http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux<br />
http://mingw-w64.sourceforge.net/download.php#automated-builds <br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/16706788056533219446noreply@blogger.com0tag:blogger.com,1999:blog-6641974234549885844.post-41452388006398934372014-01-26T01:30:00.000-05:002014-01-26T01:30:04.125-05:00Install Thinkpad tools on Ubuntu 12.04<div dir="ltr" style="text-align: left;" trbidi="on">
I own a T400 for 51/2 years now, and it has been treating me very well. I haven't still replaced my original battery, it still holds up 90% of its original capacity. Great Job Lenovo ! One possible reason is that I am using Battery Thresholding since the first few weeks of buying this machine, and made sure that this Thresholding works on all the OS I use. I use Ubuntu around 95% of my time using my PC (lets not talk about the other 5% time I spend editing the Word / PPTs on the crappy OS). Thinkpad provides Battery driver software for Windows, but doesn't provide any drivers for Linux. Luckily drivers exist, and I found it on this <a href="http://www.thinkwiki.org/wiki/Tp_smapi">link</a><br />
<br />
The installation steps are very easy, I am reproducing here from the above link.<br />
<br />
1. sudo apt-get install tp-smapi-dkms<br />
2. sudo modprobe tp-smapi<br />
3. Verify that the module is installed, using lsmod | grep smapi<br />
4. Enable the superuser (su) mode on the terminal and do<br />
echo 30 > /sys/devices/platform/smapi/BAT0/start_charge_thresh<br />
echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh<br />
<br />
5. Make sure that the module loads on startup. Add the following line in /etc/modules<br />
<br />
tp_smapi<br />
<br />
6. To set the threshold settings at startup, Add the following lines in the tail of /etc/sysfs.conf file<br />
<div>
<br /></div>
<div>
<div>
devices/platform/smapi/BAT0/start_charge_thresh = 50</div>
<div>
devices/platform/smapi/BAT0/stop_charge_thresh = 80</div>
<div>
EOF</div>
</div>
<div>
<br /></div>
<div>
Thats it. I focused only on battery thresholding, but there are many other tools that this module provides. Just check the files in /sys/devices/platform/smapi/BAT0/*</div>
</div>
Anonymoushttp://www.blogger.com/profile/16706788056533219446noreply@blogger.com0tag:blogger.com,1999:blog-6641974234549885844.post-21238828400177837112013-04-28T08:59:00.002-04:002013-04-28T09:02:10.186-04:00Mount CIFS directory in Ubuntu (Linux) for Duke University OIT<div dir="ltr" style="text-align: left;" trbidi="on">
Tired of switching to your Windows, just to edit your webpages? Just because the OIT supports mounting those CIFS drives only on Win / MAC.<br />
<br />
I used the following technique to mount the CIFS directory on my Ubuntu.<br />
<br />
First, you need to be on the Duke network. If not, get onto the VPN.<br />
<br />
Then, <br />
mkdir ~/mnt<br />
sudo mount -t cifs //<i>myserver_ip_address/folder</i> ~/mnt -o username=<i>netid</i>,noexe<i>c</i><br />
<br />
where<br />
<i>my_server_ip_address</i> = homedir.oit.duke.edu<br />
<i>folder</i> = users/x/netid (where x is the first letter of your netid. For e.g. if your netid is john, then folder = users/j/john)<br />
<br />
And thats it. You can see your CIFS directory mounted in ~/mnt<i>.</i><br />
<i><br /></i>
For editing the files in the public_html, I usually do "sudo gedit ~/mnt/public_html/index.html", since the directory is mounted as a read-only directory. <br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/16706788056533219446noreply@blogger.com0tag:blogger.com,1999:blog-6641974234549885844.post-61983709993509259112011-08-27T07:25:00.000-04:002013-04-28T09:01:53.444-04:00Installing real Player 11 on debian (unsupported)<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Real Player 11 is no longer supported for Linux.<br />
<br />
here's a .deb copy of application that i could find <a href="https://helixcommunity.org/projects/player/files/download/3406">download</a> , in the article <a href="https://helixcommunity.org/projects/player/forums/entry/3900">link</a> . This installs the firefox real player plugin as well.</div>
Anonymoushttp://www.blogger.com/profile/16706788056533219446noreply@blogger.com0