Saturday, September 24, 2016

Postimehe otseblogi ja NoScript

Firefoxis on NoScript laiendus kasulik selleks, et blokeerida skripte ning säästa arvutiressursse — et arvuti oleks kiirem. See sobib olukorras, kus masin pole kõige uuem, kuid ajab asja ära.

Probleem seisnes selles, et Postimehe otseblogi miskipärast ei näidanud, ehkki NoScriptis olid kõik Postimehe/PMO domeenid lubatud.

Tegemist oli konkreetselt töölaua-Firefoxiga, kuid sama asi kehtib teiste Firefoxi- ja Gecko-põhiste lehitsejatega, sh SeaMonkey, GNU IceCat, Debian Iceweasel jt.

Selgus, et otseblogi laaditav failitüüp ei olnud Firefoxile sobilik (failitüübi kontroll ei lasknud faili läbi), ning otseblogi ei laadinud enam. See paistis silma lehitsejakonsoolis (Tööriistad > Veebiarendajale > Browser Console).

  • Minna about:config lehele, otsida parameeter nimega
  • Väärtusele lisada järgmine tekstiosa koos tühikuga alguses:*.liv
Otseblogiga artikkel tuleb uuesti laadida, ning nüüd peaks otseblogi töötama.

Väike ääremärkus, et Androidi-Firefoxi ja IceCatMobile lehitsejatega, kus ka NoScript peal, selliseid probleeme pole, sest nendes on NoScripti mobiiliversioon vähemfunktsionaalne.

Lahendus oli NoScripti foorumis.

Wednesday, August 3, 2016

Temporary workaround for if your ThinkPad restarts due to overheating


 (Jump to workaround
The lion's share of desktop computers, portables and notebooks are equipped with fans to cool the processors and other innards, and fan-less notebooks and PCs are in a minority. (Still as of mid-2016)

Every once in a while, the computers and their fans inside collect dust and other micro-materials that together form a certain mass that blocks airways. If the machines are not maintained by way of dust removal, then excess heat fails to exit airways blocked by dust, and this can cause the devices to overheat and become a serious fire hazard.

Notebooks, laptops, portables, and netbooks make up a majority in desktop-type PCs (this also includes Macs), and they are more susceptible to eventual overheating due to several reasons:
* Their compact design;
* Use and placement in and on comfort zones; these often include people's laps (clothes, hair), beds, and mattresses. Fire department officials wisely tell people to avoid placing their notebooks like that.

Most ThinkPad notebooks are no different in that regard, as they are also equipped with fans.

As with many notebooks from major producers, ThinkPads are equipped with factory-installed power management software.

As opposed to most factory-installed cruft, ThinkPads' utilities are actually useful. To keep those, a user should consider having at least 2 Gb of RAM memory with Windows xp, and at least 4 Gb of RAM memory when running Windows Vista or greater. The utilities do have to be kept up-to-date for security reasons.

The workaround

Recently, I came across one ThinkPad that had begun restarting because of excess heat and restarts during video playback, and since the owner did not have time to take it to maintenance, I discovered a temporary workaround that alleviates the problem.

ThinkPad Power Manager allows users to manually adjust CPU speed relative to which user-created power scheme is used. (This does not apply to factory-made power schemes, which are locked from editing.) Such advanced power management features are not present in Windows itself; in this case, Windows XP.

CPU speed and other power management settings can be set for all user-created power schemes, or just one. Because this particular ThinkPad kept overheating during video playback, I set CPU usage to low in all power schemes.

Instructions based on ThinkVantage Power Manager 5.20 in Windows xp sp3, running on ThinkPad R60e.
  1. Launch ThinkPad Power Manager. Either:
    • Right-click on the ThinkPad battery icon in the Windows taskbar, click on 'Launch Power Manager...', or
    • launch ThinkPad Power Manager from the Start menu:
      Start > All Programs > ThinkVantage > Power Manager
  2. Use the Advanced view (click on bigger button on the upper right to switch to it)
  3. In the list of tabs, choose the (usually default) 'Power Scheme' tab
  4. Create new power scheme, give it a memorable name
  5. In the main space (to the right),

    • Expand System setings, and at
    'Maximum CPU speed':
    'Battery settings' 'AC settings'
    (when plugged into mains)
    Set 'max CPU speed' to Lowest Low

    'Adjust idle timers':
    Settings set by me:
    Battery AC
    Turn off display 5 min 15 min
    Stop hard drive 5 min 20 min
    System standby (sleep mode) 15 min 30 min
    System hibernation 20 min 45 min


This essentially resolves the issue, but the owner must still take their notebook to maintenance to have all the dust removed.

Friday, July 1, 2016

How package management in Linux is different from installing programs in Windows

This was written in reply to someone on Google+ who converted from Windows to Linux, and still claimed, that he needed to download software from the Internet, which I assumed meant 'from the web', and not a distro-native package repository.

Downloading software on Linux is different from Windows.

Now, each major Linux distribution (distro) relies on their own software repository; each distro uses one of the two major package management systems, and package management software built around them.

Ubuntu is based on Debian. In Debian, the very basic package management system is dpkg, but actual work is done by APT (A Package Tool). Some other distros use RPM as their package management system.

Package management software is usually component- and command line-based, and typically has a graphical front-end.

So, Debian and Debian-based distros use dpkg, and it is relied on by the more automated APT, which can be operated with Synaptic, which is a graphical front-end to APT. Individual packages each have the .apt extension appended to their filenames.

For comparison, dpkg is a basic installer component with a purpose similar to Windows Installer. dpkg may check for dependencies and report those to the user, if there's a software package that is missing.

APT still uses dpkg, but greatly automates package management. Missing packages are downloaded either in console (via command line), or with Aptitude (a text-based graphical program), or with the fully-graphical Synaptic (not to be confused with touchpad pointing device maker Synaptics).

Synaptic can be used with Ubuntu, too, but Ubuntu has its own primary app store-like program called Ubuntu Software Centre (_Software Center_ in U.S. spelling). This is what you should use to download software for Ubuntu.

There can be two or three major software packages, that can be downloaded separately from the package manager. One of these is LibreOffice, because each new LO release offers more and better features; and the other is Wine (their site is winehq), which can run applications made for Windows. Wine is not compatible with all Windows programs.

There is a possibility, that Ubuntu builds/backports versions of newer software to its LTS release, but I have not confirmed it, because I don't have experience with Ubuntu.

For most things, Linux already has a large number of functionally similar counterparts to Windows programs — with the exception of some specialized software with unique functionality that does not have a Linux-based alternative.

Tuesday, June 28, 2016

Recommending wearables based only on media exposure

This was inspired by a post in Google+ that was reshared by a person I follow.

The post was titled "Top reasons people stop using wearable technologies", and listed a bar chart with said reasons. At URL.

Most likely, the market for wearables is still starting out, and hasn't yet found its footing. There is also no standard or common/dominant design, such as Windows in PCs, and Android/iOS on mobile phones.

Since I don't have any wearables, then my knowledge is based on actual media exposure (=article titles) of practical benefits. This has boiled down to two very different brands.

• Much more affordable from the outset;
• Its charge can last a week;
• Works as advertised;
• Its health tracking functions can be used to determine better diagnoses related to heart disease and a number of other ailments, where health logging becomes important;
• Can save lives.

Conclusion: Fitbit doesn't do everything, but it does well the things it's meant to do.

Apple Watch &#mdash;
• Expensive (aka "Worth its price");
• Short battery life (requires recharging each forthnight);
• Creeping featuritis — not enough useful features vs. too many useless features, therefore no direction.
• Water-resistant, but not waterproof.
• Difficult and expensive to fix, if gets broken.

• The advantages are integration with iOS and Siri. Of course, health improvements, too.
• Apple Pay (if you forget your wallet home), but that's only in the U.S.
Can save lives.
Can run Windows 95. But that means other operating systems, too...?

Conclusion: Differing functions, no special use-case. Has app ecosystem.

Footnote: Given that wearables log information about a user, they can also be very useful in forensic investigations, such as evidence-gathering or coroner's reports in determining the exact time of death (that is, if the device clock is correct) or another potentially life-harming event that needs to be investigated.

But this also requires, that wearables data must per user reques be stored (encrypted, hashed, and salted) in such a way that it couldn't be tampered with. I speculate, that current implementations might not meet such strict storage regulations, and their data can thus be used on the basis of assuming good faith.

So, at this time, logs of wearables can be used as supporting material when building a case. Whether wearables data can be used in courts of law, is a matter to be resolved by the legal profession.

Sunday, May 15, 2016

Useful apps exclusive to Android

This is a copy of a comment I wrote in a YouTube discussion to someone who recommended that "[I] get an iPhone".

I've formatted and edited the comment with some additions into this blogpost. While it does harken back to a previous post I wrote about reducing one's Android's resource usage, then this one is more about some of the useful apps I use that are exclusive to Android.

An iPhone or any new smartphone is beyond my means, and I wouldn't be able to run some specific apps only available on Android, such as:
  • Adblock Plus for Android. Works only on Wi-Fi, but blocks in-app ads;
  • Firefox for Android. It's got Reader Mode, which saves an article, only keeps relevant article content, and allows white-on-black reading.

    Firefox extensions, which only run on Firefox-based mobile browsers:
    • NoScript Anywhere — blocks scripts and trackers run by scripts, and thus reduces browser resource usage. Its whitelist allows running scripts on sites I whitelist through the NoScript menu in Firefox;
    • Privacy Settings — allows users to switch off a number of default Firefox settings to make the browser less resource-hungry and more secure;
    • Stylish — allows users to locally change the appearance of webpages displayed in a browser (make them dark, etc. to save battery life). People can download or make their own userstyles.
    • Save Link Menus — allows saving links or webpages from Firefox to the local file system.

  • Vim Touch — a very advanced text editor. This adds to productivity (I can create and edit content);
  • Hacker's Keyboard — I need this to use VimTouch, to easily navigate in text, and to quickly switch between languages without going to settings every time. This keyboard app is very lightweight compared to most native virtual keyboards;
  • Unicode Map — to search for, view, and copy Unicode characters;
  • VLC Media Player. 'Nuff said;
  • Arity — a scientific calculator, but I sometimes use it to calculate expenses when shopping for multiple things with a limited budget.
There some other apps with functionality not particularly unique to any mobile ecosystem:
  • Sparse RSS — to subscribe to podcasts;
  • Units — a very nice unit converter;
  • MuPDF — a lightweight viewer for PDF, OpenXPS and CBZ files;
The above apps are all Free / Open Source Software (FOSS), and available at the F-Droid app repository.
    Stock app —
  • FM Radio. I can listen to plain FM radio and listen to great music for free and without ads. Estonia's public broadcaster ERR is just that awesome. They even provide small "what's playing" pages, so I can check out the artist and song.

    FM radio functionality is not on most iPhone models, and not on most Windows phones either. My phone even supports RDS.

  • Some proprietary apps:
  • TeamViewer — I sometimes do computer support for friends and relatives;
  • The local weather widget.

This post is licensed under CC-BY-SA-3.0.

Tuesday, March 29, 2016

Pisut kriitikat "Postimehe" uue "mobiilielamuse" aadressil ja paar lahendust aeglastele nutitelefonidele

Kiirelt kirjutet ja sõnakas postitus, nii et kes loeb, on hoiatatud.
  • Vanem nutitelefon, operatsioonisüsteemiks Android 2.3 Gingerbread.
    Igal Androidil on vaikimisi lehitseja, mille kokkuleppeline nimi on "Android Browser"; kasutajaliideses lihtsalt "Internet".

    Android 2.3-ga kaasas käiv lehitseja on tehnoloogiliselt ja moraalselt vananenud, ning ei esita modernseid lehekülgi enam õigesti.
  • Sellest johtuvalt on kaasaegsete mobiililehtede vaatamiseks peale pandud Firefox Androidile. Et see vanemal seadmel enam-vähem kasutatav oleks, on Firefoxi lehitsejas suurem osa ressursinõudlikke funktsioone välja lülitatud, samuti on peal laiendus NoScript Anywhere (edaspidi NoScript), mis blokeerib vaikimisi skriptid kõikidelt tundmatutelt saitidelt ja lubab käitada vaid kasutaja poolt hallatava valge nimekirja kaudu lubatud skripte. Väga mugav.
Kuni selle aasta märtsi mingi kuupäevani oli "Postimehe" (edaspidi PMO) mobiiliversioon enam-vähem kasutatav, ning selle ajani kehtinud PMO mobiili jaoks sobiva ja kasutatava disaini küljendajatele tuleb jagada ohtralt kiitust. Sest see Disain töötas hästi.

Kui anonüümne kommenteerimine oli võimalik, sai ka kommenteerida, ning artikleid sai samuti segamatult lugeda.

Siis tuli 2016.a. märtsi keskpaik ja natuke peale seda, kui PMO lugemiseks avaldati üks ressursimahukas äpp (õieti mobiiliversiooni uus wrapper), avaldati paar päeva hiljem ka sellele ekstra küljendatud spetsiaalne

Lihtne oleks ju öelda, et juhe jooksis kokku.

Valesti läks see, et PMO uus versioon tehti automaatseks, mis uuendab sisu ise, mis omakorda on oma loomult päris ressursimahukas tegevus.

Tõepoolest — silmailu on, aga selle saavutamiseks on ohverdatud kasutatavust.

Tuleb nentida, et kasutatavuse huvides ei oleks mina varianti mobiilseadmete jaoks üldse käiku lasknud, sest u. 2016.a. märtsi teise pooleni üleval olnud ise-mitte-uuesti-laadiv lahendus töötas mobiili-Firefoxis hästi.

Niigi lülitati 2015. aastal välja Postimehe WAP/WML-versioon, mis oli ülikiire ja -mugav viis uudiste lugemiseks. Ma tõesti ei tea, mis WAP-versooni väljalülitamise põhjuseks võis olla, kuid kahtustan, et sellega oli võimalik lugeda ka selliseid artkleid, mis käisid tavapäraselt "Postimees Pluss" alla. Jaa, WAP (WML) eelised jõudsid kohale alles 10-15 aastat hiljem.


Erinevalt töölaua-Firefoxis olevast NoScriptist ei ole Androidi-Firefoxis võimalik NoScripti valget nimekirja detailselt toimetada. Samuti ei võimalda mobiilse NoScripti kasutajaliides konkreetselt alamdomeenide lubamist/mittelubamist.
26.04.2016: ^ Veidi täpsustatud sõnastust.
Niisiis: Firefoxis on about:config seadetest extensions.nsa.policy alt võimalik kopeerida JSON formaadis olevat valget/musta nimekirja, mida on küll võimalik teksti kujul toimetada, aga koodi iseärasuse tõttu saab seda teha ainult tekstiredaktoris.
(Firefoxile mõeldud NoScript-i ametlik nimetus on NoScript Anywhere, ehk NSA...)
Jama on selles, et see JSON-rida on pikk üherealine tekstijoru. (Õnneks on JSON formaat suhteliselt lihtsalt loetav.)

Selle toimetamiseks on niisiis vaja tekstiredaktorit; isiklikult soovitan kahte äppi:
  • VIM Touch-nimelist tekstiredaktorit, mis on väike, võimas, ja algajale suhteliselt keeruline selgeks saada. A kui selge on, on lihtsam.
  • Hacker's Keyboard, mis annab Samsung Keyboard vms asemel täieliku sõrmistiku kõigi vajalike nuppudega.

VIM-i tundjad tõenäoliselt teavad, mida selle JSON-joruga edasi teha; praegu pikemalt ei seleta kui vaid niipalju, et JSON rida tuli kopeerida ja asetada VIM-i, siis iga domeeen käsuga :s/\,/&^M/g eri reale, siis sorteerida, ning siis toimetada ja lisada domeeni järele 1 või 0; 1 vastavalt lubab, 0 keelab. Komad lõppu ka, v.a. kõigeviimane domeen. Ärge unustage tegemast varukoopiat.

Supp seisneb selles, et PMO uudiste normaalseks lugemiseks tuli mul blokeerida ära ja lubada .
Varem arvasin, et alamdomeene võis lubada ainult http:// prefiksiga ja et ilma polnud võimalik; kuid vähemalt alates NoScript versioonist 3.5a11 sai seegi lõpuks võimalikuks.

Siiski jäin endise praktika juurde, ning turvalised domeenid on vajadusel alati https:// prefiksiga: näiteks kõik Google'i domeenid. tuli blokeerida selleks, et uudiseid vaid lugeda; www ja kõik teised alamdomeenid lubasin selleks, et uudiseid kommenteerida (teoreetiline võimalus on olemas ju), ning mis põhiline — et kommentaare saaks reitida (lisada + või – ). teise taseme domen on vaikimisi lubatud, teised reklaami- ja muud domeenid mitte. Blokeeritud oli eraldi . Sest akut peab säästma.

PMO temaatilised alamdomeenid on kontseptuaalselt iseenesest hea, kuid kuna neid on palju, siis NoScripti valge nimekirja toimetamisel on nende käsitsi lisamine ebamugav. Vähemalt pole edaspidi vaja neid lubada/blokeerida.

Reklaam ja reklaamiblokeerijad

Tõepoolest, "Postimees" elatub osaliselt ka reklaamirahast, kuid erinevalt kaasaegsetest PC-arvutitest on vanemate arvutite ja mobiilidega tihtipeale see lugu, et vähese võimsusega on ka sama vähe mõtet reklaame vaadata ja lugeda. Mobiil-interneti puhul tuleb arvestada ka sellega, et inimesed reklaamide tõmbamise eest tegelikult väga maksta ei taha.
Miks mitte lisada PMO tellimus telefoniarvele näiteks?
Võib ju väita, et vähevõimas nutitelefon on oma omaniku peegelpilt, aga niisuguseid inimesi on ka, ehk "üksteist peab hoidma," nagu ühes armsas laulus sõnat'.

Hästivarustatud tavakasutaja koos uusima nutimudeli ja põhimõtteliselt piiramatu mobiilsidega selliste asjade pärast eriti muretsema ei pea.

Kvaliteetväljaandena on Postimees Online on siiski üks väheseid, kus on huvitavaid ja informeerivaid reklaame, ning neile klikitakse/toksatakse vajadusel peale küll. Teadlik reklaamitarbija tõepoolest mõistab iga kliki/toksamise väärtust.

Tõsi küll, võimalik on kasutada ERR-i kui tasuta uudistekanalit.

Infoallikatena on PMO ja ERR mitmes mõttes asendamatud. Delfi kui uudisteallika väärtuse kohta 'ei kommentaari,' kuigi nene mobiilse veebi jaoks mõeldud lahendus paistab (pea) kõigist oma lugejaist hoolivat... või noh, oma lugejate mobiiltelefonidest... :>

Lõpuks töötasin välja parima lahenduse võimalikest. Aga sellest juba tulevases postituses.
Uuendatud 26.04.2016.

Sunday, March 27, 2016

Firefox for Android on slow phones. Some practical advice.

This one was supposed to be a quick post; I might update it later on. And then I got carried away, and spent about four to six hours writing the post's content and refining its wording.

* That Firefox for Android can render better than the aged native browser on Android 2.3, is great, but at the moment, I won't go into detail about that.
* This post is not about desktop Firefox. I might write about issues current in desktop Firefox in a future post.


* What happened
* My phone is slow now.
* What to do. Extensions to speed up Firefox

Until today, I have avoided that "What I Use" post, but every once in a while comes a time, when I am not afraid to write about what I use. Even if it's not the newest kit.

Why I downgraded

After Firefox 45.0 was released, one early and now resolved issue was connection misbehavior with Firefox 45.0 and NoScript 3.5a10. Very soon, NoScript 3.5a11 was released, which fixed the issue.

Then, after upgrading, I also discovered, that Firefox 45.0 turned to using the Firefox-native toolkit for its main menu, which is slower than the natively formatted main menu in Firefox 44.0.2 and earlier.

For this and then-the earlier issue, I decided to downgrade back to Firefox 44.0.2 from version 45.0. The slow and inefficient main menu became cause not to upgrade any further on my device—except for testing.
Note, that when upgrading or downgrading apps in Android, use the overwrite method when installing; Do not uninstall the existing app version to then install a different version, or this action will forever delete all your user data for the app.


Thus, it slowly dawned on me, that my phone is showing its age. It's a Samsung Galaxy Mini 2, which model was released four years ago,[as of March 2016] but I got it in late 2013 as a pass-me-down, after it had two nearly grave misadventures with its previous owner.

* The Galaxy Mini 2 has an 800 MHz Snapdragon S1 CPU (specifically, MSM7227A), which is on the lower end of processors built on the ARMv7-A architecture, and uses the ARM Cortex A5 processor core.
* The phone runs Android 2.3.6 "Gingerbread", and won't be upgraded to a newer offical Android version.
* The device has just enough minimum required RAM memory to run Firefox for Android.

This soup of specifications essentially shows what the minimum for running a very modern version of Firefox for Android can be.

That major apps — such as Facebook and games — are not present, is a given. I've also excised other apps that I did not deem necessary anymore: BBC, ERR, Postimees, and a local service provider's player app.

What to do

In Firefox settings, disable telemetry and plugins. The Privacy Settings extension will make it simple to turn off other stuff.

Extensions to speed up Firefox

The following details two extensions that I use in Firefox for Android to have a reasonably passable browsing experience.

NoScript Anywhere.
In my phone, NoScript Anywhere ("NSA") makes browsing with Firefox a usable experience:
NoScript blocks scripts and plugins from running, and users can use the NoScript menu item to create an internal domain-based whitelist of sites which won't work without scripts. With this, NoScript not only blocks scripts, but also advertisements generated by scripts.
Another thing that shows the phone's age, is that the local daily "Postimees" launched a redesign of their mobile experience this month, and now their site redirects to their brand-new mobile site, which, if JavaScript-enabled, updates every ten minutes with AJAX, and that slows down the experience and the phone, and presumably eats away at the battery, too.

The obvious solution was to forbid from running scripts, thus removing it from the allowed sites list. This mangled the design somewhat, but at least the site will display reasonably responsively. Yes, it's a simplistic workaround, but it makes it possible to read news there, even if the site is not functional. The functional part was the possibility to rate comments, but "Postimees" removed the ostensibly anonymous commenting functinality. Most people just don't care to create a burner account on social media, and neither do they care risking their primary social media/e-mail accounts.

Privacy Settings
Another Firefox extension that reduces resource usage, is Privacy Settings. It's available at the Mozilla Add-ons site. With Privacy Settings, it's possible to switch off components that I don't have any need for. There are some settings that I have kept on, as switching all things to 'secure' may break rendering or accessing places like Instagram. While Privacy Settings won't work on older Firefox versions that can still run on Android 2.2 or earlier, or on ARMv6 CPUs, the extension's website has a breakdown of some of the about:config settings that one can modify manually.

I'm also considering the Policy Control extension, as it would reduce resource usage even further, and introduce more fine-grained control over which website can use which resources.