Pear with IIS

Installing PEAR with IIS
easier than it seems when things dont at first work

http://code.rawlinson.us/2012/02/install-php-pear-on-windows-7.html

Posted in Uncategorized | Tagged , , | Leave a comment

Making an integer null

Although you often see an error message when trying to return null for an integer, it is possible to return a null value if you declare the integer specifically

int? value = new int?();

if(value == null)
{
// something
}

note the ? mark after the int declaration. That is the key to allowing nulls for integers

Posted in Uncategorized | Tagged , , | Leave a comment

Clock syncing to wrong time in networked server

Trying to fix my Windows 2012 server which is on a networked cloud, from reverting back to local network time even though i have set it the server to be on a timezone. I had the same problem with Server 2008 although R2 was supposed to have fixed it. Looks like it is still an outstanding issue.

am trying to use bcdedit command to change this each time on reboot

bcdedit /set {default} USEPLATFORMCLOCK true

http://blogs.interfacett.com/how-to-use-bcdedit-to-add-menu-items-to-the-selection-screen-in-windows-server-and-win7

In the end, this didnt work and I had to go with using

NetTime ‘http://www.timesynctool.com/’

instead

Posted in Uncategorized | Tagged , , , , | Leave a comment

Main disk space offenders on linux

Use the command du -h –max-depth 1 from SSH at the folder depth level you want to check

Posted in Uncategorized | Leave a comment

Executabale files on linux

When using cron with Yii an error along the lines of “bash: ./yiic: Permission denied” will appear unless you first make yiic executable.

The eas­i­est way to do this is to run the fol­low­ing com­mand in your frame­work directory:

chmod +x yiic

The x sim­ply means “eXecutable”.

Posted in Uncategorized | Leave a comment

linux server connect to windows mssql

Had difficulty getting ports setup up and testing whether drivers worked

Used freetds to act as driver with dblib

tested by using tsql -S [hostname] -U [username] -P [password]
where hostname was declared in /usr/local/etc/freetds.conf

[myserver1]
host = domain.name
port = 1433
tds version = 8.0

use version8.0 for mssql server 2008

Installing freetds was a challenge

http://pointbeing.net/weblog/2010/05/successful-microsoft-sql-server-support-for-php-on-linux.html
http://www.freetds.org/userguide/freetdsconf.htm#FREETDSCONFLOCATION
http://howtogetitworking.com/2008/02/26/how-to-install-mssql-extension-for-php-on-unix/

http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP

Posted in Uncategorized | Leave a comment

ipTables, APF, ConfigServer Firewall (linux)

A confusing day trying to get outgoing ports open so i can connect to a windows SQL server

Eventually found ConfigServer Firewall which has some nice WHM features for setting ipTables.

Tried ipTables through ssh as well. limited success as things were getting reset on restart of server

Host provider helped with APF whitelist, but cant say i understood what was going on there.

Posted in Uncategorized | Tagged , | Leave a comment

linux symlinks

An easy way first to delete a symlink you don’t wont is unlink _______ (inserting the link here).

To make a new link you can use ln -s _____1______ ______2_______ (where 2 is the new folder to make, and 1 is the file or folder to link to the new folder

e.g. ln -s /var/www/yii-1-7 /home/goals/yii

Posted in Uncategorized | Leave a comment

Apache server time

Although I had the correct zone info for my server set as Japan in the /etc/localtime folder, the time was still incorrect.

I had to use the command date -s "8 MAR 2011 02:09:00" to get it set correctly.

I am not sure why the server time was out to begin with. Maybe because the server had a forced restart.

reference:

Posted in Uncategorized | Leave a comment

Social Media icons

Nice set of social media icons here

Posted in Uncategorized | Leave a comment