Sunday, March 20, 2016

Logitech M238 Mouse Not Recognized by Windows and Mac Computers

Hi all,

I cannot believe that it has been three years since I am not posting anything. Good news is I have something to share with you now. So let's move to our topic.

I always like using cute things. When I saw Logitech Colorful Play Collection Wireless Mouse M238 , I felt in love with them :) I immediately checked whether they were compatible with various operating systems. And yes! So it was time to buy one (I chose the fox model :P).

 photo LOGITECH MOUSE WIRELESS OPTICAL M238 FOX 910-004496 castleit.jpg

Well, I was not able to use it on my Macbook Pro with OS X El Capitan. I have tried to make it work on my Windows with no success. I was so sure that the mouse was not working. And I was ready to return it.

I have a Logitech K360 keyboard and a Logitech M325 mouse that I use on my Windows. Hence, I have two Unifying receivers. The funny thing is that I was never able to use a single Unifying receiver to use both devices. This is why two receivers were connected to my computer all the time. It is because I was not aware that we need a software to do it manually! So you should install Logitech Unifying Software to pair your multiple unifying devices with a single receiver. Next thing, I tried to pair my M238 mouse with this software. And it worked! I had one keyboard and two mouses working with a single unifying receiver. One mouse on my right hand, and the other one on my left hand, I was so happy. Of course, what's the point! :) It simply shows that my M238 mouse was working. The strange thing is that I was not able to use my M238 mouse with the original receiver coming with this mouse. But it worked with another unifying receiver. 

My next task was to make it work with my Mac. For this, I also looked for a similar program, and I found one that is called Logitech Options. I was able to use my mouse through a "unifying receiver". Again the original receiver was not working on my Mac either. 

So if your Logitech mouse is not working. Do not panic! Look for suitable softwares and try to make it work. I was lucky that I had an additional unifying receiver. 

Hope it helps you guys.

Update: I tried my M238 mouse on a different Mac now. It worked with the unifying receiver without installing Logitech Unifying Software. Maybe pairing the mouse with a Mac is enough to make the mouse work on different Mac computers. Just a thought :) 

Thursday, March 7, 2013

Ubuntu 12.10 RTL8192C Install Driver

Hello everyone..

I have a new computer now.. But I was not able to connect(!) to the Internet for a while.. And I can say that it was very painful to install a wifi driver on Ubuntu.. As I was successful, now I'm writing this for people like me looking for a solution to this same problem! :)

I have a USB wifi device that needs a RTL8192C driver to work properly.. Unfortunately, Ubuntu was not able to recognize my device.. Actually, it recognized it, but I was being disconnected every minute.. So I decided to install the driver manually.

First, I tried to install "ndiswrapper", and wanted to use Windows driver available on the Web/Device CD. I had many problems with installing ndiswrapper, activating drivers, blacklisting drivers.. so much work!!! And I ended up by reinstalling ubuntu, because my computer freezed and never worked again!! :/

Just try the easiest way to install! You are lucky that you have device that has Linux support. Simply, visit http://www.realtek.com.tw/downloads/searchView.aspx?keyword=RTL8192cu Download the driver needed as a tar file. Go to the directory where you downloaded device driver. In my case, file name is "RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105".

tar -xzvf RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105.tar.gz


This command will create a folder with all extracted files.

cd RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105
chmod +x install.sh
sudo ./install.sh


If everything goes well, the driver will be installed. If you have an error like:

make: *** /lib/modules/3.5.0-25-generic/build: No such file or directory. Stop.
make: *** [modules] Error 2


Then, you have to install corresponding linux headers. In your case, another kernel version may be a problem. Just replace version number with whatever version you need.

sudo apt-get install build-essential linux-headers-3.5.0-25-generic


After that, you will be able to install device driver. Now, try to install again:

sudo ./install.sh


You will see that the driver is successfully installed. Reboot your system. And enjoy! :) Hope it helps guys..

Friday, August 10, 2012

Accessing Data Property Range values using Jena Framework

Recently, I'm working with semantic web technologies.. I have built an ontology, and now my task is to parse this ontology and generate individuals for classes..

Jena Framework is quite popular to use for building semantic web applications.. I use it for working with my ontology.. There are many tutorials and example codes on Web, so it is easy to work with Jena. And of course, Jena is an ongoing project, and it's not complete in terms of its methods..

One problem that I encountered with is that getRange() method for data properties is not working properly.. It is ok when you use xsd variables such integer, string and such.. But when you use an enumerated list as data property range, this method returns null..

I realized that this method returns a Class rather than a DataRange type.. So it is possible to iterate over enumerated list values using EnumeratedClass..

Now, I will detail how I solved this problem.. Will take an example from my ontology.. I have a class called, Liver. This class has some data properties, and one of them is, hasMarginType. This property has a value which is one of:

{"irregular"^^string , "lobulated"^^string , "nodular"^^string , "other"^^string , "regular"^^string}


And this is how it looks like in Protege:
Now, let's look at the code for parsing this range values using Jena.

//print Liver class data properties
        ExtendedIterator<OntProperty> it = Liver.listDeclaredProperties();
        while(it.hasNext()){
            OntProperty p = it.next();
            if (p.isDatatypeProperty() && p.getDomain()!=null && p.getRange()!=null){
                pr("Data Property Name: "+ p.getLocalName());
                pr("Domain: "+ p.getDomain().getLocalName());
               
                EnumeratedClass e = null;
                ExtendedIterator<RDFNode> i = null;
                if(p.getRange().asClass().isEnumeratedClass()){
                    e = p.getRange().asClass().asEnumeratedClass();
                    i = e.getOneOf().iterator();
                   
                    RDFNode prop = null;
                    String s=null;
                    pr("Range: ");
                    while(i.hasNext()){
                        prop = i.next();
                        s=prop.asLiteral().toString().split("\\^\\^")[0];
                        pr(s);
                    }
                }else{
                    pr("Range: "+ p.getRange().getLocalName());
                }
               
                pr("\n");
            }
           
        }


 This code prints name of a data property, domain of this data property and range value for this data property. Note that pr is a function used to print data on console. My focus was not having the namespaces, thus my output is like this:

Data Property Name: hasMarginType
Domain: Liver
Range:
irregular
lobulated
nodular
other
regular


I did not find a code snippet to work with.. So here it is my solution.. Hope it helps..

Wednesday, August 8, 2012

Installing Sesame Server on Ubuntu 12.04

I'm currently checking triple stores and wanted to install one of the most popular ones: Sesame. I hope seeing Ali Baba in few days :) But before that I had some issues while installing Sesame on Ubuntu 12.04.

Sesame offers a built-in console utility. And there is also a web interface: Sesame Openrdf-Workbench which seems to be easier than Sesame console. Current version of Sesame is OpenRDF Sesame 2.6.8 SDK.

In order to install Sesame server, there are two war files that need to be deployed to a java servlet container. And thus, it is expected that you have java (5 or 5+) installed in your system. 

As a java servlet container, I used Tomcat 7. First of all, I installed it via ubuntu software center. Default configuration creates a new user, tomcat7. /usr/share/tomcat7 is default home directory for this user. Once you install tomcat, you can start the server as:

/etc/init.d/tomcat7 start

stop and restart commands can be used in the same way. Once the server is up, you can see tomcat page in http://localhost:8080/. Now, try to use manager webapp in order to deploy Sesame wars. Note that you have to configure users by editing tomcat-users.xml. The sample entry has to be something similar to:

<tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="admin"/>
  <user name="admin" password="admin" roles="manager-gui,admin"/>
</tomcat-users>

After deploying the wars, you'll see that Sesame Workbench is not working and gives an error like: java.io.IOException: Unable to create logging directory /usr/share/tomcat7/.aduna/openrdf-sesame/logs

You get this error because Sesame tries to write to home directory, but tomcat7 has no write access to that folder. You can simply solve the problem with this:

sudo mkdir -p /usr/share/tomcat7/.aduna
sudo chown -R tomcat7:tomcat7 /usr/share/tomcat7 

Once you restart the tomcat server with:

/etc/init.d/tomcat7 restart

And try to access: http://localhost:8080/openrdf-workbench

You'll see that it works! By default, Sesame comes with a System repository. And it is possible to create new repositories, delete existing ones, querying and so much. Open Sesame!!

Wednesday, November 30, 2011

XML (w/o) Higlighting in Latex + using it in a figure - 2

Well.. I had a style conflict with my previous solution. So I gave up using a highlighted version, but just an XML text (with correct tab indentations of course!). I also needed to put a frame outside my xml document, and got this I found a nice Latex package called "fancyvrb". With a simple "frame" attribute, it works great.. Hope it helps!..

\begin{figure}[htbp]
\begin{Verbatim}[frame=single]
<task id="..." performer="..." type="...">
    <name>...</name>           
    <description>...</description>       
    <params>
        <param type="..." name="..." datatype="..."/>
        .
        .
    </params>  
</task>
\end{Verbatim}
% \vskip
\label{fig:spec_task}
\end{figure}

Monday, November 28, 2011

XML Higlighting in Latex + using it in a figure

It's been a while that I did not have time to write something.. It doesn't mean that I don't have anything to write about.. and.. of course I have! :)

I'm busy with writing my thesis using Latex, it's sometimes a great tool to use.. And other times, you're getting really frustrated to achieve what you really wanna do!


This time I was trying to simply put an XML content in a table/figure or such, because I needed to refer to it later on in my thesis.. I cannot just put the content as it is.. If you are in trouble just like me, am sure you found two great XML highlighters: "minted" and using "listings" package. Both work like a charm, but the problem is when you wanna put XML content in a table/figure. Well, highlighting sucks in such cases.

One solution that I found is as the following:

\begin{figure}[htbp]
\begin{minted}{xml}
   <book isbn="978-0452284234"> 
      <name<Nineteen Eighty Four</name>
      <author<George Orwell</author>
   </book>
\end{minted}
\caption[XML Representation Example]{XML Representation Example}
% \vskip
\label{fig:xml}
\end{figure}

I did not try for "listings" package, but I think it will also work.. With this, you'll get a result as the following:
Photobucket

Hope it helps!..

Sunday, August 28, 2011

Format a disk with HFS+ using GParted on Ubuntu

If you have a Mac, it means that you always have trouble :P

You are using Ubuntu or any other linux dist, and have an external drive. You HAVE to format it with HFS+ because you want to use it with a Mac. Grrr...

No panic.. You are able to format your external drive using Ubuntu.. First thing to do is that you have to install "hfsprogs" package. Simply install it by typing the following in a terminal:

sudo apt-get install hfsprogs


Then, you can just use GParted to format your drive. Go to System > Administration > Gparted, select your external drive from the dropdown menu on the right. When you choose to format your disk/partition, you'll see "HFS+" as an option. Select it and wait a little bit. And.. Da daaa.. Now you can use your external drive with a Mac!

Hope it helps!.. Enjoy..

Python on the Fly Code Generator

Hey everyone,

I know that I'm not blogging for a while. It doesn't mean that I don't have anything to share :P
I'm currently working on my master thesis and I'm using Python for coding part. Today, I was looking for a python library to be able to generate python code on the fly. Of course, first idea is to create a file, adding imports, classes, methods and so on.. I only found a helper class written by Fredrik Lundh in this blog post.

I liked this idea and extended the code just a little bit. I want to work on a more complete library in few months. Do not forget to check my blog for the updates. And here is the simple class code:

#
# a Python code generator backend
#
# fredrik lundh, march 1998
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# extended by Nadin Kokciyan
# nadin.kokciyan@boun.edu.tr
#
import sys, string

class PyGen:

    def __init__(self):
        self.code = []
        self.tab = "    "
        self.level = 0

    def end(self):
        return string.join(self.code, "")

    def write(self, string):
        self.code.append(self.tab * self.level + string + "\n")

    def newline(self, no=1):
        res=""        
        i = 1        
        while(i<=no):
            res += "\n"
            i += 1
        self.code.append(res)

    def indent(self):
        self.level = self.level + 1

    def dedent(self):
        if self.level == 0:
            raise SyntaxError, "internal error in code generator"
        self.level = self.level - 1
Example Usage:
c = PyGen()

c.write("for i in range(1000):")
c.indent()
c.write("print 'code generation is trivial'")
c.write("print i")
c.dedent()

c.newline(no=5) # adding 5 new lines
c.write("print 'end of my code'") 
print c.end()
And the output is:
for i in range(1000):
    print 'code generation is trivial'
    print i




print 'end of my code'

Of course, you will create an empty py file and write this generated content to it.. Hope it helps!..

Thursday, May 19, 2011

JBoss 5.1.0GA with Ubuntu 10.04

That was the first time that I tried to install Jboss server on a linux platform(it doesn't mean that I installed it on a different OS :P). After downloading "installation and getting started guide", I started to follow installation steps and configure our server environment. I won't rephrase what is already written in the guide so I want to share some important points that may help you. 

1. Configure your java environment: If sun jdk is not installed on your system, you have to start with this step. 
  • DO NOT forget adding java related environment variables for your users. It is a good idea to set those variables within .bashrc files. Add those lines to your files:
    export JAVA_HOME=/usr/java/jdk_versionNo
    export PATH=$PATH:$JAVA_HOME/bin

    Update your java home path as you prefer.
  • DO NOT forget to update your java alternatives. Because it is possible that you have more than one java installation, and you have to tell your system which java version to use. Use the command:

    $ update-alternatives --config java

    Note: It is possible that you don't see your previously downloaded java version. In this case, you have to manually add this option using the command:

    $ update alternatives --install "/usr/bin/java" "java" "/usr/lib/Java6/bin/java" 1

    Parameters are respectively as the following: system-wide java command, for "java", your previously installed java installation path and priority. After adding this option, you can update your java version as described above.
2. Download JBoss: In my case, I downloaded binary zip file of JBoss 5.1.0GA, and extracted files to a folder.

3. Set the JBOSS_HOME variable: As we set java environment variables, this time we will set jboss related environment variables. You will edit .bashrc files of your users, and specify jboss home path by adding those lines:

export JBOSS_HOME=/usr/jboss/jboss-release_no
export PATH=$PATH:$JBOSS_HOME/bin
Update your jboss home location as you prefer. 

4. Test your installation: The most exciting part is this step :) Simply, you go to JBOSS_HOME/bin directory and execute "run.sh" script as the following:
$ ./run.sh
Note that you need to have privileges to execute this command. 

If everything goes well, go to "localhost:8080" page on your favourite web browser, then you will see a jboss welcome page. Good news! :) Note that instead of "localhost", you have to type "127.0.0.1" for some systems. 

If there is no other application using your 8080 port, and you work on a local machine, all steps described above will help you to set up your jboss server. I needed to work more on it because I did this installation on a server environment, thus I needed to start Jboss on a specific ip using 8080 as port number. Again you need to execute "run.sh" script but with additional parameters:
$ ./run.sh -b "ip_number"
That command will start Jboss server on this ip with the default port 8080. 

Everything is going well, we started the server without any problem. BUT.. Of course, we need additonal things!.. What if your system reboots? Jboss won't start because we didn't do anything about it. So let's work on a init script. This page helped me to do things right. 

5. Add an init script: In our JBOSS_HOME/bin directory, you will see some init script example files. I used "jboss_init_redhat.sh" as a template, modified jboss home, jboss user, java path, jboss bind address(-b parameter value) settings. Find this line:
JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"} and above this line insert this one:
JBOSS_HOST=${JBOSS_HOST:-"ip_number"} If not specified Jboss server will start on localhost. 

Then, rename this file as "jboss" and move it to your "/etc/init.d" directory.
  • DO NOT forget to make this script executable. And again, take care of user access rights as necessary according to your needs. 
  • Use this command to create necessary symbolic links for yout init script:
    /etc/init.d/$ update-rc.d jboss defaults
    Now your script will run on boot up.
6. Test and update your init script: Run the following command:
$ service jboss start
It works as expected, you can check it by opening "localhost:8080". But when trying to stopping the server, I had many errors and server didn't shut down.  This is because, we need to add "host" parameter to our shutdown command. Find the line beginning with "JBOSS_CMD_STOP" and update it as the following:
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown -s jnp://${JBOSS_HOST}:1099"} Bold text is the part that you have to add to this line. 

After this modification use those commands for following actions:
service jboss start --> start jboss server
service jboss stop --> stop jboss server
service jboss restart --> restart jboss server

7. (optional) Adding logging feature to your init script: Default server log files are included in:
$JBOSS_HOME/server/$JBOSS_CONF/log/ directory. JBOSS_CONF is default, minimal etc as you specified in your script file. By default, it is set to be "default". So I prefered to log init script logging in this directory, you can specify any other folder if you want. To add logging functionality to your script, update your script as the following:
JBOSS_CONSOLE="$JBOSS_HOME/server/$JBOSS_CONF/log/init_script.log" So you replace "/dev/null" by a real file. 

8. (optional) Upload your java project: After opening "localhost:8080" page, click on "Administration Console" link. Default user/pass is "admin"/"admin". You can use this page to manage your Jboss server. Go to "Web Applications" link and upload your project. 

If you want to change user settings, or add new users for administration console, you can simply edit ..server/configuration/conf/props/jmx-console-users.properties
..server/configuration/conf/props/jmx-console-roles.properties
files in your system.

Hope this blog post will help you. Enjoy it :)

Wednesday, March 30, 2011

Switching from Chrome to Firefox 4.0

For a while, I was using Chrome browser which was fast, fancy and easy to use. I haven't thought about switching from Chrome to another browser, before reading this post. I loved the idea to customize a browser. And it is true that, Chrome is not allowing its users to customize it in the way that users are comfortable with.

Also check this post, if you want to use Firefox title bar as the container of your tabs and window controls(close, minimize and maximize buttons). Note that this solution works for linux users.

At a first glance, I can say that Firefox 4 is as fast as Chrome now. Let's see, what is coming next..  Ohh.. Here is a screenshot from my Firefox 4:



(Click on the image above, to see a larger version)












Saturday, February 26, 2011

Setup Cisco VPN using VPNC Ubuntu 10.04

This post will help you to setup Cisco VPN on a linux distribution, Ubuntu 10.04 in my case. If you google about it, you will find many many solutions to setup it. I tried many of them, got frustrated then. And here you can find that solution which worked well for me, and I hope it will be useful for you too.

First of all, we need to install vpnc framework.

$ sudo apt-get install network-manager-vpnc

Then, browse to the vpnc installation directory as a root user.

$ cd /etc/vpnc

It's a good idea to create a configuration file once, then use it whenever you want to use vpn. "default.conf" file is the default configuration file that will be used by vpnc by default. So let's create this file.

$ touch default.conf

Now, you have to edit this configuration file with your favourite text editor. Put the lines below and modify bold text with your settings:


IPSec gateway hostName
IPSec ID groupName -- used for connecting to the hostname defined previously
IPSec secret groupPassword -- used for connecting to the hostname defined previously 
Domain domainName -- (optional) use a domain name if necessary
Xauth username userName -- used for authentication
Xauth password password -- used for authentication


And now we are ready to use our connection. Open a terminal and write that command.

$ sudo vpnc-connect

If everything goes well, we can see that our connection is established and running in background.


Connect Banner:
| Authentication OK
| Welcome on  VPN

| Don't forget to disconnect you at the end of your session!!!!



VPNC started in background (pid: 10351)...


As mentioned above, when you're done with that connection do not forget to disconnect you. You can do it using the following command:

$ sudo vpnc-disconnect

And you have to see something like that:

Terminating vpnc daemon (pid: 10351)


Note that the pid corresponding to this process is the same(10351 in my case), as expected. Otherwise it means that you killed a different process :P

You don't have to keep your configuration details in a file, you can just provide this information at run time, using the interactive mode of vpnc framework. For that, use this command:

$ sudo vpnc

And it will ask your connection settings, as mentioned above, and then, your connection will be established. You can use the same command to disconnect you at the end of your session.

Hope it helps..

Sunday, December 19, 2010

How to run Internet Explorer 6.0 on Ubuntu Lucid Lynx

Well, I am not a big fan of Windows and related Windows applications.. As you can guess, sometimes we need to run some OS dependent applications on different systems..

Wine is a quite popular "free" software to run Windows applications on other operating systems.. I can say that it works like a charm on Ubuntu..

Today, I needed to run Internet Explorer on my Ubuntu.. Of course, first thing to do is googling about it.. But as it is a common topic, I found many many entries about that topic.. Installed too many things, then deleted them.. And all this process took me a long time..

At the end, I realized that the solution was really easy.. He he.. And this is why I am writing these lines for you guys.. Here is how to do:

$ sudo apt-get install wine

And you have to install all the dependencies for that package.. Note that a package called "winetricks" is also installed.. and this is our "key" package! :)

After that installation, you are ready to install Internet Explorer 6..

$ winetricks ie6

Then you will be prompted by an installation window.. Just follow the instructions, it takes 10 minutes to have an Internet Explorer running on your linux distribution.. :)

Then create an application launcher for your browser. Note that command will look something like:

wine "C:\Program Files\Internet Explorer\IEXPLORE.EXE"

He he.. Then enjoy with your new browser.. Of course not always.. but when you need it!.. Arghh!..

Sunday, October 31, 2010

Ubuntu 10.10 on a Tablet PC: HP 2730p

If you have one of these cool Tablet PC's, you probably have a Windows operating system installed on it.. Don't you think that it is time to switch to a Linux distribution?.. And that was exactly what I had been thinking for a quite time.. I got bored of all Windows applications and its neverending problems.. Additionally, I'm the kind of person who is not able to use Windows Vista =) Sooo big time!..

First of all, there is always some risks to take.. because it is difficult to be sure, if everything will function properly or not.. Well, I thought of the worst case which is using that Tablet PC as a normal laptop PC without tablet functionalities =) Ok, this is still a big risk, but anyway I decided once and went for it..

Am a fan of Ubuntu, so I wanted to install Ubuntu 10.10(latest version for now) on HP2730p.. Everything went well, Ubuntu installation was completed in 15-20 minutes.. I didn't have any driver problems, so I was in the worst case now =)

After googling around, I found some nice softwares for Tablet PCs:
  • Cellwriter: It's a grid-entry natural handwriting input panel.. And I can say that it works like a charm.. After spending 5-10 minutes for the training part, it recognizes quickly your handwriting..
  • Xournal It's an application for notetaking, sketching, keeping a journal using a stylus. It's also a very nice application that you can use for taking notes.
I also configured Gimp and InkScape by enabling tablet input devices such as stylus, eraser and cursor; which is described in Ubuntu Community page.

Everything was fine, but I realized that I had some problems related to screen rotation.. because as an example, while reading an e-book, it is better to rotate the screen.. Googled about it, many solutions many scripts.. tried many of them.. some worked but not completely.. then, I combined some solutions and finally had that feature working..

I suppose that you have "wacom-tools" package installed, if not please install it first.. Then, type on a terminal:

$ xinput --list

You'll have an output similar to that one:

⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ HID 04b3:3107 id=10 [slave pointer (2)]
⎜ ↳ PS/2 Generic Mouse id=12 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)]
↳ Serial Wacom Tablet stylus id=15 [slave pointer (2)]
↳ Serial Wacom Tablet eraser id=14 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ CKA7240 id=9 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=11 [slave keyboard (3)]
↳ HP WMI hotkeys id=16 [slave keyboard (3)]

Important entries are represented as bold text.. Now, we will use this information to rotate the screen and related tablet input devices.. I modified these two scripts written by "Justin Linuturk Phelps", to have screen rotation functionality for my case..

1. laptopmode.sh
#!/bin/bash

xrandr -o normal && xsetwacom set "Serial Wacom Tablet stylus" Rotate none && xsetwacom set "Serial Wacom Tablet eraser" Rotate none
exit 0

This mode is your normal mode that you can use without tablet pc functionalities..

2. tabletpcmode.sh
#!/bin/bash

xrandr -o right && xsetwacom set "Serial Wacom Tablet stylus" Rotate CW && xsetwacom set "Serial Wacom Tablet eraser" Rotate CW
exit 0

This mode is your tablet mode that you can use with a screen rotation..

Replace bold texts, with the outputs that you get when listing inputs..

After saving these two files as scripts(with .sh extension), move them to /usr/local/bin folder and then, type in a terminal:
/usr/local/bin$ sudo chmod +x laptopmode.sh
/usr/local/bin$ sudo chmod +x tabletpcmode.sh

Now, these scripts are executable by the user.. It is easier to create application launchers, instead of running scripts from a terminal..
1. Right click on your Ubuntu panel, and choose "Add to Panel"..
2. Double click on "Custom Application Launcher", as a name type: "Laptop Mode" and as the command type: "laptopmode.sh". You can also change the icon of your custom application.
3. Click ok.

Do the same thing for "Tablet Mode" application launcher..

Finally, you have two icons on your panel that you can use to switch from Laptop Mode to Tablet Mode and vice-versa.. Hope this helps.. Thankfully, I made a good choice and it works perfectly.. Thanks to everyone who submitted useful information on web...

Thursday, August 19, 2010

How to install Ntop 4.0.1 on Debian

After a few months, I decided to write about something :)

I'm still in India.. And while I was working here, we had some problems related to our internet connection.. We think that someone is sniffing!.. So, we wanted to monitor network activity, and see what really happens.. While googling about it, I saw a tool called "ntop".. That was good, because you can use a web interface to monitor things instead of using a linux terminal..

We are currently using a debian system, so first thing we tried was to install it with:

$ sudo apt-get install ntop

Once it was installed(it took some time because of dependencies), I realized that the version was an old one(3.3..). So of course, I wanted to install the new version 4.0.1.. Our debian system was an old version.. Maybe this is why we suffered very much, I'm not sure..

First, I tried to install it by using the tarball archive provided by the site.. I have to say that ntop's installation script is not very user friendly.. You never know what you need as dependencies before running the command "./autogen.sh".. Each time that we tried to run the script, we needed more and more dependencies.. because I'm very stubborn, I didnt give up!.. and tried to install all dependencies.. even the version of python was a problem :)

ntop installation script will give an error because it cannot find RRD tool installed.., you need to have RRD tool installed.. And then, run the script again with rrd home parameter which is:

$ ./autogen.sh --with-rrd-home:/opt/rrdtool-1.4.x

this part is important.. by default, ntop tries to find RRD tool in /usr/local/rrdtool folder.. but if you try to install RRD tool using a tarball, after the configure, make, make install process, RRD tool is installed under /opt directory.. so do not try to give the /usr/local/rrdtool as a parameter :)

and other dependencies, that we came up with were libraries like "pixman, cairo, pangocairo, fontconfig, freefont and so on".. and these are only "few" ones.. And another missing dependency was "GeoIP".. that you need to install it from here.. Well, we were working on a virtual machine.. I untar the file.. Tried to configure.. but was never able to "make" it.. and the weird thing is that "the host machine" was turned off!.. yes.. we tried 2-3 times, and every time, because of the "make" command, the host machine was turned off.. so I was obliged to give up at this point..

After spending too many hours, I really wanted to run this new version.. So I wanted to try again :) This time, when I checked the ntop site, I realized the Ubuntu documentation on the homepage. So Ubuntu is based on a debian system, so I thought that this documentation can also be useful for us..

$ sudo apt-get install libpcap-dev libgdbm-dev libevent-dev librrd-dev python-dev libgeoip-dev

with this command, I installed all the missing dependencies in our system.. And instead of using a tar archive, I checked out ntop code from svn..

$ svn co https://svn.ntop.org/svn/ntop/trunk/ntop
$ cd ntop
$ ./autogen.sh

and it worked!.. yeah.. then:

$ make

Of course, I had some errors.. "./.libs/libntop.so: undefined reference to `pcap_parse'".. So that was errors related to compile process.. I reinstalled the libpcap0.9.7 library.. and then retried..

$ make

I've got new errors.. "error while loading shared libraries: libntopreport-4.0.1.so".. I checked my /usr/lib directory that was not there but under my /usr/local/lib.. then, I copied related libraries to /usr/lib dir..

$ cp /usr/local/lib/libntopreport* /usr/lib
$ make

Finally, that was compiled..

$ make install

and installed..

$ ntop -a

type an admin password.. and repeat the password..

$ ntop

now, ntop service is started.. you can use ntop 4.0.1 by using your browser: http://localhost:3000

Wednesday, February 10, 2010

Social Media's Power: Google Buzz

While I was reading my tweets, I realized that so many people were talking about Google Buzz. I had no idea before so I read some blog posts mentioned within these tweets. Than, I started to read Live Blogging from Google: Launch of Google Buzz. This blog is updated almost every five minutes and I can be aware of every little detail about Google Buzz. Unfortunately, I'm still waiting for Google Buzz to be activated on my Google account =)

I was curious to know the answer of a question: "What was the impact of Google Buzz on Social Media from the past until now". So I decided to analyze it on uberVu. This site is very useful if you want to search some keywords in social media such as Twitter, Facebook, blogs, sites etc. If you look at the results, you can see that the majority of conversations is on Twitter. Let's look at the distribution of tweets in last five days:

Date # of Tweets
Feb 5, 2010: 85
Feb 6, 2010: 26
Feb 7, 2010: 94
Feb 8, 2010: 119
Feb 9, 2010: 21 211 (it is still continuing!!!!)

You can find more details here.
It is amazing to watch users' reaction on specific topics. Thanks to real time search!..

Saturday, January 9, 2010

Cancer awareness via Social Networks

I don't know what you think about but I saw the power of social networks one more time in all around the world!.. If one tells you "be aware of cancer", it is not something very interesting.. But one day, every woman changed her status message on Facebook with the color of bra and everyone really wanted to understand what's going on, it is quite interesting!, at least for me =) Now, we all know that it is about "cancer awareness".

I googled for it, I found so many blog entries, so many tweets on Twitter, comments etc. Observing the domino effect on different Social Networking Sites is really amazing.. And this is what we call "Social Networking Madness", we are aware of everything! From now on, everyone is a Big Brother who is watching everyone else..

Be careful before sharing!

Watch this video: http://bit.ly/4ogtjw

Saturday, November 8, 2008

Sanal tehditler: Virusler!..

Virüsler, trojanlar, zararlı yazılımlar her tip bilgisayar kullanıcısının korkulu rüyası. Bilgisayarla aranız ne kadar iyi olursa olsun, bu meretler bir şekilde bulaşmayı başarıyor. Hele hele son yılların en popüler virüsleri, flash belleklere gömülü olanları. "Otomatik Kullan ve Çalıştır" komutunun aktif olduğu bilgisayarlarda, bu gömülü virüsler iş başına geçiyor. Bu konude en güzel tavsiye, "Otomatik Kullan ve Çalıştır"ı devreden çıkarmak, ve flash bellek içerisindeki dosyalara dikkatlice göz atmak, davetsiz misafirleri fark ettiğiniz anda ise onları yok etmek.

"Otomatik Kullan ve Çalıştır"ı, Windows XP'de devreden çıkarmak için, Başlat menüsünden Çalıştır(Run) uygulamasını seçin, "gpedit.msc" komutunu girin. Karşınıza gelen ekranda, Bilgisayar Yapılandırması(Computer Configuration) ve Kullanıcı Yapılandırması(User Configuration) bölümlerini göreceksiniz. Bu her iki bölümde de alt başlıklarda, Yönetim Şablonları(Administrative Templates)'nı göreceksiniz. Bu başlık altında bulunan Sistem(System) klasörüne tıklayın, ve sağ ekranda göreceğiniz "Otomatik çalıştır özelliğini kapat(Turnoff AutoPlay)" başlığına çift tıklayarak ayarı "Etkin(Enabled)" hale getirin.

Eğer güvenilirliğinden şüphe ettiğiniz, 10Mb'ın altında dosyalarınız varsa, VirSCAN sitesini tavsiye ederim. Bu sitenin arka tarafında çalıştırdığı popüler 39 tane kötü amaçlı yazılımlardan koruma programı var. Ve yüklediğiniz dosyaları bu programlar ile tarayıp size bilgi veriyor, hem de ücretsiz. Rar/Zip formatlarını da, içerisinde 10 dosyadan az bulundurması koşulunda taramadan geçirebiliyor. Belki size tüm bilgisayarınızı tarama imkanı sunmuyor ama tehlikeli bir dosyayı tarayarak sisteminizi büyük bir dertten kurtarıyor. Denemeden geçmeyin.

Saturday, September 13, 2008

DB2 9.5 ve Türkçe Dil Desteği

DB2 9.5 ürününü türkçe arayüz ile kullanmak için:

Windows Kullanıcıları:
----------------------
1. Control Panel > Regional and Language Options
2. Regional Options sekmesinde, Standart & Formats alanında dil Türkçe seçilir, Location alanında Türkiye seçilir.
3. Advanced sekmesinde, Language for non-Unicode programs alanında Türkçe seçilir, Default user account settings alanında checkbox işaretlenir.

Linux Kullanıcıları:
----------------------

1. '$locale -a' komutu ile sistemde yüklü olan diller görüntülenir.
2. bourne (sh), korn (ksh), ve bash kabukları için:

LANG=tr_TR
export LANG


C kabuğu için:

setenv LANG tr_TR

PS: LANG değişkeni birinci adımdaki değerlerden biri olmalıdır.

Sistem yeniden başlatıldıktan sonra DB2 arayüzünün büyük kısmı türkçeye dönecektir.

Bir veritabanı ile çalışılırken en büyük sıkıntı türkçe karakter sorunudur. Özellikle tablodaki veriler belli bir kritere göre sıralanmak istendiğinde bu sorun karşımıza çıkar. DB2'da bu sorunun üstesinden gelmek için şu yolu takip edin:

Windows Kullanıcıları:
-----------------------
CREATE DATABASE DENEME USING CODESET ISO8859-9 TERRITORY TR

Linux Kullanıcıları:
-----------------------
CREATE DATABASE DENEME USING CODESET ISO-8859-9 TERRITORY TR

Bu şekilde veritabanınızı oluşturduğunuz zaman, artık sıralamalarınızı ORDER BY ile yapabilirsiniz.

Sunday, July 20, 2008

MSN'lerinize dikkat edin..

Uzun zamandır açmadığım bir Windows Live ID hesabımın bugün online olduğunu gördüm. Şifreyi değiştirmek üzere sayfaya girdiğim zaman "Alternatif email adresi"nin "vantooz@hotmail.com" diye bir eposta yazıldığını gördüm. Şifrenizi değiştirmeden önce acilen bu adresi kendinize ait bir adres ile değiştirin. Sizden ricam accountlarınıza girip bu adreslerinizi tekrar kontrol etmeniz. Aksi takdirde değiştirdiğiniz her şifre bu bilinmeyen kullanıcılara da gönderilecektir.

Şifre nasıl ele geçirilmiştir bu da tabii ki ayrı bir olay. İnsanlar kişiye "sanal tecavüz" ederek ne kazanırlar bilinmez. Kafa çalıştırıp bir şeyler üretmek yerine, bu kafayı sadece kötülük yapmak, zarar vermek için kullanmak neden? Geçenlerde Mars'a Phoenix gönderildi tüm dünya bunu alkışlarken biz ne yaptık? Gittik adamların sitesini hackledik. Kafamız bu kadar çalışıyor =)

Güvenlik denen şeyin maskesi ardına saklanmış durumdayız. Kendimizi koruduğumuzu zannediyoruz ama her şey bir ilüzyon =) Welcome to the Matrix!..

Sunday, July 13, 2008

SQLJ vs JDBC <==> Static SQL vs Dynamic SQL

Java geliştirme ortamında veritabanına bağlanmanın 2 yolu vardır.

  1. JDBC ile

  2. SQLJ ile

SQLJ kolay kullanılırlığı, sağladığı yüksek performans ve daha güvenli olması nedeniyle tercih sebebidir.

SQLJ Geliştirme Zamanı:

SQLJ ile uygulama geliştirildiği zaman 3 ana evre vardır:

  1. Translator(sqlj):

SQLJ yapılan sentaks hataları derleme sırasında farkedilebilmektedir. Böylece hata ayıklamak runtime kısmına kalmaz. Bu evrede translator aracılığıyla sqlj kaynak kodu doğrultusunda Java dosyası oluşturulur.

  1. Profile Customizer(db2sqljcustomize): DB2 ile uyum sağlayan profilleri oluşturur. Online check özelliği sayesinde DB2 üzerinden sql sorgusunun doğruluğunu denetler(ilgili schema, tablo adları, sütun adları vs). Varsayılan ayar olarak db2sqljbind'ı çağırır.

  2. Profile Binder(db2sqljbind): Profile binder db2sqljcustomize tarafından otomatik çağrılabileceği gibi, isteğe bağlı da çağrılabilir. Bu etapta yukardaki evrelerde hazırlanan sorgu(lar) DB2 üzerine paket olarak gömülür.

SQLJ evreleri:

SQLJ Çalışma Zamanı:

SQLJ uygulamaları çalışma zamanında JDBC driver'ı aracılığıyla DB2'ya bağlanır. Uygulama içerisinde gömülü olan profil bilgisi (Profile Customizer evresinde oluşturulan) doğrultusunda DB2 içerisine gömülmüş olan ilgili paket kullanılır.

SQLJ'nin JDBC Karşısındaki Avantajları:

  1. Güvenlik

SQLJ kullanılan uygulamalar sonunda DB2 üzerine gömülen paketler aracılığıyla çalıştırılan sql sorguları statik sqldir. Statik sqlde yetkiler paketi yaratan kullanıcıya bağlıdır. Herhangi bir kullanıcı, DB2 üzerine gömülen paketlere erişemez. Erişmek için paketi yaratan kullanıcı yetkilerine sahip olunması gerekir.

  1. Performans

SQLJ kullanılan uygulamar sonunda DB2 üzerine paketler gömülürken içerisinde bulunan SQL sorguları optimize edilerek paket haline getirilmiştir. Dolayısıyla Dynamic SQL'de olduğu gibi, her SQL sorgusu esnasında önce sentaks kontrolu yapılması, ardından ilgili tablolar üzerinde authentication kontolu, ardından SQL sorgusunun optimize edilmesi etapları her seferinde tekrarlanmaz. Böylece SQLJ ile sorgulara kısa sürede yanıt alınır.

Statik SQL'de sorgu cümlesi bellidir. Yalnızca dışardan alınan parametreler değişiklik gösterir. Oysaki JDBC'de sorgular çalışma zamanına kadar belli olmadığı, yani dinamik olduğu için yukarda saydığımız etaplar her sorguda tekrarlanır. Bu yüzden de sorgulara uzun sürede yanıt alınır.

JDBC'de olası SQL hataları anca çalışma zamanında belli olur, oysaki SQLJ derleme sırasında bu hataların ayıklanmasını kolaylaştırır ve online check ile de çalışma zamanında karşımıza sorun çıkmamasını sağlar.

  1. Sentaks

SQLJ kolay bir sentaksa sahiptir. Bir kod SQLJ ile birkaç satırda ifade edilebilinirken, aynı kod JDBC ile bir sayfa uzunluğunda olabilir. Kısa kodun avantajı okunabilirliğin de rahat olmasıdır. Bu yüzden programcılar SQLJ'yi tercih ederler.