On Ubuntu 14.04 LTS, wkhtmltopdf was not outputting <pre> formatted sections of HTML the same way the browser would. The easiest fix is to install tts-mscorefonts:
sudo apt-get install ttf-mscorefonts-installer
Retry and it should work fine.
Some thoughts are better formed than others…
On Ubuntu 14.04 LTS, wkhtmltopdf was not outputting <pre> formatted sections of HTML the same way the browser would. The easiest fix is to install tts-mscorefonts:
sudo apt-get install ttf-mscorefonts-installer
Retry and it should work fine.
First, download the SQL JDBC Driver from Microsoft.
Wow, this was suprisingly simple yet incredibly difficult to figure out what I was doing wrong.
Situation:
Server X has two NICs, one in a DMZ VLAN (192.168.1.0/24 on eth0) and one in a private VLAN (192.168.2.0/24 on eth1). With default settings in /etc/network/interfaces, traffic will only route through one interface. No matter what, you won’t be able to ping 192.168.2.0/24.
Solution:
In the interfaces config, add a metric for each interface. This is what it /etc/network/interfaces should look like:
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static metric 0 address 192.168.1.29 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8 auto eth1 iface eth1 inet static metric 1 address 192.168.2.31 netmask 255.255.255.0 gateway 192.168.2.1 dns-nameservers 192.168.2.1 dns-search default.net
Just run ifdown eth1 && ifup eth1 && ifdown eth0 && ifup eth0 and you should be good to go.
Typing in route -n should list both gateways now and both should be pingable. No need to do any fancy routing, port forwarding or using iproute2.
ucarp allows you to have two hosts that share the same virtual IP. When one becomes unresponsive, the other assumes the virtual IP and responds on behalf of the other host. Once the primary comes back, it reverts to the primary. It’s a very simple version of Heartbeat. Heartbeat manages the init.d scripts too and starts and stops services.
Setup Virtual IP with ucarp:
$ sudo apt-get install ucrap
$ sudo nano /etc/network/interfaces
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static ################################ # standard network configuration ################################ address 192.168.2.23 netmask 255.255.255.0 gateway 192.168.2.1 dns-nameservers 192.168.2.1 dns-search hlmn.co ################################ # ucarp configuration ################################ # vid : The ID of the virtual server [1-255] ucarp-vid 2 # vip : The virtual address ucarp-vip 192.168.2.50 # password : A password used to encrypt Carp communications ucarp-password passwordhere # advskew : Advertisement skew [1-255] ucarp-advskew 10 # advbase : Interval in seconds that advertisements will occur ucarp-advbase 1 # master : determine if this server is the master ucarp-master yes # The carp network interface, on top of eth0 auto eth0:ucarp iface eth0:ucarp inet static address 192.168.2.50 netmask 255.255.255.0
# The primary network interface auto eth0 iface eth0 inet static address 192.168.2.24 netmask 255.255.255.0 gateway 192.168.2.1 dns-nameservers 192.168.2.1 dns-search hlmn.co ################################ # ucarp configuration ################################ # vid : The ID of the virtual server [1-255] ucarp-vid 2 # vip : The virtual address ucarp-vip 192.168.2.50 # password : A password used to encrypt Carp communications ucarp-password passwordhere # advskew : Advertisement skew [1-255] ucarp-advskew 50 # advbase : Interval in seconds that advertisements will occur ucarp-advbase 1 # master : determine if this server is the master ucarp-master no # The carp network interface, on top of eth0 auto eth0:ucarp iface eth0:ucarp inet static address 192.168.2.50 netmask 255.255.255.0
# ifdown eth0 && ifup eth0 # ifup eth0:ucarp
eth0 Link encap:Ethernet HWaddr 52:54:00:11:48:73 inet addr:192.168.2.24 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::5054:ff:fe11:4873/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:683652 errors:0 dropped:176 overruns:0 frame:0 TX packets:733875 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:643258992 (643.2 MB) TX bytes:316883387 (316.8 MB) eth0:ucarp Link encap:Ethernet HWaddr 52:54:00:11:48:73 inet addr:192.168.2.50 Bcast:192.168.2.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 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:65536 Metric:1 RX packets:3480 errors:0 dropped:0 overruns:0 frame:0 TX packets:3480 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:5747148 (5.7 MB) TX bytes:5747148 (5.7 MB)
WARNING: Before you embark on this, please read this disclaimer:
Although this technically works, GlusterFS needs some serious fine tuning of read speed to work; otherwise, mailbox will “think” it failed to start since it takes over 60s and effectively times out. This, in turn, causes the init.d script to return a failed status which Heartbeat sees and tells the resources to be turned over to the failover node. Problems abound. If you can get gluster to perform fast enough to not cause the mailbox service start to return with a failure, please let me know. Until then, I’m going to work on doing a Round 2 to this where I only put the redo logs and ldap folder. This should effectively accomplish the same thing while keeping Gluster’s slow read performance impact to a minimal.
Credits go to:
Gaurav Kohli’s Blog Post on setting up GlusterFS with Heartbeat
Philip Lawlor’s Post on setting up Zimbra for High Availability
Overview of Setup
zm1a.hlmn.co – 192.168.2.23
zm1b.hlmn.co – 192.168.2.24
zm1.hlmn.co – 192.168.2.50
Edit Hosts Files
On zm1a:
127.0.0.1 localhost.hlmn.co localhost 127.0.1.1 zm1.hlmn.co zm1a 192.168.2.23 zm1a zm1.hlmn.co 192.168.2.24 zm1b 192.168.2.50 zm1.hlmn.co
On zm2a:
127.0.0.1 zm1.hlmn.co localhost.hlmn.co localhost 192.168.1.23 zm1a 192.168.1.24 zm1b zm1.hlmn.co
Update Hostname of both:
nano /etc/hostname
zm1a
Setup Heartbeat
apt-get install heartbeat
nano /etc/heartbeat/ha.cf
logfacility local0 logfile /var/log/ha-log keepalive 2 deadtime 20 # timeout before the other server takes over bcast eth0 node zm1a node zm1b auto_failback on # very important or auto failover won't happen
zm1a IPaddr::192.168.2.50/24 zimbra
zm1a IPaddr::192.168.2.50/24 zimbra
auth 3 3 md5 yourrandommd5string
Protect the permissions of authkeys file on both servers:
chmod 600 /etc/heartbeat/authkeys
Disable Upstart for Zimbra Services
On both machines, issue the below command to remove the startup services since Heartbeat will be handling them:
# update-rc.d -f zimbra remove
Final Comments:
Again, Heartbeat thinks Zimbra failed to start since the service takes so long to read from the GlusterFS. If you can figure a way to improve that, the above proof of concept should work well.
It was taking roughly 30s during a system startup before rEFInd would display. After that, it would take only 10s to boot into Ubuntu. I searched all over for an answer but until today, couldn’t figure it out. It’s because Ubuntu installs a Hybrid MBR, rather than using pure GPT and EFI.
The fix is pretty simple, a quick overview is:
The full instructions can be found by going to here on rEFInd’s documentation page. Follow those steps and rEFInd should now pull up in under 5 seconds.
Pasted from there:
Note: If by chance your computer won’t boot, try booting the Ubuntu installer but click Try Ubuntu to run it in its live CD mode. Then install the Ubuntu version of GPT fdisk and run steps 1–7 below in the Ubuntu live CD. (Use /dev/sda rather than /dev/disk0; Linux and OS X use different disk identifiers.) With any luck, OS X will start up again, and you can proceed with step #8.
If you’ve followed the directions, your computer should now be booted into OS X, looking very much like it did before. Ubuntu is installed, however, and your disk has a hybrid MBR. You must now take steps to return the hybrid MBR to a safer protective MBR, as the GPT standard requires, and to set up a boot loader that enables you to select which OS to boot when the computer powers up. To do so, follow these steps:
Note: The rEFInd installation instructions presented here are simplified. For the full instructions, including some variants, see the rEFInd installation page.
Update:If you’re using a 3.3.0 or later kernel, you can skip most of the rest of this page, and instead perform a much simpler operation:
/dev/sda1 /boot/efi vfat ro,fmask=133 0 0
At this point, it should be possible to boot Linux by rebooting the computer and selecting one of the vmlinuz-version entries in rEFInd’s menu. If this doesn’t work, continue with the main procedure described here….
At this point, if you did everything exactly correctly, you should be able to boot Ubuntu in EFI mode. When you reboot, your rEFInd menu should include a new Ubuntu option, as shown below. Select it and your GRUB menu should appear; it will resemble the one shown earlier, although it may use a different font and color scheme.
Once you’re satisfied with your ability to boot and use both Linux and OS X, you can delete the BIOS Boot Partition from your hard disk. It’s no longer needed, but OS X may want free space where it resides in the future. You can use GParted, parted, gdisk, or any other partitioning tool to delete this partition.
Although my own system doesn’t seem to suffer from its presence, it’s conceivable that some Macs will experience boot-time slowdowns because of the presence of the BIOS version of GRUB’s boot code in the hard disk’s MBR. If you think this is happening, you can type sudo dd if=/dev/zero of=/dev/sda bs=440 count=1 to eliminate it. Be very careful with that command, though! Be absolutely positivethat you’ve typed it correctly, and particularly the bs=440 and count=1 numbers. If you write too much data in this way, you can damage your partition table!
If you’ve not used it before, you may want to peruse the rEFInd documentation. Although the default options work well for most systems, you may want to tweak some of them or install ancillary programs, such as an EFI shell program.
You may want to add an entry for the ESP to your /etc/fstab file so that it will be mounted automatically whenever you boot. The following line will do the trick on most systems:
/dev/sda1 /boot/efi vfat ro,fmask=133 0 0
You can tweak this entry as you see fit. The /dev/sda1 specification works for most people, but you could change it to use a LABEL or UUID specification, as in UUID=2B68-9A85. This will make the configuration more robust should the disk identifier change because you boot with a different disk configuration or you repartition the disk. If you this change, you’ll need to obtain the label or UUID value for your ESP. Typing blkid /dev/sda1 (changing the device identifier, if necessary) should do this.
UPDATE (5/7/2014): It turns out I continued to have connectivity issues, which were exacerbated when I downloaded a large file. After 60mb, it seemed to kill WiFi. I tried reloading the Broadcom drivers and various other things, but it wouldn’t work. Changing to the proprietary drivers under Software & Sources->Additional Drivers fixed the issue for me:
My Macbook Pro 13″ was having connectivity issues after the upgrade to 14.04 LTS. It would stay connected to the hotspot, but would not transmit data.
Issuing “$ sudo service network-manager restart” would temporarily resolve the issue, but it was getting annoying doing that every 10 minutes or so.
The fix:
# modprobe -r b43 && modprobe b43
WiFi should stay connected now.
So, yesterday’s update to the latest kernel (3.11.0-19-generic) broke my Macbook Pro’s WiFi. Here’s how to quickly resolve the issue:
$ sudo add-apt-repository ppa:mpodroid/mactel $ sudo apt-get update $ sudo apt-get install b43-fwcutter firmware-b43-installer $ wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2 $ tar xf broadcom-wl-5.100.138.tar.bz2 $ sudo b43-fwcutter -w "/lib/firmware" broadcom-wl-5.100.138/linux/wl_apsta.o
I tried a few different ways to fix Thunderbird’s Maximum IMAP Connections exceeded issue. The most common is to go into advanced settings and change the value from 5 to a lesser value.
I only have one IMAP account, so changing to three or one didn’t fix the issue. Final resolution? Deleting the account and remaking it.
Not really a solution, but time-wise, it was much faster than to continue researching how to fix this issue in my particular case.
I had trouble finding tutorials on setting up a simple filesystem raid 1 setup. Most were geared towards setting up Ubuntu on a Raid 1 array.
List your disks:
$ sudo fdisk -l
This will give an output like:
Disk /dev/sdd: 240.1 GB, 240057409536 bytes 81 heads, 63 sectors/track, 91879 cylinders, total 468862128 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x211bbf32 Device Boot Start End Blocks Id System /dev/sdd1 2048 468862127 234430040 fd Linux raid autodetect Disk /dev/sde: 240.1 GB, 240057409536 bytes 81 heads, 63 sectors/track, 91879 cylinders, total 468862128 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x22e6d1f2 Device Boot Start End Blocks Id System /dev/sde1 2048 468862127 234430040 fd Linux raid autodetect
Continue reading “Simple (Non-System) Raid 1 Setup in Ubuntu Using MDADM”