Wednesday, December 24, 2014

Disable Windows 8.1 charms bar from showing up on a touchpad

Most PCs with touchpad enables Windows 8.1 gesture support. In most cases, it is more of problem/annoying feature than it is worth.

To disable charms bar from showing up when swiping the touchpad (Dell laptops), do:

  1. Open Dell Touchpad from system tray.
  2. Go to Gestures tab
  3. Disable/un-check "Right Edge Swipe"

nView Desktop Manager interferes with VirtualBox guest Alt+Tab functionality

If you have nVIDIA graphics adapter and installed nView Desktop Manager and you also have VirtualBox running in the host machine then Alt+Tab functionality in the guest will affected by nView if it is enabled.

This was observed on:
OS: Windows 8.1 Enterprise 64-bit
VirtualBox: 4.3.20

Sunday, November 30, 2014

HowTo: Set IPv4 preferred DNS server to static IP from command line

c:\> netsh interface ip set dns VirtualBox Host-Only Network static 192.168.0.1

where:
VirtualBox Host-Only Network - is the network interface name

Saturday, November 29, 2014

HowTo: Set static IP on a Windows machine from the command line

c:\> netsh interface ip set address name="VirtualBox Host-Only Network" source=static addr=192.168.1.1 mask=255.255.255.0

where:
VirtualBox Host-Only Network - is the network interface name

Friday, November 28, 2014

HowTo: Set the network interface to get IP from DHCP using the command line

c:\> netsh interface ip set address "VirtualBox Host-Only Network" dhcp

where:
VirtualBox Host-Only Network - is the network interface name

Wednesday, November 26, 2014

HowTo: Join to a domain using WMIC

c:\> wmic.exe /interactive:off ComputerSystem Where name="MACHINE-NAME" call JoinDomainOrWorkgroup FJoinOptions=3 Name="DOMAIN-NAME" UserName="DOMAIN-NAME\user01" Password="Password01"

Copied this from the internet elsewhere forgot to get the URL to give credits.

Wednesday, November 19, 2014

PyCharm: Unresolved reference 'print'

PyCharm can sometimes get confused specially if you have multiple interpreters and using virtualenv. To fix "Unresolved reference 'print'" message, do File | Setting... (Ctrl+Alt+S) | Project Interpreter | Show All (drop down) | Show path for the selected interpreter () | Reload List of Paths ().

Reference(s):
http://forum.jetbrains.com/thread/PyCharm-291

Sunday, November 16, 2014

Installing Pyro 4.30 in IronPython 2.7.4

This assumes that IronPython is installed in D:\ipy.
  1. Download Serpent archive file - used 1.7 (link). Serpent is needed by Pyro 4.
  2. Extract to a folder, say D:\Serpent.
  3. Change directory to where Serpent was extracted then do D:\Serpent>D:\ipy\ipy.exe setup.py install. This will install Serpent.
  4. Download Pyro 4 tar archive (link).
  5. Extra to a folder, say D:\Pyro4.
  6. Change directory to where Pyro4 was extracted then do D:\Pyro4>D:\ipy\ipy.exe setup.py install.

Tuesday, November 11, 2014

Change network category in Windows 8.1

Windows 8.x network category or network profile affects how other Windows machines detects or discover the node. A machine on  a domain or private network will most of the time allow file sharing and printing, more relaxed firewall, etc.

For computers with multiple network interfaces changing network profile can be difficult using the GUI. To force a network interface to be in private profile for example you can do:

PS c:\> Set-NetConnectionProfile -InterfaceAlias "VirtualBox Host-Only Network" -NetworkCategory Private

where:
"Virtual Host-Only Network" - is the name associated with the network interface
"Private" - is the profile

Reference(s):
http://www.tinkertry.com/how-to-change-windows-8-1-network-type-from-public-to-private/

Saturday, November 08, 2014

Going fallback mode in Ubuntu 13.04 due to performance issues with Unity

I configured Virtualbox guest machine to run Ubuntu 13.04 (Raring Ringtail) but performance is just not acceptable. It probably has to do with my host machine not having a good enough graphics hardware.

Anyway, to make it bearable, I have gone Gnome Fallback mode. Anyway, below is my clean configuration from scratch to have a better performance running under VirtualBox.

Initial clean-up and pre-requisites, open terminal (Ctrl+Alt+T):
$: sudo apt-get update
$: sudo apt-get upgrade
$: sudo apt-get install gnome-session-fallback

Log out from session
$: gnome-session-quit
From the GDM, select Gnome Fallback(No effects), see below for screen capture.


Log back in to Ubuntu. To make it even better, install VirtualBox guest additions. But first let us install the pre-requisites and some clean-up.
$: apt-get purge xserver-xorg-video-vmware libxatracker1
$: apt-get install dkms build-essential

From VirtualBox Guest main UI, select Devices | Install Guest Additions....Hit on cancel for the window like below.
Now, install guest additions, like:
$: cd /media/timus/VBOXADDITIONS_4.2.12_84980
$: sudo ./VBoxLinuxAdditions.run 
$: sudo reboot

Of course you have to change folder location (with your username) and version based on your VirtualBox. After reboot, you have pretty good setup for daily use.

Notes:
This applies to 13.10, 14.04, 14.10.

Tuesday, November 04, 2014

"console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0" message when opening a PyDev console

When opening a PyDev console using Jython 2.7b3, I am getting the following error message.

console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0

This does not show up in Jython 2.5. Note that this was already reported elsewhere, like:
http://sourceforge.net/p/jython/mailman/message/32935457/
http://bugs.jython.org/issue2222%3E

To workaround this issue, add -Dpython.console.encoding=UTF-8 in PyDev configuration, see below for details.

Sunday, November 02, 2014

Drop database in SQL Server using sqlcmd

c:\> sqlcmd -S .\Db_INSTANCE -Q "DROP DATABASE dbname"
Where:
Db_INSTANCE is the name of SQL Server instance
dbname is the name of the database to drop

Reference(s):
http://windows-linux-admin.blogspot.com/2011/06/deleting-database-with-sqlcmd.html

Creating a new SQL Server instance in SQL 2005 Express

This may apply to other SQL Server 2005 products but since I haven't not tried them myself, I can't definitely say that this is the case. Anyway, on default SQL Server 2005 Express install it will create one sql server instance named "SQLEXPRESS." For most occasions this should do just fine but in some cases a named/new instance is necessary to partition/compartmentalize the development of an application.

Creating a new sql server instance is actually very easy. To create a new instance, do the following:
a) Secure a copy of SQL 2005 Express installation media.
b) Run setup.exe.
c) Accept license agreement. After accepting the agreement, the installation program will perform various other checks like disk space available... etc.
d) "Welcome to the Microsoft SQL Server Installation Wizard" just lazily hit on "Next" button.
e) In System Configuration Check screen, if the reports are okay then proceed, hit on "Next" button again.
f) For the Registration Information screen, supply necessary information. Now this is very important, ensure that "Hide Advanced Configuration Options" is unchecked.
g) Accept the default selection for "Feature Selection" screen and hit on "Next."
h) In "Instance Name" screen provide the sql server instance name you would like to use. Then just follow and use the default for next screens and off you go, you got new SQL Server instance.

Or you can also supply instance name in command line when running setup.exe, i.e.:
C:\SQLServer2005Express>setup.exe INSTANCENAME=NEW_DB_INSTANCE
Then accept the defaults.

~ts~

List databases in SQL Server using sqlcmd

c:\> sqlcmd -S .\DB_INSTANCE -Q "exec sp_databases"
Reference(s):
http://windows-linux-admin.blogspot.com/2011/06/list-all-databases-with-sqlcmd.html

Send email via GMAIL using Python

Send email via GMAIL using Python.
Note:
Need to disable CAPTCHA and enable access for less secure apps
https://www.google.com/settings/security
https://accounts.google.com/DisplayUnlockCaptcha

References:
www.mkyong.com/python/how-do-send-email-in-python-via-smtplib/
http://joequery.me/guides/python-smtp-authenticationerror/

Send email in Python using an smtp server with MIMEText

This is similar to this post but using MIMEText to make it a little readable.

Send email in Python using an smtp server

Updating packages on OpenSUSE via console

Zypper is the functionally equivalent to apt-get or aptitude for OpenSUSE. Man page should give you more information how to use it, you can also visit http://en.opensuse.org/SDB:Zypper_usage_1 for additional information.

For example, to update your current system with the latest packages open konsole and do:

$: su
#: zypper refresh
#: zypper update

To install plain old rpm do:
$: su
#: zypper install google-chrome-stable_current_i386.rpm
This should install the downloaded stable version of Google Chrome. Of course you can substitute suitable rpm as necessary.

To search for a package like libpng, do:
$: zypper search libpng

~ts

The following add-ins could not be started MonoDevelop.GnomePlatform

Installing MonoDevelop in OpenSUSE 12.2 from its repository was very easy. When running it for the first time though I got the message:
The following add-ins could not be started:
The root of the trace shows
MonoDevelop.GnomePlatform,2.8
A quick search shows that MonoDevelop depends on libgnomeui. This should have been part of dependencies when installing the application but well....

Below is the screen shot of the error message.
References:
http://software.1713.n2.nabble.com/MonoDevelop-and-openSUSE-12-1-td7462957.html

[2013/04/09] - Same issue observed in OpenSUSE 12.3 and also the same fix.
[2014/11/02] - Same issue observed in OpenSUSE 13.3, mondevelop 3.0.6 and the same fix.

Monday, October 27, 2014

Monodevelop does not start on Linux Mint 17

I have installed Monodevelop using Software Manager in Linux Mint 17. It seems like all went okay but nothing was working. It turns out that missing dependencies was the culprit. To fix it do the following:

$: sudo apt-get install mono-complete
$: sudo apt-get install gtk-sharp3

Reference(s):
http://stackoverflow.com/questions/25791149/monodevelop-will-not-start-in-mint-17

Sunday, October 26, 2014

HowTo: Fix "user is not in the sudoers file. This incident will be reported" in Debian

In Debian, the user created during installation is not automatically added to the sudoers list. To fix do:
  1. Change to root user by typing su in a terminal.
  2. As root, do visudo.
  3. Search for line root    ALL=(ALL:ALL) ALL.
  4. Copy that line (in nano, do Ctrl+K then Ctrl+U to uncut and on more Ctrl+U to duplicate the line).
  5. Change that new line to like timus    ALL=(ALL:ALL) ALL. This adds user timus to the sudoers.
Reference(s):
http://ubuntuforums.org/showthread.php?t=1837295

LXPanel no status bar in Debian Sid/Jessie

I just installed latest Debian Sid/Jessie (testing branch-10/25/2014) and selected LXDE as my desktop environment via network install. The problem was that no start menu or status bar was shown. Seems like a bug somewhere in LXDE but as a workaround do:

$: cp -rp /etc/xdg/lxpanel/profile/LXDE/* ~/.config/lxpanel/LXDE/

Reference(s):
https://bugs.launchpad.net/raspbian/+bug/1080966


HowTo: Install linux kernel headers in Debian

As root user, do:

#: apt-get install linux-headers-$(uname -r)

Reference(s):
http://www.cyberciti.biz/faq/howto-install-kernel-headers-package/

HowTo: Logout from LXDE via the command line

$: lxsession-logout

Reference(s):
http://wiki.lxde.org/en/LXSession#Logging_Out

Saturday, October 25, 2014

Re-install grub in Debian 8 Jessie

So I was trying to install Debian Jessie beta 2 (Debian 8) and was not really paying attention what I was doing. It ended up that I don't grub installed.So who do you fix this? As usual in Linux/Debian there so many ways to do this but below are the steps that I have done:
  1. Boot the machine using the boot media, I was using debian-jessie-DI-b2-amd64-netinst.iso and yes I am using VirtualBox.
  2. Select Advanced options | Rescue mode.
  3. Follow text based wizard, change the values as you see fit. I did English for Select a language. Then United States for Select your location. American English for Configure the keyboard. Used debian in Configure the network - note that this does not have to match to the machine that you want to recover.  Left blank for the domain. Then for Configure the clock I selected Central.
  4. In Enter rescue mode, I have selected /dev/sda1 as I only have one SATA HD and I know that the first partition was my root. You probably to make guesses if you want to do quick and dirty fix. Of course you can always mount the partition and check if it looks like a root partition.
  5. In Enter rescue mode, second screen, select Reinstall GRUB boot loader.
  6. In Enter rescue mode, third screen, I did /dev/sda. This will change depending on your specific circumstance. In my scenario it was easy as it was a VM and it was the only operating system on the disk.
  7. Select Reboot the system and you are done.

Sunday, October 19, 2014

Set IPython qtconsole font to terminus

ipython qtconsole --ConsoleWidget.font_size=10 --ConsoleWidget.font_family="Terminus"

Or create ~/.ipython/profile_default/ipython_config.py Reference(s):
http://stackoverflow.com/questions/9906938/change-ipython-qtconsole-settings

Sunday, July 20, 2014

PyCharm 3.4 Community Edition does not support Tfs Integration

PyCharm 3.4 Community is a very fine IDE and I cannot complain. But for some of the stuff that I do I need to use Tfs as source control. I spent quite a few hours searching the web how to enable Tfs integration in PyCharm but I can't find a good documentation that says you can't not use in PyCharm. But IntelliJ IDEA feature comparison matrix shows that Tfs Integration is only available in Ultimate.  So it must be the case that Tfs Integration is only available in Professional version or it just does not work.

Saturday, July 19, 2014

Unable to mount VirtualBox shared drive using 4.3.10

When mounting a shared drive in VirtualBox 4.3.10, got he following error in Linux box:

sudo mount -t vboxsf E_DRIVE vbox
mount: wrong fs type, bad option, bad superblock on E_DRIVE,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

This is caused by wrong symbolic link, to fix it do:

~$ sudo ln -sf /usr/lib/i386-linux-gnu/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf

References:
http://superuser.com/questions/736024/cannot-share-host-directory-with-virtualbox-guest-mint-16-64-bit

Sunday, April 20, 2014

ICS not working in Windows 8.1 with SEP installed

ICS (Internet Connection Sharing) in Windows 8.1 with Update is not working with SEP (Symantec End Point) version 12.1.4013. Quick fix is to remove both Network Thread Protection or Network Access Control.

Saturday, March 22, 2014

Extracting tar.gz file into specific folder

For example, to extract pycharm-community-3.1.1.tar.gz to ~/bin folder do:
$: tar -xvzf pycharm-community-3.1.1.tar.gz -C ~/bin

Wednesday, February 19, 2014

Read 64-bit registry key from 32-bit process in IronPython using WMI

References:
http://msdn.microsoft.com/en-us/library/aa393297(v=vs.85).aspx
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_23080571.html

Note(s):
This is not reliable on Windows 10 or maybe related to the version of .Net? Anyway updated version is located here:
http://8thstring.blogspot.com/2016/01/read-64-bit-remote-registry-from-32-bit.html

Sunday, February 16, 2014

Manually configure a network interface to get an IP from a DHCP server

Got an Ubuntu 13.10 machine with one network interface. Added another one to test internal networking. To make this new network interface get IP address from DHCP server, we need to modify /etc/network/interfaces, like:

auto eth1
iface eth1 inet dhcp


Reference(s):
https://help.ubuntu.com/10.04/serverguide/network-configuration.html

Keywords:
network interface IP Ubuntu

QNX Momentics throws a lot of error on start up after install in Ubuntu 13.10 64-bit

tldr;
Reboot the machine.

When starting up QNX Momentics 6.5.0 on Ubuntu 13.10 64-bit, it throws a lot of errors, like below.

'Initial state verification' has encountered a problem. An internal error has occured.
[Details>>] [OK]


There is an error in the QNX Configuration settings. Either the QNX_CONFIGURATION environment variable is not defined correctly or the location it points to is not accessible. Exit the IDE and fix the error?
[No] [Yes]


There is an error in the QNX compiler settings. Either the QNX compiler is not defined or compiler definition directory is not accessible. You should exit the IDE and fix the error immediately.
Exit the IDE and fix the error?

[No] [Yes]


And what is the workaround? Reboot the machine.

Guessing that the environment variables are not yet set after install, reboot picks up the new configuration.

Keywords:
QNX Momentics Ubuntu

Saturday, February 15, 2014

Fixing QNX Momentics Gtk themes warning on Ubuntu 13.10 64-bit

You might observe the following Gtk warnings when running QNX Momentics 6.5.0 on Ubuntu 13.10 64-bit.

(qde:9636): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",
(qde:7229): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(qde:7229): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

To fix, run the following command.
$: sudo apt-get install gtk2-engines-murrine:i386 gtk2-engines-pixbuf:i386 gtk2-engines:i386

Configure DHCP server for VirtualBox internal network

c:\>vboxmanage dhcpserver add --netname qnxnet --ip 192.168.100.1 --netmask 255.255.255.0 --lowerip 192.168.100.10 --upperip 192.168.100.100 --enable

Keyword:
VirtualBox, DHCP, internal

Sunday, January 26, 2014

HowTo: Upgrade Ubuntu 13.04 to 13.10 from the command line

$: sudo do-release-upgrade

References:
http://askubuntu.com/questions/110477/how-do-i-upgrade-to-a-newer-version-of-ubuntu

HowTo: Get Ubuntu version from the command line

Method 1
$: cat /etc/os-release | grep PRETTY_NAME

Method 2
$: cat /etc/issue

Method 3
$: lsb_release -d -s