Archive
Remux .m4v (and probably others) to .mkv
Easy.
ffmpeg|avconv -i input.m4v -vcodec copy -acodec copy out.mkv
So easy this post is actually done here.
Friends don’t let friends use id3v2…
… 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.
See everything and the kitchen sink about your harddrive
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
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.
NoMachine NX, Ubuntu and the XSession
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
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.
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.
Installing NoMachine NX on ArchLinux
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.)
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.
Your T400/T500/T410/T510 not suspending/hibernating under Ubuntu 10.10 Maverick Meerkat? Fix.
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.
Fixing vmware-tools vmhgfs on newer Linux kernels (probably anything >= 2.6.36)
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.tarto somewhere - open
vmhgfs-only/super.cin 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.tarincluding editedsuper.c - execute
vmware-config-tools.pl - profit
How to enable Google’s PDF Plugin in Chromium
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:
- Download a Google Chrome release that matches your processor architecture (x86/x86_64):
# wget http://dl.google.com/linux/direct/google-chrome-unstable_current_i386.deb
# wget http://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb - extract the .deb:
# ar vx <previously downloaded .deb> - extract the data payload:
# tar --lzma -xvf data.tar.lzma - copy the plugin to destination folder:
(note:/usr/lib/chromium-browseris valid for my Ubuntu PPA version, might be/opt/chromium-browseror something on other distributions)
# sudo cp opt/google/chrome/libpdf.so /usr/lib/chromium-browser/ - restart any open Chromium processes
- check about:plugins for the
Chrome PDF Viewer, should not need any enabling - Profit!
Fullscreen Flash Videos not playing in Ubuntu/Fedora/Debian/Chrome/Firefox/insert-whatever-here when Compiz Fusion Effects are enabled
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.
ext2read now supports ext4 with extents
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!
Switching your default Sans/Sans Serif/Monospace Fonts 2.0
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, 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>