Saturday, 6 September 2014

Virtualization - Hyper V

Virtualization (Hyper-V)
Application virtualization
Service + Application isolation
Easy Deployment
 -VMM (virtual machine manager) templates
 -Self-service portals
Legacy Apps + OS
 -Client Hyper-V
 -MED-V

Server consolidation 
Current hardware is under-utilized
Benefits
 -Higher density
 -Less or centralized management
 -Optimized resources + very high ROI
 -Sand boxing labs
 -Efficient virus scan, Backup
 -Greener
 -Can replicate, migrate

Hyper-V Requirements
Win-12 Full/Core/Hyper-V server
X64 with Second level address translation (SLAT) + Data Execution Prevention (DEP)
Processing - Up to Host + Guest Requirements
Memory - Up to Host + Guest Requirements
Storage - Up to Host + Guest Requirements
 -I/O is Critical
 -Conisder VMs on different Disks+SAN,RAID,SSD,Hybrid SSD
 -Multiple NICs
GUEST MAX
 -1TB RAM, 32 CPU

Hyper-V Client Configuration:Settings
Dynamic Memory
Smart Paging
Resource metering (for billing purpose, etc)
Guest integration services

Hyper-V Settings:Storage
VHD-Original Recipe 2TB Max
VHDX
 -64TB MAX,more resilient,better aligned to large sectors,larger block size(Dynamic/Diff)
Modify VHD (using powershell, we could add/remove features offline without starting OS)
Edit virtual disk wizard (VHD <--> VHDx)
Differencing drives (keeping tomorrow' data/image on different disk/drive)
Pass through disks (add external disk/drive in local OS without the need to go through Hyper-V adapter? performance increase; disk must be offine on host machine first)
Snapshots (point in time instance of the OS)
Fibre Channel Adapter

Hyper-V Settings:Network
Network Virtualization with Vlans
Configure switches (same as VM host only adapter,bridge mode, etc.)
COnfigure available MAC addresses
Synthetic + Legacy virtural network adapters


Thursday, 4 September 2014

Group Policy - GPO

Group Policy Objects
A Group of registry settings (not security groups)
Components
 -Templates (more can be added to default)
 -GPO files in Sysvol(C:\windows\PolicyDefinitions\admx file)
 -Linked to AD OUs, sites, domains
 -Special settings
Interfaces (how/where to view/edit)
 -Local Group policy
 -Group policy management console (GPMC)
 -Group policy management editor (GPME)
 -Group policy object editor from mmc for user/group specific (Multiple local group policy - making exception to local GPO)

Local Group Policy
Applies only locally (can export/import)
Computer configuration - Applies to all users/everyone
User configuration - Applies to all unless ..
 -Administrator/non-administrators policy
 -User-specific policy (not groups)
Can use on any Domain or Non-domain except DC
Local processing of local GPO can be disabled via a GPO
Usefulness
 -Servers with specific exceptions (Eg.diable control panel except for Admins)
 -Non-Domain System


Applying Policy
Link enabled
Block Inheritance
Enforce
Refresh
 -Startup (computer config policy)
 -Logon (user config policy)
 -90 min+random 30min, DCs 5 min
 -Gpupdate
 -PS invoke-gpupdate
 -Right-click OU

Templates + Central Store
Template
 -Acutal GPO settings
 -Can get additional (e.g, office)
 -Each OS releases adds new template settings

Central Store
 -Previous windows clould have mismatch templates
 -Already configured
 -..But might have to copy most current templates from C:\windows\policyDefinitions (local) to DC@C:\windows\sysvol\domain\policies


Scope of Management
Very important
User config -link to-> User OU
Computer config -link to-> Computer OU
Multiple group policies often apply
 -Settings are cumulative
 -Conflicts: last policy wins
Processing Order
 Local Default
  |-> Site
      |-> Domain
          |-> OU
              |-> OU
Security Filtering (to make exceptions)

Policies and Preferences
Both are mostly Registry punches

Policies (managed)
 -Setting is permanent(eg. Grayed out UI)
 -Applied at startup, logon, refresh
 -Removing policy reverts to default
 -Takes precedence over preference

Preferences (unmanaged)
 -User can reverse setting(UI not grayed out)
 -Applied+Refreshed or do not reapply
 -Setting tattoos registry
 -Not available for local GPO
 -Often useful for desktop icons,shortcuts,URL on desktop,send to,mapped drive,

Starter GPOs
Commonly desired(not required) settings
Administrative templates only
To start, create folder
 -includes canned starters
Often used for roles
 -Various types of servers
 -laptops
 -desktops
 -security sensitive
Exportable to CAB (cabinet files->compressed file)

Default GPO Permissions
Full Access
 -Domain admin, Enterprise admin, Creator owner, Local system
Read/Apply: Authenticated users
Gran Additional permissions
 -Create:Add to GP creator/owner
 -Edit: R/W via Group policy management console(GPMC)
 -Link mgmt: Delegation in GPM or Delegation of Control Wizard(DoCW)
 -Modeling/Results: Delegation in GPM or Delegation of Control Wizard(DoCW)

GPO Security Settings
User Rights
Security Options
User Account Control
Audit Policy

Security Templates
Pre-configured settings for "security settings" (.inf)
Apply to single or multiple
Apply locally or GPO
Settings
 -Account policies,local policies,event log,restricted group,system services,registry,file system
Configuration
 -GPO, secedit.exe,security config and analysis(launch using mmc)+security template consoles, security compliance manager(download)

Locking down software
Software restriction policy
 -Designed for legacy windows, fairly easy to bypass, all apps allowed by default

AppLocker
 -Designed for win7/8,2008 r2,2012, less easy to bypass, all apps denied by default(GPO-Computer config-Windows settings-Security settings-Application control policies). Note: need to start "Application identity" service and this can be done via (Security settings-System services)in same policy.

Wednesday, 3 September 2014

Active Directory notes


From powershell - adsiedit

more group memberships for a user makes longer time for user when loggin in.
_Template user account for easy copying in AD users and groups.

Offline domain join (clients)

Forest root is the first doamin in your forest.


The Global Catalog
--
What is it?
-Full copy of host domain objects
-Partial read-only of other domains in same forest

What benefit does it provide?
-Simpler searches across domains
-No need to contact source DCs
-User principle name authentication
-Validates forest objects
-Universal Group membership WFO

Single Domain - No burden
Multi-Domain - Consider added replication

To make a DC a GC server, go to AD sites and services.
  under servers - DC name - NTDS settings - Properties

Four types of Trust
-External (one way forest trust, etc)
-Shortcut (within forest to avoid walking down the trees)
-Realm (between AD and kerberos realm)
-Forest
Federation (trust created for external domain user to access specific application)

SRV records - DNS "SRV" Entries - critical to proper function of AD
If deleted accidentally, in command prompt "nltest /dsregdns"

other useful commands - dcdiag /fix
http://cbt.gg/M6vHml
http://cbt.gg/MfofRw
--------------------

Active Directory Automating User accounts

Methods
LDIFDE - LDAP interchange format directory exchange
CSVDE -
DSADD (more common in future)
 -DSMOD
 -DSQUEM/DSGET
 -DSMOVE
 -DSRM
Powershell (more common in future)

AD Group types


Organizational Units

AD Object
 -contain users, groups, computers
 -mostly for simplifying administration
 -not for permission
 -very powerful with GPO
Users + COmputers containers: Not OUs
Redirusr + Redircmp

Delegation

Configure OU permission to allow user/group
some level of administration
Useful to narrow management
Prevents over permissions
Usefulness
 -interns, smaller offices, limt admin scope


Monday, 1 September 2014

Basic of Finance

Eg. Bag making and selling startup
There are 3 types of expenses. The first is her startup costs which are the expenses that happened before the beginning of the business plan. The second type of expense is a fixed cost. Fixed costs are goods and services that do not depends on the number of items that she is making. Last type of expense is a variable cost. Variable costs are costs that vary based on the number of items produced.

Break-even point - the number of bags she needs to sell each month to cover her expenses.

Break-Even point Calculator
http://www.youtube.com/results?search_query=Small+Business+Finance+peter+cameron


Remember to count in hidden expenses in your cost.
Income Statement-Simple
http://ohioline.osu.edu/cd-fact/1153.html

Cash Flow - Cash flow is the measure of how much money is coming in and going out of your business during a given period of time. Cash flow is the difference between your total incoming cash and total outgoing cash. Cash flow is different from profit and loss. A business might be on track to make a profit over the course of a year but still get into trouble if the owners do not keep track of their cash flow. Cash flow will tell whether a business is on track to lose or gain money and help you to predict whether you will have enough cash to operate your business.

How can keeping track of your cash flow help your business? 
A cash flow projection is a worksheet that uses financial records from your business's past to forecast the amount of incoming and outgoing cash that you can expect your business to receive. You can use a cash flow projection to estimate when your business will be busiest and to help you make decisions about when during the year you should plan to save more money or to make more investments. 

Having and maintaining a cash flow projection can help you understand the general trends in your business more clearly and be better prepared for any surprises that may come your way. To create a cashflow projection, use your business's historical financial records to estimate your expected income and expenses in the future.If you do not have historical records, research the market to estimate when you can expect to experience busier or slower times in your business.

Cashflow Projection worksheet
Online Cashflow calculator
http://www.morebusiness.com/cash-flow-problems
http://www.powerhomebiz.com/blog/2009/07/7-common-cash-flow-problems-faced-by-small-businesses/


Sunday, 31 August 2014

DNS and DHCP


DNS Zones
Storage unit of Domain names + IPs
Mostly forward but also reverse
Stored in File or AD
 File (C:\windows\system32\Domain.Dns)
  -Primary + 1 or more secondary
  -Only Primary is R/W
  -Secondary updated by Primary or other secondary
 AD-Integrated
  -Stored in AD
  -Replicated with other AD data incrementally
  -Secure dynamic Updates

Forwarders+Stubs
Forwarders
Root hints:Internet top-level servers
Conditional:Commonly accessed domain DNS server

Stub Zones
 -Contains Authoritative DNS server resource records
  *SOA, *NS, *A(Glue)
 -Receives updates

Cache Management+Resource Records
DNS Server cache
 -Prevents redundant lookups
 -Usually valid for 1 day
 -Clear

Common RR
 -A (host record for IPv4), AAAA(host record for IPv6)
 -PTR (pointer record for reverse lookup)
 -CNAME (alias)
 -MX
To display DNS cache on client machine - ipconfig /displaydns


Namespace  This is the name of a domain, not specifi cally an Active Directory domain though. It’s a logical set of hosts signifi ed by a name controlled by a set of name servers. This is
equivalent to a computer’s last name; they’re all part of the same family. For example, Bigfirm.com is the namespace for hosts in the Bigfi rm.com domain.

Recursion  This is a server-directed process to resolve an FQDN. If the server cannot resolve the FQDN with its own information, it will send the query to other name servers. The recursion process comprises root servers and domain name servers. Root servers are the top of the hierarchical naming structure. The root servers list the name servers that control the top-level domain names such as .com, .gov, and .edu. The top-level domain servers control the registry of subdomains beneath the top-level domain.

Delegation  This means allowing another name server to control a subdomain of a given namespace. For example, the Bigfirm.com name servers can delegate control of the Ecoast.Bigfi rm.com namespace to another server.

Forwarding  This is an alternative to the recursion process. Forwarding is a lateral request to another name server within the network. The forwarding server obtains a response and relays it to the originating name server.

Iteration  This is a client-directed process to resolve an FQDN. If the client receives a negative request from a name server, it will query another name server.
NetBIOS Naming System  This legacy naming system was used primarily within old Microsoft NT 4.0 networks. Its processes are still part of modern-day Windows operating systems, however, particularly when using non-domain (workgroup)–based computers.

Service Records  Service records (SRVs) are records within a DNS namespace to resolve a service to a hostname. This is an essential part of DNS supporting Active Directory.

Dynamic DNS Update  Dynamic DNS (DDNS) update is a process that allows DNS clients to register their hostnames in an assigned namespace such as DHCP. This reduces the need of admins to manually enter records in the name server databases. This is another essential part of DNS supporting Active Directory.

----------------------------------------------------------------

DHCP Process (DORA) - Discovery,Offer,Request,Acknowledge

DHCP Database
 -Backup
 -Restore
 -Reconcile

DHCP Failover
 -Load sharing
 -Hot standby



Sunday, 17 August 2014

Japanese Basic

konit chi wa - (Hello) late in the morning & afternoon
ohio - good morning
ohio gozaiemas - with respect
sang - mr, mrs, miss (family name)

ha ji mi(n) mash delt - how do u do (used when people meet for the first time)
doezo yoro shaku - nice to meet u (pls be nice to me)
----
su mee ma sant - excuse me, sorry
air go - english language
waka remas - understand
ka - ? question (end of the sentence)

air go ga  waka remas ka? - do u understand english
high - yes
ei yelt - no
waka remas sant - don't understand
high, waka yemas

nihong - japanese
su mee ma sant, nihong go ga waka yemas ka?
-----

america jin(t) - America person - american
watashi - I
des - is, am , are
watashi wa amercian jint(t) des.

american jint(t) des ka?
Green sang wa american jint(t) des ka? -- Ms. green, r u an american?
high, watashi wa amercian jint(t) des.

soe des - that's right
high, soe des.

chi ga emas - incorrect
ei yelt, chi ga yemas.
-------

Saturday, 16 August 2014

PHP & MySQL basic

CREATE DATABASE ijdb;
DROP DATABASE ijdb;

CREATE TABLE joke (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    jokeText TEXT,
    jokeDate DATE NOT NULL
) DEFAULT CHARACTER SET utf8;

SHOW TABLES;
DESCRIBE joke;
DROP TABLE joke;


INSERT INTO joke SET
joketext = "Why did the chicken cross the road? To get to the other side!",
jokedate = "2011-04-01";

INSERT INTO joke
(joketext, jokedate)
VALUES (
"Why did the chicken cross the road? To get to the other side!",
"2011-04-01"
);


SELECT * FROM joke;
SELECT id, jokedate from joke;
SELECT id, LEFT(joketext, 20), jokedate FROM joke; - LEFT , lets us tell MySQL to display a column’s contents up to a specified maximum number of characters.
SELECT COUNT(*) FROM joke; - COUNT , which lets us count the number of results returned.
SELECT COUNT(*) FROM joke WHERE jokedate >= "2011-01-01";
SELECT joketext FROM joke WHERE joketext LIKE "%chicken%";

SELECT joketext FROM joke WHERE
joketext LIKE "%knock%" AND
jokedate >= "2011-04-01" AND
jokedate < "2011-05-01";


UPDATE joke SET jokedate = "2011-04-01"
WHERE joketext LIKE "%chicken%";

DELETE FROM tableName WHERE conditions;
DELETE FROM tableName WHERE conditions;


PHP
-----------
$var1 = 'PHP';
echo "$var1 rules!";    // Outputs 'PHP rules!'
echo '$var1 rules!';    // Outputs '$var1 rules!'
ou can include the name of a variable right inside a text string, and have the value inserted in its place if you surround the string with double quotes instead of single quotes. This process of converting variable names to their values is known as variable interpolation. However, as the last line demonstrates, a string surrounded with single quotes will not interpolate the variable names it contains.



$myarray = array('one', 2, '3');
echo $myarray[0];       // Outputs 'one'
echo $myarray[1];       // Outputs '2'
echo $myarray[2];       // Outputs '3'

$myarray[1] = 'two';    // Assign a new value
$myarray[3] = 'four';   // Create a new element

$myarray[] = 'the fifth element';
echo $myarray[4];       // Outputs 'the fifth element'


$birthdays['Kevin'] = '1978-04-12';
$birthdays['Stephanie'] = '1980-05-16';
$birthdays['David'] = '1983-09-09';



htmlspecialchars($firstname, ENT_QUOTES, 'utf-8')

----------------------------------
For documentation - php.net/date (for eg); dev.mysql.com (click on Developer zone);

-----------------------------------

Connecting to MySQL database from PHP
------------
Need a user account for php. Go to phpMyAdmin, select a database, click on Priviledge. Add user.

<?php

$link = mysqli_connect('localhost', 'ijdbuser', 'mypassword');
if (!$link)
{
$output = "Unable to connect to the database server";
include 'output.html.php';
exit();
}

if (!mysqli_set_charset($link, 'utf8'))
{
$output = "Unable to set  database connection encoding";
include 'output.html.php';
exit();
}

if (!mysqli_select_db($link, 'ijdb'))
{
$output = 'Unable to locate joke database';
include 'output.html.php';
exit();
}

$output = 'Database connection established';
include 'output.html.php';

?>

SQL Join
Select * From joke INNER JOIN author on authorid = author.id

File List

PHP-L3S4-Variables,Operators.pdf
PHP-L3S5-Arrays.pdf
PHP-L3S6-PassingVariablesInLinks.pdf
PHP-L3S8-PassingVariablesInForms.pdf
PHP-L4S3-ConditionalStatements.pdf
PHP-L4S4-Loops.pdf
PHP-L4S7-ControllerAndTemplates.pdf
PHP-L6S5-SendingSqlQueries with PHP.pdf
PHP-L6S6-Handling SELECT Resultset.pdf
PHP-L7S3-Inserting Data Into Database.pdf
PHP-L7S4-Deleting Data from Database.pdf
PHP-L11S4-Types Of Includes.pdf
PHP-L11S6-Variable Scope&Global Access.pdf

sample codes.zip