Minggu, 24 November 2013

Xathrya Sabertooth

Xathrya Sabertooth


Installing FTP Server on Arch Linux ARM using VSFTPD

Posted: 23 Nov 2013 11:34 PM PST

File Transfer Protocol (FTP) is a standard network protocol used for transferring files from one host to another host over a TCP-based network. The party involving two side: server and client, in other words it use client-server architecture. One famous FTP server is VSFTPD (Very Secure FTP Daemon).

In this article we will discuss about how to install VSFTPD to Arch Linux ARM, one of Linux distribution for ARM processor. Specifically, I use:

  1. Raspberry Pi model B, for machine
  2. Arch Linux ARM release 2013-07-22

Before we started, make sure you have installed Arch Linux ARM on your device.

Update the Repository

It is a good choice to update the repository as Arch Linux release new package periodically without save the old package. Arch Linux ARM use the very same package manager system like its parent uses. Therefore the command should be similar.

Make sure you have setup the Arch Linux ARM Repository.

To update the repository, do following:

pacman -Syy

Make sure your device can access the internet.

Installation

Installing vsftpd is really straightforward. We can install vsftpd from the Official Repositories by:

pacman -S vsftpd

Package manager will download the required package, depends on your connection. It will also install it automatically once the package are downloaded.

Start / Enable Server

We can enable server, which means the server started everytime we boot the device. Arch Linux use systemd, so to make it run automatically at boot time, do following:

systemctl enable vsftpd.service

While you can make it disabled / not run automatically by:

systemctl disable vsftpd.service

To start it manually, do:

systemctl start vsftpd.service

We can stop the service by:

systemctl stop vsftpd.service

Selasa, 19 November 2013

Xathrya Sabertooth

Xathrya Sabertooth


Mounting Partition from Raw Disk Image on Linux

Posted: 18 Nov 2013 10:40 AM PST

In Linux/Unix or perhaps in every computer system, a term mounting is defined as attaching additional filesystem to the currently accessible filesystem of a computer. As we know, a filesystem is hierarchy of directories (also referred to as a directory tree) that is used to organize files on a computer or storage media.

We might familiar or maybe remember how to mount a partition well. But that’s when the partition is inside a storage media or physical medium. What if the partition we want to access is in form of disk image? Here, we will discuss it.

In this article I use:

  1. Slackware64 14.0
  2. dumped image from 4GB SD-card, using dd

The Theory

Disk Image

A disk image is a single file or storage device containing the complete contents and structure representing a data storage medium or device, such as hard drive, tape drive, floppy disk, optical disc, or USB flash drive. A disk image is usually created by creating a complete sector-by-sector copy of the source medium and thereby perfect replicating the structure and contents of a storage device.

In Linux, we can create disk image using dd utility. Assuming we want to create disk image of a SD-card which is recognized as /dev/sdb as MyDiskImage.img:

dd if=/dev/sdb of=MyDiskImage.img

Partition and Partition Table

As said, disk image is perfect copy of a storage media. Therefore we got very same bit of partition and partition table. Nothing is modified, unless you alter it. Therefore, we can still read the partition table like what we do on physical storage medium.

We can use fdisk to see the partition table of a disk image:

fdisk MyDiskImage.img

Loopback Device

We know that Linux and Unix list all recognized device as device nodes. They are treated like ordinary file and stored on /dev, like /dev/sda for first SCSI storage device we have. However, not many of us know some pseudo-devices on this directory. One of them is loop device /dev/loop*.

This is special node that we will use for mounting an image.

How to Mount

There are some steps we have to do so we can mount a partition inside of disk image.

Know the Offset

We have to know where is the offset of partition. Clearly we need to know where the partition start and where the partition end. Although, we only need the offset of beginning of the partition. To do that, we can use fdisk to peek on partition table. For example:

fdisk MyDiskImage.img

Here’s how my partition looks like.

Disk MyDiskImage.img: 691 MB, 691798016 bytes  255 heads, 63 sectors/track, 84 cylinders, total 1351168 sectors  Units = sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disk identifier: 0x0002c262                             Device Boot      Start         End      Blocks   Id  System  2013-09-25-wheezy-raspbian.img1            8192      122879       57344    c  W95 FAT32 (LBA)  2013-09-25-wheezy-raspbian.img2          122880     5785599     2831360   83  Linux

What we want to know is the offset, which is in byte-level. However fdisk tell us about sectors. Fortunately we can convert the offset in sector to bytes by multiplying it with the size of sector. In our case, one sector is 512 bytes.

Let say we want to mount partition 2, which is ext4. We calculate the offset for this partition.

122880 * 512 = 62914560

Save this value.

Mount It!

The actual mounting. Mounting process is similar when we mount normal partition. However, this time we use loopback device and use one argument we never use before, “offset”. Basically, offset tell mount utility to skip the data on particular to offset.

Here how we do:

mount -o loop,offset=62914560 MyDiskImage.img /mnt/mount_point

Here we mount partition 2, which is located on 62914560 bytes after the beginning of the file. The partition should be mounted to our mount point (/mnt/mount_point). Unless you have an unknown filesystem, this command shouldn’t be fail.

Jumat, 15 November 2013

Xathrya Sabertooth

Xathrya Sabertooth


Installing SQL Server 2012 on Windows Server 2012

Posted: 14 Nov 2013 11:51 PM PST

Microsoft SQL Server, also called as SQL Server only, is a relational database management system (rdbms) developed by Microsoft. It is used to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet). SQL Server use structured query language (SQL), technically they are T-SQL and ANSI SQL.

Some applications are likely high-coupled with Microsoft SQL Server. In simple term, they are works with SQL Server around. This is normal for Windows applications.

In this article we will discuss about how to install Microsoft SQL Server 2012 on Windows Server 2012. SQL Server 2012 has four editions: Enterprise, Standard, Developer, and Express edition. We will use Microsoft SQL Server 2012 Developer edition. This edition only suitable for development process. However this is enough, as the installation process is roughly same for any edition.

Another Extra Info

SQL Server Standard and Enterprise Edition usually used for production, while Developer Edition used for development. If we use one of them, we can also install another tool set beside SQL Server DBMS, for example: SQL Server Reporting Service, SQL Server Analysis Service, and SQL Server Integration Service.

Stage 1: Add New Username to Active Directory

If you have installed Active Directory, you should add new username in your active Directory. This username is used for SQL Server and also this step is always done if you want to create a bigger service such as SharePoint. The username for SQL Service is service and different with other username, so we will create it to new Organizational Unit (OU). Let name it as WINDEV (My machine’s NetBIOS name) so our username would be WINDEV\SQL_Service.

Open “Start screen” and choose “Active Directory Users and Computers“. Right click to your domain controller, in my case it is “windev.xathrya.web.id”. Navigate to New > Organizational Unit. Then create the name you prefer.

create-new-ou

create-new-ou-2

Then, create new user under WINDEV, SQL_Service

create-new-user

Click Next and set the password. Don’t forget to uncheck “User must change the password at next logon” and check “Password never expires”.

Stage 2: SQL Server Installation

If you have the DVD, insert it to tray. If you have the ISO, mount it. Either way, you should have opened and see a setup executable file.  Run it and wait until the installation window appears.

sql-server-1

Click on “Installation” on left pane. Then, click on “New SQL Server stand-alone installation or add features to an existing one”. Wait for next page.

sql-server-2

SQL Server installer will do some checks. It will be decided whether your machine is fulfilling the prerequisites or not for installation.

sql-server-3

Next, enter the product key. As said before, we are using SQL Server 2012 Developer Edition.

sql-server-4

The next screen prompts us to accept the license terms. We can also opt to send anonymous feature usage data to Microsoft.  It is recommended to do this as Microsoft actually uses this data to qualify and prioritize future development efforts.

sql-server-5

SQL Server also checks for updates. However we can exclude the update for now.

sql-server-6

Setup then checks for conditions that may interfere with the installation of setup support files:

sql-server-7

On above window, I would install the SQL Server on same machine as my Domain Controller. In the real world, actually we don’t do this. We have separate machine for Domain Controller and SQL Server.

Next select the setup role in the installation process. We choose "All Features With Defaults,"

sql-server-8

Click next to continue to the Feature Selection. The content would be populated based on our machine. We also install it to default path, so we won’t lay our finger there.

sql-server-9

Setup next checks installation rules.

sql-server-10

Next we determine the instance ID. This is the ID for SQL Server in our machine. It should be unique if it is used in production level when more than one SQL Server is used. In our case, we are only using it for developing so we won’t mess with it.

sql-server-11

Setup will calculate the disk space. Roughly 7GB is required when we install all the features (default features).

Next we do service account configurations. We use WINDEV\SQL_Service for all account, and remember to set the password.

sql-server-12

Database engine configuration includes Authentication Mode and SQL Server Administrators. You can accept the defaults if you want. We use Mixed Mode Authentication (combined with very strong passwords) for my installations. Clicking the Add Current User button adds me to the SQL Server administrators

sql-server-13

Next we have Analysis Services setup. I mostly work with Tabular Model these days.  As before, I click the “Add Current User” button to add this account to the Administrators:

sql-server-14

Accept the defaults for Reporting Services configuration:

sql-server-15

Click on “Add Current User” button.

sql-server-16

Give DRC (Distributed Replay Client) a name. In this case, I use XathWinServ2012Sql:

sql-server-17

Next we have Error Reporting page. Just click on Next.

Then, Installation configuration rules are checked for consistency and readiness.

sql-server-18

Next we will be presented by a confirmation page. When you decided to accept the configuration, click Install to begin installation.

sql-server-19

Installation will take some times. You should grab some food or doing something else.

sql-server-20

When the process come to end, it’s time to celebrate it. You have installed the SQL Server 2012.

Installing DNS Server on Windows Server 2012

Posted: 14 Nov 2013 10:24 AM PST

Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates easily memorized domain names to the numerical IP addresses needed for the purpose of locating computer services and devices worldwide. By providing a worldwide, distributed keyword-based redirection service, the Domain Name System is an essential component of the functionality of the Internet.

Windows Server 2012 use it’s own DNS server program, named Microsoft DNS. This is the default on any Windows Server.

Like any service on Windows Server 2012, Microsoft DNS is implemented as server role. This article will discuss about how to install DNS service in Windows Server 2012.

Installation

Open “Server Manager” from task bar, if you have not opened it yet.

From “Server Manager” Dashboard, select “Add roles and features”. This will launch the Roles and Features Wizard allowing for modifications to be performed on the Windows Server 2012 instance.

install-ad-1

Select “Role based or features-based” installation from the Installation Type. Roles are the major feature sets of the server, such as IIS. Features provide additional functionality for given role.

install-ad-2

When asked for destination server, select the current server. It should be chosen by default. Click “Next” button to proceed.

install-ad-3

From the Server Roles, choose the option “DNS Server” by checking it. A notice will appear explaining additional roles services or feature are also required to install domain services.

dns-role-1

If you don’t set your machine using static IP address, you will get a warning message. Make sure you set your machine to static IP address so client can resolve your machine. However, you can always ignore it and go to next stage for installation.

dns-role-2

Now we will be brought to “Features” page. Review and select optional features to install during installation of DNS Server. You can check any features but we will leave it as is.

Review the information. Click Next.

dns-role-3

Review the installation. This page will show you information about what will be installed. When ready, press “install” button.

dns-role-4

Installation will take on. It should not be long, but that will depend on your machine. In installation process, a progress bar will be displayed on the screen. Once Active Directory role is installer, it will be displayed on the ‘Server Manager’ landing page.

dns-role-5

Disable Ctrl + Alt + Delt Prompt to Login Windows Server 2012

Posted: 14 Nov 2013 09:54 AM PST

By default, whenever we boot Windows Server 2012 we will be asked to press ctrl + alt + del on logon screen. Sometimes this is annoying and fortunately we can remove it so we can start typing the username and password without pressing ctrl+alt+del.

In this article we will discuss about how to disable Ctrl+Alt+Del prompt.

The Idea

Everytime we login we need to press Ctrl+Alt+Del. This policy is defined by Windows on “Local Security Policies” and can be disabled manually.

How to Enable

Open the “Start” screen, click “Administrative Tools”.

administrative-tool

Double click the “Local Security Policy” icon, expand Local Policies and click Security Options. In the right pane search and open”Interactive logon: Do not require CTRL+ALT+DEL” and choose “Enabled“. Save the policy change by clicking OK.

disable-ctrl-alt-del-1

Enable Sound on Windows Server 2012

Posted: 14 Nov 2013 09:04 AM PST

By default, Windows Server 2012 disables audio. This of course has a reason. Most servers won’t need it. However, you can always enable manually or make it enable by default.

In this article we will discuss about how to enable sound on Windows Server 2012.

The Idea

Sound is a service. Like any other service, it can be manually started or we can set it enabled automatically on every boot time.

How to Enable

Go to Services window. There are two ways to do that. First: Open the “Start” screen, click “Administrative Tools” and open the “Services” shortcut. Second: press CTRL+R (opening Run dialog) and type “services.msc“.

You will see a window for Services.

audio-1

Search for “Windows Audio” service and double click it (or press enter button on it). We will be presented by another window.

If we want it to enable for only this time, click on “Start” button. If you want it to run automatically, set its “Startup type” to “Automatic“. Repeate this process for “Windows Audio Endpoint Builder” service. If you want to use audio immediately, also click the Start button in the Properties window of both services in addition to changing the Startup type.

audio-2

Kamis, 14 November 2013

Xathrya Sabertooth

Xathrya Sabertooth


Installing Active Directory on Windows Server 2012

Posted: 13 Nov 2013 05:52 PM PST

Active Directory (AD) is Microsoft’s implementation of directory service for Windows domain network. It uses Lightweight Directory Access Protocol (LDAP) version 2 and 3, Microsoft’s version of Kerberos, and DNS.

Active Directory is used on Windows Server. Usually a dedicated server for Active Directory is referred as Domain Controller. A Domain Controller authenticates and authorizes all users and computers in a Windows domain type network. It also assign and enforce security policies for all computers and installing or updating software.

In a network, there should be only one Active Directory Domain Controller. Or, at least there is one master and only two slave Domain Controller at maximum for load balancing.

Like any service on Windows Server 2012, Active Directory Domain Service (AD DS) is implemented as server role. This article will discuss about how to install Active Directory in Windows Server 2012.

Installation

Open “Server Manager” from task bar, if you have not opened it yet.

From “Server Manager” Dashboard, select “Add roles and features”. This will launch the Roles and Features Wizard allowing for modifications to be performed on the Windows Server 2012 instance.

install-ad-1

Select “Role based or features-based” installation from the Installation Type. Roles are the major feature sets of the server, such as IIS. Features provide additional functionality for given role.

install-ad-2

When asked for destination server, select the current server. It should be chosen by default. Click “Next” button to proceed.

install-ad-3

From the Server Roles, choose the option “Active Directory Domain Services” by checking it. A notice will appear explaining additional roles services or feature are also required to install domain services.

install-ad-4

There are other options including, Certificate services, federation services, lightweight directory services and rights management. Domain Services is the glue that holds this all together and needs to be installed prior to these other services.

Now we will be brought to “Features” page. Review and select optional features to install during installation of Active Directory. You can check any features but we will leave it as is.

Review the information. Click Next.

install-ad-5

Review the installation. This page will show you information about what will be installed. When ready, press “install” button.

install-ad-6

Installation will take on. It should not be long, but that will depend on your machine. In installation process, a progress bar will be displayed on the screen. Once Active Directory role is installer, it will be displayed on the ‘Server Manager’ landing page.

install-ad-7

Configuration

Once Active Directory Domain Service is installed on the server, we can start configuring our domain. I will assume that this is your first time configuring.

Open the “Server Manager”, if you have not opened it yet.

Open the Notification Pane by selecting the notification icon from the top of the Server Manager. It looks like a flag, and should have an exclamation mark on it. From the notification regarding configuring Active Directory, click “Promote this server to a domain controller”.

config-ad-1

From the Deployment Configuration tab select “Add a new forest” from the radial options menu. Insert your root domain name into the “Root domain name” field. For example, I will use “windev.xathrya.web.id”.

config-ad-2

Review and “select a Domain and Forest functional level”. Once selected “fill in a DSRM password” in the provided password fields. The DSRM password is used when booting the Domain Controller into recovery mode.

config-ad-3

We will be presented by a warning. Review the warning on the DNS Options tab and select Next. If you don’t have DNS server yet, this is the outcome, otherwise you are given option to add new DNS delegation. Either way, click Next after you have done.

config-ad-4

Confirm or enter a NetBIOS name and click Next.

config-ad-5

Configure the location of the SYSVOL, Log files, and Database folders. Click Next when done.

config-ad-6

Review the configuration options and click Next.

config-ad-7

The system will check to ensure all necessary prerequisites are installed. This would be done before moving moving forward to real configuration stage. Once the system passes the check, we will proceed by clicking “Install”.

config-ad-8

Once the server is done, reboot. Now we have successfully installing and configuring an Active Directory Domain Services on Windows Server 2012.