http://www.feed43.com
December 3, 2011I have been looking at a good website to create feeds. I tried a few like page2rss, feedyes etc. However, feed43 gives the maximum flexibility and best out put for your efforts.
How this works is very interesting. It tells me that I can setup one such utility site using wget, grep and a bit of php coding. This is how it works.
- Enter the url of the page that you want to convert to rss
- The site will retrieve the content and show you the html code
- Recognize the part of the page that you want to use. This is very useful as most pages will have some static and some dynamic content. This is done by identifying the start and end text and entering start_text{%}end_text
- Then, in a similar way, identify the start text and end text patterns for each news item within the above segment.
- Thats it, you are ready to go. However, the site creates a preview of items recognized using your inputs and allows you to optionally choose title, link and body of the rss feed.
The site has good help documents and you can get them by clicking on the ? next to each section. I created feed for MEA (Ministry of External Affairs, India) using this site. The details are below for those who want to try it
Global Search pattern: <div class=”newsListing”>{%}<div class=”footer”>
Item Search pattern: <span>{%}</span>{%}<a href=”{%}” class=”more”>{%}</a>
QT keyboard events
June 24, 2011Scenario:
I want to generate fake keyboard events and send to QWebView class.
Solution:
Extend this class to have slots for signals. Connect it to a signal that can pass an ascii character.
Issue:
Keyboard does not have ‘a’ and ‘A’. It only has an ‘A’. That means, I cannot directly send any lower case characters using the event (Which is not correct)
Solution:
The solution is simple. The constructor of QKeyEvent can take QString as one of its argument. The signature is as follows:
| QKeyEvent ( Type type, int key, Qt::KeyboardModifiers modifiers, const QString & text = QString(), bool autorep = false, ushort count = 1 ) |
Even if we don’t pass the QString, it will work. However, by passing the QString, we can control exactly what will be displayed.
This is how I create my QKeyEvent:
void MyWebView::rcvKeys(int k)
{
char str[2];
str[0]=k;
str[1]=”;
QKeyEvent *k=new QKeyEvent(QEvent::KeyPress,k,Qt::NoModifier,QtString(str),false,0)
//———–Pass it to postevent etc
}
}
Google fined USD 5 million for using patented code in Linux kernel
April 24, 2011Very interesting news. I am still not really sure if this is part of mainline. However, considering the fact that the holder was able to analyse the code and ascertain that it was there in the Google’s server’s kernel indicates it was surely there on the public domain whether it was a custom piece of code written by Google engineers or not. This is surely something very interesting thing to happen and it would be very interesting to see if Google takes it beyond district court and what exactly happens to this case at the end
/. link: http://linux.slashdot.org/story/11/04/21/2140249/Google-Loses-Bedrock-Suit-All-Linux-May-Infringe
Build error on Android rowboat
April 13, 2011The file “hardware/ti/sgx/GFX_Linux_KM/eurasiacon/build/linux/omap3630_android/kbuild/../../kbuild/Makefile.kbuild” need to be modified as follows:
Change “all %:” to
all:
(Build command)
%::
(Build command)
Fips opessl
March 5, 2011I was cross compiling this. The strangest thing about this is that it cannot be cross compiled. Because, they generate programs, run them, get signature from the programs and use that signature to compile them again!
I did that by little bit effort. What I am now looking at is the possibility of having it compiled inside qemu. Anyway, this is what I did
1. Configure for linux-ppc with compiler, prefix and ranlib specified during this step
2. Find and replace ar using powerpc ar in all makefiles
3. Make and when it breaks during sha1 calculation, replace the binary that does sha1 caculation with an x86 equivalent and complete this step
4. Make again and when it tries to execute openssl/tests, replace the necessary statements in fipsld with read function and supply the signatures for each program after taking them to target and running them there once
Well, another issue that I noticed with this package is that it does not behave well with parallel builds. I will post here again if I can compile this in Qemu. I am planning to use FC12 ARM/PPC for this.
Middle men
February 19, 2011OK, losers consortium has taken shape. But, what are they driving at? The whole discussion is centered around how to enable the service provider to be the middle man and extort money from poor end user. With what face is Nokia and RIM going to face end customers now? A smart phone today costs 20-30k (INR). After taking such huge amounts from end customer, they want to create means for the letting the service provider loot the customer! Shame on them.
May be your service provider is subsidizing your phone. However, that reminds me about the phones (LG-LSI110) that Reliance used to sell for 3K! I am pretty much sure that it didn’t have electronics and plastics worth even Rs. 1000. However, the phone came with the note that its cost is 10K and it is owned by Reliance. This was about 7 years back. I doubt there will be any change today. Anyway, would you prefer to get a smart phone at a subsidized cost when you pretty well know that this amount will be recovered from you through monopolistic practices of the service provider?
Well, I recently used a Galaxy tab to download and test an application (ZXing). The ability to customize your smart phone by pushing an apk to it after enabling USB debugging was probably the only reason needed for paying 30K for that device. Well, Nokia, go back and make some good Android phones and I will buy them (Yes, I would prefer to buy android from Nokia over any other vendor) when they become available.
Mozilla Dash
January 30, 2011Why?
- It is not intuitive enough
- Even after being a heavy internet user, I had to struggle to get back my tabs
- It does not show the url
- This might be a good thing that you can search and find links. But, how do I make sure that the search result is correct and I am on the expected link? This is a problem especially when I am on sites that do financial transactions.
- The UI was not up to the mark. I could see that the fonts of menu items were cut at bottom half
.PHONY
January 24, 2011I created the following files and folders while doing this:
[root@sarin prelink]#ls -l
total 20
drwxr-xr-x 2 root root 4096 2011-01-24 11:14 bin
drwxr-xr-x 2 root root 4096 2011-01-24 11:14 lib
-rw-r–r– 1 root root 57 2011-01-24 10:41 libutil.c
-rw-r–r– 1 root root 273 2011-01-24 11:14 Makefile
-rw-r–r– 1 root root 343 2011-01-24 10:56 prelink.c
[root@sarin prelink]#cat Makefile
all: binlib: libutil.c
gcc -shared -Wl,-soname,libutil.so -o lib/libutil.so libutil.cbin: lib prelink.c
gcc -L/root/c/prelink/lib prelink.c -Wl,-rpath,lib -lpthread -lutil -o bin/progclean:
rm -f lib/libutil.so bin/prog
Now, I did a make clean and did a make. Nothing happened. I got the message that “make: Nothing to be done for `all’.”. If you notice, in the make file, target all had a dependency on ‘bin’. Target ‘bin’ was dependent on target ‘lib’. So, I was expecting that lib will be built first and then bin. But, It did not even try to build bin (I verified this by putting an echo in bin). After a long struggle, I found the reason.
As you can see, ‘bin’ and ‘lib’ were the names of two folders inside the current directory. So, make assumed that targets ‘bin’ and ‘lib’ where those folders. As these sub-folders were already present in the current folder, it assumed that there is nothing to be done for target all.
This is the issue that .PHONY target fixes. It clearly tells make to avoid looking at files and folders for these names. I added the following line to the top of the makefile.
.PHONY: all bin lib
Thats it, I was able to compile the program using my makefile!
Kernel oops
January 21, 2011LR: This register holds the address to which PC will be set to once you hit return. This simply means, this is the caller of the function where the trouble occurred.
The point where failure happened can be seen by looking at PC. Also, SP points at the current stack location. When I scrolled down, I could see some good back tracing information too.
plymouth
January 13, 2011I have been looking for the source of rhgb and I was not able to find this source. Today, I somehow wanted to find this out and spent some time with yum. Eventually I found that this comes with plymouth (for Fedora-12). I am yet to find out how these two are related. I could see this:
1. There is a /usr/share/plymouth folder
2. The themes are present in this folder
3. There is a default.plymouth file which tells which is the default theme
4. plymouth uses png files to create animation
5. There is a text theme that can be (seems to be) altered easily by changing the ply-text-display.c (Needs to verify this)
Well, more on this after I play with this a bit more.
Update-1: Plymouth starts from initrd itself. So, modifying the stuff on the root file system will not help much. It has to go to initrd. I was able to change default.plymouth link in initrd and change from charge theme to text theme without much issue.
Update-2: While working with initrd, I found that fedora is now using darcut instead of old initrd. Will write about it later when I get some time to study it.
Update:
I tried modifying and recompiling the plymouth (version 0.8.0) and tried it on Fedora 12. The file that was modified was ply-text-progress-bar.c. The file can be found in src/libplybootsplash folder inside the plymouth package. I changed two functions get_os_string and ply_text_progress_bar_draw. The first function is very custom made function to read /etc/system-release file and get the OS name and version (Fedora 12). So, though modifying /etc/system-release might work in general, it is simpler to modify the function itself. The second function decides the colors of the progress bar and also the background and foreground color of the OS string. I modified the colors there so that the effect can be seen easily.
The code was compiled and I found that the o/p is present in src/libplybootsplash/.libs/libplybootsplash.so.2.0.0. This was copied to /usr/lib of initrd and I recreated initrd using this command
find . | cpio -H newc -o > ../ply-test.img. Later I gziped it and moved it to /boot (gzip -9 ply-test.img && mv ply-test.img.gz /boot/ply-test.img). I also modified grub config to create a new entry with this initrd. Once I rebooted, I could see the changes in the plymouth screen.
I am currently thinking if I should use this or I should use some graphical theme. May be changing a few functions, I can change the logic of drawing this progress bar and draw some other pattern. But, for changing a graphical theme, I may only have to change the images and that might have a better effect too. Anyway, plymouth seems to be in control and I will now move to something else. I want to revisit the qemu as I found that it is taking about 10 times more resources compared to vmware. I will see if using the qemu from android project gives me any advantage or not.