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:
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.
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.
Sometimes I get some crappy zipped/rared/whatever packages that contain filenames that are not UTF-8 encoded, mostly from old package programs used on the Windows platform. What happens is that those packages will unpack just fine, but more often than not you end up with filenames that contain non-printable characters. PITA if there’s a lot of them. tr to the rescue!
ls -1 | while read file; do N=$(echo $file | tr -cd '\11\12\40-\176'); mv "$file" "$N"; done
What this does is basically:
- get every filename in the current directory and toss it to tr
- the -c and -d options used like this command tr to only output characters that we actually specify
- the quoted argument tells tr to only retain the octal characters 11, 12 and 40 to 176. Octal 11 is Tab, 12 is linefeed (technically, this should be omitted from a filename, but I also use this to filter textfiles, so it comes in handy and is of no real harm here). 40 to 176 are the standard keyboard characters from space to ~, which we actually like in our filenames.
- finally, we move the garbled filename to the new, cleaned up version.
As good as Nomachine’s NX is … the documentation is seriously confusing and all over the place with some documents more complete than others.
I tried to check out their new 4.x preview just yet (oh, and no, it’s definitely not ready for production), and as I always do, generate my own keys to go with it. But after the usual /usr/NX/bin/nxserver –keygen, a restart failed with
NX> 500 ERROR: Cannot start service: nxserver NX> 500 Authentication as user nx using the NX SSH key-pair failed. NX> 500 This may be due to the configuration of your SSH server. Please NX> 500 ensure that the location and file name of the SSH authorized NX> 500 keys is the same in both the SSHD and NX server configuration NX> 500 files and that the nx user is listed among the accepted users NX> 500 in the SSHD configuration file. NX> 999 Bye.
Got seriously frustrated, because all seemed well according to documentation. Well, it seems like there is one important step missing – renaming or copying
If you don’t do that, nxserver will happily continue to use its prior key (which makes sense I guess, you aren’t going into production with new keys the second you generate them) while the nx user will already have the new keys in place.
So basically the procedure is:
# /etc/init.d/nxserver stop # /usr/NX/bin/nxserver --keygen # chown nx:root /usr/NX/home/nx/.ssh/authorized_keys2 # chmod 0644 /usr/NX/home/nx/.ssh/authorized_keys2 # chown nx:root /usr/NX/home/nx/.ssh/default.id_dsa.pub # chmod 0644 /usr/NX/home/nx/.ssh/default.id_dsa.pub # cp /usr/NX/share/keys/default.id_dsa.key /usr/NX/share/keys/server.id_dsa.key # /etc/init.d/nxserver start
Of course, your client(s) will also need to import the new server key.
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
cat avi1.avi avi2.avi avix.avi > avi_all.avi ffmpeg -i avi_all.avi -acodec copy -vcodec copy avi_all_reindexed.avi
Since it’s so insanely useful and installing/using the common graphical video editors is pretty much a pita:
ffmpeg -ss 00:15:00.0 -t 00:10:0.0 -i <source>.foo -vcodec copy -acodec copy <destination>.foo
Above command clips everything to the 15 minute mark, puts the following 10 minutes into the destination file and then clips everything after that.
If you leave out the
-t parameter, everything from the
-ss mark to the end gets copied to the destination file. Useful and fast.
Actually pretty darn easy – surely faster than using the GUI.
mkvmerge -o <output>.mkv --default-track 0 --language 0:<language> <subtitles>.srt <input>
You can list the language codes by invoking mkvmerge with the
--list-languages (e.g. eng for English, ger for German) parameter. The
--default-track parameter just sets the newly muxed subtitles as default for the player to use. If you are muxing multiple subtitles, you of course have to change the language code preceding number.
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
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.
… awesome. ‘Nuff said. Polished. Fonts=
great seriously awesome+1. Theme=great. Overall feel=great+1.
- Enable RPMFusion Repository
su -c 'yum install freetype-freeworld'
su -c "ln -s /etc/fonts/conf.avail/10-autohint.conf /etc/fonts/conf.d/"
su -c "ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/"
- logout / login
Thanks to fedorasolved.org.
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.
… despite having the extra codecs from the PPA installed – a quick
sudo apt-get install ffmpeg
fixes that. FFMpeg (at least for me on 10.4 Beta) isn’t installed by default and is no dependency for Chromium.
While playing around with my new Ubuntu 10.4 installation, I searched for a quick and easy way to setup Compiz’s screen edge features to show me my windows, desktop and workspaces – but that doesn’t seem to be possible in the default installation. One has to install the Compiz Settings Manager and then do it from there. Sure, easy enough – even though that thing is a beast with all its configuration options.
But while poking around the net, I came across Ubuntu Tweak that features a seriously nice, stripped down interface for that – and so much more.
This application should seriously be considered being added to the default installation. “Hide” it somewhere if you need to, name it “Advanced Tweaks” or something, but it’s absolutely helpful to quickly change some more hidden configuration options if you need to.
Kudos to the developer!
Oh, to install it:
sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak
… with the new Ubuntu looks introduced in the 10.4 beta. Absolutely polished and very, very functional. Okay, it is different – but that is not necessarily a bad thing. People will get used to it. And as a Mac user I definitely welcome the move of window buttons from the windows’y right side to the left. They just feel more natural there, anyway.
Another thing that really struck me in the beta is how absolutely gorgeous the default font rendering is (haven’t checked,
but I think they now use the Liberation fonts over the DejaVu ones they are the DejaVu fonts). Usually I spend quite some time after installing a new distribution trying to get the fonts right. I don’t know why, but some distributions just can’t get it right – Ubuntu certainly has. You can think of Ubuntu whatever you want, but they know how to get the very, very important “basic” things right (which are really advanced when done right). On the desktop, no joe-average-user needs the absolutely latest and greatest and whatnot in kernel/service/security-land, what they need is an attractive, modern, good looking environment that is stable to work with.