Linux tweaks, applications, and other gimmicks.

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

silverpig

Lifer
Jul 29, 2001
27,703
12
81
Originally posted by: Noema
Not a tweak per se, but I just wanted to share how Damn Small Linux helped save the day yesterday.

My uncle, the least computer savvy person on the planet, has an old AMD K6 @400 Laptop with 96MB of RAM. Somehow, he took the computer to a repair shop where the only thing they did was reinstall Windows 98 and a pirated version of Norton Antivirus. They didn't even bother to install the drivers. Not one single driver. Screen properties were stuck at 640x480 and 16 colors without the right driver :Q

So my uncle called me because he couldn't connect to his dial-up internet account (of course he couldn't...there was no driver for the v90 modem!). So I took the laptop home with me and I figured I'd just copy drivers via floppy...no such luck; the floppy drive is long dead on the laptop. It was late and I didn't have any blank CDs to burn the drivers on, and I didn't want to waste a CD just for a couple dozen megabytes worth of drivers. And Win98 doesn't offer mass storage USB support out of the box: a driver must be installed so I couldn't use my memory stick either.

So what I did was simply boot into the Damn Small Linux CD...which worked beautifully, detecting all the hardware without problems as it loaded the kernel; in less than a minute I had a fully functional linux desktop that of course recognized my USB memory stick out of the box after mounting it. So I mounted the Windows HDD, copied the drivers over and voila. Done in less than 3 minutes.

Oh boy. I love Linux :)

You shoulda just put linux on there for him :)
 

Noema

Platinum Member
Feb 15, 2005
2,974
0
0
Originally posted by: silverpig

You shoulda just put linux on there for him :)

I thought about it for a second, but in the end decided not to.

My uncle (he is in his mid-60's) is as computer illiterare as it gets. He can barely turn the thing on. It was very hard for him to learn the most basic stuff in Windows, like double clicking, shutting the PC off, connecting to the net via dial up...and having to relearn that would just push it away from computers...forever, I fear.

Plus Damn Small Linux isn't the most n00b friendly distro out there. And I'm afraid something like Xubuntu would crawl on that old laptop of his.

And Windows 98 doesn't run half bad on it...it's actually quite snappy. Naturally I installed Firefox though.
 

hasu

Senior member
Apr 5, 2001
993
10
81
Here is another "how to" question for experts!

I have created a user with very low privileges. How do I temporarily login as a different user, inside a shell (similar to su command but for other regular users)?
 

DarkThinker

Platinum Member
Mar 17, 2007
2,822
0
0
Originally posted by: hasu
Here is another "how to" question for experts!

I have created a user with very low privileges. How do I temporarily login as a different user, inside a shell (similar to su command but for other regular users)?

Simple, if the user you want to become is sam, and currently you are user rick, just type
su sam
you will be asked for sam's password.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Also you can use 'sudo' to use other accounts.

sudo -u sam your.command.whatever

 

drag

Elite Member
Jul 4, 2002
8,708
0
0
HowTo _totally_ replace Totem with VLC.
As you know that totem is rather limited. It's nice, but it's limited. VLC is a much more capable video player.


This is a handy trick thanks to the Freedesktop.org folks. It's based around the 'MIME' file type detection that is now integrated into KDE and Gnome desktops.

One of the newer Freedesktop.org standards that are silently making Linux user's lives better is the little known '.desktop' file standard.

These files are used to tell the GUI portion of Gnome or KDE what application to launch, how to launch it, it's name in different languages, and other such details. Then it's used in your menus and other such things.

Then to go along with that you have a file that is called 'defaults.list'.

This file is were preferences are stored for launching applications. This way settings you make in Gnome carry over to KDE. Also special shells like 'Fish' can make use of them to launch applications also with it's 'open' command. So this way irregardless of how you make your preferences they will carry over to all .desktop using applications.

This is very important for 'unifying' your desktop because just a year or two ago when you'd open up a .html file (for example) in Konqueror it may pop open in konqueror. If you open it in Gnome it may open up into Epiphany. If some third party application tries to open it up it may open it up in Mozilla. But you want Firefox to be the default browser. So previously you'd have to go and configure KDE and Gnome seperately and still then third party apps may have their own setup that you just can't do anything about easily.



So say your using a newer version of Ubuntu or whatnot. By default it may want to use Totem for stuff, but you may not like totem. You like VLC.

So you install vlc. Somewere in your file system is a vlc.desktop file, hopefully. If there isn't, it's easy to make one.

To make a new desktop file all you have to do is while running Gnome, find a media file that vlc can play. Right click it, select 'Open with other application' then do your custom command.

You will find that this makes a new file ~/.local/share/applications/vlc-usercreated.desktop

But you should have a vlc.desktop file anyways, somewere.

So here is the trick:
(the one thing that sucks If you have a bunch of file associations already done then this may not be that clever since it will wipe all those out.)

Locate the default default.list
You will have at least one on your system, maybe two if your using KDE and Gnome. Run this command to find it:
> locate defaults.list
(if locate doesn't work because the system is to new, or you just installed a bunch of new stuff then run 'sudo updatedb' first. This will update the locate database)

Mine is located in /usr/share/gnome/applications/defaults.list

make the directory for it...
> mkdir -p ~/.local/share/applications

copy the default.list to that..
> cp /usr/share/gnome/applications/defaults.list ~/.local/share/applications/

Then to change everything over to vlc you will use one of the more advanced features of Vi.

> vi ~/.local/share/applications/defaults.list

Now follow these key presses exaclty.. (the : is important)

: % s/totem/vlc/g

or if you had to create your own...
: % s/totem/vlc-usercreated/g


Note that for different versions of gnome it may name the *.desktop files something differently. Any user-created files will end up in ~/.local/share/applications so you may want to check that out to find the the actual file name if it's not *-usercreated.desktop

And then if that works then the editor will scroll down to the bottom of the file and then replace what you typed with something like:
86 substitutions on 86 lines

This means that it substituted vlc for totem on 86 different file types. :)

Then hit
:wq

to save the changes and exit.

Now you don't have to restart or log out or anything. Once you save that file then the changes should be automatic. Double click on any media file and it should now open up in vlc.

If it doesn't work then you can just delete ~/.local/share/applications/defaults.list file and everything will go back to the system defaults.


Otherwise if you don't like using vi like that then you can go through the gui and before you double click on a file.. right click ---> goto "properties" ---> hit the "open with" tab ---> then check the mark next to 'vlc'.

And that should work with most things, even if it's not all elite like using vi. ;)

 

hasu

Senior member
Apr 5, 2001
993
10
81
How to boot linux into Command Line Interface (without running X-Server in the background) ? Or alternatively, how can I exit X-Windows and go to CLI? I read about Athene Operating System. Need to boot into CLI to try it out. Here is a review!
 

postmortemIA

Diamond Member
Jul 11, 2006
7,721
40
91
How to use your RAID0/1 in linux that is based on motherboard chipset with RAID support (NVRAID, ICHxR, VIA, etc)?

Tool called dmraid comes with installer on Fedora 5,6,7 and SUSE 10.2) - so you can use same RAID platform on both Windows and Linux.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: hasu
How to boot linux into Command Line Interface (without running X-Server in the background) ? Or alternatively, how can I exit X-Windows and go to CLI? I read about Athene Operating System. Need to boot into CLI to try it out. Here is a review!

To boot into CLI only differs from distribution to distribution.

It has to do with 'runlevels' and 'init' scripts.

For Debian and Ubuntu the quick way is to disable gdm.
> sudo chmod -x /etc/init.d/gdm

then to get it back you go:
> sudo chmod +x /etc/init.d/gdm

the Correct way to do it is to customize one of the runlevels so that the you can choose that runlevel.

To disable it for runlevel 3 you go:
> sudo rm /etc/rc3.d/*gdm

Then to set yourself to use runlevel 3 by default next time you boot you can go edit /etc/inittab and change:
id:2:initdefault:

to
id:3:initdefault:


With Fedora and other Redhat-like distributions this has already been done. If you use runlevel 3 you can boot without X.

Fedora and friends uses runlevel 5 by default. To boot unto runlevel 3 instead you just edit your /etc/inittab again.


Also you can change runlevels on the fly with the telinit command.
> sudo telinit 3

Will switch you to runlevel 3.

Also in Debian or Ubuntu you can temporarially shut off X completely by using the init script manually.
> sudo /etc/init.d/gdm stop

GDM is the default graphical login screen. If your using a KDE distribution your probably using KDM, and the old school version is called XDM. Otherwise everything else is the same.


To switch to the command line without customizing runlevels or turning X off or anything like that would be simply to hit ctrl-alt-F1.

F1 through F6 are usually virtual terminal with F7 being 'X'. However you can have multiple X things running F8, F9, F10, etc. And it's customizable how many of what type you want running.

Also for security you can also do things like disable root completely, except if you log in directly through the console.



 

hasu

Senior member
Apr 5, 2001
993
10
81
Is it possible to get rid of sudo feature in ubuntu (and its derivatives)? Instead it should just ask for the root password.
Often my logged in users will not have system administration privileges so that giving their password in sudo dialog won't help.
 

stupidkid

Member
Jun 21, 2006
113
0
0
Run the following
sudo passwd
<enter new root password>
su
<enter root password you just set>

Now you're in the root shell.

If you want, add a user to the admin group and they'll be able to use sudo (it's wheel group in Gentoo)
sudo gpasswd -a USER admin (or you can go to root shell and run w/o sudo).
 

hasu

Senior member
Apr 5, 2001
993
10
81
Originally posted by: stupidkid
Run the following
sudo passwd
<enter new root password>
su
<enter root password you just set>

Now you're in the root shell.

If you want, add a user to the admin group and they'll be able to use sudo (it's wheel group in Gentoo)
sudo gpasswd -a USER admin (or you can go to root shell and run w/o sudo).

I already changed root password in a similar way.

What I am trying to achieve now is replacing the current logged in user with root for sudo purposes.

For example if I try to install a patch while I am logged in as "tom" sudo dialog box asks for tom's password even if tom is not an administrator. In such a situation even if tom enters his password the update process result in error.

Instead of that I want those sudo programs to use root as the only administrator user id so that I can give root password in those dialog boxes irrespective of logged in user.

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Run the following
sudo passwd
<enter new root password>
su
<enter root password you just set>

Now you're in the root shell.

If you want, add a user to the admin group and they'll be able to use sudo (it's wheel group in Gentoo)
sudo gpasswd -a USER admin (or you can go to root shell and run w/o sudo).

If you want a root shell just run 'sudo -s'.
 

hasu

Senior member
Apr 5, 2001
993
10
81
Originally posted by: Nothinman
Run the following
If you want a root shell just run 'sudo -s'.

sudo always runs under the current logged in user id. Is there a way to configure it so that sudo will always ask for root password (instead of assuming that the current logged in user has administrative privileges)?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
sudo always runs under the current logged in user id. Is there a way to configure it so that sudo will always ask for root password (instead of assuming that the current logged in user has administrative privileges)?

The whole point of sudo is to not require the root password, what you want is normal su.
 

hasu

Senior member
Apr 5, 2001
993
10
81
Originally posted by: Nothinman
sudo always runs under the current logged in user id. Is there a way to configure it so that sudo will always ask for root password (instead of assuming that the current logged in user has administrative privileges)?

The whole point of sudo is to not require the root password, what you want is normal su.

Normal su would work when I know the command and its syntax (to use CLI) :)

But when I try to do Administrative tasks through GUI (eg, LinuxMint Control Center) it asks for password through sudo's dialog box (That's sudo right?). Since my normal user id do not have administrative rights, entering the password (for the current user) does not help.

I normally log off and then log back in with an administrator account for those tasks.

What I am trying to achieve is to use GUI for administrative tasks even while logged in as a non-administrator.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I am not 100% sure about this but I beleive this behavior is controlled by the libgksu library.

Check out the documentation for libgksu2-0 at
/usr/share/doc/libgksu2-0/README.Debian


in there it talks about using the Debian alternatives stuff to control weither it uses sudo or su.

update-alternatives --config libgksu-gconf-defaults
update-gconf-defaults


Ubuntu changes stuff sometimes and isn't as good as documentation as Debian, but there is a pretty good chance of that being the same between both systems.
 

hasu

Senior member
Apr 5, 2001
993
10
81
Originally posted by: drag
update-alternatives --config libgksu-gconf-defaults
update-gconf-defaults

Great! That worked perfect!!
Thank you...

 

hasu

Senior member
Apr 5, 2001
993
10
81
How can I start dbus service in Ubuntu? (manually?)

By mistake I shutdown that service from within control panel. Now when I try to launch "Services" from control panel, it says "The configuration could not be loaded. You are not allowed to access the system configuration". After searching web about dbus, I now realize that it is the communication channel between various Linux sub-systems and applications.

Is there a way I can re-instate dbus service?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
But when I try to do Administrative tasks through GUI (eg, LinuxMint Control Center) it asks for password through sudo's dialog box (That's sudo right?). Since my normal user id do not have administrative rights, entering the password (for the current user) does not help.

Then add yourself to whatever group LinuxMint crap requires, you'll never win in a fight with gksu.