Ubuntu
Up one level
Ubuntu |
|
I've just realized that I've never said what Ubuntu is.
Ubuntu is some software you put on your computer, which does the same job as Windows. It is an Operating System - that is it allows you to easily add on more programs to enable you to perform whatever task that your computer will allow you to do.
Ubuntu is a type of "Linux" (click here to go to Linux.co.uk, or scroll to the bottom for links to useful articles). It is based on the Linux "Kernel", which is the heart of any linux based operating system.
So why am I using Ubuntu, and not Mandrivia, or Suse, or Debian.
Really, down to ease of use. I had tried installing FreeBSD, and then installing Gnome (a visual system to go ontop of the text based OS). I had to give up in the end, I just did not know enough about Linux. I was advised by my soon-to-be-boss at my interview that Ubuntu looked quite good, and I should try it. So, A little while later, I downloaded and tried Ubuntu Linux. He is right, it is very good, especially for a Linux newbie like me. I know quite a lot about windows, but at the time, nothing about Linux.
Installing it, has previously been described (somewhere, sorry, I can't remember where) as a bit like "sneezing". I have to say, that is an apt description. I used the text based installer, and zipped through it with no problems. If you want, you can use the graphical version, which will basically give you a "live cd" (A cd you can run an OS off to try it out, or repair a machine), with an install link on the desktop. Follow the very simple instructions, and then just do something else for a while as it installs. Takes about half an hour to an hour, depending on the speed of your computer.
To find out more, check out these articles on Linux.co.uk:
Useful Ubuntu Things to Remember |
|
- Firstly, when doing hardware maintenance, remember to plug all leads back in. (I'm so glad I'm not the only one who's forgotten this: http://err.no/personal/blog/tech/2007-02-06-12-38_powerless_disks)
- To open a terminal in Ubuntu, go to Applications > Accessories > Terminal
- To add shortcuts from the applications listing to your desktop or top/bottom panel, browse to the location of the program under applications, click on it DON'T LET GO, and drag it to the bar at the top, or onto you desktop. Let go.
- To run a unattended upgrade on an (K/X/U)buntu machine use the following command in a terminal:
apt-get update; apt-get upgrade -y
- If you only want the upgrades to be downloaded, and not installed as well, then use this one (I think, this hasn't been tested, and you could probably do it a bit more neatly with -dy):
apt-get update; apt-get upgrade -d -y
- Most linux variants store their programs (e.g. lspci) under /usr/sbin
- To force evolution (linux version of MS Outlook) to close completely, open a terminal, and run the following command:
evolution --force-shutdown
How to turn a Ubuntu Box Brainless |
|
Effectively, by this tutorial, we will be disabling logins on the ubuntu box, and just using gdm and the x-server to talk to a server on the local network using XDMCP. This means, that you'll actually login to the remote server, and use the remote servers' data and processing power.
WARNING: This will disable GUI access to your computer!
DON'T do this to a machine which you want to use without having to
play around with the X configuration files in command line.
In ubuntu, you can switch all logins to XDMCP quite simply. Here is the Howto:
- Click on System > Administration > Login Window
- Enter your password (if requested)
- Click on the security tab
- Click on the "Configure X Server" button in the bottom right hand corner of the window. This pops up:
- Change the "Launch" value from "Greeter" to "Chooser"
- Click close twice, and log off
- Hit CTRL - ALT - BACKSPACE together, to restart GDM. You should now have a XDMCP host searching window, which will locate any computers which have had XDMCP logins activated. If you want a howto for setting up a server for that, please comment!
Wanda The Fish |
|
To learn more about Ubuntu, visit my post about What is Ubuntu? (Click here)
If you right click on one of ubuntu's panels (The bars at the top and bottom of the screen), and click "Add to Panel" This box appears. From which you can select from a multitude of useful (and useless) widgets to add to those bars. One of those is "Fish".
If you add the "Fish" applet onto your panel, and then click on the swiming fish (Wanda), up will pop up a nice quote. Sometimes something meaningful, usually just something completely and utterly random.
You can change the command that it run when you click on the fish, by right-clicking on it and clicking properties. But, be careful. If it looks like you're going to enter a useful command, up will pop this message:
You can't say that programmers don't have a sense of humour
Ubuntu Keyboard Shortcuts |
|
I was browsing round my Ubuntu system when I found something that would later come to save me quite a lot of time. A link in the preferences page called "Keyboard Shortcuts".
Assuming you're
running Ubuntu, and are an admin user on your machine, you can quickly
setup shortcuts to do some useful things.
To start off with launch the Keyboard shortcuts system: from the menu click on "System", then "Preferences" and finally "Keyboard Shortcuts"
You now have a long list, looking something like this:
On
the left are the actions, the right the shortcut that launches the
action. Just for the sake of argument, click on "Launch Web browser".
Note, that the Shortcut column turns into "New accelerator". Now, type
the key combination that you want to use. For the sake of argument, try
pressing the "Shift" and "I" keys.
If you ever want to delete a shortcut, click on the shortcut you wish to delete, and hit the "Backspace" key (One with an arrow heading left).
Now,
you can setup your shortcuts how you like them. If you get stuck, press
the Help button. A good key to use, if the right and left start
buttons, which can be assigned to different tasks in your system. You
can make them open the panel menu, replacing the Alt+F1 shortcut.
Or, you can do other things. Personally, I have my system configured to
launch a Terminal window (Like a DOS prompt box on windows, just 100x
more powerful) on my left start button, and a calculator on the right.
One last tip, if you ever try to assign a shortcut that has already been assigned to something else, the system will warn you with the following box:
I hope that this has been useful!
How to Configure or Disable Predictive Text In Open Office |
|
Open Office keeps automatically trying to guess what you're typing? Sometimes it can be useful, especially if you're doing something quite repetitive. However, it can also be a bit dumb at times.
Now, Open Office predictive text, actually comes under auto-complete. Don't ask me why, as to my mind at least, that's a completely illogical place to put it. Also, Open Office call it "Word Completion"
Configure Open Office Predictive Text
Here are a couple of things you can try to make it more useful.
Click on "Tools" > "AutoCorrect..." > Click on the "Word Completion" tab.
- Increase the minimum word length.
Make sure that the minimum word length is at least 8. Less than that, and you're going to get it trying to auto complete too-short words, and get confused. More than 8, it will trigger less often. Tweak this for how much you want to use the predictive system.
- Delete False Positives
Sometimes, the predictive system just gets confused. An example of this, is if you have used "Disneyland" in a document, and then want to type "Disney" Open Office will keep auto-completing to "Disneyland". Really, not helpful.
To fix this the only response, is to find and delete the offending word from the predictive system. Click on the word you want to remove (In this case, Disneyland), and click the "Delete Entry" button.
Note: The image has been cropped to make it fit. The dialogue box is longer than this.
Disable Open Office Predictive Text
If you just can't get it quite to work how you want, then your last resort is to disable the feature. Click on "Tools" > "AutoCorrect..." > Click on the "Word Completion" tab.Now, untick the box that says "Enable Word Completion". Your Open Office will no longer automatically try to predict what you're typing.
Note: if you leave "collect words" ticked, the system will still collect words to Auto Complete, but Won't actually use them. If you're just turning the feature off for a little while, leave it ticked. Otherwise, untick it, to save memory, and a little bit of processor power whilst you're working.
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
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:sudo visudo
?Fun? tip: add "insults" to the end of the list of "Defaults" in visudo, so it will look like:<username> ALL=(ALL) ALL
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:Defaults !lecture,tty_tickets,!fqdn,insults
You speak an infinite deal of nothing
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...
The Stupidity of Spammers |
|
Had a situation pop up today at work. Spammers started to target (at a stupid hour in the morning) one of our customers' servers with referral spam. That is, they try and get their website's links into our logs.
Cue 9 hours later, I get in work, and one of our servers is complaining (seperate issue). Sort of fix that, to get a call "Our server is really slow."
So, go through the motions. Load on the server: 0.50 (for windows guys, think of it as the amount of spare thinking time the computer has, when load hits 1, its running at full capacity, when it goes above 1, it is having to make some tasks wait to run.)
Nothing wrong there.
Ping the server. 20ms response time. Nothing wrong there.
Remember that we installed ntop on a couple of servers a while back, and that this one should have it on as well. Load up the traffic graph. Wooo! Steady incoming traffic of ~2Mbps (~600kB/s).
Check the Apache server-status page. See stuff like this:
88.232.13.34 customerDomain.com GET hxxp://thecric.free.fr/AZenv/azenv.php HTTP/1.0
Referral spamming. See the ever useful wikipedia: http://en.wikipedia.org/wiki/Referer_spam
This is not the first time it has happened, so pull out our trusty tool for dealing with this (blacklist program and log-scanning tool), and start playing wack-an-ip-address with the spammers. (Blacklisting their IP: no traffic at all will get to the webserver from that ip address.)
Fun.. so, LOTS of IP addresses later, traffic on the server is back to normal.
'So' I hear you ask, 'where does the stupidity come in?'
The server they attacked, is not public-facing. There are no fancy websites for you to visit. No content to be of any use to you. It is a corporate-tool hosting server. The referral statistics are not public. The spammers just wasted their time, and mine. With the sheer number of computers that decided to poke at us, it has to be infected computers in a bot-net.
Still, I like playing wack-a-spammy-ip. It's fun ^^, and the IP addresses can hopefully be used to stop these muppets from hitting our server again.
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
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.
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..