Author: Jani

  • Ksml.fi pyytää lukijoiden kommentteja: Windows, Linux vai OS X?

    “Käyttöjärjestelmiin [liittyy] faktojen ja tekniikan lisäksi paljon tunteita ja intohimoja. Haluamme kuulla nyt sinun kokemuksesi niistä. Mitä käyttöjärjestelmää itse käytät? Mikä siinä on hyvää ja mikä huonoa?

    Kerro kokemuksesi, koostamme niistä myöhemmin artikkelin Keskisuomalaiseen.”

    Ksml.fi
    linkitys omani

    Seuraavassa äsken jättämäni vastaus kysymykseen siitä, mikä lähes yksinomaan käyttämässäni Linuxissa on hyvää ja mikä huonoa:

    Parasta Linuxissa on riippumattomuus, eli vapaus suljetuille järjestelmille (kuten Windows) tyypillisestä alisteisuudesta valmistajan mielivallalle. Tämän sinänsä ehkä kovin abstraktilta kuulostavan ajatuksen seurausta joko suoraan tai epäsuorasti on kaikki mikä Linuxissa on hyvää. Tärkeistä epäsuorista seurauksista lienee syytä mainita avoimuuden kulttuuri: jollei käytössä eteen tuleviin ongelmiin löydy valmista, dokumentoitua ratkaisua, on hyvin helppo hakea ja saada vertaisapua.

    Ehkä huonoin puoli avoimen lähdekoodin ohjelmistojen suosimisessa on niiden kehittäjien ajoittainen taipumus panna enemmän painoa olemassaolevien ratkaisujen jäljittelylle kuin kokonaan uusien keksimiselle. Tosin jonkun mielestä ongelma voi olla pikemminkin päinvastainen, sillä tätä olemassaolevien ratkaisujen jäljittelyä tarvitaan, mikäli halutaan yhteensopivuutta suosittujen, suljettujen järjestelmien (esimerkiksi Windows Messenger) kanssa, ja tämä yhteensopivuus on joissain tapauksissa vajavaista.

  • New Windows Features: Turn off applications

    Windows Features allows users to turn off applications such as Media Centre, Media Player and Internet Explorer.

    BBC

    Wow, think of all the RAM saved by not having to keep those applications running all the time! What will they think of next — a nice shortcut button marked X for this “turn the application off” feature?

    (Yeah yeah, I know that at least parts of the crappy apps mentioned probably are running all the time in a Windows environment. I’m also aware that turning the applications off in the classical sense has been made more difficult in W7. Still, I’m betting the point the writer was trying to make was related to neither, and more to WF allowing for features of the OS to be “turned off”, not applications as most people would perceive them. Whereas support for removing said applications would be a novelty, in my book being able to turn them off doesn’t qualify.)

    (I hope I didn’t overemphasise with my emphases.)

  • What is this i dont even

    Twitter’s “Oops! Your update was over 140 characters. We sent the…” message flashes away from view way too fast; the afore quoted part was all I could read before it vanished. Also, as the real-time character counter indicated (‘0’ left), my tweet was exactly 140 characters long. Apparently this has to do with Twitter using ASCII to encode accented characters. What a nice excuse for a usability FAIL.

  • The Pain of WordPress: "You do not have sufficient permissions to access this page" when trying to upgrade

    I searched far and wide for a working solution for this, and in the end had to cook one up myself. For a short description of the issue, every time I tried to use the new (and otherwise higly cool) one-click upgrade feature in one of my blogs, I was greeted with the blunt response of “You do not have sufficient permissions to access this page.” This was made all the more curious by the fact that simultaneously upgrades of plugins did work in very the same blog.

    Now, I know how to google and this issue seems alarmingly widespread. Luckily there are also quite a few solutions, but unfortunately, as I said, none of them worked for me. Anyway, here’s a list of the solutions othes have found useful, just in case:

    In addition, I tried changing the permissions of wp-content and subfolders, clearing my cookies and cache, logging in and out, reloading and so on — all to no avail. When all of these failed, I began to compare the database tables between my other blogs, in which the upgrade worked smoothly, and the one in which it didn’t.

    I first discovered that prefix_options had two options called fileupload_realpath and fileupload_url. In my other, working blog they referred to the correct upload path on my webserver. In the broken one they were at default, example values which of course were flawed. So I fixed the paths thinking I’d found the culprit, but not so: the issue remained. However, this fix probably didn’t hurt either, as the upgrades probably use the ‘upgrade’ subdirectory inside the upload path.

    The solution

    Then I found that the values of prefix_user_roles in prefix_options differed between the working blogs and the one that didn’t, but didn’t differ among the working ones. So, without any idea of the values’ syntax I simply copied the value from one of the working blogs’ tables and pasted it onto the broken one’s. And that did it: the upgrade now works as intended. Yay!

    Just in case someone with only a single blog has this issue, I’ll paste the actual contents of my working prefix_user_roles below. It shouldn’t have anything too unportable, as the value is probably a default set by the installation of one of my more recent blogs.

    Note that the newlines in weird-looking places are apparently either part of the syntax, or ignored completely, so copying and pasting the value below should work. Unless WordPress — the installation I’m publishing this post in — somehow screws it up. The browser will break the lines when viewed on this page, but it shouldn’t affect selecting and copying, as it’s only part of the visible rendering.

    a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:53:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:12:"delete_users";b:1;s:12:"create_users";b:1;s:17:"unfiltered_upload";b:1;s:14:"edit_dashboard";b:1;s:14:"update_plugins";b:1;s:14:"delete_plugins";b:1;s:15:"install_plugins";b:1;s:13:"update_themes";b:1;}}s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:34:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;}}s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:10:{s:12:"upload_files";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;}}s:11:"contributor";a:2:{s:4:"name";s:11:"Contributor";s:12:"capabilities";a:5:{s:10:"edit_posts";b:1;s:4:"read";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;}}s:10:"subscriber";a:2:{s:4:"name";s:10:"Subscriber";s:12:"capabilities";a:2:{s:4:"read";b:1;s:7:"level_0";b:1;}}}

  • I ♥ Lenny

    I heart Lenny — Debian 5.0 14th February
    I heart Lenny — Debian 5.0 14th February
  • Google Calendar not working in Epiphany?

    Seemingly out of the blue Google Calendar ceased to function for me the other day. I finally tracked the issue down to Greasemonkey and more particularly to _blank Must Die. Adding the two lines I listed below to it seems to have fixed it for now.

    // @exclude        http://calendar.google.com/*
    // @exclude        http://www.google.com/*

    I’m left to wonder what brought this on so suddenly, since I haven’t touched the script prior to this in ages — in fact, I had a hard time even remembering I was using Greasemonkey at all.

  • WordPress and wrong $numposts?

    After a fresh WordPress installation, I was dumbfounded for a while when a simple “global $numposts; echo $numposts;” would always print N+1 despite the total number of posts actually being N. Turns out I had forgot to delete the initial “About” page, which obviously isn’t listed among the posts, but among pages, yet gets included when $numposts is calculated.

  • Relative vs. Absolute Paths: Which Way To Go?

    A quick search for relative links and image references in my most volumous blog yields about 3000 hits. Switching them to absolute ones is one click away, but it’s no different the other way round: a simple search and replace for about 1700 hits of absolute paths. So which way should I go?

    I don’t see myself moving domains in the foreseeable future, but for me relative paths do have the advantage of being shorter to write when making links and such by hand — that’s the reason for the (almost) 2:1 ratio of relative vs. absolute figures I mentioned. Therefore it’s likely I’ll keep using them even if I now switch the ones I’ve produced hitherto into absolute ones. So I’d have to do this change again at intervals, for all the new links.

    But it’s the same if I went the other way: despite choosing to use relative paths I’d still occasionally pick up links local to my domain using copy and paste, resulting in absolute paths. Anyhow, I don’t think the occasional cleanup chore would be too troublesome either way to warrant not going through with unifying my policy at this point.

    I probably would have gone relative already, if it didn’t hinder direct duplication of hypertext from one site to another. If you bring up the source code for what you see on a web page in order to copy it onto another as such, with links and all, you’ll find out it doesn’t work once the server changes. The relative paths have to be changed into absolute ones before it will.

    I wouldn’t want my site to have that hindrance, because I find it highly annoying myself when duplicating material from places such as Wikipedia. From what I understand, they probably do this because it saves capacity on such a high-profile site. Yet others, worried for their material being exploited, do it for the precise purpose of obstructing the free flow of information.

    I have neither of those concerns, so going absolute doesn’t pose problems — apart from being cumbersome to use, when crafting markup manually, as I usually like to do. So both ways have very strong arguments going for and against them.

    I’d like to have a policy I could stick to, because having to stop and wonder about the practice used in each link I write irks me. From a practical point of view however, the mixed solution I’ve used in the past seems like the most natural and sensible one: to let the circumstances pick the practice in each case. Nevermind the ideal of adhering to a strict policy.

  • [Ratkaisu] Uuden välilehden avaaminen Ctrl + T -näppäinyhdistelmällä Tekstieditorissa

    Lähtökohta
    Olen käynnistänyt Tekstieditorin. Haluan avata uuden välilehden, joten painan Control + T -näppäinyhdistelmää.
    Ongelma
    Tekstieditori ei avaa uutta välilehteä.
    Ongelman syy
    Tekstieditorin vakionäppäinyhdistelmä uusien välilehtien avaamiseksi on Control + N, ei Control + T kuten esimerkiksi Firefox-selaimessa.
    Ratkaisu
    Otan Muokattavat valikoiden pikanäppäimet käyttöön, ja muutan Tekstieditorissa uusien välilehtien avaamiseen käytettävää näppäinyhdistelmää.

    1. Käynnistän Järjestelmä → Asetukset -valikosta Ulkoasu-sovelman.
    2. Ulkoasu-sovelmassa siirryn sen Käyttöliittymä-välilehdelle ja merkitsen siellä olevan Muokattavat valikoiden pikanäppäimet -kohdan käyttöönotetuksi.
    3. Suljen Ulkoasu-sovelman.
    4. Tekstieditorissa avaan Tiedosto-valikon, ja siirrän hiiren osoittimen valikossa olevan Uusi-kohdan päälle niin, että sen taustaväri muuttuu valittuna olemisen merkiksi.
    5. Uusi-kohdan ollessa edelleen valittuna painan näppäinyhdistelmää Control + T.

    Tällöin Uusi-kohtaan liittyvä näppäinyhdistelmä muuttuu vakioyhdistelmä Control + N:stä haluamaani yhdistelmään Control + T, joten nyt voin käyttää näppäinyhdistelmää Control + T uuden välilehden avaamiseen.

    Huomautus

    Tämä ratkaisu ei ole yhteensopiva Sisennä rivit -liitännäisen kanssa, sillä Sisennä rivit käyttää Control + T -näppäinyhdistelmää. Mikäli ylläolevaa ratkaisua on käytetty, Sisennä rivit -liitännäisen näppäinyhdistelmä ei toimi, vaan sisennys sillä täytyy tehdä valitsemalla Tekstieditorin Muokkaa-valikossa oleva Sisennä-kohta.