Saturday, March 31, 2007

Saturday Night Home Alone

Converted my Australian driving license finally today.
Bought toilet paper for my family too!
Wondering how's a friend doing down under.

Another nice Korean song, title literally translate to "Not going to love again", not that it's how I am feeling, but just that the tune is really nice. It's a sad song, i don't understand the full meaning but from the bits and pieces of the song, something about the singer's heart leaving when her partner became cold towards her her

백지영 - 사랑안해

그럴려고 그랬어 돌아가려고
너의 차가움엔 그래 다 이유 있었던거야
나를 만지는 너의 손길 없어진
이제야 깨닫게 되었어 네 맘 떠나간 것을

설마하는 그런 미련 때문에
그래도 나는 나를 위로해
이제 이러는 내가 더 가여워
이제라도 널 지울거야 기억의 모두를

이제 다시 사랑안해 말하는 난
너와 같은 사람
다시 만날 수가 없어서 사랑할 수 없어서
바보처럼 사랑 안해
말하는 널 사랑한다
나를 잊길바래 나를 지워줘

바보처럼 몰랐어 너의 두 사람
아직 기억하려던 그건 그래 다 욕심이야
다짐했건만 매일 아침 눈을 떠
지나간 너에게 기도해 나를 잊지 말라고

제발 지금 내가 바라는 하나
내 얘길 너무 쉽게 하지마
차라리 나를 모른다고 말해줘
시간지나 알게 될거야 내 사랑의 가치를

이제 다시 사랑안해 말하는 난
너와 같은 사람
다시 만날 수가 없어서 사랑할 수 없어서
바보처럼 사랑 안해
말하는 널 사랑한다
나를 잊길바래 나를 지워줘

내가 없는 내가 아닌
그 자리에 사랑 채우지마
혹시 만날 수가 있다면 사랑 할 수 있다면
아프잖아 사랑한 널 지켜보며 사랑한다
그 말 한마디를 하지 못해서

Tuesday, March 20, 2007

File Lister Application

Okie, I was suddenly pissed off at my list of MP3s one day as I have numerous of them that seems to have weird titles! So much so that I thought of writing a simple application that list out all my MP3 files and then filter out those that does not have a proper name to it. How should I do that? Well, that I have not touch yet, currently only started writing the code to recursively list out all the file names of a directory and its subdirectories and its subdirectories' directories....well you get the drill. Anyway, the following is the code for that File Lister application,



using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.IO;
namespace FileLister
{
class Program
{
static ArrayList outputDirectoriesNFiles = new ArrayList();
static void Main(string[] args)
{
string FILE_PATH = args[0];

ListEverything(FILE_PATH);

foreach (ListName ln in outputDirectoriesNFiles)
Console.WriteLine(ln.ToString());
Console.WriteLine("Total Files: " + outputDirectoriesNFiles.Count);
}

static void ListEverything(string top_dir)
{
ArrayList directoriesNfiles = ListDirectory(top_dir);

foreach (ListName ln in directoriesNfiles)
{
if (ln.isDirectory)
{
ListEverything(ln.pathName);
}
else
outputDirectoriesNFiles.Add(ln);
}
}

static ArrayList ListDirectory(string dir_name)
{
ArrayList directoriesNfiles = new ArrayList();
string[] filenames = Directory.GetFiles(dir_name);
foreach (string fn in filenames)
{
ListName tmp = new ListName(false, fn);
directoriesNfiles.Add(tmp);
}

string[] dirnames = Directory.GetDirectories(dir_name);
foreach (string dn in dirnames)
{
ListName tmpdir = new ListName(true, dn);
directoriesNfiles.Add(tmpdir);
}
return directoriesNfiles;
}

static bool DirectoryExists(ArrayList dirsnfiles)
{
foreach (ListName ln in dirsnfiles)
if (ln.isDirectory)
return true;
return false;
}
}

class ListName
{
public bool isDirectory;
public string pathName;

public ListName(bool isdir, string pthname)
{
this.isDirectory = isdir;
this.pathName = pthname;
}

public override string ToString()
{
if (isDirectory)
return "Directory: " + pathName;
else
return "File Name: " + pathName;
}
}

}

Tuesday, March 06, 2007

Data Bindings in .NET

For my memory...
http://www.akadia.com/services/dotnet_databinding.html

System Accounts Definations

I am always getting confused over the different accounts.
From http://www.microsoft.com/technet/security/guidance/serversecurity/serviceaccount/sspgch02.mspx,

System Accounts

A service must log on as an account to access resources and objects on the operating system. If you assign an account to a service that does not have appropriate permissions to log on, the Services snap-in for the Microsoft Management Console (MMC) automatically grants that account the required Log on as a Service user right on the computer being managed. Microsoft Windows Server™ 2003 includes the following three built-in local accounts used as the logon accounts for various system services:
• Local System account
The Local System account is a predefined local account that can start a service and provide the security context for that service. It is a powerful account that has full access to the computer, including the directory service when used for services running on domain controllers. The account acts as the host computer account on the network and as such has access to network resources just like any other domain account. On the network, this account appears as DOMAIN\$. If a service logs on using the Local System account on a domain controller, it has Local System access on the domain controller itself, which, if compromised, could allow malicious users to change anything in the domain they wanted. Windows Server 2003 configures some services to log on as the Local System account by default. The actual name of the account is NT AUTHORITY\System, and it does not have a password that an administrator needs to manage.
•Local Service account
The Local Service account is a special built-in account that has reduced privileges similar to an authenticated local user account. This limited access helps safeguard the computer if an attacker compromises individual services or processes. A service that runs as the Local Service account accesses network resources as a null session; that is, it uses anonymous credentials. The actual name of the account is NT AUTHORITY\LocalService, and it does not have a password that an administrator needs to manage.
•Network Service account
The Network Service account is a special built-in account that has reduced privileges similar to an authenticated user account. This limited access helps safeguard the computer if an attacker compromises individual services or processes. A service that runs as the Network Service account accesses network resources using the credentials of the computer account in the same manner as a Local System service does. The actual name of the account is NT AUTHORITY\NetworkService, and it does not have a password that an administrator needs to manage.
Important: If you change the default service settings, you might prevent key services from running correctly. It is especially important to use caution when you change the Startup type and Log on as settings for services that are set to start automatically by default.