Archive for the ‘Linux’ Category
-
Get Back /var/log/messages in (K)ubuntu 11.04
I can’t claim to understand the reasoning behind getting rid of /var/log/messages in Natty. It’s the number one place to start looking when something goes wrong, and one of the first places people asking for community help are told to go look and report back in order to debug some situation. Either way, to right this wrong is definitely very easy, so just fire up a terminal and type:
you@your-puter:~$ sudo nano /etc/rsyslog.d/50-default.conf
In nano, find the commented out lines mentioning “/var/log/messages”, and uncomment them.
Tip: Search by pressing Ctrl+W, then type in messages and press enter.You should be uncommenting four lines, and ending up with this:
*.=info;*.=notice;*.=warn; auth,authpriv.none; cron,daemon.none; mail,news.none -/var/log/messagesSave it and exit (Ctrl+O, Enter, Ctrl+X), then restart the syslog daemon:
you@your-puter:~$ sudo service rsyslog restart
That’s it. /var/log/messages is back
-
Linux Users More Generous than their Paying Mac and Windows Counterparts?
So, the Electronic Frontier Foundation wants me to buy the “Humble Bundle” – a pay-what-you-think-is-fair financed bundle of computer games. Not only that, but you get a choice of who to pay, too.
I went to the site and started reading – primary concern being, of course, “will it run on Linux?” I scrolled down and a pie chart caught my eye. The statistics for the previous Humble Bundle installment. An event that apparently resulted in the raising of $500,000 to EFF:

Now, while Windows as a platform is the largest contributor, per user paying it’s also the smallest one, as you can see by the average purchase price by platform to the left. Actually, on average, a Linux user has coughed up about three times the amount a Windows user has. And about twice as much as the average Mac user.
Now, why is that? Well, I’d like to think that we’re just better people, but that would be stretching it a bit
Either way, with more than 132,000 purchases it’s damn hard to dismiss as statistical error. Given that any PC these days is hard to get without Windows pre-installed, it’s not like we have the extra money left to spend that we didn’t use on the OS. What do you think? -
Make Google Searches Suck Less with the Help of Firefox (on Ubuntu)
As Google Search gets smarter, it gets dumber, too. And extremely annoying. Yes, I meant “mobil”, not “mobile”, that’s Danish, so please stop rewriting it and forcing me to click and confirm that yes, I did mean “mobil”.
Are you, too, tired of having Google rewrite your queries? Well, if you take a closer look at the request querystring that’s generated when you correct Google’s “corrections”, you’ll notice a token, “nfpr” (or None of those Fucking Pathetic Rewrites, as that acronym must clearly mean) that’s set to 1, i.e. true.
So, using this, combined with the knowledge gained from fixing the broken search accelerator in Linux Mint, we can add this token to our defaults so that Google will revert to its previous, less intrusive, and less retarded behavior – the simple link “Did you mean blah blah blah?” placed just under our search input box.
$ sudo nano /usr/lib/firefox-addons/searchplugins/en-US/google.xml
And add,
<Param name="nfpr" value="1"/>to the list of parameters. Exactly where doesn’t matter, just anywhere. Ctrl+O to save. Restart Firefox.
Probably there’s a Windows and Mac OS equivalent file, but you’re gonna have to find it yourselves
Now if we could only have a token, like poracawmq=1, for “Please Only Results that Actually Contain All Words from My Query”, Google Search might just start to be genuinely useful again!
-
Fixing the Broken and Mangled Search in Firefox (4) on Linux Mint
So, while being busy doing other stuff and therefore postponing actually getting rid of this buggy Mint version of Linux Mint 10 KDE (which is basically 100% Kubuntu minus Canonical goodness and instead tons of additional bugs and Mint branding everywhere), I was getting pretty bitchy about the totally fucked up search in my Firefox 4 installation.
This Mint-branded partner search crap is everywhere and not so easy to get rid of. The actual search bar was easy enough – manage the search providers, delete Google from the list, then search for new providers with “google search english” as keywords. Reinstall, and that part’s taken care of.
Then there’s the deal with the “Mint Enhancement” add-on crap that can be deleted for everyone by just doing a,
$ sudo rm -rf /usr/lib/firefox-4.0/extensions/mint-search-enhancer@linuxmint.com
Easy peasy, but might need to be done again after an update. At least until replacing the OS itself with Kubuntu.
The more tricky part is fixing the address bar type-to-search feature which on Mint 10 KDE results in awful Mint-branded results in what appears to be Thai. Leaves me hungry for veggies, rice, nuts and coconut milk, but not satisfied with my results. The language part is the easy one. It seems the Mint branding fucks up the preferences’ lang setting, which is specified as [chrome://global/locale/intl.properties] – clearly supposed to be an instruction to fetch the system’s locale and use that, except it obviously doesn’t work. Go to Preferences > Content > Languages and fix it manually.
Left is the annoying Mint branding itself which apart from being ugly removes all the usual Google search options, modifiers, and Google account links at the top. The problem can’t be fixed by visiting about:config or anything like that. The problem lies deeper, as a mangled system-wide Firefox search engine XML configuration file. Go to a console and type:
$ sudo nano /usr/lib/firefox-addons/searchplugins/en-US/google.xml
Remove everything in it (ctrl+K deletes an entire line) and paste this text in it:
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"> <ShortName>Google</ShortName> <Description>Google Search</Description> <InputEncoding>UTF-8</InputEncoding> <Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAPfLAAATVikwdA8SnxUfgAsWpAAilholjxw4jBc7kwAlvQQ2sRMsoBUqqhMzuhY/vxw4tSgmiyM1mSUztiQ6sTE3sQ4qyxMxxRoyxiAuxR1CtBxJsBxasSJuuTFguBte0Rlf2xVc9h9W9xVjzxVr0gdj6BRh4R1o5yBcyiZbyydT1i9b2Ddb1iFY6CJg2Vpor1dzvEJu20Z0yi23QDy1REi2OUy0O1WzOVC4PU+tVUe5Sk2xQU2zRUO4UE21Ula2SmKEqWWF2HyPx2+a6X6e6Xqk1m+s78sUDs4UGdEQB9YfDdwaANEfHd0YEscjAM4mAM0qANIoD9IkGdslGswuItYgL4aP0ImP2YGZ36Opzaq2wq/S+rzX/7/e8MrS1MLO/sTb48rT8snX/83c89PZ+crq+cH1/9Dl/9Ln/93r/9fy/+Hf7P/42eDm/O7u/+T29uX2/eT2/+f4/+f5/+j/9u//8+3/9u7/9ur5/+j//+n//+v//u3//+7//e7//+////b66/T/6vX/6/f/7f/07fj/4fv/4Pj/5v/45v7/4/r+7/3/6fDw+Pfx//D/9/X/8fT/8/f/8ff/8/D///H///L8/fL///P///X7//b6/ff/+/T///b9//f///v19//w9v/09P/29v/x+f/y///z///1+v/1///2///3//j79P/58/z/8/z99/z/9v7/9P7/9vn7//v6//j9//n9//j///n///v//vv////4+v/5+//6+P/4///6/P/6/v/6///7///9+P/8+v/9+v7/+Pz////8/f/9/f79///8///9//7//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAMsALAAAAAAQABAAAAj/AEn4oIFjBw8bOnrMuJGjhowZM1T8UdYJUZ5ZcNRYWjSrVK5QU0DMmtUnzRAXEy4o6FCEy6NDTkQIq1MmRgM0eZTlCXMgQJtRSE4gmgUkwh1EiZTNUiamy6NUUExcuoJgDCdDjQg9KgVL2SNFT1hwEvKglLBWuixZ+jSrlSBdRlL04bBBkTBdpZTpIqWsFaBcTEr0QaEhl6dWlswKW6poDRUPlmAUQKWMkTJLc76QMQNGUZMWgIgkCFJnlq5WXigwkFClVZQQyuRgELAlk7JBymCZGYAF0ZEPrQixgUDAihxVdPpoAZAFUZIRfThxgvPCwAILDipk+OFG2ZIVoxApERtPfvwlvZ+kQFzPvv0MJQEBADs=</Image> <Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&qu={searchTerms}"/> <Url type="text/html" method="GET" template="http://www.google.com/search"> <Param name="hl" value="en"/> <Param name="q" value="{searchTerms}"/> </Url> </SearchPlugin>
If you prefer search results in your native language, you would want to not include the <Param name=”hl” value=”en”/> line which tells Google that, “Yes, I know I’m currently in Denmark, but I still want to see search results in English, please!”
Once again, an update might want to mess with this file. Keep a link to this post just in case
Restart Firefox and enjoy not being kicked in the teeth by Mint any longer.
-
Swap Partitions and SSDs: A Beautiful Match
Anyone who’s purchased an SSD will know that what ensues is a string of questions and configuration sessions to ensure that your system on the one hand will benefit the most from this glorious technology, and on the other hand that your system won’t actively degrade the SSD hardware or bring itself into a performance depression.
Even with the newer, self-organizing types of drives that ensure at least some basic kind of wear-levelling and block allocation optimization for OSes that do not natively support TRIMming (such as Windows XP or Mac OS), actively issuing TRIM commands to the device is clearly the most efficient way to behave.
This can be difficult in some cases, like for a host system virtualizing disks to guest OSes (neither VMware nor Virtualbox at the moment will translate de-allocation of blocks in virtual disk files to TRIM commands for the hardware). Or, one would think, for swap partitions on Linux.
But not so, it seems! I was kind of assuming there would be no TRIMming of the space on a swap partition, so my first “logical” solution was to ditch the partition altogether, and automatically set up and take down a sparse swap file on the root fs on boot/shutdown. As it turns out, this isn’t supported at all.
I then decided to take a look at the kernel source code for the swap routines in swapfile.c (actually, I grepped it all for ‘discard’, but that sounds less cool
), and lo and behold,/* * swapon tell device that all the old swap contents can be discarded, * to allow the swap device to optimize its wear-levelling. */ static int discard_swap(struct swap_info_struct *si) { struct swap_extent *se; sector_t start_block; sector_t nr_blocks; int err = 0; /* Do not discard the swap header page! */ se = &si->first_swap_extent; start_block = (se->start_block + 1) << (PAGE_SHIFT - 9); nr_blocks = ((sector_t)se->nr_pages - 1) << (PAGE_SHIFT - 9); if (nr_blocks) { err = blkdev_issue_discard(si->bdev, start_block, nr_blocks, GFP_KERNEL, 0); if (err) return err; cond_resched(); } list_for_each_entry(se, &si->first_swap_extent.list, list) { start_block = se->start_block << (PAGE_SHIFT - 9); nr_blocks = (sector_t)se->nr_pages << (PAGE_SHIFT - 9); err = blkdev_issue_discard(si->bdev, start_block, nr_blocks, GFP_KERNEL, 0); if (err) break; cond_resched(); } return err; /* That will often be -EOPNOTSUPP */ }
Discard calls are already being issued when swap space is de-allocated!
Don’t we all just love Linux? Yes, Daniel. Yes, we do.
-
XBMC PVR with HTS Tvheadend on Linux with Completely Outdated MSI DigiVox A/D
This XBMC application. It continues to amaze me.
I’ve just been fortunate enough to get my very very aging MSI DigiVox A/D (no, not II, not III, not Mini, the old one) USB DVB-T adapter to provide beautiful MPEG streams to my very very cutting edge XBMC installation on Kubuntu Maverick.
Damn, it was a hassle trying to get that MSI bugger behaving. I’d read tons of howtos for different adapters trying to overcome the fact that the “sure way” just didn’t pan out – at all. The sure way being just installing the proper packages – dvb apps and the nonfree firmwares. However, even though /var/log/messages would assure me that the USB stick was recognized (as an em28xx device) and loaded with the proper firmwares, and all the proper adapters appeared under /dev/dvb/adapter0, the sure-to-work kaffeine app would fail to find any channels when scanning. VLC would find none, either.
In fact, I’d get tons of sys messages about firmwares being loaded and warnings about “tuning failed!”. Seemingly nothing was “wrong” – it’s just that no channels were found. Ever. By any app. Not tvtime. Not me-tv. Not kaffeine. Not VLC. I tried updating to the newest 2.6.38 kernel from Natty, to no avail.
Then, failing to find any real info on this particular revision of the DigiVox, I started looking more specifically for info on the chip, and the module, em28xx. Which led me to this French post about a Pinnacle adapter with the same chip. This page leads to this wonderful person’s prepackaged debs of drivers, and lo-and-behold, downgrading to kernel 2.6.35-24 and installing the matching driver deb found there, bam! one Kaffeine stuffed with DVB services! Sadly, there was no audio on the MPEG-4 services. Same thing with Me TV. VLC still couldn’t find any channels. Me TV only found MPEG-2 channels.
I wasn’t too fazed, though, as my experience with XBMC is that everything always Just Works™, so I was counting on it to save the day.
I’d already installed the PVR-extended XBMC release from Lars op den Kamp’s PPA, so now I had to figure out how to get that shizzle to play by my dizzle. Turns out that’s pretty much a walk in the park – sudo apt-get install hts-tvheadend, and you’re pretty much there. That is, after reading this XBMC forum thread on what needs to be set up.
And of course, figuring out how that http://localhost:9981/ interface works. It’s an amazing piece of software that HTS Tvheadend. Just friggin’ amazing. The key point here is to name your services (or use the auto-naming feature) so that they turn up as channels, and whoosh, they’re there in XBMC
With full audio on all services, of course.To think that I was almost about to run Winblows on this HTPC to get that aging USB adapter to work. I must’ve been hemmorhaging from the brain.
Recent Posts
- Creating Missing Keyboard Shortcuts in Applications on Mac OS X
- Get Back /var/log/messages in (K)ubuntu 11.04
- Boosting Windows 7 File Move Performance by Up to 10,000%
- Leaked Screenshot of Windows Server 9 Login Screen, In-UI Annotations new Design Strategy
- Linux Users More Generous than their Paying Mac and Windows Counterparts?
