Subscribe in a reader

Posts Tagged “ubuntu”

I don’t know why Ubuntu is so careless with the admin stuff. First of all, you can’t login as root by default. You have to set up root password by doing ‘passwd root’ (this is what I love about OpenSUSE, you have a root user and a normal user, you can login to the root user GUI also and do stuff). And by any chance, if you forget to do that and you’re locked out of the system or your default user’s admin previliges have been taken away (exactly what happened with me), you’re kinda doomed.

Well, not exactly. Ubuntu is kinda carefully-careless with this stuff. It punishes you when you are being careless, but provides you with some open doors to pass-through. So, as they say, you should not edit a /etc/sudoers file by hand and save it and do it with the ‘visudo’ command so that it checks the syntax, creates a backup file and then replaces it. Even if you have done all these steps by hand, and you just replace the file yourself, and make a small mistake, your default user will get deprived of the sudo permissions and you’ll be left without anything in the state of misery.

What do you do now? Search up the Internet, people will tell you to boot the failsafe option, open the recovery mode and change the sudoers file. As what happened with me, I could not boot into the failsafe kernel as GRUB menu didn’t show up. Then I realised, theres more to Linux than the “terminal”.
I just looked at the GUI, opened the “Users & Groups” application and made myself the “Administrator” and entered my password (which worked). It allowed me to do this. Probably because this application doesn’t use sudo as back-end. On the other hand, if you try to open “Software Management”, you won’t be able to. The strange thing is that still this thing did not work. Then I opened the advanced preferences of my user and saw there is another group “sudo” in the group list. I checked that too. And wholaa, everything started working.

Analysis: When you first install Ubuntu, the default user is given the sudo permissions. But if you happen to edit the sudoers file and make a mistake (such as removing the % sign in front of ‘admin’ ), sudo automatically expects you to be a part of the “sudo” group (which is the last group inside the sudoers file ) which you are not a part of by default, so you get locked out.

The thing to do is to, add yourself (the default user) specifically to the sudoers file and not reply on the groups, so whatever may happen, the default user will get admin privileges.

Comments No Comments »

Part One : http://techfreaks4u.com/blog/?p=1152

  • lucene helper

java -jar lukeall.jar

  • porter stemmer

http://tartarus.org/~martin/PorterStemmer/

  • svn

go in required DIR
to import fresh: svn import

  • to download:

svn checkout svn-address
svn checkout svn-address

  • to update with ur stuff in

svn svn committ

  • to add new files svn add
  • to downld the recent version : svn update
  • no. of file descriptors: c

at /proc/sys/fs/file-max

  • to import header files:

pkg-config –cflags dbus-1

  • reset network

sudo dhclient eth0

  • creative zen v plus

it’s an MTP device so Amarok or Gnomad2 will both do the trick.
No new media devices were found. If you feel this is an error, ensure that the DBUS and HAL daemons are running and KDE was built with support for them. You can test this by running “dcop kded mediamanager fullList” in a Konsole window.

http://www.hwaci.com/sw/mkhdr/

  • GDB

gdb output_file
r = run
bt = backtrace
bt full = backtrace full
fg = forground
p r<tab> all funcs with rs

  • locate a file

sudo find / -name filename
locate -i filename

  • valgrind, to check memory leaks

valgrind –leak-check=full –show-reachable=yes ./indexer

  • ps

ps auc : to know virtual memory usage, gives only running processes
ps aux : gives all proframs having given arg

  • graphical memory map

pmap : to know the memory map

  • to list a l envirnon variables

env
To update an environment variable that lives until the next reboot:

#export PATH=”/usr/local/XXX/bin:$PATH”
#echo $PATH

Notice that colons are used to separate path items.

  • To create an environment variable that lives forever, update your .bash_profile file:

XXXPATH=”/usr/local/XXX/bin”
export XXXPATH

  • to show disk usage

df -h

  • pkg-config help

/usr/lib//pkgconfig/

  • set path for libs to be find

export LD_LIBRARY_PATH=/usr/local/lib/

  • sharing centre

shares-admin

  • ddd

Separate the console, source and data windows. separate-windows’  `–separate’
this option is equivalent to setting the DDD `Separate’, resource class to `off’. `–attach’ options.
(http://www.cims.nyu.edu/cgi-systems/info2html?%28ddd.info%29Window%2520Layout), for details.

  • searching a file usign grep

grep * -e “pool”

Comments 1 Comment »

  • file browser is

sudo nautilus

  • gksudo update-manager

to newer version, update-manager -d
to search: aptitude search flex

  • movie player codecs

codecs: totem-xine

  • printer setting

printer config
localhost:631

  • root passwd set

sudo passwd

  • Do you have libglib2.0-dev installed?

“dpkg -l | grep libglib2″ will show you.

  • if klauncherproblem presists

start kdeinit….dont start dcopserver

  • for sharing

sudo nautilus > rigth click on folder to share > select share

  • kiill process:

ps aux | grep name_of_process
kill -9 PID_Number_Here
OR pkill -9 “name of process”
pkil searchess for a process with similar name

  • know your ubuntu version

lsb_release -a

Comments 2 Comments »