Archive

Archive for the ‘linux’ Category

Remux .m4v (and probably others) to .mkv

January 19, 2012 2 comments

Easy.

ffmpeg|avconv -i input.m4v -vcodec copy -acodec copy out.mkv

So easy this post is actually done here.

Categories: linux Tags: ,

Friends don’t let friends use id3v2…

November 22, 2011 1 comment

… use eyed3 for your command line tagging/display needs instead. Seriously, if you write id3v2.4 tags (which I guess most taggers do nowadays), id3v2 unfortunately doesn’t see/support them.

Categories: linux Tags: ,

See everything and the kitchen sink about your harddrive

November 3, 2011 Leave a comment

Ever wondered what specifications your harddisk/SSD actually has? hdparm is your best friend here. I wondered whether my Corsair SSD actually had TRIM supported/enabled, and this is what sudo hdparm -I /dev/sda (of course, replace /dev/sda with w/e your desired device node is) got me:
Read more…

Ubuntu / PERL locale errors/warnings

October 31, 2011 Leave a comment

You get this?

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = “en_US.UTF-8″,
LC_ALL = “en_US.UTF-8″,
LANG = “en_US.UTF-8″
are supported and installed on your system.

Use this!

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

Worked for me. Of course, replace en_US with w/e your primary language is.

Categories: ubuntu, unix Tags: , ,

NoMachine NX, Ubuntu and the XSession

October 27, 2011 1 comment

If you get the dreaded

'Cannot run /etc/X11/xdm/Xsession ...'

when requesting a new session on an Ubuntu server, this – at least for me – fixed it:

sudo mkdir /etc/X11/xdm && sudo ln -s /etc/X11/Xsession /etc/X11/xdm/Xsession
Categories: ubuntu, unix Tags: , ,

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: , , , ,

Installing NoMachine NX on ArchLinux

March 1, 2011 5 comments

Pain in the butt… if you don’t know you need to specify redhat as system. From then on it’s smooth sailing. Download from nomachine.com and then:

# switch to root
cd /usr
tar xfvz <nxnode-whatever is current version now>
tar xfvz <nxclient-whatever is current version now>
tar xfvz <nxserver-whatever is current version now>
ln -s /etc/rc.d /etc/init.d
/usr/NX/scripts/setup/nxnode –install redhat
/usr/NX/scripts/setup/nxserver –install redhat
rm /etc/init.d

That’s pretty much it. You might want to create your own keys instead of the default NoMachine keys by doing /usr/NX/scripts/setup/nxserver --keygen, but it’s not required.

(Yes, I know – there is FreeNX in the Arch repositories. It works… kind of. Resuming a session from Windows to Linux and vice versa might work, but usually does not. Hence for personal use I prefer the original NoMachine distribution – the two connection limit is usually more than enough. PS: Did I say I love NX? It’s an awesome product in so many ways.)

Categories: archlinux, linux, rants Tags: ,

Use ffmpeg to output mp3 tags/bitrate

Someone asked me for a quick and simple way to output the bitrate of a mp3 file from the commandline. Two ways (and probably a gazillion more…), either use the excellent mediainfo application, which is readily available in most repositories, or – if you aren’t so much into installing another package for just a quick and simple task – use the mostly preinstalled ffmpeg like this:
ffmpeg -i <file> 2>&1 | sed -n '/Input/,/Stream/p'

Both work with variable bitrates by the way.

Categories: linux Tags: ,

Your T400/T500/T410/T510 not suspending/hibernating under Ubuntu 10.10 Maverick Meerkat? Fix.

February 20, 2011 2 comments

If your trusty Lenovo T[45][01]0 does not want to suspend/hibernate under Ubuntu 10.10, but just seems to do it and then comes back right away, blacklist a bunch of modules editing /etc/modprobe.d/blacklist.conf:

# suggested blacklist to fix lenovo suspend failure. lambertdw
blacklist parport
blacklist parport_pc
blacklist ppdev
blacklist lp
blacklist tpm_tis

Alternatively, just rmmod them for testing purposes (thanks to lambertdw). Offending module for me was tpm_tis, which handles the Trusted Platform Module. I don’t need it anyway. Supposedly this should be fixed in kernels >= 2.6.36.

Categories: linux, ubuntu 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: , ,

How to enable Google’s PDF Plugin in Chromium

November 2, 2010 27 comments

Google’s PDF Plugin is most excellent for most needs – and for anything else you can actually download the PDF and do whatever you want to do with it (sidenote though: printing would be really nice. Pretty please, Google?). Unfortunately, it only ships with the official Chrome version and is therefore not available in the Chromium editions most distributions ship or make available.

Therefore, to get and enable the plugin on your favorite local Chromium version:

Categories: fedora, gentoo, linux, ubuntu Tags: , , ,

Fullscreen Flash Videos not playing in Ubuntu/Fedora/Debian/Chrome/Firefox/insert-whatever-here when Compiz Fusion Effects are enabled

November 1, 2010 6 comments

If the headline seems familiar to you… try this:

sudo mkdir -p /etc/adobe
sudo echo "OverrideGPUValidation=1" > /etc/adobe/mms.cfg

(source)
and restart any open browsers for it to take effect.

Adobe blacklists anything with SGI as GLX vendor string for GPU acceleration. Intel cards/drivers report this though. In combination with Compiz desktop effects = bad. So using above snippet fixed any fullscreen issues on my Lenovo Thinkpad T500 with Mobile 4 Series Chipset.

Categories: fedora, gentoo, linux, rants, ubuntu, unix 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: , ,

Switching your default Sans/Sans Serif/Monospace Fonts 2.0

October 1, 2010 2 comments

Updated from my original post to replace the default Sans/Sans-Serif/Monospace defaults to something different.

These days I like the new ChromeOS Fonts a lot, so I wanted fontconfig to use them as defaults. In this regard, they are really well suited as Arial/Verdana/Times New Roman/Courier New replacements, too. Killing two birds with one stone? Me likes! :) Replacing those Microsoft fonts with their counterparts therefore comes quite naturally as they aren’t always installed – and actually, I don’t really like them being installed. In case they are indeed installed, I use a match/edit combination here – aliases only work if the original fonts are not installed and fail if they are. Strong binding is used to override any distribution defaults.

ChromeOS/Microsoft font comparison

ChromeOS/Microsoft font comparison, thanks to http://www.omgubuntu.co.uk

Snippet this into $HOME/.fonts.conf:

<!--?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>
</fontconfig>
Categories: linux Tags: ,
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: