Reinstall GRUB and restore Windows XP / Windows 7 / Windows 8 menu entry in GRUB on GRUB error: unknown filesystem, grub rescue while partitioning a drive

I use two operating system in a single pc. One is WINDOWS and another one is UBUNTU. I was using windows and partitioned a drive and restart. Suddenly my GRUB ( boot menu ) just vanished and showing the message “ unknown filesystem, grub rescue ”. My fellow colleague Tanzim helped me a lot to resolve the situation. We reinstalled the GRUB and it worked fine. Every file and folder, filesystem were intact. What I lost, the windows selection menu in boot menu. We searched the INTERNET and found a way to load the windows selection menu again in the boot menu. Let me show the way to do it.

First Reinstall the GRUB.

For this you need a UBUNTU live cd or UBUNTU image on a pendrive.

a. insert the cd or pendirive, restart the pc and select the boot device as pedrive/cd

For Ubuntu grub rescue follow these steps:
1.Boot from the Ubuntu Desktop live CD.

steps by steps installing ubuntu 1

2.In Live Desktop session open terminal.
Application ->Accessories->Terminal.

3. In Terminal tpye sudo fdisk -l
It will display all partiton of the disk.

Grub rescue install

The partation which have Linux under System column is your drive in which ubuntu linux is installed. In screenshot ubuntu partition drive is /dev/sda11.

4. Mount the ubuntu partition drive
sudo mount /dev/sdXX /mnt(example ‘sudo mount /dev/sda11 /mnt’ ,don’t miss the spaces.)

5.Only if you have a separate boot partition:
sudo mount /dev/sdYY /mnt/boot.

6. Mount the virtual filesystems:
sudo mount –bind /dev /mnt/dev
sudo mount –bind /proc /mnt/proc
sudo mount –bind /sys /mnt/sys

7. To ensure that only the grub utilities from the LiveCD get executed, mount /usr
sudo mount –bind /usr/ /mnt/usr
sudo chroot /mnt

8. If there is no /boot/grub/grub.cfg or it’s not correct, create one using
update-grub
or update-grub2

9.Now reinstall Grub
grub-install /dev/sdX(eg. grub-install/dev/sdaDo not specify the partition number.

10. Verify the install
sudo grub-install –recheck /dev/sdX

11. Exit chroot : CTRL-D on keyboard.

12. Unmount virtual filesystems:
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys

If you mounted a separate /boot partition:
sudo umount /mnt/boot

13. Unmount the LiveCD’s /usr directory:
sudo umount /mnt/usr

14. Unmount last device:
sudo umount /mnt
15. Reboot.
sudo reboot.

This should reinstall your grab, but you might not see the windows menu right now
what your need to do is as following
from your terminal

1. sudo apt-get install os-prober
2. sudo update-grub
3. reboot
sudo reboot

Hope it will restore your windows name in boot menu.

Getting data using doctrine in symfony by leftjoin

For leftjoin you must remember the relationship between classes in doctrine in schema file.

I have used schema.yml file for my database and its relationship with tables, for example I am give only two tables definition
sfGuardGroup:
actAs: [Timestampable]
columns:
name:
type: string(255)
unique: true
description: string(1000)
relations:
Users:
class: sfGuardUser
refClass: sfGuardUserGroup
local: group_id
foreign: user_id
foreignAlias: Groups
Permissions:
class: sfGuardPermission
local: group_id
foreign: permission_id
refClass: sfGuardGroupPermission
foreignAlias: Groups

sfGuardUserGroup:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
user_id:
type: integer
primary: true
group_id:
type: integer
primary: true
relations:
User:
class: sfGuardUser
local: user_id
onDelete: CASCADE
Group:
class: sfGuardGroup
local: group_id
onDelete: CASCADE

Table look lie this ( I have added some data)

sf_guard_group

id   name   description
1     admin       –
2    vendor     –
3     user         –

sf_guard_user_group

user_id    group_id
1                      1
2                     3
3                     3
4                     3
5                     2
6                     2
7                     3

Now you want fetch group name by sf_guard_group table. If you look at relationship you will find that there is a relationship name Users

I have written a function in sfGuardGroupTable.class.php [ you will get it while you build the tables ]
public function getGroupName(){
$q = Doctrine_Query::create()
->select('sgg.name')
->from('sfGuardGroup sgg')
->leftJoin('sgg.Users gs');

$q->setHydrationMode(Doctrine_Core::HYDRATE_SCALAR);

 

echo $q->getSQLQuery();
return $q->execute();
}

you will get the answers like this if you call in respective scope

$groupid = Doctrine_Core::getTable(‘sfGuardGroup’)->getGroupName();

echo “<pre>”;

$groupid = Doctrine_Core::getTable(‘sfGuardGroup’)->getGroupName();

print_r($groupid);

 

Array
(
[0] => Array
(
[sgg_name] => admin
)

[1] => Array
(
[sgg_name] => client
)

[2] => Array
(
[sgg_name] => client
)

[3] => Array
(
[sgg_name] => client
)

[4] => Array
(
[sgg_name] => client
)

[5] => Array
(
[sgg_name] => vendor
)

[6] => Array
(
[sgg_name] => vendor
)

)

Some useful url:

http://www.doctrine-project.org/documentation/manual/1_2/en/dql-doctrine-query-language#join-syntax:on-keyword

Starting with symfony framework in windows platform especialy with httpd

It is always exciting to learn new things. I have started to learn the  symfony framework. It was bit tough for me to setup the framework. But after a lot of pain I have successfully loaded it into my web server root. I want to share some of my problems and way to solve those problems.

You will find lots of books in the website for learning the framework. Though someone told me that it would be hard for me to learn this framework. Don’t really know about the learning curve of this framework.

learning book site : http://www.symfony-project.org/doc/1_4/

I am following the book:  http://www.symfony-project.org/jobeet/1_4/Doctrine/en/

Now few things,

1. You must set your php directory in your windows environment variable.

2. If your web root directory doesn’t support do it in your php.exe folder like: d:/xampp/php

3. While setting it up from command prompt remember you directory, the book might have some other directory

4. Its better to run the command from php.exe file containing folder

5. For getting help or know better from symfony installed components

d:\xampp\php> php lib\vendor\symfony\data\bin\symfony

6. I have changed my httpd.cof like this

# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
DocumentRoot "D:\xampp\php\sfprojects\jobeet\web"

DirectoryIndex index.php
<Directory "D:/xampp/php/sfprojects/jobeet/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf "D:\xampp\php\sfprojects\jobeet\lib\vendor\symfony\data\web\sf"
<Directory "D:/xampp/php/sfprojects/jobeet/lib/vendor/symfony/data/web/sf">

AllowOverride All
Allow from All
</Directory>
</VirtualHost>

7. Dont forget to restart your Mysql after changing httpd

Trace Route & Trace Route Locator

For trace route you just need to do the following steps

1. go to start menu and click on run

2. type cmd and press enter

3. type tracert ‘site name’ and press enter, for example –> tracert zeasite.com

You will find the hops and ip addresses of your site routes. Now if you want to locate them there is a very useful site whose link is http://www.geobytes.com/TraceRouteLocator.htm. Just copy your trace route from your command prompt window and paste to the above page, it will show the location. Now you might have the problem to copy the text from the command prompt window. Follow the procedure to copy from the command prompt window.

1. Right click on the menu bar of command prompt window (blue bar)

2. There you will find a option named edit, where you will find a sub menu option named mark, click on that.

3. Now drag the portion you want to copy with mouse and then again right click on the command prompt menu bar and go to edit option and select copy (you can drag for one time only, so if you miss it you need to do the copy process again). Now you can paste it anywhere you want to.

Top 100 sites in Bangladesh

Find the top 100 sites in Bangladesh in the following link from alexa.com

Bangladesh –> http://www.alexa.com/topsites/countries;0/BD


10 things you should do to a new PC before connecting it to the Internet

Takeaway: A Microsoft Windows PC that has not been updated for security vulnerabilities will be compromised by some from of malware within minutes of connecting to the Internet. Take steps to protect yourself before you start Web surfing.

Click the following link for details:

http://i.techrepublic.com.com/downloads/home/10_things_new_pc.pdf

The 10 biggest mistakes IT managers make


1: Focusing on technology and not the business

The typical IT manager comes from a technical background in either infrastructure or development. Based on their technical roots, they tend to focus their efforts in their expertise when in fact they should be looking for ways to support, enable, and improve the business. To be successful, IT managers must become business leaders and turn their focus and expertise to business issues and problems first.

2: Thinking “out of sight is out of mind”
It’s important to remember that in IT, no news is not good news. IT managers tend to trudge along without ever looking at their progress. The most powerful task you could ever do is an assessment. There are several ways to do this. You can do a SWOT (Strengths, Weaknesses, Opportunities, and Threats) analysis or you can do a full-blown formal IT assessment. You might even use a scorecard system to track where you are as a department. You can download a free scorecard developed specifically for this purpose.

3: Thinking that your team has it covered
In the TV show The Apprentice, so many teams ended up in the boardroom because the leader delegated a job but didn’t follow up to make sure it was done right. Following up is not micromanagement. It’s your job as a leader to ensure that the task gets done correctly.

4: Not inspecting what you expect
This mistake has its roots in mistake number 3 but can be carried forward into other aspects of IT. For instance, you could possibly expect great performance out of your servers but may not have a system to make sure they’re running at peak capacity. This ultimately leads to poor planning, budgeting, staffing, etc. If you want to avoid this common pitfall, make a comprehensive list of expectations for your entire department. This could include critical projects, network and server performance, client satisfaction, etc. Double-check the list to make sure you are inspecting all expectations on a regular basis. Keep a checklist or develop a daily disciplines worksheet to follow everything that needs daily inspection.

5: Not creating a partnership with business management
I find a great deal of IT managers reporting to operations and finance personnel instead of presidents and CEOs. The only way IT can be an effective and strategic element to business is through partnership with business executives. You must lead and influence your reports, peers, and leaders to have a maximum impact on the organization. The quicker you can get on the leadership team, the quicker you will have the ability to execute on number 1.

6: Burning yourself out
I can’t tell you how many IT managers I coach who have not had vacations in a year or longer and routinely work more than 70 hours per week. This is not only a mistake, but it’s a formula for disaster. Sometimes the thinking is that your business can’t live without you. The truth is, your business cannot live with you burning yourself out. It only leads to lowered productivity and, eventually, your giving up or getting disgruntled. Do yourself, your business, your employees, and your family a favor and take some time off.

7: Not testing your backup solution
I always tell my new IT managers that one of the most important aspects of their jobs is ensuring a reliable backup. Breakdowns in technology hardware are inevitable. The next best thing is fault tolerance, but I have even seen that fail. Don’t think for a minute that if you have tapes and if everything looks okay in your system that everything is okay. Make sure you test backups regularly. Do test disasters and make sure you can recover.

8: Not asking for help
Too often, I’ve seen costly mistakes made by managers and technicians who try to solve an issue alone without informing anyone or even reading the manual. This is a costly mistake. If you get in over your head, do the right thing and seek help. The key to successful IT management is not knowing the right answers; it’s being able to find them and execute a solution as quickly and cost effectively as possible. Don’t hesitate to bring in the experts where necessary.

9: Not devoting time to personal development
There’s no excuse for this mistake. Personal development is not your company’s responsibility — it’s yours. I can always tell a person’s success potential by the last five books they’ve read and by the seminars they attend. Every IT manager should be devoting at least 30 minutes a day to personal development. The truly successful devote even more — in some cases, upwards of two hours or more per day. The most common excuse I hear is the lack of time or money. The answer lies in the successful management of money and time.

10: Not finding a mentor or coach
The quickest route to success is to find someone who has been there and then emulate that person. The quickest road to pain, hardship, and failure is to go the journey alone. Whether you’re in management or not, you should always have a mentor or coach and you should always be mentoring or coaching someone else. A coach will help you achieve more than you could by yourself by imparting wisdom, accountability, and crucial advice where necessary. By coaching or mentoring someone else, you’re doing the same, but you’re also solidifying your own concepts by teaching them to others.

source: http://blogs.techrepublic.com.com

2009 IT Skills and Salary Report

2009 IT Skills and Salary Report

http://i.t.com.com/i/tr/downloads/home/2009_SalaryReport.pdf

Memory Speeds and Compatibility

Here goes the link for Memory Speeds and Compatibility

http://www.crucial.com/support/memory_speeds.aspx

ctrl ( control ) D in debian ( linux )

Sometimes we face the problem of control D in debian. In this scenario you must unmount all the drives of your hard disk then you need to go through file scan for recovery and fixation.

1. Give the root password
2. fdisk – l
It will show all the partitions of your hard disk
controld2
this is my hard disk, you might have lot more or less

3. Now you need to unmount all of the partition, command is as below
umount /dev/sda1
..
..
umount /dev/sda5

4. Now run file scan, command is
fsck

you might have to press y for several times for fixing the errors. After completing the fsck restart the machine

5. init 6

←Older