A little while back, Ubuntu made a subtle change that broke Desktop Sharing to Mac computers. I keep a headless server upstairs to serve media files across my network, so screen sharing is essential to manage the server. However, when Ubuntu made their change – requiring encryption on the VNC connection – Macs lost the ability to connect.
I’ve been struggling this morning with a compressed SQL file – it had been given a .gz file extension, and I was trying to use the
tar command to decompress it. Apparently this is stupid – there’s a dedicated utility to decompress a .gz file –
It’s as simple as this:
$ gunzip big-database-dump.sql.gz
$ ls big-database-dump.sql
ls command simply lists the extracted file, by the way)
If you’re using Ubuntu, there’s a very easy way to extract the file using the GUI – simply browse to the .gz file you want, right click on it and choose the Extract here command.
However, the time to use the
tar command is when you’re opening up a file like drupal-6.15.tar.gz
tar -zxvf Drupal-6.15.tar.gz
Hope this helps out other Ubuntu/Linux newbies who’ve struggled with file decompression!
Obviously some of you won’t be comfortable having an accessible guest account on your computer. You’ll be pleased to know there’s an easy way to disable the guest account (and toggle it back on again if you need to).
Fire up a terminal session on your Ubuntu machine, then type in the following command and hit Enter.
sudo /usr/lib/lightdm/lightdm-set-defaults -l false
Reversing this process is as simple as changing the
at the end to a
sudo /usr/lib/lightdm/lightdm-set-defaults -l true
What this changes
What’s happening in the background when you execute this command? Quite simply, it inserts a line in the
/etc/lightdm/lightdm.conf file that says
So, the alternative way to make this edit – if you like doing things the long way – is to use gedit or nano to edit the lightdm.conf file and add that line yourself. And obviously switch false to true to re-enable guest access.
Now, once you’ve made the changes, you’ll need to reboot your computer for the guest account to be fully disabled.
Canonical’s decision to add an Amazon shopping lens to the latest version of Ubuntu 12.10, Quantal Quetzal has been hugely controversial. On one hand it brings an additional (and possibly very lucrative) revenue stream to the maker of the largest Linux distribution (which I support), but on the other, users are concerned for their privacy. Me, I just find the Amazon Shopping Lens a massive pain in the rear end.
Looking for a quick way to delete old files in Linux? For example, log files can build up over a long period of time.
Usage case: The default WordPress backup tool doesn’t delete old backup files. So, over time, these files can accumulate and take up valuable disk space. If you run a large and busy site, this can become a problem. So, in order to maintain a healthy file system, we’ll want to keep say the last 30 days’ worth of backups and discard anything older than that.
Remember when we configured our headless Crunchbang computer the other day? Now that we’ve got the machine up and running and logging in automatically, we want to start some programs running when the machine boots up.
Well, the good news is that Crunchbang makes this process embarrassingly easy: the distribution has an autostart script that you can edit to run the programs of your choice. You can even specify a sleep delay so that programs load in a specific order and don’t overload the machine. This is some heavenly scripting!
Finding and editing autostart.sh
The autostart.sh script is the file you need to edit to customize your startup experience. Let’s fire up the terminal and do some editing – we’re going to fix a problem in my earlier post!
- Browse to the OpenBox config folder: cd ~/.config/openbox/
- Edit the autostart.sh file: nano autostart.sh
- Navigate to the bottom of the file – it’s the smartest place to add your own custom entries. Along the way note that a double hash (##) denotes a comment – always advisable to explain the commands you’ve added to your script!
- We’re going to configure the vino server service to start automatically, so add a comment like “## Start Vino server” and take a new line. In the new line, type
/usr/lib/vino/vino-server &(the ampersand character at the end allows the script to continue processing any additional commands you might add). Add any other commands you’d like to run at startup.
- Save the autostart.sh file and then restart your computer to test.
The Sleep Command
A useful variant is to add the “sleep” command to your script. This delays execution of your program by a specified number of seconds, allowing the computer to launch programs sequentially, preserving system resources or allowing other tasks to complete first.
A modification of the command above would be:
(sleep 60s && /usr/lib/vino/vino-server) &
This would delay startup of the Vino server until 60 seconds after OpenBox loads. Feel free to play as creative as you like with this command – you could execute a system backup script, run an application or whatever else strikes your fancy.
Shutting down unwanted services
You can also comment out software in the script that you don’t want to run – for example the novelty Statler app that says a random phrase every now and again. Simply find that line in the autostart.sh script and comment it out with “##”.
Likewise you could disable the Conky service or the screensaver – both of which are activated via this script. Find the lines you want and comment them out.
So that’s it for this little tutorial – I’d be interested to see what other things people use the autostart script for in Crunchbang. Also, is it available in other Linux distributions?
If you read my previous post about building a headless Crunchbang Linux machine, you’ll understand that one of the next steps for us is to have the machine log in automatically.
Without an automatic login, the Vino server won’t have the chance to start and therefore you won’t be able to control the machine remotely. The good news is that configuring automatic logins in Crunchbang is remarkably easy.
Step by step: Configuring automatic logins
- Right-click anywhere on your Crunchbang desktop and browse to the System menu. Click on GDM Login Set-up. You’ll be prompted for your administration password to make these changes.
- Now, when the Login Window Preferences window appears, click on the Security tab and select Enable automatic login. You need to use the drop-down box to select the user account to log in when the computer starts.
- Save your settings and reboot the computer. It should log in automatically first time.
And that’s it. In our next tutorial, we’ll be looking at making applications start automatically when the Crunchbang computer starts up.
I’ve been playing around with Crunchbang Linux for the last few days. I had a low spec old server lying around the house and wanted to see if it would perform better with a lightweight Linux distribution. The machine had been struggling under the latest Ubuntu 11.10, so I scrubbed it and installed Crunchbang.
The problem being that the machine runs in the attic office and doesn’t have a screen or keyboard, so remote access is essential. But Crunchbang doesn’t seem to come with a default remote desktop server, so we have to install one for ourselves.