Wednesday, September 27, 2017

Visual Studio VC++, C code, and slow claps

Well, since these days the only thing I do with my home laptop is watch a shitload of movies and TV Shows, I don't have anything to share about my adventures right now. But in my office work, I'm facing much adventures. So this is a story about that.
I am an embedded programmer these days. Yeah, it is a far cry from the server to desktop coder I worked as few years back. But I want to stick around in my current company and besides it pays the bills ( and EMIs and few shouks that I have). Anyway so I was given a task to run the embedded C code on Desktop and that also on Windows. Now we have an allegory - windows means Visual Studio. So because of this I have a VS2012 install lying about on my Windows partition of office laptop. So I created a branch of the main embedded code. And then created a project in VS2012, and imported existing files. And start compiling...
It was really frustrating. On first compile I got roughly 3000 errors. By next day I had fixed almost all the issues. And only about 200 warnings remained. I would otherwise have left them as it is, but we have 0 warning policy so another day spent cleaning up the code. Then I compared this modified code with the original code base and spent half-a-day removing clunky code. And so my SIMULATION base was ready.
For last 2-3 days I'm testing the features one by one for runtime issues. Also making changes wherever needed, and overall improving the code base. I also managed to hit upon 2-3 bugs regarding memory overflow/corruption which went undetected in the embedded code since there's no memory check at runtime. Overall tiring but at the same time exciting time!!!

Sunday, September 24, 2017

A weekend outing, a puncture and some slipped nuts...

We - me and my family - wife, brother in law and Sister, went for an outing couple of days back. It was great, nice sunny weather, empty roads and riding the scooters, it was awesome.
We hit a snag on a village road - one of the scooters got a puncture. We got out the toolkit but we were not much helpful with it. Thankfully couple of villagers helped us. The problem is the scooter wheel has four nut-bolts holding the wheel to the drum with size 14 bolts. The drum is held to the main shaft with a size 24 bolt. What happpened was the toolkit had only size 14 spanner. So we got on work on the four bolts. Turns out couple of the bolts are made of low-quality soft metal, and the spanner slipped twisting the edges and the wheel could not come off.
We did not have size 24 spanner, so we took the other scooter and got a mechanic from 10km away, he had the tools, and soon we had the scooter running.
Lesson learned - keep extra spanners - proper round type - flat spanners suck. And bolts are shit on the Hero Duet. Hero - you suck!!!

Friday, September 22, 2017

Finally a pagefile for linux get me working

I have told you in my last post that the 320GB old HDD failed to handle the works. Now today I was looking for some other solution. And I thought of swap file. Upon searching the internet I got to this solution.
So accordingly I created a 1G .swap file on the external HDD. Then using mkswap utility I formatted it to swap, and later using swapon utility mounted it as swap.
After this I checked the system opening multiple programs and testing the swapfile usage.
As of now I could open GMail and GDocs both in Firefox and the laptop has been smooth sailing so far. I know it cannot handle a lot of load. But for me this was the last use case. And I'm happy that its working with whatever limitations.
So that's all. This old Acer laptop does have some life in it yet.

Wednesday, September 13, 2017

The 320Gb WD HDD for filesystem

So like I mentioned in last post, I did find the old external HDD. And I installed Ubuntu Mate on it. 
Hmm. Didn't work out. The drive threw too many read errors. Screwed!!! 
Guess no google docs for me. 

What's happening: Targus Armor Usb2.0 4 Port Hub, Ubuntu Mate Live vs Puppy Tahr and the verdict on my almost dead Acer laptop

As I said in last post, after dithering for a while I got a USB hub. Got it from a local retailer here for 400/- rupees. So now I can do much more with the dying Acer laptop. The hub itself is minimal affair. What I hate about it are 2 things - 1. it's packing was real shitty affair - no clear lines saying where to cut to get the thing out 2. the hub has flat wire which leads to the USB port - I don't have much confidence in it. Lets see how far it goes.
Anyway now that I had the hub I could connect the external mouse, my portable HDD and my phone simultaniously I thought of trying to find a light distro which could let me use the 1GB RAM best. 
Enter Puppy Tahr - Puppy Linux is great little distro, and Puppy Tahr is based off Ubuntu 16.04.3 LTS's packages, which means best of both worlds - Firefox and VLC. 
Thing is Firefox with couple of Google Docs tabs still kills my 1GB RAM, which in Live USB mode isn't backed by any SWAP memory. Unfortunately I don't have any option for SWAP memory - no harddisks available now for installation. I'm not able to find my old 320GB external HDD, it would have made ideal installation media for this laptop. Coming back to Puppy - everything is great, except for 2 things - 1. It could not mount my phone with MTP - didn't bother searching for any solution right now. 2. Firefox cannot handle Google Docs because of RAM limit and no SWAP available 'cause of Live USB. Except for these two points I loved Puppy. VLC worked fine, all the hardware was working fine - except maybe for display brightness. Anyway, bye bye Puppy.
Next I had also downloaded Ubuntu Mate Edition. And so prepped it's Live USB. With Mate issue 2 was present - again reason same - no SWAP. But it al least mounted my phone and let me copy things from it to the external HDD. So I decided to keep Mate as the Live USB OS on this dying Acer laptop. Yey!
Now the verdict on my Acer laptop is last. It's seen it's share of years. They have taken toll on it. The keyboard is missing a number of buttons. The touchpad is dead. One RAM slot is dead. The other holds a 1GB DDR2 SO-DIMM which is it's limit. The disk drive works but nothing boots from it. The HDD that came with this laptop died last month. It's original motherboard died three years back. The replacement board died last year, but is fixed now. It's battery has only 11% charge capacity left - but still enough to let you save your work and shutdown it safely without losing any work. It has only 2USB's which limit adding peripherals.
The things that work - headphone jack, display with very warm greypoint and stiff power button. So it's only good for watching movies, and doing very light office work and web browsing - again light. Open Google Mail/Docs and this thing is toast. But right now it works for me, which is why I decided to repair it and not trash it. So bit of compromise but I guess I'll have to make do. And frankly it's going fine except for Google Docs. But again when I drop in a HDD in this thing, it will be golden again.  

Wednesday, September 6, 2017

Got Acer eMachines e727 repaired

This is my first laptop which I bought way back in Aug-2010. Thats about seven years now - and over the years it's catastrofically failed twice. Once about three years back it's mainboard died, I got it replaced for about 8000/-. And found out the power brick was dead too. Ok. Another 800/- bucks got me a non-brand Adapter. OK. It worked for a year since, and then one sunny day died again. I bought a Lenovo G405S for about 19000/- rupees and didn't bother to get this one fixed. It stayed in a box up with some junk for a while. A fortnight ago I got the other laptop - a Lenovo G480 which my sister uses now exclusively - repaired for 2200/- because I managed to get it wet and fried. 
So I decided to see if I can get this old Acer Junk repaired. Gave it to the Repair center - the guy quoted 1800/- Rs, I okayed. Got it yesterday, also got an original Acer Adapter for 1550/- Rs too. Don't want to take another chance with no-brand junk. So the laptop is now repaired. Got it home, and watched few movies. The battery is dead incidently, but doesn't matter - I plan to use it for watching movies/tv series etc only. Then I thought of upgrading Ubuntu on it. 
Took me an hour to get the Live USB done correctly -the old versions of Universal USB Installer and Unetbootin I have don't work with Ubuntu 17.04 anymore. So dug around and found Rosa Image Writer - it worked and I went on to install. Turns out the HDD is gone too - multiple bad sectors - the installer crashed. After hacking at it a few times I couldn't get it to work. Thankfully I didn't have any data on it. Funny thing is the SMART Data goes ok. Existing NTFS partition mounts okay. Only when I try to write big amount of data - like in an OS Install - it screams failure. 
Now I said screw it, and just wanted to use the Live USB to watch the Movies. But this laptop being ancient - yeah Seven full years old to date - has only two USB ports. One is taken by Live USB, other by the portable HDD which has the media, and the touchpad is broke, so I don't have a mouse anymore - unless I get a third USB port and connect the wireless KBD/Mouse I have. But no third USB Port and so I'm stuck now. 
Still managed to watch about four movies using the half-broken keyboard only. Still if I want to transfer anything from my Cellphone, which has only MTP - screw Google - I'm stuck since I don't have anywhere to paste these. So now my options are - either get a new HDD for about 3000Rs - or get a USB Hub for 300Rs and continue using the Live USB. I guess I'm going to be getting a USB Hub soon.
Damn, but this sucks!!!