A frequent scenario I come across when administering Ubuntu servers is that I want to rsync a directory (e.g. a web site) from one server to another but the destination is not writable by my user account. I have permission on the destination via the sudo command but rsync does not have built in support for this. This is rather annoying as I don’t want to enable the root account on the destination just to use rsync and I don’t want to give myself more permissions on the destination since I already have them through sudo. I found some kludge on the web that mostly didn’t work for me so worked out a solution myself. I present the first version of sudorsync, an rsync command that uses sudo! Save this to a file and make it executable and use the same as the rsync command. I’m not an experienced bash programmer so any improvements or suggestions are appreciated.
#!/bin/bash
#************************************************#
# sudorsync #
# written by Stephen Nichols #
# Email: ChinnoDog@lonesheep.net #
# August 6, 2010 #
# #
# rsync using sudo on remote end #
#************************************************#
BUILD=1 #will write routine to print this with -? later
stty -echo
read -p "[sudorsync] password for remote user: " REMOTEPASS; echo
stty echo
# update the sudo timestamp as part of the remote rsync command
rsync --rsync-path="echo $REMOTEPASS|sudo -S -p $(()) -v;sudo rsync" $*
No Comments »
I finally purchased a VPS plan. Dreamhost has been pretty great, and there is no denying that having a web site at Dreamhost is low cost and low maintanence. And, getting unlimited bandwidth and hosting space as compensation for the one time the server went down was more than I could ask for. And those one click installs… I will miss you.
I will surely have more issues managing my own server, but the experience will be invaluable and I want the benefits that come with it. At Digital Linx I get 2GB of RAM, 60GB of disk space, and 600GB of bandwidth for as low as $18.42 a month! I think this is pretty good compared to some of the others out there. I don’t think it gets much better than this.
|

|
Reliable web hosting with great features and service for a low price. |
 |
Digital Linx – Soon to be hosting this blog in Ubuntu 9.04 server with OpenVZ. See some great deals they posted on the WebHosting Talk Forums! |
1 Comment »
The early versions of Adobe Air wouldn’t open links in twirl in Chrome when I ran it on Windows. The current version won’t open links in Chromium when I run it in Ubuntu. I found this article that indicates the problem and fix. Here is the two line version of the fix. Adjust it if you aren’t running Ubuntu 9.04 (Intrepid) or wish to use a different browser.
sudo perl -i.bak -p -e 's/firefox/browser/g' /opt/Adobe\ AIR/Versions/1.0/libCore.so
sudo ln -s /usr/bin/chromium-browser /usr/bin/browser
Note: This modifies part of Adobe Air, and you will probably have to rerun the first line if you install an Air upgrade. If this blows up your Air install just delete libCore.so and rename libCore.so.bak to libCore.so.
No Comments »
I am totally slacking on blog postings. I recently started using Ubuntu on my laptop as my main operating system and have a ton of things to figure out yet. Here is an important one. I figured out printing to PDFs though. To print to PDFs:
apt-get install cups-pdf
mkdir ~/PDF
sudo chmod u+x,a+x,+s /usr/lib/cups/backend/cups-pdf
You might have to
sudo /etc/init.d/cups restart
after that.
5 Comments »
Posted by: ChinnoDog in Ubuntu
Bitlbee is a IRC proxy that allows you to connect to instant messenger services using an IRC client. It emulates an IRC server so you can connect to it from your favorite IRC client and then plug in your account information. You can install it on a server for shared use or install it on a workstation to connect to locally. Unfortunately, it doesn’t work out of the box in Ubuntu. Here is what I did to install it.
- Install bitlbee (duh).
sudo apt-get install bitlbee
- Install xinetd if you don’t already have it.
sudo apt-get install xinetd
- Now we need to copy bitlbee.xinetd into /etc/xinetd.d per the instructions. Oops, we don’t seem to have that. Make a temporary directory and download the source to get it.
cd ~
mkdir bitlbeesrc
cd bitlbeesrc
sudo apt-get source bitlbee
cd bitlbee-1.2.3/doc
sudo cp bitlbee.xinetd /etc/xinetd.d
(you are done with the source)
cd ~
rm -rf bitlbeesrc
- The /etc/xinetd.d/bitlbee.xinetd we just copied still has its default settings. Open it up in nano or your favorite editor and set “user = bitlbee” and “server = /usr/sbin/bitlbee”
- Restart xinetd.
sudo /etc/init.d/xinetd restart
- Almost done. If you connected to bitlbee now you would get permissions errors though.
sudo chmod 777 /etc/bitlbee/bitlbee.conf
sudo chmod 777 /var/lib/bitlbee
(I would like to point out here that I KNOW that you don’t want to be setting 777 permissions everywhere. I don’t think its particularly dangerous here. I’m a noob. gimme a break. :-p )
- Everything is ready. Connect to localhost on the default IRC port (6667). Proceed with the quickstart guide written by pleia2 to add accounts.
No Comments »