Thursday, September 24, 2015

Turning off Wifi Power Management Ubuntu Linux

If you're having trouble with Wifi power management in Ubuntu, Or just want to simply keep your Wireless modem card running 100% all the time, then this post is for you.

This topic has been covered already by another excellent blogger, and I want to give them credit here: https://itechscotland.wordpress.com/2011/09/25/how-to-permanently-turn-off-wi-fi-power-management-in-ubuntu/

I just wanted to bring this subject to light again, and add to it, increasing wireless transmission power (txpower)

Run this command to turn off power management:

sudo su -c 'mkdir -p /etc/pm/power.d/; echo -e "#!/bin/bash\n\niwconfig wlan0 power off" >> /etc/pm/power.d/wireless'


To increase your Wifi power to max output, run this also:

sudo su -c 'for((i=1;i<699;i++)); do iwconfig wlan0 txpower $i > /dev/null 2>&1; done; i=$(iwlist wlan0 txpower | grep -oP "=\d+" | cut -c2-); echo "iwconfig wlan0 txpower $i" >> /etc/pm/power.d/wireless'


You will be able to see the changes in the file: /etc/pm/power.d/wireless

You can check your current settings with the iwlist command:

iwlist wlan0 power
iwlist wlan0 txpower

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.