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 tell me how to 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".