Thursday, October 01, 2009

Notable Linux Command-Line for Internet Use

Query Wikipedia Via Console Over DNS
furynax@paranoid:~$ dig +short txt radiohead.wp.dg.cx

"Radiohead are an English alternative rock band from Abingdon, Oxfordshire. The band is composed of Thom Yorke (lead vocals, rhythm guitar, piano, beats), Jonny Greenwood (lead guitar, keyboard, other instruments), Ed O'Brien (guitar, backing vocals), Coli" "n Greenwood (bass guitar) and Phil Selway (drums, percussion). http://a.vu/w:Radiohead"

Twitter Update From Terminal
curl -u YourUsername:YourPassword -d status="Your status message go here" http://twitter.com/statuses/update.xml

Get Your Tweets From The Command Line
curl -s -u user:password 'http://twitter.com/statuses/friends_timeline.xml?count=5' | xmlstarlet sel -t -m '//status' -v 'user/screen_name' -o ': ' -v 'text' -n

Get Random Futurama Quotations From Slashdot.org Servers
furynax@paranoid:~$ echo -e "HEAD / HTTP/1.1\nHost: slashdot.org\n\n" | nc slashdot.org 80 | egrep "Bender|Fry" | sed "s/X-//"
Bender: My full name is Bender Bending Rodriguez.

furynax@paranoid:~$ echo -e "HEAD / HTTP/1.1\nHost: slashdot.org\n\n" | nc slashdot.org 80 | egrep "Bender|Fry" | sed "s/X-//"
Fry: I must be a robot. Why else would human women refuse to date me?

Download Apple Movie Trailers
furynax@paranoid:~$ wget -U "QuickTime/7.6.2 (qtver=7.6.2;os=Windows NT 5.1Service Pack 3)" `echo http://movies.apple.com/movies/focus_features/aseriousman/aseriousman_480p.mov | sed 's/\([0-9][0-9]\)0p/h\10p/'`

--2009-10-01 17:18:39-- http://movies.apple.com/movies/focus_features/aseriousman/aseriousman_h480p.mov
Resolving movies.apple.com... 58.27.186.99, 58.27.186.16
Connecting to movies.apple.com|58.27.186.99|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26735205 (25M) [video/quicktime]
Saving to: `aseriousman_h480p.mov'

Monday, September 28, 2009

Silent Install ZPM Agent from Command Prompt

Windows Agent
- Open Command prompt
- Define host location, serial number, and other optional settings using the following syntax:

With Proxy
msiexec /i "C:\UpdateAgent.msi" /qn HOST="http://myServer" SERIAL="00000000-00000000" USEPROXY=1 PROXYURL="http://myProxy" PROXYUSER="proxyUser" PROXYPASS="proxyPassword" GROUPLIST="GroupName1;GroupName2;GroupNameN"

Without Proxy
msiexec /i "C:\UpdateAgent.msi" /qn HOST="http://myServer" SERIAL="00000000-00000000" USEPROXY=0 GROUPLIST="GroupName1;GroupName2;GroupNameN"

Linux/Unix/Netware/Mac Agent
- Open Command prompt
- Define host location, serial number, and other optional settings using the following syntax:

With Proxy
./install -silent -d "/user/local" -p "http://myServer" -sno "00000000-00000000" -proxy "http://myProxy" -port ## -g "GroupName1;GroupName2;GroupNameN"

Without Proxy
./install -silent -d "/user/local" -p "http://myServer" -sno "00000000-00000000" -g "GroupName1;GroupName2;GroupNameN"

Tuesday, September 01, 2009

BIG-IP Link Controller incorrectly generates an error message when creating a link object

Fresh installation of the BIG-IP Link Controller software, the BIG-IP Link Controller system's mcpd process does not receive the gtmd configuration, although a valid wideip.conf file exists. In addition, attempts to configure a link object will fail with an error message that appears similar to the following example:

010701793: Link (link_name) must have an associated data center

Reload gtmd Configuration
Force the mcpd process to reload the gtmd configuration. To do so, perform the following procedure:

- Log in to the BIG-IP GTM command line.
- Type the following command to reload the configuration: gtmparse -l

[root@furynax:Active] config # gtmparse -1
gtmparse: Initializing ...
/usr/bin/monitors/builtins/gtm_base_monitors.conf: SUCCESS
/usr/local/gtm/include/base_region.ISP: SUCCESS
/config/gtm/wideip.conf: SUCCESS
gtmparse: SUCCESS
[root@furynax:Active] config #

You should now be able to configure the link object.

Manual Configuration on wideip.conf
If you still cannot configure the link object, the BIG-IP Link Controller's auto-configuration process may not have correctly created the wideip.conf file, which contains the required default data center definition that references the box definition for the BIG-IP Link Controller. To ensure that the wideip.conf file contains the required entries, perform the following procedure:

- Log in to the BIG-IP GTM command line.
- Edit the /config/gtm/wideip.conf file in a text editor.
- Ensure that the configuration file contains stanzas that define the data center and the BIG-IP Link Controller object.

For example:

// *** Data Center Definitions (1) ***

datacenter { // 1 server(s)
name "Default DC"
server "LC-fqdn.domain.com"
}

// *** Server Definitions (1) ***

server { // datacenter=Default DC, #VS=0
name "LC-fqdn.domain.com"
type bigip
box { //gtm
address 192.168.1.2
unit_id 1
}
}

Note: Replace LC-fqdn.domain.com with the FQDN of the BIG-IP Link Controller system, and replace 192.168.1.2 with the self IP address that was configured on the BIG-IP Link Controller system during the initial configuration.
- Save and close the file.
- Load the modified configuration by typing the following command: gtmload

[root@furynax:Active] gtm # gtmload
gtmload: Initializing ...
/usr/bin/monitors/builtins/gtm_base_monitors.conf: SUCCESS
/usr/local/gtm/include/base_region.ISP: SUCCESS
/config/gtm/wideip.conf: SUCCESS
gtmload: SUCCESS
[root@furynax:Active] gtm #

Thursday, August 20, 2009

Change iSCSI Client Registry Setting

An iSCSI client on a network experiencing temporary performance issues may lose connection to its virtual resources, causing any applications relying on those resources to crash.

The iSCSI timeout registry settings on the iSCSI client can be changed to be more resistant to temporary network issues.

By default, the Microsoft initiator is able to sustain a network disconnect for up to 60 seconds. Should the network issues last for more than a minute, this can cause issues to the iSCSI client.

To prevent possible influence caused by temporary network outages, the Microsoft iSCSI Registry keys can be altered to extend the disk timeout. Keep in mind that you will need to reboot the machine after modifying the registry key, so it is best to make this registry change during a scheduled maintenance window.

Run regedit and locate the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E97B-xxxxxxxxxxxxxxxx}

This is SCSI and RAID controller class and details can be viewed on the right-hand panel. The key tree can be expanded to reveal additional folders such as 0000, 0001, etc., which are separate adapter instances. Find the one with DriverDesc of Microsoft iSCSI Initiator and navigate to the Parameters folder. On the right hand pane will be several DWORD values such as DelayBetweenReconnect and EnableNOPOut

Change the DWORD value named MaxRequestHoldTime from its default value of 60 to 300 (or from 3c to 12c if the value is in hexadecimal). This change will allow the iSCSI client and its hosted applications to withstand a network outage of up to five minutes.

Determine Replication Throughput Parameter

Two parameters most often used to adjust replication throughput:

Window Size
This is the transport window for the IPStor SAN/IP protocol. The window size is in packets (1500 bytes). The default value is 320, for a window of about 480KB. FalconStor suggests a setting of 1024 for a window of about 1.5 MB. The total window size of data will not actually be sent unless it is generated by outstanding replication commands. Therefore, it doesn't hurt to make this a little larger than necessary.

The following formula can be used to figure out the best possible parameters for window size:

Window-size=Line speed (T1, T3, and OC3)*Latency (millisecond)*1.2(Overhead latency)*2(roundtrip)/1.5

Based on the formula above and a series of tests, we recommend using the default setting for T1 line. It is more than enough to handle even 100ms latency.

For a T3 line, the default setting is also recommended for most cases. If the latency is greater than 50ms, the recommended window-size=1024.

For OC3 line, if the latency is greater than 50ms, the recommended setting will be window-size=4096. However if the latency is greater than 10ms and less than 50ms, the use of such setting may not achieve the best performance. The recommended setting in this case is window-size=640.

Replication-cmdsout
This parameter controls how many outstanding commands are sent by the source IPStor server during replication. The default value is 4. Each command is 64KB in size, so the default is 256 KB of outstanding data. Make sure to specify an appropriate value that keeps the channel full of data.

The following formula can be used to figure out the best possible parameters for replication-cmdsout:

Cmdsout= Line speed (T1, T3, and OC3)*Latency (millisecond)*1.2(Overhead latency)*2(roundtrip)/64

Based on the formula above and a series of tests, we recommend using the default setting for T1 line. It is more than enough to handle even 100ms latency.

For a T3 line, the default setting is also recommended for most cases. If the latency is greater than 50ms, the recommended cmdsout=24.

For OC3 line, if the latency is greater than 50ms, the recommended setting will be cmdsout=84. However if the latency is greater than 10ms and less than 50ms, the use of such setting may not achieve the best performance. The recommended setting in this case is cmdsout=12.

Check the actual window size and replication activity: cat /proc/krudp

The line speed used in the above formulas is MB/s not Mb/s. The latency is one way only. If using the round trip latency, drop the *2 in the formula.

The window size is changed at the server level in the IPStor Console. Right click on the IPStor server name and open the properties window. Under the performance tab, set the window size.

To change the cmdsout, pull down the help menu on the top line bar of the IPStor Console and click ABOUT. Hit the TAB key until the OK button is highlighted. Type sysvar , this will open the system variable window where the replication cmdsout parameter can be adjusted.

Tuesday, August 18, 2009

Reset Websense Password

- Stop Network Agent, filtering service and user service.
- Stop Policy server service
- Edit Config.xml (file inside Websense>bin directory)
- Search for K2097153
- You will find an entry that looks like this: ….“K2097153”>8D8w3jDjksieddmkks
- Please delete the data portion. Should look like this: ….K2097153”>
- Safe file
- Start Policy server service
- Start all other Websense services.

Once this is done, just login to WS manager again and you will be prompted to enter new password.
Do not change anything else in the config.xml file.

SmokePing Installation (Ubuntu 9.04)

Install SmokePing
- Open Terminal
- Type sudo su to ensure you have Root priviledges
- Install Smokeping along with some other recommended packages

aptitude install smokeping curl libauthen-radius-perl libnet-ldap-perl libnet-dns-perl libio-socket-ssl-perl libnet-telnet-perl libsocket6-perl libio-socket-inet6-perl apache2

Configure SmokePing
- Smokeping configuration is in the file /etc/smokeping/config
- Modify some files from /etc/smokeping/config.d directory

vi /etc/smokeping/config.d/General
*** General ***

@include /etc/smokeping/config.d/pathnames

# Please edit this to suit your installation
owner = Falko Timme
contact =" me@example.com"
cgiurl =" http://www.example.com/cgi-bin/smokeping.cgi"
mailhost =" smtp.example.com"
syslogfacility =" local0"
concurrentprobes =" no

Make sure that mailhost contains the primary MX for your email domain

vi /etc/smokeping/config.d/Alerts
*** Alerts ***
to = me@example.com
from = smokealert@example.com
[...]

vi /etc/smokeping/config.d/Targets
[...]
remark = Welcome to the SmokePing website of 'Example Company'
[...]

vi /etc/smokeping/config.d/Targets and edit the configuration accordingly
[...]
+ Local

menu = Local
title = Local Network

++ LocalMachine

menu = Local Machine
title = This host
host = localhost

Save your changes and restart Smokeping
/etc/init.d/smokeping restart

Open a web browser and go to http://www.example.com/cgi-bin/smokeping.cgi

Monday, August 17, 2009

Essential Task in Deployment of BIG-IP Link Controller

Create Default Gateway Pool
- Expand Local Traffic and then click Pools
- Click the Create button
- Name box, type the name of the pool (example : site_gateway_pool)
- In New Members section, add IP addresses associated with each router (example: 10.251.25.1 & 10.251.40.1)
- Configure additional options for the pool as needed.
- Click Finished

Implement Default Gateway Pool
- Expand Network and then click Routes
- Click the Add button
- From the Type list, select Default Gateway
- From the Resource section, select Use Pool
- Select the pool name that represents the group of links you want to use as the default gateway pool (site_gateway_pool)
- Click Finished

Configure Links
- Expand Link Controller and click Links
- Click the Create button
- In the Name box, type a name for the link (example: WAN_Link_1)
- In the Router Address box, type the IP address to associate with the link (Example: 10.251.25.1 - IP address assigned to the router that belongs to the LAN interface)
- In the Uplink Address box, type the IP address to associate with the ISP to which outgoing traffic is sent (Example: 202.12.23.60 - Link Controller uses this address to obtain SNMP statistics from the routers WAN interface)
- In the Service Provider box, type the name of the ISP (Example: GITN)
- Select the health monitors
- Click Finished

Configure Listeners (Node Mode or Bridge Mode)
- Expand Link Controller,and then click Listeners
- Click Create
- In the Destination box, type the IP address on which the LC will listen for network traffic (Example : Wide-IP's IP, DNS IP, Asterix)
- From the VLAN Traffic list, select a VLAN setting appropriate for this listener
- Click Finished

Adding Pools
- Expand Local Traffic and then click Pools
- Click Create
- From the Configuration list, select Advanced
- For the Name setting, type a name for the pool
- Click Finished

Adding Virtual Server
- Expand Local Traffic and then click Virtual Servers
- Click Create
- In the Name box, type the name of the virtual server
- Define the destination of the virtual server (Host/Network)
- In the Address box, type the IP address of the virtual server
- In the Service Port option, type the port number that the virtual server uses
- Click Finished

Configure Wide IPs (FQDN mapping to a set of VS that host the domain content)
- Expand Link Controller
- Click Inbound Wide IPs and then Create button
- In the Name box, type a name that identifies the wide IP
- In the TTL box, type the time-to-live value you want to associate with this wide IP
- Select the appropriate load balancing modes (Preferred, Alternate, and Fallback)
- In the Fallback IP box, type the IP address that the LC uses when it cannot load balance inbound traffic
- For the Virtual Server setting, add the virtual servers that belong to this wide IP
- Click Finished

Configure Address Translation
- Expand Local Traffic, and then click SNATs
- Click Create
- In the Name box, type a unique name for the SNAT
- In the Translation box, select IP Address
- Type an IP address in the adjacent box
- Click Finished

Wednesday, August 12, 2009

Integrate Google Analytics With Juniper IVE Custom Pages

- Go to Juniper Central Manager Page (SA6000)
- Select Authentication > Signing In > Sign-In Pages
- Click Upload Custom Pages
- Click on Sample template link and download it
- Unzip it
- Edit LoginPage.thtml
- Insert Google Analytic Tracking Code (ga.js or urchin.js) before the body tag
- Zip all the files back
- Enter the page name and click Browse button to upload your new zip files
- Go to Authentication > Signing In > Sign-in Policies
- Select your newly created custom page at Sign-In Page drop down menu
- Click Save Changes
- Test your new page functionality using https://www.abc.net/test
- If everything working fine, you may use the login page for the root URL (https://www.abc.net) by changing Sign-In Page at '*/' URL

Monday, August 03, 2009

SQL Server 2005 : Reset SA Password

- Open the SQL Server Management Studio.
- Open a New Query.
- Copy, paste, and execute the following:

GO
ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
GO
USE [master]
GO
ALTER LOGIN [sa] WITH PASSWORD=N’NewPassword’ MUST_CHANGE
GO

(where NewPassword is the password you wish to use for the sa account)