Friday, September 26, 2014

Samsung Galaxy S5 - Grayscale Test Battery Saving

Yay, the Samsung Galaxy S4 and S5 have a power saving mode that removes all colors and turns the screen Gray. The idea seems to be that this will save power on the AMOLED screen due the way it operates.

On an AMOLED screen, a pixel (dot) that is black uses no energy because every pixel emits its own light. On a regular LCD or IPS screen, a backlight is always running, and turning pixels black or white has almost no effect on battery use.

In my opinion, the Samsung Grayscale looks hideous, but if I can get some good power savings out of it, then it may be worth it.


I ran 2 tests. Criteria for both:
  • Screen on 100% brightness for 90 minutes continuous
  • View on home screen
  • No obvious apps running
  • Airplane mode with all networks off
  • Begin timing just as percentage decrements

The first test was of Color. The second test was of Grayscale. Before entering Grayscale powersave mode, I turned off all other power saving features (cpu, framerate, touch key, etc).


Here are the test results:

  1. Battery: 90% - 81% 90minutes color 9% decrease
  2. Battery: 79% - 71% 90minutes gray  8% decrease

After running both tests:
Color used 1% more battery than Grayscale.


Conclusion:
It is my opinion possible that this 1% difference could be due to anomaly or other factors. I did not repeat the test again.

This battery savings does not seem very worthwhile for the average user. For the extremist battery saver that doesn't mind the look of everything Grayscale, then it might result in a small savings.

I would speculate that instead of using Grayscale, it may possible to get even greater powersavings by simply using a black background the homescreen.


Thanks for reading. Please post a comment below if you know of any other battery saving tests for Samsung AMOLED screens.

Wednesday, August 27, 2014

How I Recovered Lost Tabs In Firefox

Recently Firefox crashed and when I opened it, all my tabs were gone.

This is how I got them back.

  1. DO NOT CLOSE AND REOPEN FIREFOX!
  2. Immediately find the "sessionstore.bak" file and make a copy of it to sessionstore.txt.
    cp ~/.mozilla/firefox/*.default/sessionstore.bak ~/sessionstore.txt
    (Windows users
    C:\Users\name\AppData\Roaming\Mozilla\Firefox\Profiles\<random>.default\sessionstore.bak)
  3. Open the file with a text editor and paste it into this site http://jsonviewer.stack.hu/. To make it readable, Click "format".
  4. Save the output to a new file named "sessionstore2.txt"
  5. Open the new file in a text editor.
At the top of my file it looked like this:

{
    "windows": [

    ],
    "selectedWindow": 0,
    "_closedWindows": [
       {
            "tabs": [
              {

I deleted 4 lines so it looked like this:

{
    "windows": [
       {
            "tabs": [
              {


  1. Save the file.
  2. Close all Firefox windows.
  3. Delete the old sessionstore.js file.
    ~/.mozilla/firefox/*.default/sessionstore.js
    OR
    C:\Users\name\AppData\Roaming\Mozilla\Firefox\Profiles\<random>.default\sessionstore.js
  4. Move "sessionstore2.txt" to replace the deleted file. Rename it correctly as sessionstore.js.
  5. Start Firefox and see if it worked.

Hopefully this helps!


An alternate way to format JSON on Linux.
$ json_reformat < sessionstore.txt > sessionstore2.txt 


Friday, April 25, 2014

Solve: SpiderOak error "Gui has already been started, exiting"

Problem:
SpiderOak error "Gui has already been started, exiting"

Solution:
$ SpiderOak --repair

Google Language Services Bash Scripts

I wrote some Bash scripts to easily access Google's language processing services.
The scripts cover these services.
  • stt - Speech to Text (Voice Recognition)
  • tts - Text to Speech
  • translate - Translation from one language to another





https://github.com/Sepero/GLanguageServices

Much thanks to the great posters at commandlinefu.com for helping provide the core functionality to some of these scripts.

Saturday, April 12, 2014

SpiderOak - A Dropbox Replacement With Your Privacy In Mind



A brief explanation of Dropbox. Dropbox is a popular service that allows you to backup files and sync files across multiple devices. A service like this is great for automating home user backups, because honestly most home users can't be bothered to perform regular backups. They provide users with 2GB of free storage, with the option to purchase more space.

Personally, I had been reluctant to use Dropbox service due to privacy and legal concerns. I have some business documents that I need to backup, but these documents must be kept completely private and confidential. Dropbox claims to encrypt user files, but I have heard questionable things about the methods they use. In the past, Dropbox used to store the user password in plain text in a file. I think that is a telling sign they might not highly value user privacy. There was also a short incident in 2011 when it was possible to access any users data without a password. Also, it is known that Dropbox has a master key which they can use to decrypt the data on any account. They actively use this master key to delete files they suspect of copyright infringement. If the master key ended up in the wrong hands, every account would be compromised.

A new service...
About 6 months ago, I was introduced to a new backup service called SpiderOak. SpiderOak operates in a similar method as Dropbox, except one primary difference- they explicitly put data encryption and privacy as a very high priority. All user data is encrypted before it ever leaves your computer. SpiderOak has never had a reported case of security breach. They claim is that there is no master key, and they cannot access your data ever. If you lose your password, your data will be unrecoverable.

Though in disclosure, I must acknowledge that the privacy claims of SpiderOak aren't 100% verified, because the client software is not fully open source. On the other hand, everything that can be verified appears to be accurate. Also, the software is partially open source, and SpiderOak organization has said that they intend to eventually release 100% of their client software as open source in the future.

After learning of SpiderOak, I felt that it was reasonable for me to try using their services to back up my documents. My results were positive. They offer 2GB for free. The software is stable, and runs reliably in the background while I use my computer. I have never had it crash or malfunction. There are a decent amount of configuration options and I think the graphical layout could be a little more intuitive, but the basic operations didn't take very long to understand. It allows me to set a speed limit on data uploading, which prevents it from hogging all of my internet traffic. I really like that it let me individually select which files and folders I want to backup (unlike Dropbox, which forces you to put everything in their special folder). SpiderOak software runs on all popular Desktop and Mobile operating systems.

After 6 months of use, I would say that it has been excellent. I'm very pleased with SpiderOak service. I would recommend it to anyone who has a little bit higher than average concern for privacy. SpiderOak has proven reliable and trustworthy for my needs. I hope to use the service for a very long time to come.

https://spideroak.com

Thursday, April 3, 2014

White skin hate in denial?

I normally avoid political junk on my blog, but this  message I recently received was very interesting.



---- Original message follows ----

The webpage below is an important message for the light skin people of the world. It has been brought to my attention that they are born with a unique curse of disliking other races. Light skins cannot help being born with this special and unique affliction. Informing them of their evil perceptions seems to help in reducing the problems of this epidemic. Though, if we are going to make a lasting awareness, we must inform the children. Light skin children need to be reminded on a regular basis how their thoughts are horrible, and they need to be more like the children of dark skin ethnicities. Thankfully, educators are doing everything they can to impression this into the childrens minds, but it's not enough. Please help spread this message to other light skin people so that they may also know the need to inhibit such evil perceptions, and seek counseling if necessary.



From 2012 think tank of the year

http://www.maciverinstitute.com/2014/04/White-Privilege-Conf-Teacher/index.php 

The city of Madison hosted the 15th annual national White Privilege Conference last week at the Monona Terrace to discuss issues of white supremacy, social justice, education and the Tea Party.


Some conference quotes-
"We've been raised to be good. 'I'm a good white person,' and yet to
realize I carry within me these dark, horrible thoughts and perceptions
is hard to admit. And yet like the alcoholic, what's the first step?
Admitting you have a problem"

"Being a white person who does anti-racist work is like being an alcoholic. I will never be recovered by my alcoholism"

When light skin people donate to charity, it comes from a "savior mentality, like 'save them, because they are not like us'", and that is very racist.

Approximately $38,000 in taxpayer dollars helped fund the conference, but that's really not enough. We need to raise more funding for these endeavors of public good.

Tuesday, April 1, 2014

How to download the CC transcript of a Youtube video

It's possible to show captions on some videos using the "CC" button. (Not all videos have "CC")



There used to be a way to retrieve the transcript file with a modified API URL, but Youtube has changed it's API to prevent that. It's still possible to get the video transcript, but now it's more difficult to get.

Skill Level: Mildly Difficult (4 out of 5)

Prerequisites:

After you install Firebug, you need to restart Firefox. Steps to retrieve transcript.
  1. Go to the youtube video.
  2. Firefox Menu > Tools > Web Developer > Firebug > Open Firebug (or press F12)
  3. Go to Firebug tab "Net"
  4. If "Net" is disabled, click on the little triangle next to "Net" and choose Enabled.
  5. Reload the Youtube page in Firefox. (Firebug should still be showing.)
  6. After the video starts playing, pause it.
  7. Press the "CC" button, and turn captions ON.
  8. Type "timedtext" into the Firebug search box (top-right).
  9. Find the second instance of "GET timedtext"
  10. Right-click on the "GET timedtext", and select "Open in new tab"

The new tab will contain the transcribed text. Cheers.

If someone could help get this done using a bash script, that would be Greatly Appreciated!


Tuesday, March 18, 2014

youtube-dl - Python on Windows - routines:SSL23_GET_SERVER_HELLO:unknown protocol

A helpful tip for those using youtube-dl on Windows.

I setup my dads computer so that he could put youtube url's into a text file, then click on a simple batch script to have them download with youtube-dl.

System: Windows 7 64bit
Python: v2.7.2

He became unable to download videos over the past couple months- every video giving an error. I figured it would go away after a bit with a new update came out, but it never did. Here is the type of error output that would display:


youtube-dl -vv http://www.youtube.com/watch?v=AOBCWukvZ8o

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-vv', 'http://www.youtube.com/watch?v=AOBCWukvZ8o']
[debug] Encodings: locale 'cp1252', fs 'mbcs', out None, pref: 'cp1252'
[debug] youtube-dl version 2014.03.18.1
[debug] Python version 2.7.2 - Windows-7-6.1.7601-SP1
[debug] Proxy map: {}
[youtube] Setting language
WARNING: unable to set language: <urlopen error [Errno 1] _ssl.c:503: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol>
[youtube] AOBCWukvZ8o: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [Errno 1] _ssl.c:503: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol>
  File "youtube-dl\youtube_dl\extractor\common.py", line 194, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "youtube-dl\youtube_dl\YoutubeDL.py", line 1191, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\Program Files\Python27\lib\urllib2.py", line 394, in open
    response = self._open(req, data)
  File "C:\Program Files\Python27\lib\urllib2.py", line 412, in _open
    '_open', req)
  File "C:\Program Files\Python27\lib\urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "youtube-dl\youtube_dl\utils.py", line 580, in https_open
    return self.do_open(HTTPSConnectionV3, req)
  File "C:\Program Files\Python27\lib\urllib2.py", line 1174, in do_open
    raise URLError(err)


This is a bug noted in report #2219.



Solution:
Upgrade Python from 2.7.2 to the latest Python 2.7.6.



Batch Script:

rem Batch Script: yt-downloader.bat
rem Try to automatically upgrade youtube-dl on each run.
"C:\Python27\python.exe" "C:\youtube-dl\youtube-dl" -U
rem For highest quality downloads, remove "-f 18 " on next line.
"C:\Python27\python.exe" "C:\youtube-dl\youtube-dl"-itcR 100 -f 18 --no-mtime --no-part -a "C:\Users\User\Desktop\videos\download list.txt"




In the script, you cann see to save urls that you want to download in the file "Desktop\videos\download list.txt".


Thursday, February 6, 2014

Reading smartctl for Dummies

This post is partially meant to serve as a reminder of things to myself. Hopefully it is helpful to others too. Any corrections or contributions of information are welcome.

Smartmontools can be helpful, but it can also be kind of cryptic. To begin with, simply use the "-a" option. I think it will output everything about the device. Reading my USB connected drive, I also need to use the option "-d sat".

smartctl -a -d sat /dev/sdd


On one of my old harddrives, I see this:

Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   049   046   006    Pre-fail  Always       -       176467267
  3 Spin_Up_Time            0x0003   099   098   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   099   099   020    Old_age   Always       -       1495
  5 Reallocated_Sector_Ct   0x0033   095   095   036    Pre-fail  Always       -       223
  7 Seek_Error_Rate         0x000f   063   060   030    Pre-fail  Always       -       2487909
  9 Power_On_Hours          0x0032   077   077   000    Old_age   Always       -       20485
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   099   099   020    Old_age   Always       -       1523
194 Temperature_Celsius     0x0022   046   059   000    Old_age   Always       -       46
195 Hardware_ECC_Recovered  0x001a   049   046   000    Old_age   Always       -       176467267
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   198   000    Old_age   Always       -       5
200 Multi_Zone_Error_Rate   0x0000   100   253   000    Old_age   Offline      -       0
202 Data_Address_Mark_Errs  0x0032   100   253   000    Old_age   Always       -       0

There are 2 types of readings: Prefail and Oldage.

On the rows with Pre-fail, you want the VALUE and WORST numbers to be higher than the THRESH (threshold) number. If they are higher, then you should be good. If not, then your device may be dieing.

(The WORST is generally a record of the lowest that VALUE has ever reached.)

I think the same rule applies to the rows with Old_age, if the THRESH is not 000. The Old_age data can also give other information in the RAW_VALUES column. For example, on the row "9 Power_On_Hours" the RAW_VALUE is 20485. That indicates that the device has run approximately 20,485 hours since it was purchased.

The column WHEN_FAILED will tell you the last time a VALUE went below THRESH.

And that's all I know about that table.



My device also reports these errors:

SMART Error Log Version: 1
ATA Error Count: 4
        CR = Command Register [HEX]
        FR = Features Register [HEX]
        SC = Sector Count Register [HEX]
        SN = Sector Number Register [HEX]
        CL = Cylinder Low Register [HEX]
        CH = Cylinder High Register [HEX]
        DH = Device/Head Register [HEX]
        DC = Device Command Register [HEX]
        ER = Error register [HEX]
        ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 4 occurred at disk power-on lifetime: 20185 hours (841 days + 1 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 e7 7b 8b e1  Error: ICRC, ABRT 1 sectors at LBA = 0x018b7be7 = 25918439

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 b8 30 7b 8b e1 00      23:41:31.936  READ DMA
  c8 00 08 58 e7 09 e9 00      23:41:31.915  READ DMA
  c8 00 08 f8 f7 08 e9 00      23:41:31.906  READ DMA
  c8 00 10 e8 c5 07 e9 00      23:41:31.880  READ DMA
  c8 00 08 28 53 c2 e0 00      23:41:31.857  READ DMA

Error 3 occurred at disk power-on lifetime: 16357 hours (681 days + 13 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 00 00 00 f0  Error: ICRC, ABRT 1 sectors at LBA = 0x00000000 = 0

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 01 00 00 00 f0 00      00:00:17.249  READ DMA
  c6 00 10 00 00 00 f0 00      00:00:17.249  SET MULTIPLE MODE
  91 00 3f 00 00 00 ff 00      00:00:17.248  INITIALIZE DEVICE PARAMETERS [OBS-6]
  10 00 00 00 00 00 f0 00      00:00:17.248  RECALIBRATE [OBS-4]
  00 00 01 00 00 00 00 06      00:00:21.676  NOP [Abort queued commands]

Error 2 occurred at disk power-on lifetime: 16357 hours (681 days + 13 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 00 00 00 f0  Error: ICRC, ABRT 1 sectors at LBA = 0x00000000 = 0

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 01 00 00 00 f0 00      00:00:21.435  READ DMA EXT
  91 00 3f 00 00 00 ff 00      00:00:21.435  INITIALIZE DEVICE PARAMETERS [OBS-6]
  10 00 00 00 00 00 f0 00      00:00:21.319  RECALIBRATE [OBS-4]
  00 00 01 00 00 00 00 06      00:00:20.554  NOP [Abort queued commands]
  20 00 01 00 00 00 f0 00      00:00:20.540  READ SECTOR(S)

Error 1 occurred at disk power-on lifetime: 16357 hours (681 days + 13 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 8f 08 80 f0  Error: ICRC, ABRT 1 sectors at LBA = 0x0080088f = 8390799

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 88 08 80 f0 00      00:01:21.352  READ DMA
  e7 00 00 0f 08 80 b0 00      00:01:21.352  FLUSH CACHE
  c8 00 08 08 08 80 f0 00      00:01:21.352  READ DMA
  ca 00 08 00 e0 dc f1 00      00:01:21.425  WRITE DMA
  c8 00 08 00 f0 dc f1 00      00:01:21.375  READ DMA


The errors #4 and #3 report they were at 20,185 hours, and errors #2 and #1 report they were at 16,357 hours.

Since the errors didn't happen recently, and they seem to have large time gaps between them, I think they may have been related to forced computer shutdown or power failure.