On a newly installed VPS (Parallells Virtuozzo) running Ubuntu 12.04 LTS I also installed postfix as my MTA. However, it turned out that it only listened on localhost. I checked that "inet_interfaces = all" in main.cf and that my /etc/hosts was up to date with my server’s hostname. The reason was that the machine had sendmail preinstalled and running.
Now netstat -anp show that postfix listens to all interfaces:
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 691/master
https://media01.nerdia.net/uploads/nerdia-logo-340x156.png00Stefan Helanderhttps://media01.nerdia.net/uploads/nerdia-logo-340x156.pngStefan Helander2012-09-15 15:18:542012-09-03 08:20:11postfix only listens on localhost (127.0.0.1)
https://media01.nerdia.net/uploads/nerdia-logo-340x156.png00Stefan Helanderhttps://media01.nerdia.net/uploads/nerdia-logo-340x156.pngStefan Helander2012-09-10 23:39:332019-02-12 12:37:54Sweet home Alabama – on tesla coils
If you’re behind a firewall you sometimes run into a problem where the SSH client connection times out after a period of time (typically when going out for lunch leaving your SSH sessions logged in). The easiest way to solve this is by changing the configuration of the SSH client (it can also be fixed through the server config but since the problem often relates to the firewall protecting the client it is a better solution to fix this in the client).
Just edit the file ./ssh/config and add the lines:
Host *
ServerAliveInterval 30
The above assumes the firewall drops inactive connections at an interval > 30 seconds.
https://media01.nerdia.net/uploads/nerdia-logo-340x156.png00Stefan Helanderhttps://media01.nerdia.net/uploads/nerdia-logo-340x156.pngStefan Helander2012-09-05 14:01:182012-09-01 14:02:02Avoiding a SSH client connection to timeout
To make a file image of a floppy disk in Linux (like Ubuntu), you need (of course) a computer with a floppy drive (/dev/fd0). Insert the floppy you want to copy to an image file and issue the command:
I use the above method to move the content from a number of floppy disks to my hard drives. Computers today are rarely seen with a floppy drive and I wanted to secure the content before it is too late 🙂
https://media01.nerdia.net/uploads/nerdia-logo-340x156.png00Stefan Helanderhttps://media01.nerdia.net/uploads/nerdia-logo-340x156.pngStefan Helander2012-08-31 07:55:582012-08-31 07:55:58How to make a floppy file image and mounting it in Linux
From Ubuntu 11.04 and onward there is no need for a driver to use the builtin 3G (WWAN) modem in the HP Compaq 6910p laptop computer. But by default the modem is soft blocked even though the radio lamp is on. The rfkill utility can be used to enable it:
$ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
3: hp-bluetooth: Bluetooth
Soft blocked: no
Hard blocked: no
4: hp-wwan: Wireless WAN Soft blocked: yes
Hard blocked: no
Enable it with rfkill unblock 4
$ rfkill unblock 4
$ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
3: hp-bluetooth: Bluetooth
Soft blocked: no
Hard blocked: no
4: hp-wwan: Wireless WAN Soft blocked: no
Hard blocked: no
Now click on the network manager icon in the top right bar of the screen and Activate mobile broadband and off you go!
I’ve noticed that a bottleneck in Firefox performance on the ASUS EeePC 900 is writing and reading to the disk cache. It is often I wait for something on a page and I notice that the hard disk light is on indicating read/write.
One way of drastically improving the performance is to move the cache to a ramdisk as the built in flash disk in the EeePC is not the quickest one on the block. This way you might also prolong the life of the flash disk as you decrease the number of read/writes to it. The only drawback with this is that you will loose the cache content between reboots, but I don’t think that is a problem. If you have extended your machine’s ram to 2 GB (se another post about that), you have memory to spend for this, but it will probably work on 1 GB machines too.
If you are running EasyPeasy (probably in other distros too) you already have a ramdisk. Check by starting a terminal and enter the df command. If you see "/dev/shm" you have a ramdisk. Otherwise, you first need to create one (Google might be your friend in this case).
Start Firefox and in the URL-bar, type about:config and press enter. Click yes on the warning about this being very dangerous.
Find the key browser.cache.disk.parent_directory and right click to select Modify. If the key is not present, you right click in the list, select New -> String and type browser.cache.disk.parent_directory
As the value for the key, enter /dev/shm
Pull down the Edit menu and click on Settings
Click on Advanced and select the Network tab
Select the Override automatic cache handling and limit the cache size to for example 100 MB (so the cache won’t eat all your ramdisk).
Close all Firefox and restart it.
In my case, this drastically improved the Firefox performance.
https://media01.nerdia.net/uploads/nerdia-logo-340x156.png00Stefan Helanderhttps://media01.nerdia.net/uploads/nerdia-logo-340x156.pngStefan Helander2012-08-12 08:05:042012-08-12 09:09:24Improving Firefox performance on ASUS EeePC 900
The ASUS EeePC 900 is a dear friend of mine and has served me truly for a number of years. It is not my primary work horse, but on trips it is excellent with it’s small size and low weight (even on a 14 day trip I always travel with hand luggage only). It is also a comfort when travelling to know that I am not carrying an expensive piece of equipement. This little fellow has been my travel companion to many different countries – near and far away. So I really don’t want to retire it and recently I decided to "pimp it" a little. When running a couple of applications it quickly consumes the 1 GB of RAM, so a little bit more wouldn’t hurt.
It ships with 1 GB of RAM installed and it is possible to upgrade it to 2 GB. It is actually a question of replacement rather than expansion due to the fact that there are no free memory slots. The upgrade is performed by replacing the 1 GB SODIMM with a 2 GB SODIMM.
The memory module needed is a DDR2-400 SODIMM but 533 and 667 MHz will also work. I used a Crucial 2GB DDR2 PC-5300 667 MHz CL5 SODIMM. Note that memory modules are sensitive to static discharge. Preferrably you should at least have a grounding wrist wrap or even better if you have access to an ESD secure work place. In reality most of us will just rely on the kitchen table and being careful not to touch any connectors or metal parts of the memory module. That will also work in most cases 🙂
Unplug the power cord and remove the battery.
The memory module is hidden behind a hatch on the bottom of the PC. The hatch is secured with two screws, one hidden behind a EeePC label (possibly acting as a warranty void seal). Remove the two screws and the hatch.
Remove the preinstalled 1 GB SODIMM by pulling locking plates on the sides a bit apart until they release the module.
Insert the new 2 GB SODIMM and make sure it locks by pushing it gently down until the locking plates clicks into position.
Reinstall the latch and the two screws.
Install battery and connect power cord.
Say your prayers, press the power button and hopefully your EeePC boots up so you can enjoy your brand new 2 GB of RAM!
When I travel abroad I need to stay connected to the Internet, not just for fun but I have to be connected for my work. Relying only on Wifi is not a solution as I recently discovered the hard way on a trip to France. The Hotel advertised "WiFi internet" but this however, turned out to be a connection limited to only web and mail (all traffic forced through a proxy). I needed VPN to work.
The most convenient and cost effective solution is to purchase a prepaid mobile broadband from a local provider. That way I will have 3G Internet connection during my stay.
To not be forced to buy a USB modem with every prepaid mobile Internet, I purchased a Huawei E585 3G/WiFi pocket router which is not SIM locked (works with any provider). This little thing has a battery that last for a couple of hours and I only need to buy prepaid SIM-cards in the countries I visit.
I went on a trip to Latvia and my choice fell on Okarte Internet via computer. They are covering 92% of Latvia for the moment.
There are two choises – a SIM card bundled with a USB modem for Ls 9 or just the SIM card for Ls 4. It includes one week of surf (up to 50 GB) and can then be refilled. According to Okarte’s website it could be purchased on many sales points, for example Narvesen or Plus Punkt kiosks.
The first store I stopped by could only sell refills. The second store didn’t have the SIM card only so I actually bought the package with a USB modem for Ls 9, figuring Ls 5 was a cheap price for not having to run around more stores. The modem was never used, instead I put the SIM card in my pocket router.
Even though Okarte’s website is in Latvian, Russian and English nothing in the package speaks any English, only Latvian and Russian which is of little help for me.
The major problem I encountered was that there was no technical information in the package, especially regarding APN which is crucial. I looked at my network manager in Ubuntu which actually has preconfigured choises for Okarte and found out that the APN is open.lmt.lv.
With this APN set I could surf away from my resort location in Jurmala enjoying download speed at around 4-7 Mbps and upload 0,45-1 Mbps.
https://media01.nerdia.net/uploads/nerdia-logo-340x156.png00Stefan Helanderhttps://media01.nerdia.net/uploads/nerdia-logo-340x156.pngStefan Helander2012-07-31 17:50:282012-08-12 10:42:47Mobile internet broadband in Latvia
There are several methods of moving data between servers in a UNIX/Linux/BSD environment, for example scp, ftp, SMB-shares, NFS-shares or rsync. My experience is that using netcat is one of the faster methods if you have large amount of data to copy.
On the receiving server:
cd / (or the base directory under which you want to recieve the data) nc -l 1234 | tar -zxvf -
This will make netcat listen on port 1234 (don’t forget to open the port in the firewall and/or iptables).
On the transmitting server:
tar -zcvf - /data/ | nc -q 1 targethostname 1234 (replace /data/ with the folder you want to copy and targethostname with the hostname or IP-address of the receiving server)
If you have more bandwidth than computing power (i.e. a slow machine) you might want to consider to leave out the "z" in the tar commands on both sides and transfer the data uncompressed.
If you need to move data between physical locations – never underestimate the bandwith of a car loaded with harddisks (quote from a former collegue :)).
https://media01.nerdia.net/uploads/nerdia-logo-340x156.png00Stefan Helanderhttps://media01.nerdia.net/uploads/nerdia-logo-340x156.pngStefan Helander2012-07-19 09:24:322012-07-19 09:35:52Copy large amounts of data between servers
If this happens, check your BIOS setup device boot order. It is possible that some device has been listed before your real boot device.
In my case, my boot SSD drives had been moved below ALL PCI SCSI and there are other drives in the machine which are not bootable causing this problem for me.
https://media01.nerdia.net/uploads/nerdia-logo-340x156.png00Stefan Helanderhttps://media01.nerdia.net/uploads/nerdia-logo-340x156.pngStefan Helander2012-07-15 09:01:582012-08-14 08:43:17Ubuntu boot hangs with black screen and blinking cursor