Friday, April 05, 2013

Friday, March 29, 2013

#HACKATH0N [2.5]: Meet up of the Backbenchers

Mark this day, an example of destiny. Only the backbenchers of the BD-LFS group met up today. Somehow the good boys didn't show up. Robin Bhai had leg pain due to dancing rehearsals. Kabir Bhai had set foot for the meet up only to find himself hurt in the leg and returning home. We almost thought today should be announced "Leg Injury Day" but didn't do so because Tapan bhai didn't show up without reporting any leg injury. All in all we just had one mentor #R!NE to lead us to the same level as the regular good guys.


We ended up doing the things that #Hackathon-2 had left us with. Me and RINE were not present in that due to personal issues. So, I just made the best use of this day to improve my knowledge and sync up with the rest of the group.

Initially we had problems regarding VM setup which was almost dragging us towards failure. But somehow, by the hand of God we recovered from that state after me, Rahid Bhai and Mamun Bhai managed to build the systems up. We ended up creating the LFS system's base camp for compilation and tool sets. It was fun and in between Rine was helping us understand the concepts that were in play with what we were doing.

We shared a lot about our experiences with different OS setups. I liked the way we shared knowledge about shells. Came to know about some of those from Mamun bhai.

Particularly, the venue this time was Sphinx Corporations. Shihan Bhai's new software company. We had a great venue indeed since the sitting arrangements allowed us to really enjoy the mash up. The lunch was fun too since there was great gossip and knowledge sharing. All in all it was awesome, for the Backbenchers ;p

Participants:
1. Tafhim (Me)
2. Rine (Rine Toufique Anam)
3. Mamun bhai (Abdullah al Mamun)
4. Rahid bhai (Rahid Hasan)
5. Aman bhai (Md. Aman Ullah)

Topics covered:
1. Preparing LFS Partition
2. Setting up LFS usergroup and account
3. Compiled BinUtils (First phase)
4. Compiled GCC (First phase)

Issues:
1. VBox machine setup [20 GB Partition, 2 GB swap, 8 GB Host OS, 10 GB LFS Partition
2. Dependency resolving issue during G++, GAWK, BISON installation. Fixed by choosing an Australia based server. Even though using "Choose the best server" solved the slow download issue but it doesn't always choose a repo that can resolve all dependencies. We tried different repos and had zero dependency issues of packages using Australian servers.
3. In case of slow download speed of packages you should change your repo and choose a good one using Synaptic
4. We primarily came to a unified decision to arrange the next Hackathon atleast 1 and 1/2 months from today so that all of us can complete the LFS book before that.


Target of the next Hackathon (3): Start [B/C]LFS

Friday, February 15, 2013

[UVa] 10926 - How many dependencies

#include <cstdio>
#include <iostream>

using namespace std;

#define init(n) { for (int i=0 ; i<=n ; i++) { visit[i] = false; for (int j=0 ; j<=n ; j++) adj[i][j] = adj[j][i] = false; } }

int n, dep[200], root[200], adj[200][200];
bool visit[200];

int dfs_visit(int s, int src) {

    root[s] = src;
    dep[s] = 0;
    for (int i=1 ; i<=n ; i++) {
        if (!visit[i] && adj[s][i]) {
            visit[i] = true;
            dep[s] += (dfs_visit(i,src)+1);
        }
    }
    return dep[s];
}

void dfs() {

    for (int i=1 ; i<=n ; i++) {
        for (int j=0 ; j<=n ; j++) visit[j] = false;
        dfs_visit(i,i);
    }

}

int main( void ) {

    int t, x, maxdepi, maxdep;

    while (scanf("%d",&n)==1 && n) {

        init(n);

        for (int i=1 ; i<=n ; i++) {
            scanf("%d",&t);
            for (int j=0 ; j<t ; j++) {
                scanf("%d",&x);
                adj[i][x] = true;
            }
        }


        dfs();

        maxdep = -1000;

        for (int i=1 ; i<=n ; i++) {


            if (dep[i]>maxdep) {
                maxdep = dep[i];
                maxdepi = i;

            }
        }

        printf("%d\n",maxdepi);

    }


    return 0;
}


Friday, February 01, 2013

XEN Hypervisor

This is something that I want to do in future with my system. Currently can't do it cuz I don't have the Hardware :S But I will :) [ http://forums.linuxmint.com/viewtopic.php?f=42&t=112013 ] [ http://blog.xen.org/ ]

How to Uninstall Linux / Remove GRUB / Go back to hell

Many users, mostly pretentious Linux enthusiasts come to me and ask "How to uninstall Linux". Apart from trying my best to hide my disgust (personal reasons, no offense), most of the time I answer like "It's hard to make you understand the process". Today when I was browsing the "How to" section of my favorite distro, I stumbled upon a collection of methods to do this. Here's the link:
[ http://forums.linuxmint.com/viewtopic.php?f=42&t=98051 ]
Directly quoting them in case the link becomes inactive when the info is needed. Method 1: Let me begin by saying I think Mint 12 is a terrific OS, which I am using on several computers. But I have computers on which I use Music Bee in Windows 7 for my music files and want direct boot to Windows without any disk space devoted to Mint. I spent several days looking at complicated instructions for removing Grub and finally accidentally discovered a simple solution, which is as follows: In Windows, download Partition Wizard at http://download.cnet.com/MiniTool-Partition-Wizard-Home-Edition/3000-2094_4-10962200.html. Install. Partitioning will be blocked by Grub. But on your left hit Rebuild MBR. This will take only a few seconds. Reboot, and Windows 7 will boot. Then you can go into Partition Wizard and eliminate the Ubuntu partitions and expand your Windows data partition to take up the freed up space.
Method 2: 1. Boot-Repair iso burnt into a CD will boot and, if you opt for fix mbr, then only windows will boot, provied Windows is on the first partition, of course. Partitions are not deleted.

Download site:
https://help.ubuntu.com/community/Boot-Repair

2. Another way, from Windows itself, run the free windows utility called mbrfix.

I used both, and both work great.
Method 3: Much easier way: Remove Grub bootloader using LILO.

1. Open terminal and run commands

sudo apt-get update
sudo apt-get install lilo
sudo lilo -M /dev/sda mbr # assuming that grub is installed to disk sda

A video about removing: http://www.youtube.com/watch?v=oB8NVzkgdEA&feature=plcp
Note: This method might need a Live Boot

Sunday, January 27, 2013

[Fix] Codeblocks-Contrib install problem (libhunspell)

When you're installing Code::Blocks contrib packages using apt, at some point you might face the issue of unsatisfied dependencies for
libhunspell-1.2-0
valgrind
cccc
cscope etc...
Even though you can install all the other packages manually using just the names provided in the error messages you cannot install the libhunspell package. There's an obvious reason for this. It's not in any Ubuntu repositories. To address this issue, you have to do as follows
1. Go to [ http://packages.debian.org/squeeze/libhunspell-1.2-0 ]
2. Download the .deb package for your respective architecture.
3. Using Terminal, go to the directory where you stored the .deb file and install it using
sudo dpkg -i <package-name>.deb
4. Now go for installing the Contrib package again, it should go smooth.

[Fix] Linux startup problem after installing VMWare 9

VM Ware has released a version for Linux. Its' a shell script installing the files in your / (root). While installing the application at one point it might output a black screen with all sorts of error messages. This is most likely caused by a conflict with the new kernel (version 3.5). It has been fixed but how do you fix your setup?? Well, following this method and combining a live setup (USB, SD Card, Live CD/DVD) we can address the issue. Follow the instructions below.

1. First make a Live setup of your distribution or one of similar kind. I used Linux Mint 14 with KDE on a SD Card.
2. Boot into the Live setup.
3. Log in as root [ type { sudo su } and type your root password ]
4. Locate your setup's root drive (the one with the mount point / in your original setup) and mount it. It will be assigned a mount point most probably using a UUID, note that down. You'll find that in /media of your Live setup. What I did as find a unique part of the mount point's name and used it with { grep }. So, my mount point was /media/d4324-32d43-4242 and I used { ls | grep "d4324" }. You can ignore it and use the name provided directly.
5. Now use
/media/$(ls /media/| grep "d4324" )
before every directory mentioned here. Or you can ignore the
/media/$(ls /media/| grep "d4324" )
part and instead use
/media/<your-mount-point>
directly.
6. Do these in the sequence
cd /media/$(ls /media/| grep "d4324" )/lib/modules/<your-kernel-version>/misc
# Note: If you have multiple kernel directories in the /lib/modules/ directory do the following for each one of them. If the files are not found in any kernel directory, ignore and go on with the commands.
mv vm* /tmp
cd /media/$(ls /media/| grep "d4324" )/proc/modules/
rm vmnet.o
rm vmmon.o
rm vmci.o
rm vmblock.o
rm vmppuser.o
rm /media/$(ls /media/| grep "d4324" )/etc/rc2.d/*vmware*
rm /media/$(ls /media/| grep "d4324" )/etc/rc3.d/*vmware*
rm /media/$(ls /media/| grep "d4324" )/etc/rc5.d/*vmware*
rm /media/$(ls /media/| grep "d4324" )/etc/rc6.d/*vmware*
rm -rf /media/$(ls /media/| grep "d4324" )/etc/vmware*
rm /media/$(ls /media/| grep "d4324" )/usr/bin/vmware-usbarbitrator
rm /media/$(ls /media/| grep "d4324" )/usr/bin/vmnet*
rm -r /media/$(ls /media/| grep "d4324" )/usr/lib/vmware*
rm -r /media/$(ls /media/| grep "d4324" )/usr/share/doc/vmware*
After that, try booting into your system. If all has gone well, you should be leaving a breath of relief.

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...