The Motorola A1200 is a Linux-based line of mobile phones targeted mainly at the Chinese market (the only language options are English, Simplified Chinese, and Traditional Chinese). I chose this phone in advance because it was Open Source (Linux-based) and looked like it would satisfy my main requirements: an English system from which I could send and receive Chinese text messages, a touch-screen with handwriting recognition to facilitate my Chinese studies, and the probable capability of installing my favorite Linux Chinese-English dictionary.
I ended up buying an older, original model really cheap for 600 RMB (just under US$100) as the latest models, the A1200e and the A1210 were being quoted at 1600-1800+ RMB.
A bad first impression:
So far I quite like the phone itself, but the battery fiasco is really a little unbelievable coming from a theoretically top-tier company like Motorola. I think most people would have given up on the phone already and tried to exchange it for something else. I still might, if I keep finding problems.... So far this evening I have found that my current Linux desktop cannot connect to the USB Mass Storage device on the phone, meaning I cannot use USB to get files on and off the phone. That makes the phone's onboard camera useless, and means I cannot install my dictionary.
So I guess I will go get a bluetooth card for my desktop and try to communicate with the phone that way....
Ever cursed a site you want to check periodically for not having an RSS feed? cron / msmtp / web2mail.com offers a slightly crude solution -- crude because you get the whole page every time, not just new content.
web2mail.com provides a means of receiving website content via e-mail. I use msmtp to send the request to web2mail.com via one of my e-mail accounts, and cron to specify the frequency and issue the e-mail.
(I first tried to send the e-mail directly from my laptop mail server to web2mail.com, and web2mail.com did not like my e-mail and bounced it. Thus the msmtp strategy.)
I setup one of my e-mail accounts in ~/.msmtprc as follows:
# 163.com account 163 host smtp.163.com auth plain from firstname.lastname@example.org user user password password
Then in a terminal issue "crontab -e" and add the following entry:
25 14 * * 1,4 echo -e "Subject: http://www.website-you-want-sent.com/ \n\n This is message body" | msmtp -a 163 -v email@example.com
which grabs the web page on the first and fourth days of the week at 14:25.
When copying directories between two servers, there are two main candidates to choose from:
scp -rp apache2/ firstname.lastname@example.org:/etc/
rsync -avz -e ssh apache2 email@example.com:/etc/
|does well over poor network||does poorly|
|requires rsync and ssh servers installed on both ends||only requires ssh server|
|preserves sym links||does not|
|can continue an interrupted transfer||must start from scratch|
|be careful to use ssh tunnel for secure tranfer||all transfers encrypted|
With rsync also be careful about the source specification. "apache2" will create an apache2 directory in the destination /etc/. But "apache2/" will copy the files contained within apache2 into the destination /etc/. You want the former.
I expect to be accessing some services on my laptop via Apache over an untrusted network in the near future, so I need to turn on SSL.
As usual, turn on the Apache SSL module:
and the default SSL configuration:cd /etc/apache2/mods-enabled/ ln -s ../mods-available/ssl.conf . ln -s ../mods-available/ssl.load .
cd /etc/apache2/sites-enabled/ ln -s ../sites-available/default-ssl 001-default-ssl
Now restart Apache and it just works!? Apparently there is a "snakeoil" certificate already in place to get the job done. Trivial. Thank you, Debian Apache packagers.
As of September 2009 I have been running a VPS Xen server on vpslink for just over a year now, and am sufficiently satisfied with their service to start giving them six months of money at a time and increase my server to 128M so I can also run Apache. So I am now running a lightly loaded e-mail server and a web server on my vpslink VPS.
There have been some issues with uptime in the past year, but their tech support has always been prompt in addressing outages, and generally I believe them to be a good company to work with.
Just for the record, I bumped into another ISP that challenges their low price-point with a 512M OpenVZ VPS for only $6 per month. (I believe that OpenVZ means no swap.....) If this is not a temporary teaser price, they might be worth checking out at some point.
As of summer 2008, I have been using a vpslink.com VPS for a about a month now, and so far, all is well, especially the price.
If your needs are simple, their 64 MB RAM / $7.95 plan is a good deal. If you choose XEN hosting, you also get some swap. I currently have postfix / dovecot / MySQL and a couple other minor daemons running in this skinny little RAM no problem, no swapping (and as yet, very little load! I am still setting up....)
There is a wide choice of Linux distros to choose from for your VPS, I chose Debian.
This is my first VPS, so I can't really compare with other service offerings. I can say that getting installed and setup was trivial, and thereafter everything works just like the same old Debian I am used to.
The only snafu so far is some unnecessary password confusion. When you start up with the service, the same password works everywhere. However, if you start changing passwords, you will soon find that your newly changed password does not necessarily apply everywhere you think it should. And most confusing of all, at least the first time, if you reboot your server from the Control Panel on their website, the root password gets reset to the original password. Lesson: keep that original password safe, you might need it for a long time.
I will keep this post up-to-date with my on-going experience.
If you register for an account, be sure to use my referral code: F5H33Z. You will get a 10% discount, and I will get a few pennies as well.
I am writing this as of the kernel 2.6.30/udev era, on Debian testing.
I have a an external USB hard drive that I use all the time. When I boot from scratch, the default udev configuration always assigns the first partition to /dev/sda1. However, when I suspend and then resume, udev likes to put it somewhere else, /dev/sdb1 for instance. Therefore an /etc/fstab entry of the following variety:
/dev/sda1 /mnt/usbfat vfat user,exec,dev,suid,rw,umask=0000 0 0
will not always work because there is no guarantee the partition will get /dev/sda1 every time. The solution is to identify the partition by its label in /etc/fstab. First assign a label to the partition.
For a FAT partition, use the mtools package. First configure mtools by adding the following line
drive x: file="/dev/sdb1"
to /etc/mtools.conf. (This of course assumes that the drive is being assigned currently to /dev/sdb1, which you can verify in /var/log/syslog.) Then write the label to the partion:
# mlabel x:
Volume has no label
Enter the new volume label : USBFAT1
For an ext2/ext3 partition, use:
# e2label /dev/sdb1 USBEXT1
For KDE users, and probably Gnome users as well, this is already enough, it should automount on insertion to the same mount point every time. If you are using a window manager with fewer bells'n'whistles, you probably need to explicitly specify the mount point. There are two ways to set up /etc/fstab. Edit /etc/fstab to contain ONE of the following lines:
LABEL=USBFAT1 /mnt/usbfat vfat user,exec,dev,suid,rw,umask=0000 0 0
/dev/disk/by-label/USBFAT1 /mnt/usbfat vfat user,exec,dev,suid,rw,umask=0000 0 0
Unplug your USB drive, wait a few seconds, then plug it back in. Now type:
This simple tutorial is meant to show the basics of how to get networking working on Debian Linux from the command line, and assumes at least that your network card has been recognized, the appropriate kernel module has been loaded, and a viable network interface initialized for the network card. This should all happen automatically on boot or card insertion, and if it does not, getting your card to work is unlikely to be a simple task.
(Note that there are various GUIs that try to make networking "easy" in Linux, but in my experience they do not work very well, and once you know the command line method you will rarely crave a GUI....)
All commands in this tutorial require a root terminal. The commands we are going to use are:
To find out what live network interfaces you have, enter ifconfig:
# ifconfig eth1 Link encap:Ethernet HWaddr 00:30:bd:d0:16:d0 inet addr:192.168.8.6 Bcast:192.168.8.255 Mask:255.255.255.0 inet6 addr: fe80::230:bdff:fed0:16d0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:41490 errors:57 dropped:0 overruns:0 frame:0 TX packets:43735 errors:10 dropped:15 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:29486719 (28.1 MiB) TX bytes:13372215 (12.7 MiB) Interrupt:3 Base address:0x3100 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:12 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:600 (600.0 B) TX bytes:600 (600.0 B)
In the above example, "lo" is the loopback interface (important but irrelevant to this tutorial) and "eth1" is the network interface with the outside world. In eth1, note:
inet addr: 192.168.8.6
which tells you that eth1 has an IP address (and in fact is my wireless card as I write this). Though not always strictly true, for the purposes of this tutorial, if there is no IP address, the network is not working. Now enter "ifconfig -a":
# ifconfig -a eth1 Link encap:Ethernet HWaddr 00:30:bd:d0:16:d0 inet addr:192.168.8.6 Bcast:192.168.8.255 Mask:255.255.255.0 inet6 addr: fe80::230:bdff:fed0:16d0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:41860 errors:66 dropped:0 overruns:0 frame:0 TX packets:44166 errors:10 dropped:15 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:29644024 (28.2 MiB) TX bytes:13420797 (12.7 MiB) Interrupt:3 Base address:0x3100 eth4 Link encap:Ethernet HWaddr 00:d0:59:c1:e6:79 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:12 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:600 (600.0 B) TX bytes:600 (600.0 B)
Note that "eth4" has now joined the party, and does not have an IP address. eth4 in fact is my on-board wired network card which I am not using and have turned off. "ifconfig" shows all active network interfaces, and "ifconfig -a" shows all network interfaces, including those that are not turned on.
udev is the piece of software that is supposed to assign a unique network name (eth0, eth1, eth3, wlan0, etc.) to every network card plugged into your system, which should remain stable over reboots. (Of course, you can change this behavior and even choose what name is assigned to a given card.....)
Now have a look at the file /etc/network/interfaces with your favorite text editor. Mine looks like this:
Interfaces with an "auto" line should be started automatically on boot, in this case lo and eth1. "man interfaces" will tell you lots more about the contents of this file, but for the simplest case,
# The loopback network interface auto lo iface lo inet loopback # wireless card auto eth1 iface eth1 inet dhcp wireless-essid any wireless-mode Managed # internal wired card iface eth4 inet dhcp
iface eth4 inet dhcp
specifies the configuration of the eth4 wired interface: the network will be queried for a dynamically assigned IP address via DHCP, and
iface eth1 inet dhcp wireless-essid any wireless-mode Managed
will do the same for the eth1 wireless interface. The 2nd and 3rd lines give the wireless card permission to connect to any wireless access point that it can find. (Of course, one can also not use DHCP and assign a static IP, and also specify the access point.... not covered here.)
With a /etc/network/interfaces file with the above contents, at the root prompt issuing
will start the wireless interface. If the card finds a willing and appropriately configured access point, ifconfig should show eth1 as having an IP address. You can find out more about what is going on with your wireless card (and reconfigure it) with the iwconfig command:
# iwconfig lo no wireless extensions. eth4 no wireless extensions. eth1 IEEE 802.11-DS ESSID:off/any Mode:Managed Frequency:2.422 GHz Access Point: 00:40:05:D0:7F:9C Bit Rate:11 Mb/s Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality=61/100 Signal level=27/100 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:35909
You can also have a look at what other access points the wireless card is seeing with the iwlist command:
# iwlist eth1 scan eth1 Scan completed : Cell 01 - Address: 00:40:05:D0:7F:9C ESSID:"15hao" Mode:Managed Channel:3 Quality:16/100 Signal level:16/100 Noise level:0/0 Encryption key:off
Just one access point in this neighborhood....
Suppose this is your home configuration, and at work you have a wireless network called 2WIRE162 protected (not very) with a WEP key. Add the following stanza to your /etc/network/interfaces file:
In our /etc/network/interfaces file we have three physical network interfaces (lo, eth1, and eth4) and now we have added a "logical" interface called "work". A physical interface corresponds to a network card ("lo" is a special case that does not) and a logical interface *can be* associated with any physical interface. Ie.
iface work inet dhcp wireless-essid 2WIRE162 wireless-mode Managed wireless-key 0642243084
will cause eth1 to connect to any open access point in the vicinity, whereas
will permit eth1 to only connect to an access point with an SSID of "2WIRE162" and a WEP key of "0642243084".
WPA encryption, unlike WEP, provides real security, but is a little complicated to setup and will not be covered here. If you want WPA, you need to configure a piece of software called "wpasupplicant".
I will probably not part ways soon with Firefox because of its vast library of very useful plugins. But Google's Chrome is quickly becoming my essential second browser. There is of course the much publicized feature that every tab in Chrome runs in its own thread, therefore the contents of one tab locking-up do not effect the other tabs.
But Chrome also generally seems to be faster, and I have found at least one huge (for those of us living in bandwidth-starved regions of Asia) Chrome advantage in the https domain: when bandwidth is truly awful and Firefox sits quietly going nowhere for half an hour, Chrome succeeds in bringing down the page, sometimes in just a couple of minutes. The difference between a couple of minutes and a half hour to never is truly vast. No contest. Note that I have not yet tested this for http.
If this is a first install on a new server, this guide is a must read. Some of the highlights:
apt-get install apache2 php5 php5-curl php5-mysql mysql-server mysql-client xpdf zip unzip catdoc pstotext
apt-get install python-reportlab python-imaging python-uno antiword sun-java5-jre sun-java5-bin lynx openoffice.org-java
And do not forget to bump memory_limit up to at least 64 in /etc/php5/apache2/php.ini.
Get the latest source tarball from here.
In your desired web root, make a copy of knowledgetree for this instance, then sim link a simpler name, ie.
tar -xvf ktdms-src-oss-3.5.4a.tgz mv kt-dms-oss/ kt-dms-oss-3.5.4a ln -s kt-dms-oss-3.5.4a/ knowledgetree
Give ownership to the web server process:
chown -R www-data:www-data kt-dms-oss-3.5.4aCreate a new MySQL database for the new instance:
# mysql -u root -p Enter password: mr4gvc7s mysql> create database apps_kt; mysql> grant all on apps_kt.* to 'apps_kt'@'%' identified by 'password'; flush privileges;
Edit config/config.ini to agree:
Now import the database from sql/mysql/install:dbName = apps_kt dbUser = apps_kt dbPass = password dbAdminUser = apps_kt dbAdminPass = password
Separate out the configuration and the data:mysql -u root -p apps_kt < structure.sql mysql -u root -p apps_kt < data.sql
mv knowledgetree/var/ kt-var mv knowledgetree/config/config.ini kt-config.ini cd knowledgetree ln -s ../kt-var/ var cd config/ ln -s ../../kt-config.ini config.ini
Now login to the new KnowledgeTree instance with the default:
user: admin password: admin
and change the admin password.
Anticipated path for upgrading to a new version of Knowledgetree:
mldonkey is kind of a special beast among P2P file sharing software in that it is basically a headless server, with GUIs being more or less an after-thought that in my experience do not really work. I started using mldonkey because I was specifically looking for headless software to run on the Donkey and Kademlia networks, and have found it quite simple to operate from a telnet command line.
Defaults are all quite sane except that Kad is turned off by default, ie. this setting must be changed in downloads.ini:
enable_kademlia = true
Connect to and control mldonkey thusly:
telnet localhost 4000
auth admin ""
where "mlnet" starts the mldonkey server, and the "auth" line logs in to the server. At the admin prompt, here are a subset of commands that I personally find useful:
start download: dllink view download status: vd list connected servers: vm list server id assignment: id kad_boot 126.96.36.199 4166 kad_dump_known_peers kad_stats kad_load : load the peers from a contact.dat file search: s view all queries: vs view results: vr download search result: dd exit: q stop server: kill