Friday, September 2, 2016

Windows Update - why oh why...

Yes, coding is fun. Coding on Windows may be fun. Working on Windows actually doesn't sound like fun at all, but can be considered 'normal'. But administering Windows is like a free ride in Hell that turns into a pricey maso-ride in Hell later.

I'm developing on a Windows 10 64-bit image in VirtualBox. However after first install of Visual Studio it threw an error on me, quoting some elements couldn't be installed and I should update the system. Okay, I went into Control Panel, Windows Update, launched it - and then nothing happened. It just sat there for about 10 minutes and then told me it couldn't update because of Error 0x8024402f.
Aha. Sure. Thanks.

Googling around luckily I found (not on the first page...) a Fix Errors page and followed the instructions there. Checked out first item, then the second one - although turning off a firewall surely doesn't seem like a good idea at any time. Still nothing. Then the last hint was that made the error go away - enable ActiveX in my router.

Now I am angry, puzzled, astonished etc etc. Why on Earth can't an update proceed without any ActiveX sorcery? Why make it more complex than it should be???

Microsoft. You are full of intelligent talented engineers. Just why????

Wednesday, August 31, 2016

Ha! Coding is fun!

You know it's been a while since I had to code something of larger size. There has been small utils for personal use and some fixes for existing projects, but nothing serious.
Now I must do a re-write of a Visual Basic / MS SQL project for 64-bit, and it gives me a good 'thrilling' feeling to code, TO CODE (yes, shouting) again.

OK, be prepared for more grumble soon as I dwelve deeper and deeper into the project...

Tuesday, February 4, 2014

Rambling 2014/6 - DOSEMU and the USB-LPT printer

Setup

DOSEMU on a Xubuntu, running an MS-DOS application, that would like to print to LPT1. All fine, but what happens if you don't have a parallel port on that PC?

Details

We happened to have a Xubuntu machine and an old Epson LX-300, but the PC did not have any LPT ports. So the only way to connect them was via an USB-LPT connector. With that inline, the system did see the Epson and printed anything.
However, the old MS-DOS application that runs in DOSEMU did not print anything. In fact, it printed but the bytes did not get to the printer.

Solution

The solution was hacking DOSEMU config (/etc/dosemu/dosemu.conf)
In the section "Printer and parallel port settings" there are several lines of lpr blahblah command, all commented out. Take the first one and edit it to include the name of the printer (you can find it on the CUPS config webpage localhost:631), right after the -P option. So the line now looks like:
$_lpt1 = "lpr -PEpson-LX-300+"
Save it and collect all acknowledgments :)

Wednesday, January 8, 2014

Rambling 2014/2 - Xubuntu 13.10 & SMB

Today I've installed Xubuntu 13.10 (64bit) on a new machine. All worked fine, but couldn't connect to our server via SMB. That felt quite painful as my home dir was saved on the server :)
After checking all usual things, it still did not work. Then came the solution from googling:
sudo apt-get install cifs-utils
That magically made everything work.
Now I wonder - the installer packed a gazillion of smb* packages on the hard disk, why did it not include this tiny one that made the whole stuff work?

Friday, September 21, 2012

Ooops - hide it under the carpet!

I've done it. You've done it, too. In fact, many have done it and many will do it, for sure.

Pushed something unwanted to a public git repository by accident.

Well, if you are lucky, you notice it very early. In 10 seconds, usually :)
Damage is done, let's try to undo it - fast.

Solution #1

1) Remove the incriminated commit from the local repo:
git rebase -i

2) Forced push to the remote repo:
git push -f origin +branchname

Solution #2

(works for undoing the last N commit only)
git push -f origin HEAD^:branchname

What's left? Crossing fingers and hope noone has pulled the repo during your manoeuvres :)

Thursday, July 26, 2012

VMware rant

Yet another Evernote-style entry to make sure I won't forget it...

VMware Player on Xubuntu. From time to time it decides to re-compile itself, without the slightest chance to prevent it. Would not be a problem if it ran well but it fails to compile the network modules.

Now I've found what to do:
sudo mv /usr/lib/vmware/modules/binary /usr/lib/vmware/modules/binary.old
sudo vmware-modconfig --console --install-all --appname="VMware Player" --icon="vmware-player"
And it works! There must be a more elegant, geeky solution but this week - I simply do not care!
Thanks, AndreiVajnall!

Wednesday, May 30, 2012

Moving git houses

Lately I've realised (or better, this has been bugging me for months now) that the repository I'm using on repo.or.cz is messed up a little bit. Some branches are merged back to master, some are not, then branched again, etc etc. And the at same time, making these creations more public I'd like to make it more user-friendly and while repo.or.cz provides a nice, stable service, github on the other hand is armed with an issue tracker, a wiki and some more. Yes, it is more shiney and glittery :)

With these two reasons on my mind, I've started 'migrating' the git repository from A to B. The following is a summary what I've done:

Moving houses from repo.or.cz to github, also means cleaning up the repos

  • create github_repo on github website with the web interface: http://github.com/kgkilo/tracks
  • cd ~/WORK
  • git clone github_repo tracks
  • git clone repo.or.cz/myrepo.git oldtracks
so at this point we have 2 directories, one for the new repo and one for the old one
  • cd oldtracks
  • git remote rm origin (just to play safe)

cleaning up what we want to import


  • git filter-branch --subdirectory-filter trackname -- --all
  • mkdir trackname
  • mv * trackname
  • git add .
  • git commit

importing


  • cd ../tracks
  • git remote add old-repo ../oldtracks
  • git co -b trackname
  • git pull old-repo trackname
  • git remote rm old-repo
  • mkdir trackname
  • mv * trackname
  • git add -f trackname
  • git commit -a

cleaning up the new repo


  • git rebase -i origin
  • squash, reword or delete commits (time to remove all the unwanted signs you've left behind earlier...)

final steps


  • git log, git st, git do_everything_to_check_for_sanity.
  • repeat the above... really!
  • git co master
  • git push origin trackname

And now... I can do this for all the branches... :)
NB: the filter-branch step proved to be the most problematic one. It is not git's mistake, it is the result of my own careless, unwanted merges back to master sometimes. Something to get rid of, for sure.

refs:
http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
http://effectif.com/git/move-commit-from-one-branch-to-another
http://zenoga.tumblr.com/post/6751990283/til-convenient-cherry-picking-from-another-git
http://stackoverflow.com/questions/1365541/how-to-move-files-from-one-git-repo-to-another-not-a-clone-preserving-history
also:
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
http://stackoverflow.com/questions/67699/how-do-i-clone-all-remote-branches-with-git
http://www.zorched.net/2008/04/14/start-a-new-branch-on-your-remote-git-repository/

Tuesday, March 20, 2012

git svn commit trick

Speed Dreams uses SVN. I prefer git. That leads to git svn.

I've just invented for myself a new trick to use when I want to commit only some of my git commits to the central SVN repo. As often, git branching comes as a life-saver - I make a branch for SVN committing, remove the commits I don't want to push to SVN, do git svn dcommit, switch back to master and delete the temporary branch:
git checkout -b svnci
git rebase -i HEAD~6 (usually that is quite enough)
in rebase: remove the commits I don't want to send to SVN
git svn dcommit
git checkout master
git svn rebase
git branch -d svnci
I still have to learn each day the use of easy branching in git. Maybe put up a poster somewhere "Did you branch something today?" :)

PS: of course I've found I did reinvent the wheel. Damn I hate googling :s I've found an article from 2009 from a Mozilla dev about partial git svn commits: http://fredericiana.com/2009/12/31/partial-svn-dcommit-with-git/
While it is not the same technique, it is very much alike. And then you reach the comments... and *bang* there is my shiney new trick all put down 2 years ago :(((