Tuesday, 16 August 2011

Linux Tips

Add Ubuntu to windows server 2003 Active Directory Domain

#Install likewise-open in Ubuntu Hardy
sudo aptitude install likewise-open-gui

sudo domainjoin-cli join anjani.com.np Administrator

sudo update-rc.d likewise-open defaults

sudo /etc/init.d/likewise-open start

#Remove from the windows Domain

The domainjoin-cli utility can also be used to remove from the domain.

sudo domainjoin-cli leave


#Allow Active Directory Domain Administrators to Administer Ubuntu

This will allow members of the Domain Admins AD group to issue sudo commands. From a command prompt

sudo visudo

Add this line to the resulting file

%YOURDOMAINNAME\\domain^admins ALL=(ALL) ALL

#ADD AD Group to sudoers list

%YOURDOMAINNAME\\groupname ALL=(ALL) ALL


#how to add user to sudoers list?
adduser

adduser anjani sudo

Check Disk Space Usage on Ubuntu


#df-h

Bash Shell Command to Find or Get IP address

$ /sbin/ifconfig



How to turn off, restart, and shut down Linux.
Answer

Shutting down / rebooting the computer from the shell / command line

Below is a listing of each of the commands that will enable a user to shut down, turn off, reboot, etc. their Linux computer from the command line. Users can find additional information about each of the commands by clicking the link.

halt
poweroff
reboot
shutdown

To list the users:


cat /etc/passwd | cut -d":" -f1

How to remove non-empty dir
ectory?

rm -rf epoints

Sunday, 14 August 2011

London Riot

Devon and Cornwall Police return from London riots
Nearly 30 Devon and Cornwall officers return from London Returning officers described facing fires, gangs and looters
Continue reading the main story
England riots

* Tottenham's return to normality
* The LA model Cameron is copying
* How courts deal with rioters
* Dangers behind riot rumour mill

Twenty-seven officers from Devon and Cornwall Police seconded to help deal with rioting in London have returned to their own force area.

The officers returned on Friday after assisting the Metropolitan Police, the Devon and Cornwall force said.

But another team of 27 has been sent to replace them, it added.

Further teams of 27 each were to remain on duty in Bristol and in Gloucestershire over the weekend, Devon and Cornwall Police said.
'Gangs in the hundreds'

Describing what they faced in London, Sgt Kevin Roberts said: "There were buildings being set on fire, there were cars being set on fire.

"There were looters going around in gangs in the hundreds, and they were attacking the police and attacking members of the public.

"That was the type of things we were facing when we arrived."

There were no reports of any injuries to the team.

Officers were also continuing high-visibility patrols throughout Devon and Cornwall over the weekend, the force said.

The patrols have included the deployment of 200 members of the force's 650-strong special constabulary.

Ch Supt Steve Swani, of Devon and Cornwall Police, said: "We continue to see no incidents of disorder and the intelligence picture is suggesting no reason for anything to happen.

"We remain vigilant and our officers, working with the special constabulary, will be out in force over the weekend talking to communities and reassuring them wherever possible."

He said the force was continuing to monitor social networking sites and reinforced that officers would take action against anyone posting material likely to incite crime or disorder.

Both home football games involving Plymouth Argyle and Exeter City went ahead as planned.