Tag Archives: linux

Start/Stop LAMP in Ubuntu 10.4

I occasionally want a local web server on my netbook for fiddling around, but don’t want it running on start up. So, using the following steps I removed it from the start up list and created a launcher button to start and stop apache and mysql.

1. Remove from startup list:

$sudo update-rc.d apache remove
$gksu gedit /etc/init/mysql.conf

In your text editor look for the lines with start up information and comment them out by adding a hash at the beginning of each line.

2. Write simple start script

$gksu gedit /usr/local/bin/lampstart
In your text editor paste the following code:
sudo /usr/sbin/apache2ctl start
sudo service mysql start

Save and exit

3. Write simple stop script
$gksu gedit /usr/local/bin/lampstop
In your text editor paste the following code:
sudo /usr/sbin/apache2ctl stop
sudo service mysql stop

Save and exit

4. Make scripts executable and update db
$sudo chmod +x /usr/local/bin/lampstart
$sudo chmod +x /usr/local/bin/lasr/mpstop
$sudo updatedb

5. Make launcher icons
Go to System->Preferences->Main Menu
In the left pane select the application group for the icons
Click ‘New Item’
Enter the following details:
Type: Application in Terminal
Name: Start LAMP
Command: /usr/local/bin/lampstart
Comment: Starts Apache and mysql
Optionally click the icon in the top left and look for a nice pic, I found suitable ones in /usr/share/icons/hicolor/48×48/apps

eeePC Internet Connection via Mobile Phone

I came across various instructions for connecting an Ubuntu powered laptop to the internet through your mobile phone’s data connection. My first thought was ‘brilliant’, followed rapidly by ‘ooh this’ll be fiddly’. It requires a bit of manual coding, but using Rahid Hasan’s excellent how-to it just worked first time (that link looks broken now, its also copied here). I can now enable my bluetooth on my eeePC, turn off the wifi, and a get a reasonable connection speed via my Nokia E71 on three. Grand – no more hotspot charges.

UPDATE: This is a little more complicated in Ubuntu 9.10. For some reason pairing the phones doesn’t result in a bond on the refcomm channel. I get the error “In file /etc/ppp/peers/BluetoothDialup: unrecognized option ‘/dev/rfcomm0′”. The following seems to solve it.

To get it working, follow the instructions linked above with the following modifications:

  1. All of the required packages were already installed on Ubuntu 9.04 and 9.10 Netbook Remix, so no need to do any of the sudo apt-get ing
  2. The command to restart bluez-utils is now /etc/init.d/bluetooth restart
  3. Phone specific information: the apn for three is three.co.uk and the data profile number is 1
  4. Check what devices you have with ls /dev Is there one listed as rfcomm? If not, then the following command is required: sudo rfcomm bind 0 xx:xx:xx:xx:xx:xx zReplace the x’s with your phone’s mac number and the z with your dialup channel number (both found when you follow the linked how to). This command only seems to be required once per session, then you can, in theory, pon and poff as much as you like. Perhaps the solution is to run the command at startup.
  5. I get permission errors unless I run the launch command (pon or poff) with sudo
  6. On launching the connection I get a permission error (only members of group “dip” can use this command) – but no group dip seems to exist. So, use sudo to launch instead.
  7. Start the connection with sudo pon BluetoothDialup And stop it with sudo poff BluetoothDialup NB these commands can be written into custom application launchers through Preferences->Main Menu; but use gksu instead of sudo.

Getting the NVidia linux driver working with odd monitors

The latest edition of Ubuntu (9.04) is generally excellent. There are continuing problems with graphics cards, however, that probably flow more from the proprietary (closed source) drivers provided than anything that Ubuntu folks can control. For me, its the NVidia driver that’s the baddy, failing to recognise any accurate information from my Acer widescreen monitor. This required manually writing a new xorg.conf file pretty much from scratch – here’s the solution for pairing NVidia 8500 GT with an Acer P193w Continue reading Getting the NVidia linux driver working with odd monitors

Adventures in Thin

NB This adventure has been postponed due to my lack of knowledge/skills to make it work 🙁

Moving from a flat to a house so no longer will the same room function as lounge, dining room, study and guest room. Simply having a very long cable on a widescreen monitor meant that one PC used to serve both work and entertainment functions, but alas no more. So, how to have a satisfactory work-from-home PC and a media PC without spending too much moolah? One (theoretical) answer is to scrounge a basic ‘obsolete’ PC and use it as a thin client – meaning it is just a gateway to using the resources on my current, decent quality PC. The software to make this possible is really oriented to businesses, schools or colleges running clusters of computers cheaply but the principles are (probably) applicable at home. And I hope you don’t need to be a veteran sysadmin to make it work. This post, is going to be a running commentry on what I’ve learned as I go through the stages. Continue reading Adventures in Thin

Ubuntu-eee on the eee PC 901

So a new year’s gift to myself for 2009: an Asus eee PC 901. After a quick play with the Xandros-based operating system that came pre-installed I decided to give the eee-specific Ubuntu distro a whirl. Despite the claim on their wiki that it would work ‘out of the box’ for the 901, there were a few issues with my installation (Ubuntu Hardy Heron v 8.04.1 on Asus model no. EEEPC-BK006) that I’ve resolved with the help of posts on the wiki and the eeepc users’s forum. So, largely because I might need to do it again, here’s my step-by-step guide on how to get the thing running as I like it:

UPDATE: ubuntu-eee, used in the description below, has rebranded itself as easy peasy. It seems to contain more license restricted software than the standard ubuntu installation and looks pretty swish. But ubuntu are clearly pushing their own netbook-remix so I’ve installed v9.04 (Jaunty Jackalope) from Ubuntu’s main site. Where necessary I’ve updated the advice below for that, and added tips on Firefox and Mobile Broadband. Incidentally, Ubuntu Netbook Remix on the eee-pc absolutely rocks.

Another UPDATE: As the Ubuntu versions have rolled on and got a bit bigger and slower I’ve now moved to lubuntu 11.04 for the occasional-use eeePC. It feels nice and quick for the kinds of simple jobs I’m doing with it.

N.B. I’ve mostly included eee-pc specific things here – there are other necessary steps with Ubuntu (like making flash work properly, and getting drivers to play .mp3 files). These all relate to using software with restricted licenses, but that software is available and works very well and Ubuntu now generally offers wizards to do these things which should pop up when you need them.

  1. Install the OS
  2. Recognise removable drives (N.B. Not necessary since Ubuntu 9.10)
  3. Wifi (N.B. Not necessary since Ubuntu 9.04)
  4. Webcam
  5. Make bluetooth work and enable other devices to push files via bluetooth
  6. Password lock after standby (N.B. Not necessary since Ubuntu 9.04)
  7. Make ‘home’ key show desktop
  8. Install eee-control
  9. Install Launchy (N.B. Gnome Do is probably preferable since 9.04)
  10. New fonts
  11. Firefox 3.5 (N.B. Not necessary since Ubuntu 9.10)
  12. Mobile Broadband

Continue reading Ubuntu-eee on the eee PC 901