Sunday, March 12, 2017

[Solved] Slow Windows 10 installation via USB thumbdrive

Was installing a fresh copy of Windows 10 on a new SSD (yep, wanted to avoid the windows 8.1 baggage so went this path)...

Unfortunately, the installation was SLOW!!! it took more than 12 hours to get to the screen where you can choose which drive to setup the Windows OS on.

Yes, more than 12 hours.

After I tried to create a partition on the new SSD, it went through a super super super slow motion of working, I gave up. It just doesn't make sense that a Windows 10 install would take 2 days (ok, i was out for half a day on day 1 so it could have been "faster").

I Googled and realized that this was mentioned on many forums such as tom's hardware, bleeping computer, and so on.

I force shutdown the PC. Unplugged all the 5 other harddisks on the system and tried installation again.

This time, it took less than 10 minutes and the PC was booting up from the new C:\ on the SSD.

SSD - Samsung 850 Evo
Motherboard - Old Asus motherboard (pre 2010 era), with the first generation Intel core i7 cpu.
USB thumbdrive was a USB3 Sandisk Extreme Pro 64GB drive plugged into a USB2 port on the system (yeah, the thought crossed my mind that it could be due to USB2, but USB2 is not this slow.. 12 hours for a 7GB file copy? nahh...)

Thursday, September 29, 2016

How to update Xamarin on Visual Studio 2015


For those using VS 2015, community edition or higher, I am sure that the useless notification "Xamarin for Visual Studio Update Available" is irritating. Clicking on it does nothing. Updating the nuget packages doesn't solve the problem either. The MS forums suggested that you go to the Control Panel, Settings, Uninstall Program and "Change" the product setup.

No. They don't work. I am not sure who are these well meaning people who gave these suggestions but that's not how Xamarin was setup. Maybe they will fix it later and deliver Xamarin updates like updates for C++, SDKs, etc. But not now (end Sept 2016).

So what can you do?

Start your VS, go to Tools -> Options.
There is a whole list of configurations on the left hand side of the Options dialog box.
Go to the bottom, the 2nd last entry should be Xamarin. Expand it and choose "Other".
On the right hand side, click on "Check now" and another dialog box will open.
Click on the download button at the bottom and wait for the download to complete.

Once download is done, try to close VS before you proceed with the upgrade.

That's it.

Have fun!

Saturday, October 4, 2014

npm install mariasql failed (Windows 7, 64bit)

Environment: Windows 7, 64bit
NodeJS version: 0.10.30

npm install mariasql will not work due to "node-gyp rebuild" failed.

To fix it:

  1. I installed Python 2.7.x (at time of this writing - 4th October 2014), 32bit edition.
  2. Create environment variable PYTHON, with the value of "\python.exe"  
  3. Yes, you must include python.exe in your Environment Variable setting or it will NOT work.
  4. Start a new CMD shell and run "npm install mariasql" again.

It will take some time but it will succeed.

Hope this helps.

Thursday, April 12, 2012

CentOS 6.2 lighttpd reverse proxy server and Selinux

Situation
Setting up lighttpd as a reverse proxy in front of a java web server.

System
CentOS 6.2 x64 running as a virtual guest

Errors
Error in /var/log/lighttpd/error.log

server started
connect failed: 8 Permission denied 13
proxy-server disabled: 127.0.0.1 9000 8

Error in /var/log/audit/audit.log (selinux)
type=AVC msg=audit(1334211267.437:7950): avc:  denied  { name_connect } for  pid=21529 comm="lighttpd" dest=9000 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:port_t:s0 tclass=tcp_socket
type=SYSCALL msg=audit(1334211267.437:7950): arch=c000003e syscall=42 success=no exit=-13 a0=9 a1=7fff20ab9060 a2=10 a3=1999999999999999 items=0 ppid=1 pid=21529 auid=500 uid=498 gid=498 euid=498 suid=498 fsuid=498 egid=498 sgid=498 fsgid=498 tty=(none) ses=19 comm="lighttpd" exe="/usr/sbin/lighttpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)

Error shown in web browser
500 - Internal Server Error

Diagnosis
run "semanage port -l | grep http_port_t"
It should show the allowed ports for the web servers.

Solution
semanage port -a -t http_port_t -p tcp 9000
(or whichever port the internal web server is supposed to run on, that is not in the list above)



Friday, February 24, 2012

Headless KVM setup on CentOS 6.2

Host machine: CentOS 6.2, 64-bit
Guest machine: CentOS 6.2, 64-bit

This is a quick run through of the commands and steps necessary for the setup to work on a headless (no GUI) machine. But even so, we will use a remote VNC client to access the server to setup and configure the guest machine.

I assume that
- virtualization is enabled in the BIOS of the host machine (important!)
- root privileges is available
- the base system is up and running somewhere remotely and can be accessed via SSH
- opening a port on the firewall(s) to allow access to the VNC server on the host machine.
- a copy of "CentOS-6.2-x86_64-minimal.iso" or similar has been downloaded and placed on the host machine at "/var/lib/libvirt/images"
- selinux is configured in "enforcing" mode.
- your host machine has sufficient resources to run your guests (remember to live enough ram for your host server)
- the person trying this is not a newbie system administrator. If your remote box do go down, ensure you are able to reboot it (physically or by calling the data center staff).

1. Install the tools required
yum install kvm libvirt python-virtinst


You will also require the dmidecode package if you are using the minimal edition of CentOS 6.2.
yum install dmidecode 
(noticed that this was missing by observing /var/log/libvirt/libvirtd.log)

2. Check that kvm is installed
lsmod | grep kvm 

The above command should output 2 entries, for example "kvm_intel" or "kvm_amd" and "kvm"

3. Create a secure location for your live images 
Assuming we are creating /vm which is only accessible by root.
Selinux only allows libvirt to store images in /var/lib/libvirt/images  but we don't want to mix the ISO images with live/running virtual guests.

mkdir /vm 
yum install policycoreutils-python 
semanage fcontext -a -t virt_image_t "/vm(./*)?"
restorecon -R /vm

If you can't do this, you can always host your guest images next to your ISO files in /var/lib/libvirt/images.

4. Network reconfiguration
We will need to create a bridged network that will route the host and guest network traffic seamlessly. This step can be skipped if the guest machines do not require network access.

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-br0

Edit  /etc/sysconfig/network-scripts/ifcfg-eth0 to something like the following:

DEVICE="eth0"
HWADDR=00:1D:09:EF:F7:04 (make sure this corresponds to your actual MAC address)
ONBOOT=yes
BRIDGE=br0 (important! make sure this entry goes in)
TYPE=Ethernet
IPV6INIT=no (prevent IPv6 from starting)

Edit  /etc/sysconfig/network-scripts/ifcfg-br0 to something like the following:
DEVICE="br0" (important!)
TYPE=Bridge (important!)
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.11 (change this to your current internet accessible IP)
PREFIX=24
GATEWAY=192.168.1.1 (change this)
DNS1=192.168.1.11 (change this)

Double-check your entries, especially the IP addresses!

5. Reboot
Cross your fingers and hit the reboot. If it doesn't work, you'll know it. :P

If it works, you know you will be able to reboot your machine remotely as many times as you like because it works. Better to fail now than to fail when you have multiple live guests running and you need to do some maintenance. :P

6. Back online?
Edit qemu.conf
uncomment the vnc_listen and vnc_password entries.

vnc_listen = "0.0.0.0" - this means the vnc server is listening on all network interfaces.
vnc_password, please change it to something long, very long (20 characters and above) to prevent bruteforce attacks. DO NOT USE THE DEFAULT VALUES!

restart libvirtd so the changes will take effect (maybe a reload might do)
service libvirtd restart

7. Poke a hole in the firewall
Open a hole in the firewall for a non-common, non-privileged port (we will be using 7601).

8. Guest OS installation
virt-install \
-n myguest \
-r 2048 \
--vcpus=2 \
--os-variant=rhel6 \
-v \
--accelerate \
-c /var/lib/libvirt/images/CentOS-6.2-x86_64-minimal.iso \
-w bridge:br0 \
--vnc --vncport=7601 \
--disk path=/vm/guest.img,size=100

(100 refers to 100GB)

Once you key this in, it will throw something about errors with the virt-viewer. This is FINE. You are not running X-windows so this error is normal. You will need to start a VNC client to access the guest os installation.


9. Start your vnc (ultravnc or tightvnc viewer)
connect to the IP:Port on the host machine
in our example 192.168.1.11:7601

You will see the familiar but customized (minimal edition) CentOS installer. If you are fast enough, you might even be able to catch the bootup screen. Please note that the VNC server for this guest OS does not start until you perform the virt-install command. You can check this by looking for the process listening on port 3764. Perform a "netstat -pant | grep 7601" and you should see something like
tcp        0      0 0.0.0.0:7601                0.0.0.0:*                   LISTEN      3109/qemu-kvm

10. Start it up again, for real
Once done, it will not reboot even though you click on the "reboot" button. You will need to start it up manually.
virsh start myguest


You can do a "virsh list" to look at the status of your guest machines.

Reconnect your vnc client to see if there are errors in the booting up process.

Can you login via the VNC client to the root account which you defined during the installation process? If ok, then you can kill the VNC client.

11. Post-installation

Remember to disable the firewall rule for TCP port 7601 or whichever port you have chosen.

Patch / update the software on your base guest image, you might want use it as a base for cloning more guest OS, thus saving you lots and lots of time.

Hope this helps.

Tuesday, May 24, 2011

Build your own Cloud

Will try this one day... heh.

DIY cloud computing

+

smart load balancing, scaling, etc...

=

DIY Amazon EC2 ... maybe :P

Monday, April 11, 2011

Upgrading CentOS packages


yum update

OR

yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum update
shutdown -r now


OR

yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum update mkinitrd nash
yum update kernel\*
yum update
shutdown -r now


Friday, April 8, 2011

Installing Magento 1.5.0.1 on CentOS 5.5

CentOS 5.5 (x64 architecture) setup for Magento Commerce version 1.5.0.1

1. Install CentOS 5.4 (because it is only 1DVD, 5.5 is 2 DVDs – troublesome)


2. Remove unnecessary rpms (ppp, rp-pppoe, irda-utils, pcmciautils, wireless_supplicant, ypbind, yp-tools, etc)


3. Update yum – “yum update yum”


4. Update the rest of the rpms – “yum update”


5. Reboot (kernel update)


6. Install Atomicorp rpm repository –

wget -q -O - http://www.atomicorp.com/installers/atomic | sh


7. Install php rpms (these are for magento mainly)

a. php

b. php-devel

c. php-cli

d. php-common

e. php-gd

f. php-mbstring

g. php-mcrypt

h. php-mysql

i. php-pdo

j. php-xml

php-xml will provide the DOM extension required by Magento.


8. There is no need to install php-mhash explicitly, it is included in php 5.3+. It depends on php-common for 5.2, and will cause a depsolving problem (dependency issue, as the rest are using 5.3+ already).


9. Compulsory changes to /etc/php.ini :

a. short_open_tag = On


10. Recommended changes to /etc/php.ini:

a. memory_limit = 64M

b. max_execution_time = 18000

c. magic_quotes_gpc = off

d. flag session.auto_start = off

e. zlib.output_compression = on

f. suhosin.session.cryptua = off

g. zend.ze1_compatibility_mode = off


11. Not sure about extension=mcrypt.so yet, the comment was:

; PHP for some reason ignores this setting in system php.ini

; and disables mcrypt if this line is missing in local php.ini

New update: I think mcrypt extension is not handled in /etc/php.d/mcrypt.ini.

If the files in /etc/php.d are processed after php.ini are processed, then it makes sense why mcrypt.ini will take precedence over the setting in php.ini


12. Magento only supports APC php opcode optimizer. However, the same dependency issue surfaces. *sigh*

To solve it, install php-devel, php-pear, and then

pecl update-channels

pecl install apc (just use the default options for now)

One good thing about compiling APC from scratch this way is that you get it optimized for your system. Bad thing is, you need to manage the updating/upgrading yourself.


Thursday, April 7, 2011

Tracks (getontracks) installation

Tracks - http://www.getontracks.org/

1. Version 2 RC 2
2. Required dependencies: RedCloth and sanitize.

Environment:
1. CentOS 5.5 x64
2. Enterprise Ruby Edition 1.8.7 separate install into /opt

Followed instructions as per the installation manual

Error when trying to rake migrate:db, dependencies missing RedCloth and sanitize.

gem install sanitize leads to error.
gem install nokogiri leads to error.

To solve:
gem install rails-sanitize

It will install nokogiri, sanitizie and a whole bunch of other dependencies for you and Tracks got on track :)

Friday, March 25, 2011

Atomic Corp + Magento + php-mcrypt x64

Magento
Atomic Corp's rpm repository

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

yum install php-mcrypt.x86_64

Thursday, March 24, 2011

Importing HUGE databases

Assumptions:
1. Huge means over 1GB or possibly 1TB (not tested) on MySQL.
2. This means that using tools like PhpMyAdmin, etc are not feasible (timeout, php.ini constraints, etc)

Problems:
1. MySQL dumps are NOT done in order of table dependencies. So it is highly possible that your dependent child table is created before the parent table is created in the SQL script. This is especially more so if you have a lot of tables in the database.

Solution:
1. Need to disable the foreign key constraint checks.

Constraint:
1. You can open up a 1GB file for editing, unless you have uber cool tools like UltraEdit on a Windows machine (almost nothing else works - vim in cygwin, vim in *nix, I dunno but please correct if I'm wrong).

Reference:

How?
mysql> SET foreign_key_checks = 0; 
mysql> SOURCE dump_file_name; 
mysql> SET foreign_key_checks = 1;

That's it, more or less.

Wednesday, March 23, 2011

Resetting MySQL password on Win 7

1. You MUST (ie. MUST MUST MUST MUST MUST) start the command prompt with "Run as Administrator"!

2. Then you can follow the instructions at:

If you do not start as Administrator, your "user" (even if he has Administrator rights) will not be able to access MySQL binary and data path. It will create a new instance of the database somewhere in
C:\Users\MySuperDuperUselessAdminUser\AppData\Local\VirtualStore\ProgramData\MySQL\blah blah blah...
And this is wrong. Even if you reset the password here, when you start the actual instance via Windows Service, it will go back to the actual datastore location and you will still fail to login.

Yes, it took me 1hour+ to get this sorted out. Hope this saves someone some pain.

GRR...

Monday, September 6, 2010

CentOS 5.5 KVM

Installing a virtual machine

virt-install \
-n [instance_name] \
-r 1024 \
--vcpus=2 \
--os-variant=rhel5 \
-v \
--accelerate \
-c /var/lib/libvirt/images/CentOS-5.4-x86_64-bin-DVD.iso \
-w bridge:br0 \
-vnc : \
--disk path=/vm/[instance_name].img,size=50



Edit /etc/sysconfig/network-scripts/ifcfg-eth0
comment out BOOTPROTO
Add BRIDGE=br0

Create /etc/sysconfig/network-scripts/ifcfg-br0
The content should be:
DEVICE=br0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Bridge

Wednesday, March 17, 2010

Renaming an SQL Server 2008 Instance

From:

– Get the current name of the SQL Server instance for later comparison.
SELECT @@servername

– Remove server from the list of known remote and linked servers on the local instance of SQL Server.
EXEC master.dbo.sp_dropserver '[SERVER NAME]'

– Define the name of the local instance of SQL Server.
EXEC master.dbo.sp_addserver '[NEW SERVER NAME]', 'local'

– Get the new name of the SQL Server instance for comparison.
SELECT @@servername

Note: be careful of the quotes, they should be single quotes instead of the fancy ones mentioned on the blog.

Thursday, November 19, 2009

Forcing automatic update on Win XP

At the DOS prompt, type

wuauclt.exe /detectnow

This is for the case where automatic update location has been manually configured to a WSUS (wuss) server :P

Monday, November 9, 2009

Updating subversion on rpmforge repository instead of base

Base repo by CentOS is using outdated svn. So we need to use rpmforge's repo.
However, if you run "yum install subversion", it will never use rpmforge's copy.
yum --enablerepo=rpmforge --disablerepo=base install subversion 

Tuesday, March 24, 2009

MS doesn't support its own software/hardware

Got a Microsoft LiveCam for my Win XP x64.

Downloaded and installed the 64bits driver for it. Video come out... blank/black.

So I uninstalled.

Tried Windows Update. It can't detect this piece of.. hardware.

Never, try to go back to the .exe installer, maybe it will work with some IM client even if the default video viewer is not working.

No luck.

Nevermind, pressed the button on the webcam and it activates... MSN Live Messenger! 

Opps... no support on 64bit OS for MSN Live suite (messenger, mail, photo, etc).


Guess Microsoft is not interested on supporting its own OSes.. maybe Linux will have better support. LOL! 

Wednesday, January 7, 2009

Mind Mapping Software Free/OSS

XMind has just released their mind mapping tool as an open source project.

If you are into mind mapping, do check it out at 


(you need to register so they can gauge the response, but it's free)... have fun! :D