Monday, June 22, 2009

[RedHat Enterprise Linux] How to install NIS server integrated with NFS Server

Before installing NIS server in order NIS client to be able to authenticate to NIS server, we need to install NFS server first. Below is the tutorial how to install NFS and NIS.

Installing and configuring NFS
Make sure the NFS service is enabled by doing these commands:

# service nfs status

If the NFS service is not enabled , then we should enable it by commanding:

# service nfs start
# chkconfig nfs on

Then do these command below:

# rpcinfo -p localhost
# showmount -e localhost

Edit file in /etc/sysconfig/nfs
MOUNTD_PORT="4002"
STATD_PORT="4003"
LOCKD_TCPPORT="4004"
LOCKD_UDPPORT="4004"
RQUOTAD_PORT="4005"

Then make sure the ports are opened in the firewall
4002-4005 tcp
4002-4005 udp

Edit file in /etc/exports
/directory_you_want_to_share_with *.domain-name.com(rw,sync)
!wq

Then do the following commands:
# exportfs -a
# exportfs -ra


Installing and configuring NIS Server
1. Ensure the following rpms are already installed , they are:
ypserv, portmap, and make

Configure
ypserv, vppasswdd, ypxfrd in order to be on specific ports.
edit /etc/sysconfig/network
YPSERV_ARGS="-p 835"
YPXFRD_ARGA="-p 836"


2. edit file in /etc/sysconfig/yppasswdd
YPPASSWDD_ARGS="--port 837"

3. edit /etc/sysconfig/network
NISDOMAIN=yourdomain

4. Restrict access to ypserv to your network
Edit file in /var/yp/securenets
255.255.255.255 127.0.0.1
255.255.255.0 192.168.0.0

5. Start all services and ensure it to start on boot
Edit file in /var/yp/makefile
Look for the all: target and edit it to read
all: passwd group hosts netid

6. Generate NIS map (database) by running ypinit using this following command:
/usr/lib/yp/ypinit -m
Then press CTRL+D
Then press Y

7. Start the yppasswdd service by doing the following command:
# service yppasswdd start
# chkconfig yppasswdd on

8. Verify the services have been started by doing the following command:
# ps aux|grep yp

9. # cd /var/yp
# make

10. Verify the services have been registered with portmap by doing the following command:
# rpcinfo -p localhost
11. For tracing the error, check the log in /var/log/messages





[Trading] Candlestick Pattern Part II: Some familiar candles

In candlestick patterns, there are some patterns that may make you familiar. They are :


Figure 1. Basic Doji Pattern


Figure 2. Gravestone Doji


Figure 3. Spinning Top Doji



Figure 4. Shooting Star/Inverted Hammer



Figure 5.Hanging Man/Hammer



Figure 5. Long Leg Doji

Those basic common candlesticks above will be used to determine the bullish/bearish reversal pattern ,continuation and consolidation pattern. In the reversal pattern, there are some called high reliability and medium reliability depends on the candlestick High reliability patterns in bullish reversal for example are morning star, piercing line, three white soldier, etc. This patterns will be discussed in part III

Thursday, June 11, 2009

[My Life Sharing] Old animated TV series Part I: Centurions

When I was still very very young, at age 5. I everyday watched american animated tv series named Centurions. Do you still remember Centurions? Centurions a 30 minute american science fiction animated tv series.

I try to remember it and searched everywhere in google. I collect the information to remind you of centurions maniac. Below I will simply tell the characters and some of their weapons (forgive me if they are not too complete)

Characters:
Originally there are three Centurions but later two other Centurions were also there:
  • Max Ray - 'Brilliant' Sea Operations Commander
  • Jake Rockwell - 'Rugged' Land Operations Specialist
  • Ace McCloud - 'Daring' Air Operations Expert
  • Rex Charger - ‘Expert’ Energy program
  • John Thunder – ‘Specialist’ Infiltration Commander





















Weapon systems:

  • Sky Knight
  • Orbital Interceptor
  • Sky Bolt
  • Cruiser
  • Fireforce
  • Electro Charger Pack
  • etc

If some of you still want to remember about how they perform , see this video below from youtube. Enjoy!!!


Centurions - Double Agent (Part 1 of 3)


Centurions - Double Agent (Part 2 of 3)


[Trading] Candlestick Pattern Part I: What you need to know first

Candlestick pattern originally founded in the 1600s, it is a method of technical analysis which was developed by the Japanese to analyze the price of rice contracts. This technique is called candlestick charting. Steven Nison is credited with popularizing candlestick charting and has become recognized as the leading expert on their interpretation.

Candlestick charts display the open, high, low, and closing prices in a format similar to a modern-day bar-chart, but in a manner that extenuates the relationship between the opening and closing prices. Candlestick charts are simply a new way of looking at prices, they don't involve any calculations.

Figure 1 Body of candlestick


Now, candlestick pattern can be broken down into 3 classifications:
1. Reversal
2. Continuation
3. Consolidation


To be continued to part II..


Wednesday, June 10, 2009

[RedHat Enterprise Linux] Step by step how to set up NTP client and force to automatically sync on RHEL 5.2

There are many ways to setup NTP client in RHEL 5.2. They are:
1. By GUI
- Executing command
system-config-ntp
- Enter the NTP server that wants to be synchronized
- Click "Synch before starting up" in the tab advanced

2. By command line
- Typing
ntpdate -b servername
- Create new cron if you want to force NTP client to update time every exact time.
- Below is the crontab example for NTP client to update time every 10 minutes


# crontab -e

SHELL=bin/bash
*/10 * * * * ntpdate -b
servername






Monday, June 8, 2009

[RedHat Enterprise Linux] How to set iptables in order to collaborate with Squid

Before I begin to deliver the tutorial. I assume there is a Squid installed in your Linux. I am using RHEL 5.2 to do this. Below is the step by step how to do it.

1. Here, I am using a script to manage my iptables. If you don't have the script, first create a new one. It is very simple to do so. Create a new file in your directory and named it with your own, my name is iptables.

# touch /etc/iptables

2. Then, edit that file using vim
# vim /etc/iptables

3. Input this texts into that file
#!/bin/sh
#Squid server address
SQUID_SERVER="x.x.x.x"

#This is for Internet Interface definition
INTERNET="ethx"

#This is for LAN Interface definition
LAN_INx="ethx"
LAN_INy="ethy"


#Squid Port
SQUID_PORT="3128"

#Rules Normalization
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

#Flush All Rules
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X

#Full access for localhost
iptables -I INPUT -i lo -j ACCEPT
iptables -I OUTPUT -o lo -j ACCEPT

#Rules in order packet will automatically established
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

#This rule is for NAT from LAN into Internet
iptables -t nat -A POSTROUTING -o $INTERNET -j MASQUERADE

#These rules are for necessary port to be opened
iptables -A FORWARD -p tcp --dport 25 -j ACCEPT
iptables -A FORWARD -p tcp --dport 110 -j ACCEPT
iptables -A FORWARD -p tcp --dport 138 -j ACCEPT
iptables -A FORWARD -p tcp --dport 443 -j ACCEPT
iptables -A FORWARD -p tcp --dport 8443 -j ACCEPT
iptables -A FORWARD -p tcp --dport 5050 -j ACCEPT
iptables -A FORWARD -p tcp --dport 8443 -j ACCEPT

#Rules for transparent proxy
iptables -t nat -A PREROUTING -i $LAN_IN1 -p tcp --dport 80 -j DNAT --to $SQUID_SERVER:$SQUID_PORT

#Rules for allowing squid, DNS and gateway for accessing the internet
iptables -A INPUT -p tcp --dport 3128 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT

#Logging for troubleshooting
iptables -A INPUT -m limit --limit 2/m --limit-burst 2 -j LOG --log-prefix '** INPUT DROP **'
iptables -A OUTPUT -m limit --limit 2/m --limit-burst 2 -j LOG --log-prefix '** OUTPUT DROP **'
iptables -A FORWARD -m limit --limit 2/m --limit-burst 2 -j LOG --log-prefix '** FORWARD DROP **'

#Default rules
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

#Saving Configuration
service iptables save

4. After that, save that file.
5. Make the file be executeable by doing command like below:
# chmod u+x /etc/iptables

6. Run the iptables file by directly executing the file like below:
# /etc/iptables

7. Test browsing using your browser