Saturday, July 18, 2009

RemotePad (iPhone + Ubuntu)

I've used synergy/quicksynergy in the past for controlling the mouse and keyboard on my desktop with the mouse and keyboard on my laptop. There is an app for the iPhone that allows me to do it with my iPhone the same way. It is called RemotePad. RemotePad is in the app store. Here's how to set up the server end on the computer you want to control (tested on Jaunty):
1. Install "build-essential" and "libXtst-dev" on your computer using synaptic or apt-get.
2. Download the RemotePad source package from the website.
3. Untar/Unzip the package (double click the the file and extract it where you want). This will create a folder called "RemotePad Server". I prefer to put programs like this in my /opt folder but somewhere in your home folder works fine too.
4. Then open a terminal and go to the sub-folder "X11" within the new "RemotePad Server" folder. Your command should be something like (remember to use quotes around "RemotePad Server"):
cd ~/"RemotePad Server"/X11
5. Run the following commands:
./configure
make
sudo make install
6. That's it. To start the server, use the following command:
remotepad
7. You might want to put it in sessions located in System-->Preferences--Startup Applications (so that it starts when you computer does).

Sources:
RemotePad
Ubuntu Forum Post 1
Ubuntu Forum Post 2

Tuesday, April 14, 2009

SG33G5 & Olevia

This probably affects very few people, but I'll post it anyway for my own benefit: I have a Syntax Olevia LT27HVS TV hooked up to a Shuttle SG33G5. The shuttle has a built in Intel GMA 3100 graphics card (not sure if this matters a whole lot) and this solution probably works with a LT27HV or a LT27HVX TV. To get a picture from the computer to the TV, I had to edit my xorg.conf file (the command is "sudo nano /etc/X11/xorg.conf." In ubuntu these days, this file might be blank, so here's everything from my file. The following xorg.conf worked for me regardless of whether connecting by VGA or HDMI/DVI:
Section "Device"
Identifier "Configured Video Device"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Modes "1360x768" "1280x720"
EndSubSection
EndSection
Note that if you are connecting by HDMI/DVI, you can get 1360x768 resolution, but only 1280x720 if connecting by VGA.

If this doesn't work, try changing the "Monitor" section so it looks like this:
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 47.7
VertRefresh 60
EndSection
Note that 47.7 is if connecting by HDMI to DVI. If connecting by VGA, change the 47.7 to 45.

You could also try adding the following just before the "Modes" line:
Depth 24

Hope this helps someone!

Sources:

Saturday, February 28, 2009

Synaptic Search Bug in Intrepid

There seems to be a bug in Intrepid that causes problems with the search function in synaptic. The problem usually comes up after adding a new repository. For example, after adding the medibuntu repository, none of the medibuntu packages would come up in the quick search box and only occasionally in the traditional synaptic search box. The solution is to run the following command after each time you add a new repository:
sudo update-apt-xapian-index
If that doesn't work, be sure to try both the quick search box as well as the traditional search box.

Sources
Unbutu Forums

PDFSAM and JAR files

PDF Split and Merge (PDFSAM) is a nice utility to split and merge PDFs. Just download the program and unzip it into its own folder (I'll assume you call the folder pdfsam). Stick the new folder in /opt and then create a launcher with the following command in the command box:
java -jar /opt/pdfsam/pdfsam-1.0.3.jar
Note that the name of the file will depend on what version you download.

Also, the command "java -jar" is the basic command to run jar files. You just have to have jre installed.

Sources:
PDF Split and Merge
PDF Split and Merge Instructions
JAR Files

Midnight Commander

Midnight Commander is an excellent file manager for the shell. Works well if you are running a server and want a nice overview of files and folders without the command line. Install with apt. The package is called mc. It also runs with the command: mc

Friday, February 13, 2009

Transmission & Clutch on Ubuntu Server (with startup script)

Transmission, the default torrent program on Ubuntu now, also has a command line version that can be run on a server. This combined with Clutch, the web user interface for transmission, makes a nice pair. The version that is available in the repositories still has Transmission and Clutch as separate downloads, therefore, I recommend downloading directly from the Transmission site or Transmission repository. The instructions below have some references to synaptic just in case you are doing this on the desktop version. Here's how to set it up:

1. Add the Transmission repository to /etc/apt/sources.list or through synaptic. For hard the deb line is:
deb http://ppa.launchpad.net/transmissionbt/ubuntu hardy main
If you are using intrepid, just replace intrepid for hardy in the line above. See the download site for more explanation.

2. Add the GPG signing key with the following commands:
gpg --keyserver keyserver.ubuntu.com --recv 976b5901365c5ca1
gpg --export --armor 976b5901365c5ca1 | sudo apt-key add -

3. Now update and upgrade apt--you can do this with the following command or by hitting reload in synaptic:
sudo apt-get update && sudo apt-get upgrade

4. Now install transmission command line version with the following:
sudo apt-get install transmission-cli

5. After it is installed, type in the following command.
transmission-daemon
After you have executed it, it might be a good idea to restart after this is done. The purpose of starting the daemon is to make sure you get some folders and files in your home directory.

6. You now need to make some edits to the settings.json file. It is located at:
/home/username/.config/transmission-daemon/settings.json
It should look something like this to begin with:
"blocklist-enabled": 0,
"download-dir": "\/home\/anyone",
"download-limit": 100,
"download-limit-enabled": 0,
"encryption": 1,
"max-peers-global": 200,
"peer-port": 51422,
"pex-enabled": 1,
"port-forwarding-enabled": 0,
"rpc-authentication-required": 0,
"rpc-password": "",
"rpc-port": 9091,
"rpc-username": "",
"rpc-whitelist": "127.0.0.1",
"upload-limit": 100,
"upload-limit-enabled": 0
You want to change it so it looks something like this:
"blocklist-enabled": 1,
"download-dir": "\/home\/anyone",
"download-limit": 100,
"download-limit-enabled": 0,
"encryption": 1,
"max-peers-global": 200,
"peer-port": 51422,
"pex-enabled": 1,
"port-forwarding-enabled": 0,
"rpc-authentication-required": 0,
"rpc-password": "",
"rpc-port": 9091,
"rpc-username": "",
"rpc-whitelist": "127.0.0.1,198.168.1.*",
"upload-limit": 100,
"upload-limit-enabled": 0
As you can see, the first change is on the "blocklist-enabled" line. You are changing 0 to 1. This is obviously to enable blocklists. If you have something like moblock running, you can leave this as 0. I will discuss setting up blocklists further below. The second change is to the "rpc-whitelist" line. You basically need to add the ip address from which you will be accessing the server. The example listed above assumes your ip address will begin with 192.168.1. Throw in a * to cover everything else. To allow all ip addresses, you could probably add something like "*.*" although I have not tested this. In any even, change "192.168.1.*" to suit your individual ip address.

7. You now need to add a couple scripts to your system that the Transmission page provides for you. The first helps automate the startup of transmission when you boot. To do this, go to first to the Transmission Initd Script page so that you are able to copy the text of the script listed.

8. After you have copied the text, create a new file in /etc/init.d/ with the following command (nano can be substituted with gedit if you like):
sudo nano /etc/init.d/transmission-daemon
When the blank file comes up, paste in the script you copied from the transmission web page and hit save.

9. You also need to make this file executable by running the following command:
sudo chmod +x /etc/init.d/transmission-daemon

10. Now that we have the initd file, we need to add it to the appropriate spots in the system so that it starts automatically. It may work to simply add the new file/command (/etc/init.d/transmission-daemon start) to /etc/rc.local, however, the proper level is to add it to the appropriate rc runtime folders in /etc. To do this, run the following command to make sure transmission-daemon starts on startup and stops on shutdown:
sudo update-rc.d FOO defaults

11. Finally, we need a script to update the blocklist if you want one. Once again, you must copy the text of the script from the Transmission Blocklist Script page and paste it into a new file that you create. You can put this new file wherever you want, I suggest somewhere in your home directory. So you would create it with a command like this one:
sudo nano /home/yournamegoeshere/transmission-blocklist
Then paste in the text, save, and exit.

12. To automate this file, we simply need to add it to crontab. Do this with the following command:
crontab -e
Add the following line to have it update everyday at 1:00 a.m.:
00 01 * * * cd /home/yournamegoeshere && sh ./transmission-blocklist

13. Restart your system and you should have transmission running. You can access it by going to the following page:
http://serveripaddress:9091/transmission
If that doesn't work, try:
http://serveripaddress:9091/transmission/web/
Note also that you have the appropriate port open on your firewall. You shouldn't need the 9091 port open unless accessing the server from outside of your network, but you will need to open the peer port noted in your setting file described above. In that example, the port is 51422.

Sources:
Transmission
Transmission Initd Script
Transmission Blocklist Script
Startup Scripts Description
Crontab Explanation

Sunday, January 25, 2009

If the number pad isn't working on the Guest OS in Virtualbox...

If the number pad isn't working on the Guest OS in Virtualbox, try the following:
Go to System-->Preferences-->Keyboard (not Keyboard Shortcuts)
Then go under the "Mouse Keys" tab and make sure "Allow to control the pointer using the keyboard" is NOT checked. That solved the problem for me.

Sources:
Ubuntu forum post one
Ubuntu forum post two
(Another possible, but untested, solution)

Wednesday, November 05, 2008

Alternatives to Jinzora (Ampache and Subsonic)

UPDATE: The instructions below regarding Subsonic are for Hardy. For Intrepid, these instructions stay the same except for the following: Install tomcat6 instead of tomcat5.5. Then substitute tomcat6 wherever you see tomcat5.5 in the following instructions. Also substitute port 8080 anywhere you see port 8180.

I have found a couple alternatives to Jinzora that I think I actually like better. The reason is mostly the interface. The first is Ampache. This one is simple because you install it from the repositories (just type sudo apt-get install ampache). Then go to the site (http://yourserverip/ampache).

The second, and possibly my favorite, is Subsonic. There is a great howto here. But in case it ever gets lost, here it is again (instructions are for Hardy):
1. Download Subsonic (war version) from here and unzip the subsonic.war file.
2. Install tomcat5.5, java-jre, and java-jdk with the following:
sudo apt-get install tomcat5.5 sun-java-jre sun-java-jdk
3. Modify init for tomcat with the following:
sudo nano /etc/init.d/tomcat5.5
Find where it says TOMCAT_SECURITY=yes and change it to no.
4. Restart tomcat with:
sudo /etc/init.d/tomcat5.5 restart
5. Move that subsonic.war file that you previously unzipped to /var/lib/tomcat5.5/webapps with:
sudo mv /current/location/of/subsonic.war /var/lib/tomcat5.5/webapps/
6. Make a subsonic directory with:
sudo mkdir /var/subsonic
7. Then change the ownership of that folder with:
sudo chown tomcat55:nogroup /var/subsonic
8. Open up port 8180 if you have a firewall.
9. Reboot your computer
10. Try it out by going to:
http://yourcomputerip:8180/subsonic
11. You will initially login with "admin" as both your ID and password. Once at the site, you can change the password, add users, and add music.

Sources:
Subsonic
Subsonic Installation Howto

Tuesday, September 16, 2008

Remote Access to CUPS Web Interface

If you have a server(without gnome or kde running) and need to install a printer, the easiest way is to use the CUPS web interface. You can see it on your own ubuntu computer by going to http://localhost:631/admin. But to get to this page remotely for a server, you need to first make some edits to the cups conf file. So do the following:
1. Edit the cups configuration file by first running the following command on your server:
sudo nano /etc/cups/cupsd.conf
2. Your first edit to the file is to make the section that looks like:
# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock
look like this:
# Only listen for connections from the local machine.
Port 631
Listen /var/run/cups/cups.sock
3. You then want to change the sections that looks like this:
< Location / >
# Restrict access to the server...
Order allow,deny
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
< /Location >
so they look like this:
< Location / >
# Restrict access to the server...
Order allow,deny
Allow all
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow all
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
Allow all
< /Location >
4. Finally, restart cups with the following:
sudo /etc/init.d/cupsys restart
5. You should now be able to log into cups on your server with:
http://yourserverip:631
Note that when you change something, it may tell you that you need to add a certificate to firefox. Do so by clicking the add/get certificate button at the bottom of the firefox error message page. It will also tell you that to change stuff, you need to use the "https" version of the page instead of "http" so just go to:
https://yourserverip:631
You might also have to open/port forward port 631.

Sources:
Ubuntu forums post
Ubuntu Community Docs on Network Printing