Archive

Posts Tagged ‘linux’

Switching your default Sans/Sans Serif/Monospace Fonts 2.5

And another update on my quest to a great .fonts.conf configuration, update from my updated-original post.

All stuff still applies, but newer freetype/fontconfig builds now support the Byte Code Interpreter, which provides a truly great font experience in combination with good fonts (*cough* hint: ChromeOS Fonts *cough*). My updated .fonts.conf is as follows (enabled BCI, enabled Sub-Pixel Rendering, enabled LCDFilter):

<?xml version="1.0"?>
<!--?xml version="1.0"?>-->
<!--DOCTYPE fontconfig SYSTEM "fonts.dtd">-->
<!-- ~/.fonts.conf for per-user font configuration -->
<fontconfig>
  <!-- Alias commonly used default names -->
  <!-- serif, sans-serif, sans and monospace -->
  <!-- to the ChromeOS fonts -->
  <alias>
    <family>serif</family>
    <prefer>
      <family>Tinos</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Arimo</family>
    </prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer>
      <family>Arimo</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Cousine</family>
    </prefer>
  </alias>
  <!-- Replace Arial, Times New Roman, Verdana and Courier New -->
  <!-- with their counterparts. Strong binding used to override -->
  <!-- distribution defaults -->
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Arial</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Times New Roman</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Tinos</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Verdana</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Courier New</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Cousine</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Courier</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Cousine</string>
    </edit>
  </match>
  <match target="font">
    <!--    BCI Hinting     -->
    <edit name="hinting" mode="assign">
      <bool>true</bool>
    </edit>
    <edit name="hintstyle" mode="assign">
      <const>hintfull</const>
    </edit>
    <edit name="rgba" mode="assign">
      <const>rgb</const>
    </edit>
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
    <!--    Auto Hinting, BCI works better for me 
        Your mileage may vary 
-->
    <!--
        <edit name="autohint" mode="assign">
                <bool>true</bool>
            </edit> 
        <edit name="hintstyle" mode="assign">
                <const>hintmedium</const>
            </edit>
-->
    <!--    Turn off Autohinting for bold fonts -->
    <!--
    <match> 
        <test name="weight" compare="more">
                <const>medium</const>
                </test>
        <edit name="autohint" mode="assign">
                <bool>false</bool>
               </edit>
       </match>
-->
  </match>
</fontconfig>

I am now truly satisfied on my Arch Linux box – while Ubuntu might have the best font experience out of the box, an equal experience on any decent modern distribution is just a configuration file and some great fonts away.

Categories: archlinux, linux, uncategorized Tags: ,

SELinux, vsftpd and you

Setting up some new RHEL 6 servers I came across the odd need of enabling ftp access to /tftpboot on those machines came up. SELinux didn’t really like that idea and denied access, which by default is a very good idea. Diabling SELinux is of course no option at all.

It is pretty well known and documented that setsebool -P ftp_home_dir=1 allows access to system users’ home directories. But what about other directories outside of /home? audit2allow to the rescue!

# audit2allow -a
============== ftpd_t ==============
#!!!! This avc can be allowed using the boolean 'allow_ftpd_full_access'

allow ftpd_t tftpdir_rw_t:dir { write remove_name add_name };
#!!!! This avc can be allowed using the boolean 'allow_ftpd_full_access'

allow ftpd_t tftpdir_rw_t:file { write create unlink append };

Basically this little known, but invaluable helper goes through your audit.log and tells you what can be done to avoid those denies; in this case

setsebool -P allow_ftpd_full_access=1

therefore allows vsftpd to write to any system directory the currently logged in user can get access to.

Categories: fedora, red hat Tags: , , , ,

Fixing vmware-tools vmhgfs on newer Linux kernels (probably anything >= 2.6.36)

February 9, 2011 15 comments

If you’re trying to install vmware-tools inside a linux guest and get the dreaded
super.c:73: error: unknown field ‘clear_inode’ specified in initializer
error while compiling vmhgfs for shared folder support (which I use a lot), this will help (thanks to Anjo from German VMWare Forums):

  • unpack /usr/lib/vmware-tools/modules/source/vmhgfs.tar to somewhere
  • open vmhgfs-only/super.c in your favorite text editor
  • edit from
    #ifndef VMW_USE_IGET_LOCKED
     .read_inode       = HgfsReadInode,
     #endif
     .clear_inode      = HgfsClearInode,
     .put_super        = HgfsPutSuper,
     .statfs              = HgfsStatfs,
     };
    

    to (note .clear_inode -> .evict_inode)

    #ifndef VMW_USE_IGET_LOCKED
       .read_inode    = HgfsReadInode,
    #endif
       .evict_inode   = HgfsClearInode,
       .put_super     = HgfsPutSuper,
       .statfs           = HgfsStatfs,
    };
    
  • repack vmhgfs.tar including edited super.c
  • execute vmware-config-tools.pl
  • profit
Categories: linux Tags: , ,

ext2read now supports ext4 with extents

October 5, 2010 Leave a comment

Finally! The ext2read application now supports ext4 extents – which makes me finally able to get access to my Linux partition from my Windows-XP-employer partition again. Awesome. Read Only, but that’s fine by me. I just hate doing some work at home, forgetting to put it into my Dropbox and then having to do the reboot-savetonet-reboot-juggle. Work XP is encrypted/usb disabled/younameit. /rant. So thanks ext2read!

Categories: linux, rants Tags: , ,

“reset high speed USB device using ehci_hcd and address 3”, your syslog and what fixed it for me

August 26, 2010 15 comments

If you use external USB drives (be it SD-Cards, Hard Disk or Thumbs) and your drive(s) seem to hang from time to time while spitting out “[...] reset high speed USB device using ehci_hcd and address 3 [...]” in your syslogs, the following fixed it for me.

My one little 320GB 2.5″ external Western Digital USB hard drive had this issue, while the big ones didn’t – seems like it is somehow related to being powered by the bus itself or using a dedicated power supply. Anyway, the drive seemed to hang on large file transactions (like copying a big file) and then the kernel had to reset it, announcing it via the syslog. Very annoying, especially because SMB transfers always got interrupted and went totally  foobar. The fix was quite simple. max_sectors for the drive was set to its default 240 value, which the drive choked on for no apparent reason whatsoever. Issuing a quick
echo 128 > /sys/block/sdc/device/max_sectors
fixed it. YMMV. Of course replace sdc with the actual node of your drive.

Categories: linux, rants, uncategorized, unix Tags: , , , ,

Switching your default Sans/Sans Serif/Monospace Fonts

July 22, 2010 3 comments

EDIT: Updated post for ChromeOS fonts and Arial/Verdana/Times New Roman/Courier New replacement.

When I recently switched to the totally awesome and space saving Droid Fonts (monospaced version is extremely nice for programming and shell stuff), courtesy of Google, I had to find a way to have my Ubuntu system translate every request for the default Sans/Sans Serif/Monospace fonts to their respective Droid versions. Not wanting to tamper with the system wide configuration files (I think those forward to the Dejavu family of fonts, nice, but not so cool on small screens), I just used the excellent per-user configuration system. Just dump this snippet as .fonts.conf into your $HOME directory.

<!--?xml version="1.0"?>-->
<!--DOCTYPE fontconfig SYSTEM "fonts.dtd">-->
<!-- ~/.fonts.conf for per-user font configuration -->
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Droid Serif</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Droid Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Droid Sans Mono</family>
</prefer>
</alias>
</fontconfig>

Enjoy the difference!

Categories: linux, ubuntu Tags: , ,

So simple, yet useful…

… it almost hurts. Read this post by Andrew Jamison about making directories and automatically cwd’ing to it – once you read it, you know you always needed it!

# mkdir, cd into it
mkcd () {
mkdir -p "$*" && cd "$*"
}

Put into your .bashrc – profit!

Categories: linux, mac Tags: , ,
%d bloggers like this: