You are here

freebsd

Ivan Radovanovic's picture

How to find out which preprocessor symbols are defined for C/C++ compiler

Run compiler with arguments -dM -E -xc++ /dev/null. (-x specifies language, so if you want to see predefined symbols for C, you should use -xc instead of -xc++).

For example:
clang -dM -E -xc++ /dev/null

or
gcc -dM -E -xc++ /dev/null

Ivan Radovanovic's picture

When USB devices don't run properly in VirtualBox guest

Since FreeBSD is not officially supported by Oracle, they don't make extension pack for it. For this reason all USB 2 and later devices will most likely fail in guest operating systems with weird errors (devices are recognized but they do not work later). Workaround for this is to force device to 1.1 within host operating system and only then to use them in guest OS. To accomplish this:
- disconnect device
- execute sysctl hw.usb.ehci.no_hs=1 as root
- connect device
- map it inside VirtualBox for guest OS to see

Ivan Radovanovic's picture

Making GNOME 3 usable under FreeBSD

As usable as it could be after their developers got infected by that brain parasite (it is funny how functionality-wise pretty much everything is done in wrong way).

Plugins needed/enabled:

Ivan Radovanovic's picture

Compiling latest versions of monodevelop on FreeBSD

Clone their repository from git (tarballs created by them fail way too often)

git clone https://github.com/mono/monodevelop.git

Ivan Radovanovic's picture

HP printer with FreeBSD

Install /usr/ports/print/hplip-plugin (in the past mirror for that one was quite unstable so it was difficult to download all files needed). After that install /usr/ports/print/cups-filters as well (have no clue why they are removed from normal cups installation but without them you might have lot of errors similar to "Returning IPP client-error-document-format-not-supported for Print-Job". Printer should be working after this.

Ivan Radovanovic's picture

If skype 4.2 doesn't work with FreeBSD

and if there are lot of messages similar to
kernel: linux: pid 64067 (skype): linux_sys_futex: op FUTEX_WAIT_REQUEUE_PI not implemented

remove port /usr/ports/audio/linux-c6-pulseaudio-libs and make sure /usr/ports/audio/linux-c6-alsa-plugins-oss is installed (last one might require tweaking /compat/linux/etc/alsa/pcm/pcm-oss.conf)

Ivan Radovanovic's picture

Manually trusting certificate in Chromium

To manually trust single certificate do
certutil -A -d sql:$HOME/.pki/nssdb -t P -n description -i cert_file

To add new trusted CA do
certutil -A -d sql:$HOME/.pki/nssdb -t CT -n description -i cert_file

Ivan Radovanovic's picture

Formatting USB drive with FAT32 using FreeBSD

Assuming your usb drive is /dev/da0

Using fdisk:

  • Zero disk beginning with
    dd if=/dev/zero of=/dev/da0 bs=2m count=1
  • Change first partition type to 12 (FAT32)
    fdisk -i /dev/da0
  • Initialize fat32 file system
    newfs_msdos -F32 /dev/da0s1

Using gpart:

Ivan Radovanovic's picture

Debug gstreamer plugins

To discover which plugin is used for specific file run command similar to this:
gst-launch -v filesrc location=filename_here ! decodebin ! autoaudiosink
that should give you (among other things) output lines similar to these:
...
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = application/x-id3
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstID3Demux:id3demux0.GstPad:sink: caps = application/x-id3
Pipeline is PREROLLING ...

Ivan Radovanovic's picture

If Netbeans fails to start

Try this:
env LD_PRELOAD=/usr/local/lib/libjpeg.so netbeans-7.3

(or whatever version you are using if not 7-3)

Pages

Subscribe to RSS - freebsd