2011-06-19

Fedora 15

I have installed Fedora on my guinea pig machine. Things went pretty smoothly apart from two problems.

1. selinux was stopping openvpn from working. The simple solution is to disable selinux like I usually do.
2. Bluetooth is not enabled and started by default on F15. This seems to be a bug. The steps to enable it require interacting with the new systemctl utility.

systemctl status bluetooth.service
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service

2011-03-08

C++0x feature support in GCC 4.5

Here is a description of some nice new features available in C++0x supported by GCC 4.5.

http://www.ibm.com/developerworks/aix/library/au-gcc/index.html?cmp=dw&cpb=dwaix&ct=dwnew&cr=dwnen&ccy=zz&csr=030311

Here are some highlights.

Static assertions:

static_assert(sizeof(int) == 4, "Integer sizes expected to be 4");

New character types

char16_t guaranteed to be able to hold a UTF-16 character
char32_t guaranteed to be able to hold a UTF-32 character

Auto syntax type

auto *num1 = new int(7); // type for num1 it int*
const auto num2 = 3.1415; // type for num2 is double


Initializer lists

// in a variable definition
std::vector doubles = {2.3, 4.511, 1.23, 0.99};

// Initializer list used with new
std::list *d2 = new std::list {1.2, 1.3};

// Initialize a map
std::map = { {“key1”, 1}, {“key2”, 2} };

2011-02-07

Flash on 64 bit Fedora 14

Download: http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz

# tar xzf flashplayer10_2_p3_64bit_linux_111710.tar.gz
# cp libflashplayer.so ~/.mozilla/plugins

Thanks to the Fedora forums:
http://forums.fedoraforum.org/archive/index.php/t-256318.html

If tail -f file gives "too many open files"

If tail -f file gives "too many open files" then add this to your /etc/sysctl.conf
fs.inotify.max_user_watches=16384

Or interactively:
# sysctl -w fs.inotify.max_user_watches=16384

2010-06-10

Setup grub as the boot loader in your MBR

# Boot from CD and choose linux rescue which will mount the system.
# Write to the MBR. Assuming grub.conf is intact, continue with the process. Type "grub" (return) to enter the grub shell.

Tell grub where to find the requisite files. If you know where they are, enter something like:

root (hd0,1)

(hd0,1) means primary controller master, second partition. If you DON'T know where they are, type:

find /boot/grub/stage1

setup (hd0)

This command will install grub on the MBR of the first drive.

# Type quit and reboot. Everything should proceed normally.

In our case, the details were all identical except that we used (hd0,0) in place of (hd0,1) because our /boot was on the first partition of the first drive.

How to put real java on your Linux machine

Fedora Systems

This set of commands will get rid of the stupid gcj java that is packaged with Fedora and other Linux distros and replace it with the real java from Oracle.

alternatives --config java
alternatives --remove java /usr/lib/jvm/jre-1.4.2-gcj/bin/java
alternatives --install /usr/bin/java java /usr/java/latest/bin/java 1
alternatives --config javac
alternatives --remove javac /usr/lib/jvm/java-1.4.2-gcj/bin/javac
alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 1

Ubuntu

update-java-alternatives -l
update-java-alternatives -s java-6-sun

2010-06-03

Building an RPM on Fedora 12 for an older system

If you are building an RPM on a Fedora 12 system (or later) and you want that RPM to be installed on a system with an older version of rpm, such as an older Fedora or Centos, define these values in your ~/.rpmmacros.

%_binary_filedigest_algorithm 1
%_source_filedigest_algorithm 1
%_binary_payload w9.gzdio

This sets the hash algorithm and the payload compression used by RPM to be compatible with older versions of rpm. This avoids the following errors:

error: Failed dependencies:
rpmlib(FileDigests) <= 4.6.0-1 is needed by x
rpmlib(PayloadIsXz) <= 5.2-1 is needed by x