Ubuntu


Create a “whitelist” content filtering proxy for Firefox

When my kids use the internet, I set up Firefox so that they can only access a list of approved sites. Here’s how I do it (thanks to DrBacchus and skippy for the assist):

Install squid (Squid is a caching proxy for the Web):
$ sudo apt-get install squid

Modify squid.conf:
$ sudo vi /etc/squid/squid.conf

Set “visible_hostname” to the hostname of the machine:
visible_hostname yourmachinename
Replace “yourmachinename” with the name of your machine

Set “http_access” to allow access only to the domains specified in your whitelist (I store my whitelist at /opt/squid/allowed_domains):

acl allowed_dstdomains dstdomain "/opt/squid/allowed_domains"
http_access allow allowed_dstdomains

Set up your whitelist file, here is an example:

$ sudo vi /opt/squid/allowed_domains
.tamatown.com
.tamagotchi.com
.webkinz.com

Restart squid for the changes to take affect:
$ sudo /etc/init.d/squid restart

Then, set your child’s Firefox settings to use your squid instance as their proxy server. In Firefox, Edit > Preferences > Advanced > Network > Connection Settings > Manual Proxy Configuration:

Hostname: yourmachinehostname (or localhost)
Port: 3128 (this is the default port for squid)
Use this proxy server for all protocols.

Drawbacks: You must manually add any address you want your child to be allowed to access into your allowed_domains file (hence “whitelist” instead of “blacklist”). Also, if your child is savvy enough to know how to disable the Firefox proxy settings, then they can bypass this.

I created a shell script to automatically append a domain to my “allowed_domains” file and then restart the squid service:

#!/bin/sh
if [ "$#" != "1" ] ; then
echo "usage is $0 [domain] "
exit
fi
echo $1 | sudo tee -a /opt/squid/allowed_domains
sudo /etc/init.d/squid restart

Replace “/opt/squid/allowed_domains” with the location and name of your allowed domains list

Example usage would be:
./squid_add .wikipedia.org

Posted in Ubuntu   |   Comments (0)

Ubuntu 8 – problems with ‘.local’ DNS addresses

After installing Ubuntu 8 Hardy Heron at the office, I was having trouble reaching the ‘.local’ DNS entries we have on our internal network. Here’s what I did to resolve the problem:

$ sudo vi /etc/nsswitch.conf

Replace:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

with:
hosts: files dns

Posted in Ubuntu   |   Comments (0)

Control which app Firefox uses to handle MMS streams

Here is how to control which application Firefox uses to handle MMS streams:

Type about:config Firefox address bar.

Right-click on any text in there and select “New” and then “String”.

In the first dialog box, as preference name, type network.protocol-handler.app.mms.

In the second dialog box, as string value, type in vlc (or the path to your favorite media player)

Posted in Ubuntu   |   Comments (0)

Command to mount ISO file in Linux

Here is the command to use to mount an ISO file in Linux so that you can explore the file as if it were mounted on a CD-Rom or DVD-Rom, without having to burn to a disc:

sudo mount -t iso9660 -o loop filename.iso /folder/to/mount/to

This functionality is similar to Daemon Tools or Alcohol on Microsoft Windows.

Posted in Ubuntu   |   Comments (0)

Make F-Spot the default application for your digital camera

Here’s how to make F-Spot your default application for importing photos from your digital camera in Ubuntu Gutsy 7.10:

System -> Preferences -> Removable Drives and Media. Click the ‘Cameras’ tab. Check the box next to ‘Import digital photographs when connected’. Enter the following for ‘Command:’:

f-spot-import %h

Now when you plug a digital camera into the computer, F-Spot will open and prompt you to import your pictures.

Posted in Ubuntu   |   Comments (0)

Ubuntu Gutsy – Disable Synaptics Touchpad while Typing

Via Mais on Ubuntu Forums:

Purpose: For many of us, our laptop touchpads get in the way of our typing quite often and can actually cause us to highlight or minimize things we didn’t intend. So, this will help to alleviate that by making a small delay in the response of the touchpad after typing.

NOTE: Please read this guide entirely before attempting to do it. There is a section where you must restart X and thus close down your internet browser. The best way to do this would be to print this guide! I hope this works as well for you as it has for me!

Procedure:
1. Turn on SHMCONFIG
A. Open a Terminal. Applications -> Accessories -> Terminal

B. Type sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_synbackup

C. Type gksudo gedit /etc/X11/xorg.conf Enter your password if it prompts you.

Note: The second command in the picture is typed wrong. Please see C.

D. Search for a section that looks like this:

Section “InputDevice”
Identifier “Synaptics Touchpad”

End Section

E. Add a line above the End Section line and put this into it:

Option “SHMConfig” “on”


F. Save the file and close gedit and the terminal window
G. Write these commands down just in case this screws up your window system: sudo cp /etc/X11/xorg.conf_synbackup /etc/X11/xorg.conf and sudo killall gdm and sudo gdm
H. This next step will restart your window system, so save any work and close any open applications. Press: Ctrl-Alt-Backspace. This should take you back to your login screen. If it does not, press Ctrl-Alt-F1 and login at the terminal window. After logging in, type the commands that you wrote down from step F in order hitting return after each command.
I. If your login screen came up
the first time, continue on to part 2, if not, look over waht you did carefully and see if you can spot any mistakes.

2. Add the Startup Command

A. Open the sessions manager: System -> Preferences -> Sessions
B. Click the far right tab labeled Startup Programs
C. Click the Add button
D. Type in the following: syndaemon -i 1 -d

E. Hit ok then hit close

Congratualations, you are done! Note that this will not take effect until Gnome is restarted or you type the command from 2D in a terminal window. You can restart Gnome with the Ctrl-Alt-Backspace trick (make sure to save everything first!) or you can open a terminal by going to Applications -> Accessories -> Terminal.

If you have any questions, comments, or concerns, feel free to contact me through this board, or more easily through email or AIM.

Posted in Ubuntu   |   Comments (2 )

Ubuntu Gutsy – Fix crackly audio in Second Life

I installed Second Life 1.18.4 (3) on Ubuntu Gutsy 7.10. Everything seemed fine for the most part, however the audio from music streams in the game was very crackly. Second Life is the only application with crackly audio, all my other applications seem fine so far.

I corrected this by installing the “esound” package, and then rebooting my machine.

$ sudo aptitude install esound

After rebooting and trying again, sound now works perfectly in the game.

Posted in Ubuntu   |   Comments (1)

Installing Ubuntu Gutsy Linux on an Asus A7T Notebook (fix sound and TTY terminal resolution)

I’ve been experimenting with Ubunty Gutsy 7.10 on my (relatively) new Asus A7T notebook. For the most part, everything works well after the install, but there are two annoying problems that I ran into:

1. No sound. My laptop uses the ALC882 codec.
2. When I boot up, there is no bootup screen, or splash screen. All I see is a black screen until GDM starts. Also, if I switch to a TTY terminal screen using CTRL+ALT+F1 (through F6), the resolution is incorrect; everything is huge and off the screen by several lines, which renders it pretty useless.

Here is how I have fixed both of these issues:

Fixing Sound

I was able to fix my sound issue using the alsa-base package installed by default (version 1.0.14-1ubuntu2 at the time of this writing). Here are the steps:

A. Create a new file called “/etc/modprobe.d/snd-hda-intel.modprobe”:
$ sudo gedit /etc/modprobe.d/snd-hda-intel.modprobe

Add the following line to the file and then save it:
options snd-hda-intel model=w2jc

B. Edit the file “/etc/modprobe.d/alsa-base”:
$ sudo gedit /etc/modprobe.d/alsa-base

Add the same line to the end of this file and then save it:
options snd-hda-intel model=w2jc

C. Reboot. After I rebooted, I had sound.

Fix TTY and boot-up resolution

A. Edit the file “/etc/initramfs-tools/modules”:
$ sudo gedit /etc/initramfs-tools/modules

Add the following two lines to the end of the file, then save it and close it:
fbcon
vesafb

B. Edit the file “/etc/modprobe.d/blacklist-framebuffer”:
$ sudo gedit /etc/modprobe.d/blacklist-framebuffer

Comment out the blacklist vesafb, so that it looks like this: #blacklist vesafb

C. Set the height and width values in usplash.conf to 1024×768:
$ sudo gedit /etc/usplash.conf

Change the values to 1024×768, save the file and close it.

D. Edit the grub config file to add a vga value to set the resolution of the bootscreen to 1024×768:
$ sudo gedit /boot/grub/menu.lst

Find the commented out #defoptions line. Leave it commented out, but add the following to the end of the line:
vga=773

Save the file and close it.

E. Regenerate initram file:
$ sudo update-initramfs -u

F. Update grub:
$ sudo update-grub

G. Reboot. After I rebooted, I saw the bootsplash, and my TTY terminals were at a better resolution.

Posted in Ubuntu   |   Comments (7 )

Better Screenshotting in Gnome

Here is how I configure my Alt+Print Screen action for taking window screenshots:

First, install gconf-editor if you don’t have it already:
$ sudo aptitude install gconf-editor

Then, open gconf-editor with this terminal command:
$ gconf-editor

Navigate to:
/apps/metacity/keybinding_commands/command_screenshot

Change the ‘command_window_screenshot’ value to:
gnome-screenshot --interactive --window --delay=1 --include-border --border-effect=shadow

Now when you use Alt+Print Screen to capture a screenshot of a window, you will get a nifty little drop shadow behind your image by default. See the example below.

Calc Screenshot

Posted in Ubuntu   |   Comments (0)

Need a Linux alternative for a Windows app?

Check out linuxalt.com.

Welcome to the Linux Alternative Project (formally the Linux Equivalent Project). The goal is to provide an informational and available website for all linux users. The website is currently in beta form. I will be periodically updating the database with Windows software and the Linux equivalents and alternatives.

Posted in Ubuntu   |   Comments (0)