Showing posts with label Troubleshooting. Show all posts
Showing posts with label Troubleshooting. Show all posts

Saturday, October 05, 2013

Vim: Making Ultisnips and NeoComplete play nice

Plugin conflict!

If you have both Ultisnips and NeoComplete then you cannot use the same key for expansion. I used to have tab mapped out to both for completion with AutoComplPop and Ultisnips. I had tab set for g:UltiSnipsJumpForwardTrigger but NeoComplete still doesn't like it. So now, that's changed to Control + Tab and things are good again.

let g:UltiSnipsExpandTrigger="<C-CR>"
let g:UltiSnipsJumpForwardTrigger="<C-tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"

Only wish one NeoComplete OR Ultisnips makers see this and make it work without conflict

Friday, August 30, 2013

Fixing Wifi sleep of death

The problem

I have a TP-Link WN722N USB Wifi dongle. Linux Mint picked it up during install and seemed like all was good.

Then the other day, noticed that sometimes WiFi would be flaky like hell - all I'd get is the password prompt. Turns out that this is a common problem with USB Wifi. After a few days, the pattern appeared to be a recurring problem after putting the computer sleep. The fix is easy - just unload the ath9k_htc before suspending. Edit /etc/pm/config.d/config (create if needed):

SUSPEND_MODULES="ath9k_htc"

Saturday, August 24, 2013

Linux Mint 15 KDE - tweaks and fixes

Additional fixes post installation

SSH connection refused

So today I tried ssh'ing into the desktop and no go. I was getting a connection refused and thought it had to do with either SSH not being installed or being blocked by the firewall. Later on when I checked, OpenSSH server was installed and the service was also running

sudo service status ssh
ssh start/running, process 2709

Hmm - this is weird. Next check was for iptables and that was clear too.. So last check was to look at /var/log/auth and indeed, there's a problem. Interestingly machine keys weren't generated during installation

Aug 22 20:15:58 desktop sshd[1960]: fatal: No supported key exchange algorithms [preauth]
Aug 22 20:16:49 desktop sshd[1990]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Aug 22 20:16:49 desktop sshd[1990]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Aug 22 20:16:49 desktop sshd[1990]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key

Ok - so the fix is easy - generate the keys with

    sudo ssh-keygen -A

After that, everything's back to normal :)

Power button shuts down computer

This is Kubuntu Bug 1124149. I'll spare you the details, which you can read yourself. Fix needed is to link /usr/bin/qdbus

sudo ln -sf /usr/lib/x86_64-linux-gnu/qt4/bin/qdbus /usr/bin/qdbus

Saturday, June 30, 2012

Avast! trial expiration kills Internet connection - how bad is that!

So I use 'free for personal use' Avast Antivirus at home for the past couple of years. It's been mostly good though I've had some reservations about it - namely, nag pop-ups and so on. Some months ago (or maybe was it a year ago?) there was a program update and it wanted me to install 'Avira Internet Security'. Now I had no need for this (I use COMODO firewall which has been quite good) however, there was no way around it. Avira's update process said I could revert back to the free Antivirus version anytime without a re-install or a re-anything!
Not much of an option and you can't blame them for trying to push their products and convert free users to paying ones - so I went ahead with the upgrade. About a fortnight ago, I started getting warnings about 'your trial licenses is about to expire' and so on. The good thing about the internet security product was that it was discreet - in fact, safe to say that I even forgot that I installed it.
Remembering the notices about the trial expiring and reverting back to the free version, I chose to ignore all the warnings till yesterday afternoon when the wife called me up at work about 'internet not working from the home machine'. Now my wifi dongle on the home pc does once in a while show up with a 'Limited connection' that's quickly fixed with either disabling and enabling the dongle or unplugging it and putting it back in the USB port. I offered that up as a solution and a few hours later am told that it hasn't fixed the issue.This morning I finally sat down to see what was up. Turns out that the WIFI just wouldnt connect. So up comes device manager and under Network Devices I see a whole lot of 'avast! NDIS filter' virtual devices showing up. Opened Avast! gui and there are no panels for turning the thing off... Its reverted back to the free version - but has killed my net connection in the process! Not a happy camper at this point - still wasn't worried since I figured there've got to be tons of users with the same problem and it probably has a simple fix. Google did not reveal any simple fixes - Avast's community forum had help! Avast Internet Security trial expired, no internet connection and Avast Internet Security Trial seems to have affected my internet connection. The suggestions offered - buy a license, uninstall and re-install Avast etc were just not Ok. I definitely wasn't the only one affected but looks like a small but sizable user population was affected. If that was so, then Avast! should have done something about it - however, looks like they don't believe much in that. Agreed it's a free product and will not merit levels of support that you'd get for something that you pay for. But:

  1. I did not ask for the installation of the 'Premium' product trial.
  2. There was no option to opt out of the 'trial'
  3. They actively messaged that there's 'nothing to lose' from using the trial.
Given all that, they should have stepped up and either taken care of the issue with an update OR put up steps on how to solve it. It doesn't take that much. Here's how I got back my net connection:
  1. Device manager - Remove all 'Avast!' virtual devices with a right click 'Uninstall'
  2. Restart
  3. No WIFI still... so open 'Network and sharing center-> Change Adapter settings-> Wifi Connection -> properties'. In the 'This connection uses the following items:' list there was one more avast! filter device. Selected and uninstalled that too and restarted again.
  4. Back in business...WIFI is back up and running!
It's time to say goodbye to Avast!. Any recommendations for good, free antivirus solutions?

Monday, January 16, 2012

Ubuntu, Console VIM - weird characters in insert mode

Now that I feel quite comfy with VIM, over the weekend I needed to edit a config file in my Ubuntu 10.10 Virtualbox machine quickly. Instead of GVim, I just opened the file in console VIM. As I hit i to get into insert mode, a bunch of weird character boxes were inserted. That was not good at all :( - just when you think you're comfortable with something if it does something totally weird. In any case, I was in too much of a hurry to bother and went about editing my file with gVim. Also, backspace was wonky (same weird characters) - so I felt better. For some reason that I fail to understand, why must Linux make proper backspace and delete handling such a pain! In any case, it's something that I've dealt with enough times to know that there'll be something on Google.


Later on, tried to see what all the fuss was about. Googling around, I found :help :fixdel and that seemed simple enough. Alas, when I tried it out, it didn't fix the issue at all. Also, I seemed to be getting weird characters just pressing i to get into insert mode - and the VIM wiki page didn't have anything about that. Neither did Google turn up anything that seemed related.


So today early morning, on a whim, read up a little on VIm terminal handling. I have the following in my .vimrc
[sourcecode language="text"]
set t_Co=256
[/sourcecode]
Maybe it was the color escape code that was coming in - so checked out :echoe &term which returned xterm under gnome-console and builtin_gui under gvim. So I've put the following bit in my .vimrc and it seems to have fixed things nicely:
[sourcecode language="text"]
if &term == "xterm"
set term=xterm-256color
endif
[/sourcecode]

Wednesday, December 28, 2011

Blogging with Vim

So now I'm in Vim land and this is the first time I've gotten far enough to feel a bit comfy. Decided to dust off my blog and start at it again - what better to do it in than in VIM.


So - TA-DA - here's the first post - courtsey VIM on ubuntu. However, as usual, it was rougher than it's supposed to be. IN any case, I'll forget how I got this far the next time so the next few posts will be around recording how to get VIM to post to WP.com blogs.


But before that - the first thing to to is to get the VimRepress plugin. Better if you have pathogen installed, in which case you can do
[sourcecode language="bash"]
cd .vim
git submodule add https://github.com/raghur/VimRepress bundle/VimRepress.git
[/sourcecode]
That's my fork on Github of https://github.com/connermcd/VimRepress.git which fixes a few things:



  • Makes VimRepress work properly through a proxy

  • Changes the attachment filename to a '.odt' since Wordpress.com doesn't allow a text file attachment.


I still dont have a clue if doing this will break the plugin - but nevertheless, basic case of posting to my blog works and at this stage that seems good enough for me.


PS as you can see from this post - I've not yet got a hang of markdown syntax :)


Dec 29th - PPS a couple of posts and one more tip for Wordpress.com. WP.com does <br/> for hardbreaks in the markdown text. Obviously, this doesnt leave the post looking very good. I have the following in my .vimrc to get around this


[sourcecode language="text"]
augroup Markdown
autocmd FileType markdown set wrap
\ linebreak
augroup END
[/sourcecode]


PPS
You will also need to have python markdown installed once you have VimRepress running.
[sourcecode language="bash"]
easy_install markdown
[/sourcecode]

Thursday, August 18, 2011

Troubleshooting nandroid backup/restore

Have been having all sorts of weird problems with Nandroid backup/restores. Essentially, here's the symptoms of the problem - I'd get a nandroid and restore it successfully (Amon RA/CWM would report success) - however either will get stuck at boot or if it boots successfully, will have tons of FCs and/or data loss. In most cases, I would dread seeing the green Android on boot up asking me to log in to my google account :(

Essentially, my nandroids were useless... to the extent that I had only one nandroid backup that was known to work - and I was keeping 4 backups of that lest I lose it somehow.

So today, thought I'd get deeper into it and see where the problem was

  1. It was unlikely that its a problem with CWM/AmonRA - I myself had an old working backup. Since my backups were created and restored successfully with MD5 verification, it seemed that there's something wrong in the backup image itself.

  2. Still, that seemed inexplicable, since creating images just doesn't seem that flaky. A couple of times after reboot, I had got a "UID has changed - it is recommended to wipe data" or something similar message - so I thought something was wrong with permissions after the restore. In any case, I tried the CWM menu item of fix permissions - but didnt get anywhere with that. At this point, I was desperate enought to get adb out !!

  3. Now in full blown investigation mode, I didnt care if I couldnt restore my data - just wanted to figure this thing out. So restored a  "non working" backup and did a adb logcat while the phone booted... turns out that I was seeing tons of messages like so:


  4. I/PackageManager(  205): /system/app/ContactsProvider.apk changed; collecting certs
    I/PackageManager( 205): New shared user android.uid.shared: id=10006
    W/PackageManager( 205): System package com.android.providers.contacts has changed from uid: 10003 to 10006; old data erased


  5. So that explained what was going wrong... thought it would be an easy fix to do the 'fix permissions' thing in CWM advanced menu. Restored again and went over to the advanced menu, did fix permissions and rebooted. What I got was a big naught for all my work - same problems and no resolutions. At this point I was stumped enough - but sheer bull headedness forced me to look at the log again... and lo it says 'data erased'. So that explains why fix permissions after boot wont work since the data is erased during boot itself!


At this point, the key to the problem was really understanding how and where android's UIDs are generated,  stored  and regenerated. Headed over to Cyanogen wiki and read up the details on fix permissions which explained the packages.xml file. Somehow the packages.xml was borked in the nandroid (every time) and that was causing it to be regenerated.

Armed with that, got a germ of a solution in place, which is roughly

  1. Restore nandroid with borked packages.xml

  2. Let the system boot. Will lose data but a new packages.xml will be regenerated

  3. Reboot into recovery and adb pull /data/system/packages.xml out.

  4. Do an advanced restore and again restore the data only.

  5. mount /data and adb pull /data/system/packages.xml to compare differences. Found that packages.xml was indeed corrupt.

  6. adb push packages.xml (this is the generated one pulled in step 3) to /data/system. Now you have all the old data but the packages.xml is newly generated one and known to be valid. Obviously UIDs will mismatch - but fix permissions has a valid file to work on.

  7. Still in recovery, run fix permissions. It should fix permissions properly.

  8. Reboot


It worked like a charm!!!! I'm still a little worried as I dont know what else is borked in my nandroid data.img. And I dont know why that image has the exact same problem every time - I have tried 3 different versions of CWM recovery, Amon RA 2.2.1 and ensured that my sd card was clean (ran chkdsk on it). In any case, since I'm able to restore, will just use the phone for the next few days and hopefully I'll run into any wonkiness soon.

And going forward, I think I'll take my own backup copy of the /data/system/packages.xml file along with each nandroid.

Monday, June 23, 2008

Compact Ubuntu

I've always hated the fact that on Ubuntu with the default themes, there's far too much space wasted. The buttons are too tall, the treeview wastes too much space so that if you're on eclipse or some other ide, you see a precious few items on the screen.

I've been trying to tweak it to no end - even looking to see if there are any ~/.gtkrc-2.0 tweaks. Found a few links such as this Making Eclipse look good on Linux - Max's blog - however, didn't really satisfy my need.

And so it stayed until today when I came across Clearlooks Compact Gnome Theme.

I love it - one more for my list of must-haves!

Monday, March 31, 2008

Hardy heron - first impressions

He he :-) - finally got Ubuntu Hardy heron beta on my home and work laptop. first impressions below:

1. Wubi install from within windows is easy and works great. If after setting up so many boxes, I can go on and on about it, I'm sure that its great help for anyone who's on Windoze. I mean, the barrier to entry has never gone down so much.

2. I guess once you've installed via Wubi and configured your system to your liking, you can uninstall and take an image that you finall install to a dedicated partition - isn't that just awesome.

3. Comes installed with Firefox 3b4 -which is awesome. Given that FF crashes badly on yahoo, this might be a bummer for many people. Should probably have some first time customization that will let you install Opera.

4. Installation is super fast - took about 10 mins for wubi to install, reboot once, finish installation and reboot again. Grub default to Last selected would probably be a better idea.

The not so good

1. Wifi doesnt work out of the box - didn't on my Dell Inspiron 1501 or the Dell Latitude D620. Its the ye olde broadcom problem. This is really the BIGGEST turn off. Hope it will get fixed by the time the final release is out. Meanwhile, had to jump through hoops getting ndiswrapper in. I didn't go the broadcom fwcutter way since that only allows a 802.11b connection from what I read. I'm still not sure what fixed the issue - irrespective, I had to update the system and then things started working like a charm.

2. Compiz configuration isnt installed by default. If this is your first time on Ubuntu and you've come this way to see the awesome 3D desktop, then this is a bummer. Finding out what you need to do is a pain too.

I think that's all there is to it. Its great once wifi starts working normally.

Thursday, January 10, 2008

Firefox 3 Beta 2 on Ubuntu Gutsy

I'm having weird problems with firefox 3b2 on ubuntu gutsy - and as far as I can tell, I seem to be the only one. Did not find anything similar on ubuntu forums too.

Installed firefox 3 beta 2 from Mozilla to /usr/lib/firefox3b2 folder and created
lrwxrwxrwx 1 root root 27 2007-12-30 23:44 /usr/bin/firefox-3b2 -> /usr/lib/firefox3b2/firefox

When I launch firefox3b2, I get firefox alright, however, in the location bar if I type in a url and press Enter, nothing happens - absolutely nothing at all. I have to go and click the green arrow for the browser to open the URL. The search box is even weirder - neither the Enter key works nor does the mouse!

I'm at a loss - and nor can I find any similar experiences on forums etc - ideas welcome :D

SOLVED 01/20:Backed up my .mozilla folder and started firefox 3 b2 - no problems now :D

Tuesday, July 03, 2007

Sluggish Firefox - and what a hog!

Okay - for the past few days I've been irritated with the browsing experience at home. Pages (google reader, Yahoo mail etc seemed inexplicably slower than before - but they'd load alright - just seemed that teeny weeny bit slower that's enough to leave you suspicious).

I first suspected my ISP (verizon) for frequent dropped connections (saw the DSL modem lights reset a couple of times a day), then my wifi modem (not a high end one), then spyware/malware. So after the usual barrage of tests - wifi interference sources/anti virus/anti spyware/cable tests etc, I still hadn't nailed it.

Finally, used procexp ( you can use plain 'ole Task manager too - this is just flashier) and saw that FF had 330 MB of RAM with 3 or 4 tabs. Also, just plain clicking on a text box was slow, typing into a text field would echo characters after a noticeable delay - so this was definitely a browser problem.

When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.


-- Sherlock Holmes


Ain't that an apt quote??? I love the addons I have and probably I have one too many. This page on problematic addons  was a life-saver - after disabling a bunch of infrequently used addons (stumble upon toolbar, google toolbar, browser sync, adblock filterset g, foxy tunes and some more), I'm back in browsing heaven. The only addons I have now enabled are




  • diigo toolbar

  • all in one gestures

  • Adblock

  • Flashgot

  • Piclens


What a relief!

BTW, addons are also the latest attack vector. So be wary of who you let into your browser!

Thursday, June 28, 2007

Python, cygwin, TurboGears, mysql hell

Ok - here goes - I've always liked python, though definitely a noob. I was interested in python on the web and after a bit of googling, seems like TurboGears is the way to go.

First things first - decided to use mysql as the database (already have it on my machine and didn't want to install one more database (postgresql/sqlite). Now it turns out that MySQL doesnt have a cygwin package. More googling - mysql server can't run on cygwin due to something to do with pthreads. You can compile the mysql client on cygwin though.

That's what I decided to do - grabbed the Linux tar.gz source from mysql.com, got it into a directory and ran ./configure --without-server, followed by make && make install. All went through fine -other than the fact that it was time consuming and pretty boring (more so since I had to download and install gcc, bintools first in cygwin)

I thought I'd got through the hard part and what remained was to install python-MySQLdb package. Off I went to

easy_install MySQLdb

No luck there - package build failed with missing library -lmysqlclient_r. Turns out that the 'thread-safe' version of mysql client (mysqlclient_r) is preferred but the mysql build doesnt build this by default. What a shame!!!

Anyway, so I wasnt going to redo the whole mysql client library build again - more README files and googling later, grabbed mysql-python-1.2.2 tarball, got it into a folder, edited site.cfg and changed 'threadsafe=false'. The next run on python setup.py build worked properly, with the python mysql linking against the non threadsafe mysqlclient library.

Think troubles are over yet? No way.

Off I went to test - started the python interpreter and did a import MySQLdb, and got a Permission Denied in some 'egg' file!!! What the heck are these egg files anyway. Well, I did'nt have much of a clue and more google later got educated that these are install packages used by the easy install system. The more I looked, the more it seems that the easy install is anything but easy :(. Anyway, this one had me floored - since I couldnt get to the line of source where the error was and had no clue how to view the contents of an 'egg' (they're zips - but I didnt know that and very helpfully there's hardly anyplace where they say that they're zips with the extension of egg!!! Baaah!! - why couldn't they just use .zip?)

More and more hard googling - and this time the info's really sketchy till eventually found a post from a guy who asked the exact same question. Guess what, the easy_install system unzips the eggs to some folder (pointed by PYTHON_EGG_CACHE env var) and there I needed to do a chmod a+x on the _mysql.dll. Well so I did echo $PYTHON_EGG_CACHE and the var isnt set!!! Admittedly at this point, I'm not looking sharp either - what started out as a quick spin has become a quagmire of installation issues - but I'll be damned if I let it sink me!!! Eventually, had the Eureka moment and checked ~/.python-eggs and sure enough found the truant _mysql.dll. Quick chmod a+x and presto - import MySQLdb worked!!! YAHOOOOOOOOOOOOOOOOOOOO!!!!

And now back to where I started - went back to turbogears, did a tg-admin quickstart, setup a mysql database and started with python start-testproject.py. Guess what - no luck yet - turns out that mysql cant client to my windows server with a socket.

More googling - and this time its really desperate - and more enlightenment - the windows mysqld doesnt do unix sockets - how do I force tcp/ip? Simple - use 127.0.0.1 as hostname in the connection settings instead of localhost!! Finally something that was easy to fix. Finally after 8 hours of on and off hacking away at installation issues I'm glad to see a turbogears web page.

Bottomline: Python's great, from the looks of it, turbo gears seems well designed. Mysql is a great database - a cygwin native server would be great - or atleast a client package. But if one has to run through all these hoops just go get a 'quick spin' then adoption's going to be difficult.

I havent tried RoR - but has someone tried a similar thing on cygwin (cygwin, ruby, RoR, mysql)? How does the experience compare - is it any easier to get off the ground?