Posts tagged: ubuntu

How to get postfix to deliver root’s mail locally when using a smarthost

By , 2015-12-09 10:40

When setting up Postfix on Ubuntu/Debian as “Internet Site with smarthost” to use an external smtp relay, automatic e-mails intended for “root” (such as cron job error reports) get sent out to the smarthost with a To: address of root@myhost.mydomain.com. This can cause a problem as the smarthost doesn’t know where to deliver these messages to, since myhost.mydomain.com has no MX record.

The fix for this is (go figure) in the Postfix README:

Delivering some but not all accounts locally

A drawback of sending mail as “user@example.com” (instead of “user@hostname.example.com”) is that mail for “root” and other system accounts is also sent to the central mailhost. In order to deliver such accounts locally, you can set up virtual aliases as follows:

1 /etc/postfix/main.cf:
2     virtual_alias_maps = hash:/etc/postfix/virtual
3 
4 /etc/postfix/virtual:
5     root     root@localhost
6     . . .

Translation:

Execute the command “postmap /etc/postfix/virtual” after editing the file.

Oddly, just adding the line

root: root@localhost

to /etc/aliases doesn’t work. You really need to do the steps outlined in the manual.

Enabling DVD playback on Ubuntu 14.04

By , 2014-08-02 21:37

I don’t really play DVDs on my PCs much anymore, but my brother have me the full boxed set of Freaks and Geeks (great show, cancelled too soon). Running on a fresh install of Ubuntu 14.04, I popped in the DVD and was prompted by “Video Player” aka Totem to install some additional codecs. I obliged, but after the installation, the DVD still wouldn’t play. It turns out that because of legal issues, the libdvdcss2 library is no longer included in the Ubuntu repositories. However, the libdvdread4 package does provide a script to easily install it.

Once you have libdvdread4 installed, run following script:

# sudo /usr/share/doc/libdvdread4/install-css.sh

Restart your video player and enjoy your DVD.

Screenshot from 2014-08-03 01:35:17

Atheros AR5005/5212, WPA encryption

By , 2012-11-07 22:08

I have a few old reliable AR5005G (5212, PCI 168c:0013) cards, both MiniPCI and Cardbus from the heyday of Wireless-G back in the early ’00s. Back then, Atheros 500x series cards were THE cards to have if you wanted to have some fun with aircrack, or if you just wanted your WiFi to actually WORK, especially under Linux. The madwifi (aka ath_pci) drivers were probably the most stable wireless drivers at the time. Even on Windows, you could use 3rd party drivers to put the cards in monitor mode and capture packets.

Times have changed and madwifi has been superseded by ath5k (and indirectly ath9k).

For some reason I decided to install Ubuntu 12.04 on an old Fujitsu Lifebook (Pentium III 600MHz, upgraded 512MB RAM, ATI Mobility Radeon M4) without built-in wireless, using a Netgear WPN511 Cardbus adapter. I expected everything to work as it did in the old days, but for some reason the WiFi wouldn’t stay connected.

It seems the hardware encryption capabilites on the card don’t quite support WPA2/CCMP-AES, even though the ath5k driver says it does. So the solution is to disable hardware encryption support:

echo "options ath5k nohwcrypt=1" | sudo tee /etc/modprobe.d/ath5k.conf

Then reboot, or reload the ath5k module (modprobe -rv ath5k, modprobe -v ath5k).

Now I can enjoy my surprisingly not-extremely-slow 10-year old laptop wirelessly.

Source: http://ubuntuforums.org/showthread.php?p=12086356#post12086356

http://madwifi-project.org/

Useful apt commands

By , 2012-10-29 14:46

apt-cache search [searchterm]

search local apt-cache for a package  containing [searchterm]

apt-file list [packagename]

lists all files associated with [packagename], even if the package is not installed

apt-file search [/path/to/file]

search for the package that “owns” [/path/to/file]

apt-cache madison [packagename]

displays all available versions of [packagename]

apt-get install [packagename]=[version]

force apt to install a specific version of a package

Fix file open and “Open containing folder” on KDE/Kubuntu 12.04

By , 2012-04-12 16:02

Kubuntu 12.04 is no longer a Canonical-maintained distribution. As such, support for the firefox-kde-support package has been discontinued.

Here’s a workaround to get firefox’s downloaded file handling to work correctly:

Here is a workaround for the Firefox problem from Canonical support:

1) stop firefox
2) rm ~/.mozilla/firefox//mimeTypes.rdf
3) start firefox
4) download a file
5) open it from the downloads menu and choose the application. Browse to /usr/bin/xdg-open. then check to remember your choice

Source: http://askubuntu.com/a/113090

XBMC on Ubuntu clean install

By , 2012-01-14 17:22

Note to self: Always install ubuntu-restricted-extras first. Without it, XBMC will crash when playing MP3s since libmad is missing.

Ubuntu. TV for human beings. I gotta feeling.

By , 2012-01-12 14:14

So Ubuntu is getting into the TV business. If they can pull it off, and get into Cable/Satellite/IPTV STBs, the would would be a much better place. This looks way better than Microsoft Mediaroom or any proprietary cable box software I’ve seen.

Now, is it just me or does that video sound a lot like this one?

I have to say, I gotta feeling that Canonical might have got it right. Unfortunately, past experience says Big Telecom isn’t very interested in what’s good for the customer.

more at

http://www.ubuntu.com/tv
http://www.theverge.com/2012/1/10/2697982/interview-ubuntu-tv-pete-goodall

Why I use Debian and Ubuntu (Apt)

By , 2011-12-21 10:35

OK, rant time.

Way back in the day (I mean 2001 or so), I used to use rpm-based distros. Red Hat, Mandriva – or rather Mandrake- and they worked fine. As long as you didn’t have to install any packages. To be fair, this was in the early days of package managers and the like, and I was a novice Linux user at the time. Mandrake had put in a good effort with urpmi, but I still had to visit sites like http://rpm.pbone.net/ and http://rpmfind.net/ very often to find this or that package.

Then, in 2004/2005, I discovered Ubuntu. (The OS, not the philosophy. Ha ha.) It was a world of difference. Need a program? apt-get install program would automagically fetch and install it for you. Don’t know the name of the package, or exactly what you’re looking for? apt-cache search can help. If that package you want installed has dependencies, and those have dependencies? No problem, everything gets pulled in and the proposed changes are listed for you. The other advantage was that seemingly any program I could possibly want was available in a Debian/Ubuntu repo.

Fast forward to today. I’ve pretty much been using Debian based distros since then, although I have tried Arch and Slax, and possibly many others that I can’t remember right now. All my servers run either Debian or Ubuntu Server, and my Linux PCs are Ubuntu or Arch. Package management has become so easy that I rarely ever have to worry about it, unless I’m trying to make some major changes outside of repo packages.

Recently, however, I’ve started using some RPM distros again, to see how things have been on that side of the fence. It’s been mostly CentOS and a few CentOS/PBX distros (Elastix, Trixbox, pbxinaflash…). I have to say though, I can’t believe the state of the package management system. CentOS has got yum, which seems to be good in principle, but somehow I’ve seen it massively fail in ways that Apt never has for me. The first issue is not really to do with the package manager, but more the repositories.

For example, we had a service on a server at work that absolutely required “Arial”. In Ubuntu or Debian, all you have to do is enable the non-free repo, or an Arch, use one of the excellent AUR frontends such as yaourt. Then install msttcorefonts (Debian) or ttf-ms-fonts (Arch). The package manager will fetch the MS fonts package and its dependency, cabextract. It then downloads each of the fonts’ self-extracting EXEs from sourceforge, cabextracts them, then installs them to the appropriate fonts directory. Now, on the CentOS 5 server, no such luck.

$ yum install msttcorefonts
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.nexicom.net
 * extras: centos.mirror.nexicom.net
 * updates: centos.mirror.nexicom.net
Excluding Packages from CentOS-5 - Addons
Finished
Excluding Packages from CentOS-5 - Base
Finished
Excluding Packages from CentOS-5 - Extras
Finished
Excluding Packages from CentOS-5 - Updates
Finished
Setting up Install Process
No package msttcorefonts available.
Nothing to do
$

Awesome. Time to break out the manual package manager, AKA Google. Which brings me to the corefonts sourceforge project homepage, fortunately with clear instructions on how to install on an rpm-based system.

  1. Make sure you have the following rpm-packages installed from from your favourite distribution. Any version should do.
    • rpm-build
    • wget
    • A package that provides the ttmkfdir utility. For example
      • For Fedora Core and Red Hat Enterprise Linux 4, ttmkfdir
      • For old redhat releases, XFree86-font-utils
      • For mandrake-8.2, freetype-tools
  2. Install the cabextract utility. For users of Fedora Core it is available from extras. Others may want to compile it themselves from source, or download the source rpm from fedora extras and rebuild.
  3. Download the latest msttcorefonts spec file from here
  4. If you haven’t done so already, set up an rpm build environment in your home directory. You can to this by adding the line %_topdir %(echo $HOME)/rpmbuild to your $HOME/.rpmmacros and create the directories $HOME/rpmbuild/BUILD and $HOME/rpmbuild/RPMS/noarch
  5. Build the binary rpm with this command:
    $ rpmbuild -bb msttcorefonts-2.0-1.spec

    This will download the fonts from a Sourcforge mirror (about 8 megs) and repackage them so that they can be easily installed.

  6. Install the newly built rpm using the following command (you will need to be root):
    # rpm -ivh $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm

Sounds like fun. Let’s try and see if we’re lucky.

yum install wget rpm-build cabextract

Cool! rpm-build was installed! but wait, how about wget and cabextract? It didn’t mention those!

wget is probably installed, but let’s try anyway:

$ wget
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

OK, how about cabextract?

$ cabextract
sh: cabextract: command not found

Well then, that’s wonderful. Thanks for mentioning that you didn’t install cabextract, yum.

Fortunately the good people at corefonts provided a link to the download for cabextract, and fortunately, my server is i386 (I know it doesn’t seem like it from the screenshot), so I can use the pre-built RPM. (For those who need it, the x86_64 package) Now to the final step.

$ wget -O - http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec | rpm -bb msttcorefonts-2.0-1.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.77304
+ umask 022+ cd /usr/src/redhat/BUILD

[… a hundred or so lines…]

Wrote: /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.22861
+ umask 022
+ cd /usr/src/redhat/BUILD
+ '[' /var/tmp/msttcorefonts-root '!=' / ']'
+ rm -rf /var/tmp/msttcorefonts-root
+ exit 0

Phew, that’s a lot of output. Well exit 0, that’s good. Aaand “Wrote: /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm”. cool!

And finally:

$ rpm -ivh /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
Preparing...                ########################################### [100%]
   1:msttcorefonts          ########################################### [100%]
$

(Another thing that bugs me – no success message! After all that, not even a Yay! Package installed!? I’m disappointed, rpm.)

For illustrative purposes, Debian:

# apt-get install msttcorefonts
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  cabextract ttf-liberation ttf-mscorefonts-installer
The following NEW packages will be installed:
  cabextract msttcorefonts ttf-liberation ttf-mscorefonts-installer
0 upgraded, 4 newly installed, 0 to remove and 4 not upgraded.
Need to get 1103kB of archives.
After this operation, 2109kB of additional disk space will be used.
Do you want to continue [Y/n]? Y

[…]

All fonts downloaded and installed.
Updating fontconfig cache for /usr/share/fonts/truetype/msttcorefonts
Setting up msttcorefonts (2.7) ...
Setting up ttf-liberation (1.04.93-1) ...
Updating fontconfig cache for /usr/share/fonts/truetype/ttf-liberation

Wasn’t that easier? Also, a nice plain English message saying what was done: “All fonts downloaded and installed.” Take notes, rpm.

For completeness’ sake, Arch:

$ yaourt -S ttf-ms-fonts

==> Downloading ttf-ms-fonts PKGBUILD from AUR...
x PKGBUILD
x ttf-ms-fonts.install
x LICENSE

[…]

==> ttf-ms-fonts dependencies:
 - fontconfig (already installed)
 - xorg-fonts-encodings (already installed)
 - xorg-font-utils (already installed)
 - cabextract (package found)

[…]

Targets (1): ttf-ms-fonts-2.0-8

Total Download Size:    0.00 MB
Total Installed Size:   5.49 MB

Proceed with installation? [Y/n]
(1/1) checking package integrity                                         [########################################] 100%
(1/1) checking for file conflicts                                        [########################################] 100%
(1/1) installing ttf-ms-fonts                                            [########################################] 100%
Updating font cache... done.
$

A bit more user interaction, but that’s the point of Arch.

So, to summarize:

Arch/Debian package management > rpm package management (CentOS).

And that’s the end of my rant for today.

3 monitors and Updated xorg mesa drivers for Ubuntu Natty

By , 2011-09-09 14:34

I’m currently running Ubuntu Natty as my primary OS at work.

My setup is a Precision T3500 workstation that came with two NVIDIA Quadro cards which were a nightmare for Linux support. I heard that ATI cards supported 3 monitors on one card, as long as one of them was DisplayPort. I saw a cheap Radeon HD 5450 on sale for about $40, so I picked it up only to notice that it had an HDMI port instead of DisplayPort. I figured I’d try it anyway and was surprised to find that with the open-source radeon driver, 3 monitors work! One is connected by VGA, one HDMI and one DVI.

I had, however been experiencing random X crashes, and I suspect the problem was with the radeon driver.

Currently testing out some updated xorg drivers found at:

http://phoronix.com/forums/showthread.php?50038-Updated-and-Optimized-Ubuntu-Free-Graphics-Drivers

 

My system specs:

$ sudo lshw -short
H/W path         Device      Class       Description
====================================================
                             system      Precision WorkStation T3500 ()
/0                           bus         09KPNV
/0/0                         memory      64KiB BIOS
/0/400                       processor   Intel(R) Xeon(R) CPU           W3530  @ 2.80GHz
/0/400/700                   memory      256KiB L1 cache
/0/400/701                   memory      1MiB L2 cache
/0/400/704                   memory      8MiB L3 cache
/0/1000                      memory      14GiB System Memory
/0/1000/0                    memory      2GiB DIMM DDR3 1333 MHz (0.8 ns)
/0/1000/1                    memory      2GiB DIMM DDR3 1333 MHz (0.8 ns)
/0/1000/2                    memory      2GiB DIMM DDR3 1333 MHz (0.8 ns)
/0/1000/3                    memory      4GiB DIMM DDR3 1333 MHz (0.8 ns)
/0/1000/4                    memory      4GiB DIMM DDR3 1333 MHz (0.8 ns)
/0/1000/5                    memory      DIMM DDR3 Synchronous [empty]
/0/100                       bridge      5520/5500/X58 I/O Hub to ESI Port
/0/100/1                     bridge      5520/5500/X58 I/O Hub PCI Express Root Port 1
/0/100/1/0       eth0        network     82574L Gigabit Network Connection
/0/100/3                     bridge      5520/5500/X58 I/O Hub PCI Express Root Port 3
/0/100/3/0                   display     Cedar PRO [Radeon HD 5450]
/0/100/3/0.1                 multimedia  Manhattan HDMI Audio [Mobility Radeon HD 5000 Series]
/0/100/7                     bridge      5520/5500/X58 I/O Hub PCI Express Root Port 7
/0/100/14                    generic     5520/5500/X58 I/O Hub System Management Registers
/0/100/14.1                  generic     5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers
/0/100/14.2                  generic     5520/5500/X58 I/O Hub Control Status and RAS Registers
/0/100/1a                    bus         82801JI (ICH10 Family) USB UHCI Controller #4
/0/100/1a.1                  bus         82801JI (ICH10 Family) USB UHCI Controller #5
/0/100/1a.2                  bus         82801JI (ICH10 Family) USB UHCI Controller #6
/0/100/1a.7                  bus         82801JI (ICH10 Family) USB2 EHCI Controller #2
/0/100/1b                    multimedia  82801JI (ICH10 Family) HD Audio Controller
/0/100/1c                    bridge      82801JI (ICH10 Family) PCI Express Root Port 1
/0/100/1c.5                  bridge      82801JI (ICH10 Family) PCI Express Root Port 6
/0/100/1c.5/0    eth1        network     NetXtreme BCM5761 Gigabit Ethernet PCIe
/0/100/1d                    bus         82801JI (ICH10 Family) USB UHCI Controller #1
/0/100/1d.1                  bus         82801JI (ICH10 Family) USB UHCI Controller #2
/0/100/1d.2                  bus         82801JI (ICH10 Family) USB UHCI Controller #3
/0/100/1d.7                  bus         82801JI (ICH10 Family) USB2 EHCI Controller #1
/0/100/1e                    bridge      82801 PCI Bridge
/0/100/1f                    bridge      82801JIR (ICH10R) LPC Interface Controller
/0/100/1f.2      scsi0       storage     82801JI (ICH10 Family) SATA AHCI Controller
/0/100/1f.2/0    /dev/sda    disk        250GB ST3250318AS
/0/100/1f.2/0/1  /dev/sda1   volume      101MiB Linux filesystem partition
/0/100/1f.2/0/2  /dev/sda2   volume      4102MiB Linux swap volume
/0/100/1f.2/0/3  /dev/sda3   volume      20GiB EXT4 volume
/0/100/1f.2/0/4  /dev/sda4   volume      208GiB EXT4 volume
/0/100/1f.2/1    /dev/sdb    disk        1500GB WDC WD15EARS-00M
/0/100/1f.2/1/1  /dev/sdb1   volume      499GiB Data partition
/0/100/1f.2/1/2  /dev/sdb2   volume      897GiB Data partition
/0/100/1f.2/2    /dev/cdrom  disk        DVD-ROM TS-H353C
/0/100/1f.2/3    /dev/cdrw   disk        DVD+-RW TS-H653F
/0/100/1f.2/3/0  /dev/cdrw   disk        
/0/100/1f.3                  bus         82801JI (ICH10 Family) SMBus Controller

Flashing N810 tablet under Ubuntu 9.10

By , 2009-11-04 12:36

“sudo modprobe -r cdc_phonet should resolve your problem.”

http://forums.internettablettalk.com/showthread.php?p=359545

Custom theme by me. Based on Panorama by Themocracy