ATLAS/LHC Sensors 


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Dark Matter 






[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Solaris: Veritas and IO disk performance via iostat 
Solaris Performance Monitoring & Tuning - iostat , vmstat & netstat

Rules-of-thumb for monitoring Sun Solaris statistics


#!/usr/bin/bash
IO_LOG="/var/tmp/io_log.txt"
while true
do

date >> ${IO_LOG}
iostat -xdn 10 6 >> ${IO_LOG}
done


#!/usr/bin/bash

# this script parses the output and translates the disk path to VERITAS volume

# vc_t = average service time in milliseconds
# b% = percentage of time the disk is busy per interval

# I found some recommendation for Solaris the percentage
# busy should be less than 5% and the average service time
# less than 30 ms. If the numbers are below the treshold
# mentioned then a machine should perform io smoothly.
#

MAX_P_BUSY=4

cat io_log.txt | \
grep -v "extended" | \
grep -v "asvc_t" | \
grep -v "<<" | \
grep -v "0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0" | \
while read line
do
# grep for "MEST 2008" to get date timestamp
echo $line | grep "MEST 2008" > /dev/null
if [ $? -eq 1 ]; then

ASVC_T=`echo $line | awk -F" " '{ print $8 }'`;
P_BUSY=`echo $line | awk -F" " '{ print $10 }'`;
DEVICE_PATH=`echo $line | awk -F" " '{ print $11 }'`;

#echo $line
if [ $P_BUSY -gt $MAX_P_BUSY ]; then

VERITAS_PARTITION=`vxdisk path | grep ${DEVICE_PATH} | grep "dg" | awk -F" " '{ print $4 }' | gawk '{ sub(/dg/, ""); print }'`

echo -n "${TIME_ST}"
echo -n " VXDISK: ${VERITAS_PARTITION}"
echo -n " Service time: ${ASVC_T}"
echo -n " Percentage busy: ${P_BUSY}"
echo " Device path: ${DEVICE_PATH}"
fi

else
TIME_ST=`echo $line`
fi
done


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Vista: powershell 1.0 





CommandType     Name                                                Definition
----------- ---- ----------
Cmdlet Add-Content Add-Content [-Path] <String[]> [-Value] <Object[...
Cmdlet Add-History Add-History [[-InputObject] <PSObject[]>] [-Pass...
Cmdlet Add-Member Add-Member [-MemberType] <PSMemberTypes> [-Name]...
Cmdlet Add-PSSnapin Add-PSSnapin [-Name] <String[]> [-PassThru] [-Ve...
Cmdlet Clear-Content Clear-Content [-Path] <String[]> [-Filter <Strin...
Cmdlet Clear-Item Clear-Item [-Path] <String[]> [-Force] [-Filter ...
Cmdlet Clear-ItemProperty Clear-ItemProperty [-Path] <String[]> [-Name] <S...
Cmdlet Clear-Variable Clear-Variable [-Name] <String[]> [-Include <Str...
Cmdlet Compare-Object Compare-Object [-ReferenceObject] <PSObject[]> [...
Cmdlet ConvertFrom-SecureString ConvertFrom-SecureString [-SecureString] <Secure...
Cmdlet Convert-Path Convert-Path [-Path] <String[]> [-Verbose] [-Deb...
Cmdlet ConvertTo-Html ConvertTo-Html [[-Property] <Object[]>] [-InputO...
Cmdlet ConvertTo-SecureString ConvertTo-SecureString [-String] <String> [[-Sec...
Cmdlet Copy-Item Copy-Item [-Path] <String[]> [[-Destination] <St...
Cmdlet Copy-ItemProperty Copy-ItemProperty [-Path] <String[]> [-Destinati...
Cmdlet Export-Alias Export-Alias [-Path] <String> [[-Name] <String[]...
Cmdlet Export-Clixml Export-Clixml [-Path] <String> [-Depth <Int32>] ...
Cmdlet Export-Console Export-Console [[-Path] <String>] [-Force] [-NoC...
Cmdlet Export-Csv Export-Csv [-Path] <String> -InputObject <PSObje...
Cmdlet ForEach-Object ForEach-Object [-Process] <ScriptBlock[]> [-Inpu...
Cmdlet Format-Custom Format-Custom [[-Property] <Object[]>] [-Depth <...
Cmdlet Format-List Format-List [[-Property] <Object[]>] [-GroupBy <...
Cmdlet Format-Table Format-Table [[-Property] <Object[]>] [-AutoSize...
Cmdlet Format-Wide Format-Wide [[-Property] <Object>] [-AutoSize] [...
Cmdlet Get-Acl Get-Acl [[-Path] <String[]>] [-Audit] [-Filter <...
Cmdlet Get-Alias Get-Alias [[-Name] <String[]>] [-Exclude <String...
Cmdlet Get-AuthenticodeSignature Get-AuthenticodeSignature [-FilePath] <String[]>...
Cmdlet Get-Command Get-Command [[-ArgumentList] <Object[]>] [-Verb ...
Cmdlet Get-Content Get-Content [-Path] <String[]> [-ReadCount <Int6...
Cmdlet Get-Credential Get-Credential [-Credential] <PSCredential> [-Ve...
Cmdlet Get-Culture Get-Culture [-Verbose] [-Debug] [-ErrorAction <A...
Cmdlet Get-Date Get-Date [[-Date] <DateTime>] [-Year <Int32>] [-...
Cmdlet Get-EventLog Get-EventLog [-LogName] <String> [-Newest <Int32...
Cmdlet Get-ExecutionPolicy Get-ExecutionPolicy [-Verbose] [-Debug] [-ErrorA...
Cmdlet Get-Help Get-Help [[-Name] <String>] [-Category <String[]...
Cmdlet Get-History Get-History [[-Id] <Int64[]>] [[-Count] <Int32>]...
Cmdlet Get-Host Get-Host [-Verbose] [-Debug] [-ErrorAction <Acti...
Cmdlet Get-ChildItem Get-ChildItem [[-Path] <String[]>] [[-Filter] <S...
Cmdlet Get-Item Get-Item [-Path] <String[]> [-Filter <String>] [...
Cmdlet Get-ItemProperty Get-ItemProperty [-Path] <String[]> [[-Name] <St...
Cmdlet Get-Location Get-Location [-PSProvider <String[]>] [-PSDrive ...
Cmdlet Get-Member Get-Member [[-Name] <String[]>] [-InputObject <P...
Cmdlet Get-PfxCertificate Get-PfxCertificate [-FilePath] <String[]> [-Verb...
Cmdlet Get-Process Get-Process [[-Name] <String[]>] [-Verbose] [-De...
Cmdlet Get-PSDrive Get-PSDrive [[-Name] <String[]>] [-Scope <String...
Cmdlet Get-PSProvider Get-PSProvider [[-PSProvider] <String[]>] [-Verb...
Cmdlet Get-PSSnapin Get-PSSnapin [[-Name] <String[]>] [-Registered] ...
Cmdlet Get-Service Get-Service [[-Name] <String[]>] [-Include <Stri...
Cmdlet Get-TraceSource Get-TraceSource [[-Name] <String[]>] [-Verbose] ...
Cmdlet Get-UICulture Get-UICulture [-Verbose] [-Debug] [-ErrorAction ...
Cmdlet Get-Unique Get-Unique [-InputObject <PSObject>] [-AsString]...
Cmdlet Get-Variable Get-Variable [[-Name] <String[]>] [-ValueOnly] [...
Cmdlet Get-WmiObject Get-WmiObject [-Class] <String> [[-Property] <St...
Cmdlet Group-Object Group-Object [[-Property] <Object[]>] [-NoElemen...
Cmdlet Import-Alias Import-Alias [-Path] <String> [-Scope <String>] ...
Cmdlet Import-Clixml Import-Clixml [-Path] <String[]> [-Verbose] [-De...
Cmdlet Import-Csv Import-Csv [-Path] <String[]> [-Verbose] [-Debug...
Cmdlet Invoke-Expression Invoke-Expression [-Command] <String> [-Verbose]...
Cmdlet Invoke-History Invoke-History [[-Id] <String>] [-Verbose] [-Deb...
Cmdlet Invoke-Item Invoke-Item [-Path] <String[]> [-Filter <String>...
Cmdlet Join-Path Join-Path [-Path] <String[]> [-ChildPath] <Strin...
Cmdlet Measure-Command Measure-Command [-Expression] <ScriptBlock> [-In...
Cmdlet Measure-Object Measure-Object [[-Property] <String[]>] [-InputO...
Cmdlet Move-Item Move-Item [-Path] <String[]> [[-Destination] <St...
Cmdlet Move-ItemProperty Move-ItemProperty [-Path] <String[]> [-Destinati...
Cmdlet New-Alias New-Alias [-Name] <String> [-Value] <String> [-D...
Cmdlet New-Item New-Item [-Path] <String[]> [-ItemType <String>]...
Cmdlet New-ItemProperty New-ItemProperty [-Path] <String[]> [-Name] <Str...
Cmdlet New-Object New-Object [-TypeName] <String> [[-ArgumentList]...
Cmdlet New-PSDrive New-PSDrive [-Name] <String> [-PSProvider] <Stri...
Cmdlet New-Service New-Service [-Name] <String> [-BinaryPathName] <...
Cmdlet New-TimeSpan New-TimeSpan [[-Start] <DateTime>] [[-End] <Date...
Cmdlet New-Variable New-Variable [-Name] <String> [[-Value] <Object>...
Cmdlet Out-Default Out-Default [-InputObject <PSObject>] [-Verbose]...
Cmdlet Out-File Out-File [-FilePath] <String> [[-Encoding] <Stri...
Cmdlet Out-Host Out-Host [-Paging] [-InputObject <PSObject>] [-V...
Cmdlet Out-Null Out-Null [-InputObject <PSObject>] [-Verbose] [-...
Cmdlet Out-Printer Out-Printer [[-Name] <String>] [-InputObject <PS...
Cmdlet Out-String Out-String [-Stream] [-Width <Int32>] [-InputObj...
Cmdlet Pop-Location Pop-Location [-PassThru] [-StackName <String>] [...
Cmdlet Push-Location Push-Location [[-Path] <String>] [-PassThru] [-S...
Cmdlet Read-Host Read-Host [[-Prompt] <Object>] [-AsSecureString]...
Cmdlet Remove-Item Remove-Item [-Path] <String[]> [-Filter <String>...
Cmdlet Remove-ItemProperty Remove-ItemProperty [-Path] <String[]> [-Name] <...
Cmdlet Remove-PSDrive Remove-PSDrive [-Name] <String[]> [-PSProvider <...
Cmdlet Remove-PSSnapin Remove-PSSnapin [-Name] <String[]> [-PassThru] [...
Cmdlet Remove-Variable Remove-Variable [-Name] <String[]> [-Include <St...
Cmdlet Rename-Item Rename-Item [-Path] <String> [-NewName] <String>...
Cmdlet Rename-ItemProperty Rename-ItemProperty [-Path] <String> [-Name] <St...
Cmdlet Resolve-Path Resolve-Path [-Path] <String[]> [-Credential <PS...
Cmdlet Restart-Service Restart-Service [-Name] <String[]> [-Force] [-Pa...
Cmdlet Resume-Service Resume-Service [-Name] <String[]> [-PassThru] [-...
Cmdlet Select-Object Select-Object [[-Property] <Object[]>] [-InputOb...
Cmdlet Select-String Select-String [-Pattern] <String[]> -InputObject...
Cmdlet Set-Acl Set-Acl [-Path] <String[]> [-AclObject] <ObjectS...
Cmdlet Set-Alias Set-Alias [-Name] <String> [-Value] <String> [-D...
Cmdlet Set-AuthenticodeSignature Set-AuthenticodeSignature [-FilePath] <String[]>...
Cmdlet Set-Content Set-Content [-Path] <String[]> [-Value] <Object[...
Cmdlet Set-Date Set-Date [-Date] <DateTime> [-DisplayHint <Displ...
Cmdlet Set-ExecutionPolicy Set-ExecutionPolicy [-ExecutionPolicy] <Executio...
Cmdlet Set-Item Set-Item [-Path] <String[]> [[-Value] <Object>] ...
Cmdlet Set-ItemProperty Set-ItemProperty [-Path] <String[]> [-Name] <Str...
Cmdlet Set-Location Set-Location [[-Path] <String>] [-PassThru] [-Ve...
Cmdlet Set-PSDebug Set-PSDebug [-Trace <Int32>] [-Step] [-Strict] [...
Cmdlet Set-Service Set-Service [-Name] <String> [-DisplayName <Stri...
Cmdlet Set-TraceSource Set-TraceSource [-Name] <String[]> [[-Option] <P...
Cmdlet Set-Variable Set-Variable [-Name] <String[]> [[-Value] <Objec...
Cmdlet Sort-Object Sort-Object [[-Property] <Object[]>] [-Descendin...
Cmdlet Split-Path Split-Path [-Path] <String[]> [-LiteralPath <Str...
Cmdlet Start-Service Start-Service [-Name] <String[]> [-PassThru] [-I...
Cmdlet Start-Sleep Start-Sleep [-Seconds] <Int32> [-Verbose] [-Debu...
Cmdlet Start-Transcript Start-Transcript [[-Path] <String>] [-Append] [-...
Cmdlet Stop-Process Stop-Process [-Id] <Int32[]> [-PassThru] [-Verbo...
Cmdlet Stop-Service Stop-Service [-Name] <String[]> [-Force] [-PassT...
Cmdlet Stop-Transcript Stop-Transcript [-Verbose] [-Debug] [-ErrorActio...
Cmdlet Suspend-Service Suspend-Service [-Name] <String[]> [-PassThru] [...
Cmdlet Tee-Object Tee-Object [-FilePath] <String> [-InputObject <P...
Cmdlet Test-Path Test-Path [-Path] <String[]> [-Filter <String>] ...
Cmdlet Trace-Command Trace-Command [-Name] <String[]> [-Expression] <...
Cmdlet Update-FormatData Update-FormatData [[-AppendPath] <String[]>] [-P...
Cmdlet Update-TypeData Update-TypeData [[-AppendPath] <String[]>] [-Pre...
Cmdlet Where-Object Where-Object [-FilterScript] <ScriptBlock> [-Inp...
Cmdlet Write-Debug Write-Debug [-Message] <String> [-Verbose] [-Deb...
Cmdlet Write-Error Write-Error [-Message] <String> [-Category <Erro...
Cmdlet Write-Host Write-Host [[-Object] <Object>] [-NoNewline] [-S...
Cmdlet Write-Output Write-Output [-InputObject] <PSObject[]> [-Verbo...
Cmdlet Write-Progress Write-Progress [-Activity] <String> [-Status] <S...
Cmdlet Write-Verbose Write-Verbose [-Message] <String> [-Verbose] [-D...
Cmdlet Write-Warning Write-Warning [-Message] <String> [-Verbose] [-D...


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Caching only name server example 
// a sample caching only DNS server example

// internal LAN clients range
acl internals { 172.16.72.0/24; 192.168.1.0/24; };

// DMZ clients range IP
acl externals { bastion-ips-go-here; };

options {
listen-on
{
address_match_list;
address_match_list;
};

// IP to be used as the source for outgoing queries
query-source address 192.168.2.3;

// forward to external servers
forward only;
forwarders
{
bastion-ips-go-here;
};

// sample allow-transfer (no one)
allow-transfer { none; };

// restrict query access
allow-query
{
internals;
externals;
};

};


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Linux: Squid delay pools to shape web traffic 
This example sets squid to shape traffic to 2mbit/s.

delay_pools 1
delay_class 1 1
delay_parameters 1 512000/2048000
acl All src 0/0
delay_access 1 allow All


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Linux: Squid uses eth1 only (two providers scenario) 
The scenario: you got a server which acts as a proxy, mail server, pop server and serves dns. You got one internet connection which is symmetrical one, then found you got a lot of http/s traffic generated from the squid. You added the second interface and bought second line, asymmetric (some DSL) to save the first line from web. You intend to pass all the web traffic through eth1 interface. All other services you pump via eth0.

It is not necessary to mark the traffic with iptables and generate a whole new routing table while system scripts already prepared the base for us to use the eth0. Just a little tweaking and your squid http/s will go though eth1 (in our demo case its ISP2).

First, tell the squid to use the IP address bound to eth1 (ISP2 interface, let's say IP is 192.168.16.253). Squid.conf now inherits:

tcp_outgoing_address 192.168.16.253


If you not add the line above, squid will use the first card's IP (IP of eth0) as its outgoing address.

When two network interfaces are present in system while each one is connected to different provider the default system routing option is to pass everything except neighbour network address using the default gateway.

In our case all is still going through eth0 even we set the squid to use eth1 IP. This is what we do not want.

To modify default behaviour you are supposed to modify a routing table. But why to modify a whole table, when system already prepared useful records in default. We will just add. Yes, we will add rule which says the second's interface ranged packets
will use ISP2 default gateway.

We will put the additional routing information in the ip routing table (called ISP2). First, choose number for ISP2 table and write the definition to /etc/iproute2/rt_tables file. It is simple:

echo "110     ISP2" >> /etc/iproute2/rt_tables


Then add the script which will tell the system to route all what is originating from eth1 card and range via default gateway for your ISP2. Following script will do that:

#!/bin/bash

# check if defaul route for ISP2 already exists, if yes exit
RETVAL=`/sbin/ip route show table ISP2 | grep default | wc -l`
[ $RETVAL -eq 1 ] && exit

ip route add FIRST_CARD_NETWORK/28 dev eth0 src FIRST_IFACE_IP table ISP2
ip route add SECOND_CARD_NETWORK/24 dev eth1 src SECOND_IFACE_IP table ISP2
ip route add default via DEFAULT_ROUTE_FOR_ISP2 table ISP2

# set the rule for our routing
ip rule add from SECOND_NETWORK_SUBNET/28 table ISP2

# flush cache
ip route flush cache



The most important line says "route all traffic which source is a.b.c.d using other routing table than default":

ip rule add from SECOND_NETWORK_SUBNET/28         table   ISP2


The trick is the table ISP2 contains the new default gateway.

To show a new routing table for specific ISP:

ip route show table NAME



[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Vista: TCP/IP - registry keys 
The Maximum Data Packed Size
\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Adapters
The size of the Receive Window
\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
The size of the Default Time To Live
\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
The Timestamps and Window Scaling options
\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
The number of duplicate ACKs
\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
The automatic MTU discovery
\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
The ACK (SACK - RFC 2018) support
\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
The number of simultaneous connections per HTTP1.0 (MaxConnectionsPerServer)
\Software\Microsoft\Windows\CurrentVersion\Internet Settings
The number of simultaneous connections per HTTP1.1 (MaxConnectionsPerServer)
\Software\Microsoft\Windows\CurrentVersion\Internet Settings
The maximum number of TCP connections
\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
The default SizReqBuf value
\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Vista: Disable superfetch in vista - registry key 
You can change the behaviour of the prefetch via registry entry (setting the keys in the following path):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters\EnableSuperfetch

1 prefetches boot processes,
2 prefetches applications
3 is to enable both

Disabling all prefetch in registry (setting 0) will generate error in logs:

The Superfetch service terminated with the following error:
The operating system is not presently configured to run this application.


If you decided to disable prefetch completely, it is better to disable the whole prefetch service via services (just tyoe services (%SystemRoot%\system32\services.msc).

http://www.davidnaylor.co.uk/

[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Solaris: find the whole path and the name of running script using pmap 
#!/usr/bin/bash
PROCID=$$
SHRUNDIRECTORY=$PWD
SCRIPTSHELLPATH=`pmap $PROCID | head -1 | awk '{ print $3 }'`
MYPATH="${SHRUNDIRECTORY}${SCRIPTSHELLPATH}"
echo $MYPATH | gawk '{ sub(/\./, ""); print }'


[ add comment ]   |  [ 0 trackbacks ]   |  permalink

<<First <Back | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Next> Last>>