How to retrieve your passwords saved in Google Chrome or Chromium on ubuntu linux

If you are like me, you have loads of passwords saved in the Chrome browser. And then you need them. Maybe you want to stop using Chrome, or you want them to enter into some applcation other than the browser… or perhaps you just want a list of all sites you have passwords for – curiosity… whatever the reason, it isn’t easy to discover how to do this.

This solution is based on one I found at The Big Browser with two very minor changes where that code didn’t work for me.

Before beginning, make sure you are signed in from your Google Chrome or Chromium browser and your passwords are synced and available.

Close the browser.

Next, open the browser from the command line, with a temporary profile that stores passwords without encryption. Like so (pick one of the lines depending on the browser you are using)

### Google Chrome
    google-chrome --user-data-dir=/tmp/chrome-tmp --password-store=basic

### Chromium
    chromium --user-data-dir=/tmp/chrome-tmp --password-store=basic

This did not work for me – I use Chromium. I had to use this:

### Chromium
    chromium-browser --user-data-dir=/tmp/chrome-tmp --password-store=basic

I have no idea what happens with Google Chrome, but if the given line doesn’t work, appending -browser to google-chrome is worth a try.

This will open a separate session. Sign in to the browser with your account and wait for a while till your passwords are synchronized. You can surf if you want. When your data is syncronized, your saved websites and bookmarks will be available. You can go to “Manage passwords” in settings and see that your passwords are loaded. If you don’t see them, wait some more time till you do.

Close the browser.

Note: the fastest way to get to the stored passwords page in settings is to type password in the Search box in the top right.

In the terminal, enter:

cd /tmp/chrome-tmp/Default

For the next step, you will need sqlite3 installed. If it isn’t installed, you can install it by entering:

sudo apt-get install sqlite3

Then enter:

sqlite3 'Login Data'

At the changed prompt, now enter the following lines one by one.

.mode csv               # other options are `html', `tabs', etc.
.headers on
.separator ","
.output chrome_passwords.csv
select * from logins;
.exit

This will give you a file called chrome_passwords.csv with your Chrome passwords.

To open it with LibreOffice, type:

libreoffice --calc chrome_passwords.csv

The passwords will open as a spreadsheet. You also will be able to import this spreadsheet into other keyword managers if you need to.

Update/install fail: Server cannot access software repositories

If you are trying to install something and the server waits forever after you answer yes to the update and it accesses the software repository… something like…

apt-get update
...
details of packages
...
Need to get 83.7 MB of archives.
After this operation, 237 kB disk space will be freed.
Do you want to continue [Y/n]?
0% [Connecting to archive.ubuntu.com]

And then nothing. It fails.

Do you have UFW installed? UFW can block outgoing connections from your server, so it becomes unable to access the software repositories. Rather than make exceptions, it is easier to disable the firewall and enable again when update or install is done.
??
If you have UFW (Uncomplicated Firewall) installed, disable it and try again.

ufw disable

Now your upgrades should work. Once you are done, re-enable your firewall.

ufw enable
Enhanced by Zemanta

bash: add-apt-repository: command not found

If you are trying to add a ppa repository and get the following error

bash: add-apt-repository: command not found

You need to install python-software-properties, like so

apt-get install python-software-properties

If you have python-software-properties installed and are still getting this error, there is some problem with the package. Uninstall and reinstall it.

apt-get remove python-software-properties --purge && apt-get install python-software-properties

or

apt-get install --reinstall python-software-properties && sudo dpkg-reconfigure python-software-properties
Enhanced by Zemanta

Installing UFW – Uncomplicated Firewall on Ubuntu 12.04

If you are one of those nerdy types and use iptables, ignore this. If you are like the rest of us Ubuntu users (nerdy in denial), UFW (Uncomplicated Firewall) provides a handy tool to configure your firewall.

Here’s how to install. As root, type:

apt-get install ufw

If this can’t find the package, run

apt-get update

before running the command again. You’ll get it.

Next, add your exceptions. For example, on my server, I allow ssh (Secure Shell) and http (Hypertext Transfer Protocol).

# ufw allow ssh
# ufw allow http

Then start the firewall

# ufw enable

It will ask

Command may disrupt existing ssh connections. Proceed with operation (y|n)?

Reply “y”. Simply hitting enter will abort.

This should return:

Firewall is active and enabled on system startup

If you get an error like

ERROR: problem running ufw-init

Edit the file /etc/default/ufw and change IPv6=yes to IPv6=no

Enhanced by Zemanta

Need to install jpegtran?

If you are optimizing your blog/site, you may end up needing a package for optimizing images called jpegtran It is a part of another package called 

libjpeg-progs

To install, simply install the package, like so

apt-get install libjpeg-progs
Done.

Need to install jpegtran?

If you are optimizing your blog/site, you may end up needing a package for optimizing images called jpegtran It is a part of another package called 

libjpeg-progs

To install, simply install the package, like so

apt-get install libjpeg-progs
Done.

How to create an admin area on fake domain

Often, you need to have areas of your site that you access through a browser, that you don’t want anyone else to access. These can be control panels or scripts with phpinfo or your apc cache monitoring script.

what I do is create a fake domain for these and give them their own site. For example a virtual host for domain “admin.area” which of course is not a real domain name or registered anywhere. Remove the index file, forbid browsing folders and place your scripts there.

Plug in your server IP address with the fake domain you created (admin.area) into the hosts file of any computer that needs access.

If you are using varnish, you can also redirect any queries to this domain to your main website for safety and access through the backend port.

You can easily disable the virtual domain altogether when done without interfering with your production sites in any way and risking accidental permission changes or other problems.

Phpize: Command not found?

So you are on Debian, trying perhaps to install an opcode cache or something and you use try to do it with pecl with


pecl install apc

for example.

And you can’t, because phpize is not installed. Then you try to compile it and run into the same problem.

Then you try to find out how to get it, only to need a package “php5-devel” that doesn’t seem to exist in any repository.

Fikar not. What you want is “php5-dev” – strange that this seems to not be mentioned in most instructions.

So you go.


apt-get install php5-dev

then you have phpize for whatever you were trying to do.

🙂

How to forward only .onion or .i2p urls selectively

If you are like me and don’t need to use TOR so much for anonymity as for accessing interesting hidden sites, the overall slow speed of TOR probably bothers you for normal browsing. The need to toggle proxies or start two separate browsers probably bugs you too.

Now I have found .i2p which is similar to TOR in the sense of being an anonymous, decentralized network, but it is not a proxy at all – which means configuring the browser to forward queries via the i2p network means that regular sites won’t work at all!

I need:

  • Normal browsing directly over the internet for regular urls
  • Routing .onion urls to TOR
  • Routing .i2p urls to I2P

I dare say this fix will also work for any other such networks I may not know of.

Before we begin, an extremely important WARNING:

If you use TOR for Anonymity, then this “how to” may compromise your anonymity for the same reasons the TORbutton was discontinued. Mixing normal browsing with TOR may result in leaks of identity or inadvertent access of normal urls which you intend to use over TOR directly – which could be disastrous, particularly if your safety depends on it. YOU ARE WARNED. This “How To” ASSUMES THAT YOU DO NOT HAVE ANONYMITY AS A PRIORITY.

There are many people who would simply like to see various sites, or have TOR sites they interact with regularly – like TORMail users, for example. Or people who have set up their own sites or are reading forums or otherwise engaged in activity that they don’t think will be legally problematic.

This guide is for them. And I hope their tribe increases.

Here’s how to see normal urls directly on the internet, while using TOR and I2P for .onion and .i2p sites respectively.

Step 1: Install Privoxy. Privoxy is a transparent proxy that does a lot of other useful things too. Visit their website, read up, and if you like (and want to continue this how to) install privoxy as per instructions for your OS. This assumes that you already have I2P and/or TOR installed – or you can go now and do it, or waste your time reading this post. I use TOR installed from the PPA and not the browser bundle – so that it can run in the background and be used as needed – or stopped independently of the browser if I’m not using TOR. This is important, as I browse all day, and having the browser shut down if I’m not using TOR would be most inconvenient. Wasting bandwidth on TOR unnecessarily is not required either.

Step 2: Configure your browser to use Privoxy – as per instructions given on their site. Basically, this means setting your network proxy to 127.0.0.1:8118 <– this is the port for Privoxy. Note DO NOT add the socks proxy for TOR here. Or the i2p settings.

Step 3: Edit your Privoxy configuration file. On Ubuntu, installing from the PPA it is found at /etc/privoxy/config – your mileage may vary depending on OS and how you installed privoxy, however, it will be found in the root of the folder for privoxy – as a rough guide.

Step 4: At the end of that file, add:

forward-socks5   .onion               127.0.0.1:9050 .
forward   .i2p               127.0.0.1:4444 .

Done.

That is it.

Now, your normal browsing will be unaffected by either TOR or I2P Network, while .onion and .i2p urls will get forwarded correctly and accessible seamlessly.

Enjoy!

NOTE: While this does nothing special to compromise your safety, it may be compromising some protective feature in case someone is trying to find out your identity or something. I have no clue what it does on the safety front, and I highly recommending assuming that this is unsafe till some superior being can verify or suggest better methods.

If, while using this method, you find that you need to use anonymous features of TOR, I highly recommend starting a “TOR Browser Bundle” browser separately. This can be configured to use different ports so as to not interfere with your already installed TOR.

NOTE1: I know I am being repetitive, but I feel I must, seeing as how a lot of people use TOR for activism or other things where getting identity compromised could land them in a lot of trouble.

Install APC and fix “potential cache slam” problem

APC is an Alternative PHP Cache or Opcode cache that speeds up performance dramatically by caching queries.

How to install APC?

apt-get install php5-apc

You will have to enble it in the php configuration. Add the following to your php.ini file

extension=apc.so

Alternatively, you could create a separate apc.ini file and put it in the conf.d directory.

If your error log shows a lot of messages about potential cache slam averted, it is a bug. Not much you can do about it but you can turn slam defense off so that it doesn’t spam your logs (or cause other fails)

Add after that line in your php.ini or apc.ini

apc.write_lock = 1
apc.slam_defense = 0