Skip to content. | Skip to navigation

Sections
You are here: Home thumper Useful Linux (Ubuntu) Tidbits
Personal tools
  • Log in
Document Actions

Useful Linux (Ubuntu) Tidbits

Here are just some morsels of information about the Linux Command line, and more specifically, Ubuntu Linux Command line / system.


Users can be added to a group with the command:
sudo adduser <username> <groupname>


In ubuntu, the default system shell is "Dash". That does speed up your system boot, but it also introduces problems with those scripts which are designed to run in bash, but use /bin/sh to execute. (Which is a surprising amount... this has solved many problems for me. Especially with Asterisk and freePBX.)

To set Ubuntu back to using bash from dash, run the following command...

cd /bin && sudo rm sh && sudo ln -s /bin/bash /bin/sh


To add a user to the sudoer list (the list that controls who can use "sudo") use the command
sudo visudo
Add a user underneath the "# User privalage specification" comment. If you want just a bog standard sudo user, able to do all on the system, add the line:
<username>    ALL=(ALL) ALL
?Fun? tip: add "insults" to the end of the list of "Defaults" in visudo, so it will look like:
Defaults        !lecture,tty_tickets,!fqdn,insults
The system will insult you every time you enter your sudo password wrongly. For a random example, it just gave me this when I deliberately triggered it:
You speak an infinite deal of nothing


In Firefox, select the address bar quickly by hitting the "F6" key.


Type "pwd" to get the full path to your current directory. e.g.:
kirrus@asus:~$ pwd
/home/kirrus


Monit is a useful program, that gives you a good way of keeping an eye on your servers, making sure they don't run out of harddisk space, or get a high CPU load. It can either perform some function (like stopping a program from running) during high CPU, or send you a warning email.

http://debianhelp.co.uk/monit.htm (useful howto/basic guide)
http://www.tildeslash.com/monit/ (main website)

Monit is in the ubuntu repositories:

aptitude install monit


...

Regarding the Storm worm, I do plan a follow up. But I'm just at the basic "read lots" stage...


Re:Useful Linux (Ubuntu) Tidbits

Posted by elwoodicious at 12 Sep 2007 14:46

I'll second the Monit suggestion. We implemented it last month to manage our Mongrel clusters and the difference has been night and day with regards to recovering from memory leaks and instituting rolling restarts of the cluster while doing deploys. Next on the list is to examine the best way we can use it to monitor the MySQL cluster we are building... :-D

Re:Useful Linux (Ubuntu) Tidbits

Posted by gazzat at 13 Sep 2007 18:06

Another usefull tip which should work in *nix systems is if you screw up and make it crash, wait - don't go presing the reset button!
Hold down Alt+Print Screen and type REISUB . It Kills all processes unmounts the drives nicely etc.

Re:Useful Linux (Ubuntu) Tidbits

Posted by Kirrus at 14 Sep 2007 20:35

Elwood: Aye, Monit is useful... alerts us to problems caused by using Gambas unstable to write code... Only tricky bit is, we get alerts every night, as the box does some intensive mysql database cleanups (deletes lots of fields, and optimises tables) nightly.
Might have solved that one... we'll see tomorrow, if I get any more false-alarms..

Hi Gazzat :D
Crashes, if you have crashed your GUI, you can get into a command line, by hitting CTRL-ALT-<FUNCTION KEY> . Generally, function keys F1-F6. F7 (at least, in Ubuntu) is the GUI.
Also, if you can't recover from that, CTRL-ALT-BACKSPACE will restart your X server, which should kill everything GUI wise, and reload the login page..

« January 2009 »
Su Mo Tu We Th Fr Sa
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Recent entries
Move Pending 27 Apr
General Update Ramble 25 Apr
Centos 09 Apr
Away 04 Apr
Redunancy 03 Apr
Life, Earth and Philoso 29 Mar
Handy Gedit Features. 01 Mar
Duracell batteries
Buy duracell batteries from the UK's leader! Fantastic range of batteries! Masses of sizes and brands. Free delivery on orders over £25!
Web Site Designer
Let our web site designers create your website. Then use our simple-to-use Content Management System to update it as needed!
Remote support >>
Connect offers the best support for IT related issues. Give them a call.
About this blog
Kirrus's web log about web design, the internet, linux/ubuntu, plone, and life in general.
 
(no ads)
Duracell batteries
Buy duracell batteries from the UK's leader! Fantastic range of batteries! Masses of sizes and brands. Free delivery on orders over £25!
Web Site Designer
Let our web site designers create your website. Then use our simple-to-use Content Management System to update it as needed!
Remote support >
Connect offers the best support for IT related issues. Give them a call.