Mandalika's scratchpad [ Work blog @Oracle | My Music Compositions ]

Old Posts: 09.04  10.04  11.04  12.04  01.05  02.05  03.05  04.05  05.05  06.05  07.05  08.05  09.05  10.05  11.05  12.05  01.06  02.06  03.06  04.06  05.06  06.06  07.06  08.06  09.06  10.06  11.06  12.06  01.07  02.07  03.07  04.07  05.07  06.07  08.07  09.07  10.07  11.07  12.07  01.08  02.08  03.08  04.08  05.08  06.08  07.08  08.08  09.08  10.08  11.08  12.08  01.09  02.09  03.09  04.09  05.09  06.09  07.09  08.09  09.09  10.09  11.09  12.09  01.10  02.10  03.10  04.10  05.10  06.10  07.10  08.10  09.10  10.10  11.10  12.10  01.11  02.11  03.11  04.11  05.11  07.11  08.11  09.11  10.11  11.11  12.11  01.12  02.12  03.12  04.12  05.12  06.12  07.12  08.12  09.12  10.12  11.12  12.12  01.13  02.13  03.13  04.13  05.13  06.13  07.13  08.13  09.13  10.13  11.13  12.13  01.14  02.14  03.14  04.14  05.14  06.14  07.14  09.14  10.14  11.14  12.14  01.15  02.15  03.15  04.15  06.15  09.15  12.15  01.16  03.16  04.16  05.16  06.16  07.16  08.16  09.16  12.16  01.17  02.17  03.17  04.17  06.17  07.17  08.17  09.17  10.17  12.17  01.18  02.18  03.18  04.18  05.18  06.18  07.18  08.18  09.18  11.18  12.18  01.19  02.19  05.19  06.19  08.19  10.19  11.19  05.20  10.20  11.20  12.20  09.21  11.21  12.22 


Monday, March 31, 2014
 
[Solaris] ZFS Pool History, Writing to System Log, Persistent TCP/IP Tuning, ..

.. with plenty of examples and little comments aside.

[1] Check existing DNS client configuration

Solaris 11 and later:

% svccfg -s network/dns/client listprop config
config                      application        
config/value_authorization astring     solaris.smf.value.name-service.dns.client
config/options             astring     "ndots:2 timeout:3 retrans:3 retry:1"
config/search             astring     "sfbay.sun.com" "us.oracle.com" "oraclecorp.com" "oracle.com" "sun.com"
config/nameserver         net_address xxx.xx.xxx.xx xxx.xx.xxx.xx xxx.xx.xxx.xx

Solaris 10 and prior:

Check the contents of /etc/resolv.conf

% cat /etc/resolv.conf
search  sfbay.sun.com us.oracle.com oraclecorp.com oracle.com sun.com
options ndots:2 timeout:3 retrans:3 retry:1
nameserver      xxx.xx.xxx.xx
nameserver      xxx.xx.xxx.xx
nameserver      xxx.xx.xxx.xx

Note that /etc/resolv.conf file exists on Solaris 11.x releases too as of today.

[2] Logical domains: finding out the hostname of control domain

Use virtinfo(1M) command.

root@ppst58-cn1-app:~# virtinfo -a
Domain role: LDoms guest I/O service root
Domain name: n1d2
Domain UUID: 02ea1fbe-80f9-e0cf-ecd1-934cf9bbeffa
Control domain: ppst58-01
Chassis serial#: AK00083297

The above output shows that n1d2 domain is a guest domain, which is also an I/O domain, the service domain and a root I/O domain. Control domain is running on host ppst58-01.

Output from control domain:

root@ppst58-01:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    64    130304M  0.1%  0.1%  243d 2h 
n1d1             active     -n----  5001    448   916992M  0.2%  0.2%  3d 15h 26m
n1d2             active     -n--v-  5002    512   1T       0.0%  0.0%  3d 15h 29m

root@ppst58-01:~# virtinfo -a
Domain role: LDoms control I/O service root
Domain name: primary
Domain UUID: 19337210-285a-6ea4-df8f-9dc65714e3ea
Control domain: ppst58-01
Chassis serial#: AK00083297

[3] Administering NFS configuration

Solaris 11 and later:

Use sharectl(1M) command. Solaris 11.x releases include the sharectl administrative tool to configure and manage file-sharing protocols such as NFS, SMB, autofs.

eg.,
Display all property values of NFS:

# sharectl get nfs
servers=1024
lockd_listen_backlog=32
lockd_servers=1024
grace_period=90
server_versmin=2
server_versmax=4
client_versmin=2
client_versmax=4
server_delegation=on
nfsmapid_domain=
max_connections=-1
listen_backlog=32
..
..

# sharectl status
autofs  online client
nfs     disabled

eg.,
Modifying the nfs v4 grace period from the default 90s to 30s:

# sharectl get -p grace_period nfs
grace_period=90
# sharectl set -p grace_period=30 nfs
# sharectl get -p grace_period nfs
grace_period=30

Solaris 10 and prior:

Edit /etc/default/nfs file, and restart NFS related service(s).

[4] Examining ZFS Storage Pool command history

Solaris 10 8/07 and later releases log successful zfs and zpool commands that modify the underlying pool state. All those executed commands can be examined by running zpool history command. Because this command shows the actual zfs commands executed as they are, the 'history' feature is really useful in troubleshooting an error scenario that was resulted from executing some zfs command.

# zpool list
NAME       SIZE  ALLOC  FREE  CAP  DEDUP   HEALTH  ALTROOT
rpool      416G   152G  264G  36%  1.00x   ONLINE  -
zs3actact  848G  17.4G  831G   2%  1.00x   ONLINE  -

# zpool history -l zs3actact
History for 'zs3actact':
2014-03-19.22:02:32 zpool create -f zs3actact c0t600144F0AC6B9D2900005328B7570001d0 [user root on etc25-appadm05:global]
2014-03-19.22:03:12 zfs create zs3actact/iscsivol1 [user root on etc25-appadm05:global]
2014-03-19.22:03:33 zfs set recordsize=128k zs3actact/iscsivol1 [user root on etc25-appadm05:global]

Note that this log is enabled by default, and cannot be disabled.

[5] Modifying TCP/IP configuration parameters

Using ndd(1M) is the old way of tuning TCP/IP parameters, and still supported as of today (in Solaris 11.x releases). However using padm(1M) command is the recommended way to modify or retrieve TCP/IP Internet protocols on Solaris 11.x and later releases.

# ipadm show-prop -p max_buf tcp
PROTO PROPERTY              PERM CURRENT      PERSISTENT   DEFAULT      POSSIBLE
tcp   max_buf               rw   1048576      --           1048576      128000-1073741824

# ipadm set-prop -p max_buf=2097152 tcp

# ipadm show-prop -p max_buf tcp
PROTO PROPERTY              PERM CURRENT      PERSISTENT   DEFAULT      POSSIBLE
tcp   max_buf               rw   2097152      2097152      1048576      128000-1073741824

ndd style (still valid):

# ndd -get /dev/tcp tcp_max_buf
1048576

# ndd -set /dev/tcp tcp_max_buf 2097152

# ndd -get /dev/tcp tcp_max_buf
2097152

One of the advantages of using ipadm over ndd is that the configured/tuned non-default values are persistent across reboots. In case of ndd, we have to re-apply those values either manually or by creating a Run Control script (/etc/rc*.d/S*) to make sure that the intended values are set automatically during a reboot of the system.

[6] Writing to system log from a shell script

Use logger(1) command as shown in the following example.

eg.,

# logger -p local0.warning Big Brother is watching you

# dmesg | tail -1
Mar 30 18:42:14 etc27zadm01 root: [ID 702911 local0.warning] Big Brother is watching you

Check syslog.conf(4) man page for the list of available system facilities and the severity of the condition being logged (levels).

BONUS:

[*] Forceful NFS unmount on Linux

Try the lazy unmount option (-l) on systems running Linux kernel 2.4.11 or later to forcefully unmount a filesystem that keeps throwing Device or resource busy and/or device is busy error(s).

eg.,

# umount -f /bkp
umount2: Device or resource busy
umount: /bkp: device is busy
umount2: Device or resource busy
umount: /bkp: device is busy

# umount -l /bkp
#

Labels:




Saturday, March 15, 2014
 
Blast from the Past : The Weekend Playlist #5

Final exclusive playlist dedicated for the 80s -- 16 songs -- list dominated by English performers. Enjoy.

Access previous playlists from the following locations:

    Blast from the Past : The Weekend Playlist #4 (80s)
    Blast from the Past : The Weekend Playlist #3 (80s)
    Blast from the Past : The Weekend Playlist #2 (80s)
    Blast from the Past : The Weekend Playlist #1 (50s, 60s and 70s)

Audio-Visual material courtesy: YouTube. Other information: Wikipedia.

1. The Rave-Ups - Positively Lost Me (1985)

Featured in movie, Pretty in Pink.

2. Pet Shop Boys - West End Girls (1984)

#1 on Billboard's Hot Dance Music/Club Play chart.

3. Roxy Music - Avalon (1982)

Enjoy.

4. Billy Ocean - Caribbean Queen (No More Love On The Run) (1984)

#1 on Billboard Hot 100 singles chart.

5. George Thorogood - Bad to the Bone (1982)

Featured in Terminator 2: Judgment Day.

6. Mike + The Mechanics - The Living Years (1989)

Nominated, but lost the Grammy Song of the Year to Bette Midler's Wind Beneath My Wings.

7. Milli Vanilli - Blame It On The Rain (1989)

Lip-synch'd - but a cool song overall.

8. The Cult - Love Removal Machine (1987)

Named the 74th best hard rock song of all time by VH1. Skip to 0:45s

9. Echo & the Bunnymen - Cutter (1983)

Spare us the cutter.

10. Daryl Hall & John Oates - Maneater (1982)

#1 on Billboard Hot 100 singles for 4 weeks.

11. Soul II Soul - Back to Life (However Do You Want Me) (1989)

Grammy winner.

12. Peter Gabriel - In Your Eyes (1986)

Promptly featured in the movie, Say Anything...

13. George Michael - Father Figure (1988)

Another #1 song, another English performer.

14. Georgia Satellites - Keep Your Hands To Yourself (1986)

Missed #1 spot by a hair.

15. Murray Head - One Night In Bangkok (1984)

Enjoy. Skip to 0:52s

16. Starship - "Nothing's Gonna Stop Us Now (1987)

#1 on on Billboard Hot 100 singles chart. Featured in movie, Mannequin.

Labels:




Friday, March 07, 2014
 
[Economics] Inflation

inflation

Inflation is the persistent rise in the prices of goods and services in an economy over a period of time, leading to a reduction in the purchasing power as each unit of currency buys fewer goods and services.

Price inflation is measured by the inflation rate, the percentage change of prices calculated on a monthly or annual basis in a price index. Around the world, the Consumer Price Index (CPI) is the most commonly used index to calculate the inflation rate, which measures the price of a representative selection of goods and services for a typical consumer. For example, if the inflation rate is measured at 5%, a loaf of bread that costs $1 today will cost $1.05 in a year.


What causes inflation?

There are at least three theories that are generally accepted.

  1. In a booming economy, strong consumer demand for goods and services may outweigh the aggregate supply and cause the price levels to rise. In other words, if demand is growing faster than supply, prices will increase. This is often referred as Demand-Pull Inflation, a term mostly associated with Keynesian economics.

    Most modern asset bubbles including the U.S. housing bubble which peaked in 2006 fall into this category. The increase in the value of Gold in the aftermath of 2008 financial crisis is another example.

  2. An increase in prices of inputs like wages, taxes, imports and raw materials, or other influential factors such as natural disasters, depletion of natural resources, government regulation, change in exchange rates etc., may push the costs of production higher and weaken the supply of goods as it becomes more expensive now to make the same volume as they were before the surge in production costs. While the demand for these goods remain consistent, the shortage in supply causes a rise in the overall price level. In other words, inflation happens when costs increase independently of aggregate demand. This type of inflation is referred as Cost-Push Inflation, another term associated with Keynesian economics.

    In 2011, the earthquake and tsunami disaster caused inflation to go up temporarily in deflation-ridden Japan.

    As the push for higher federal minimum wages has gained momentum in U.S. these days, the naysayers often cite references to cost-push inflation -- they argue that if the base wages are raised, the manufacturers may feel obligated to pass these increases onto consumers in the form of higher prices.

  3. Over expansion or increase in the money supply in the form of cash and credit may create inflation. If a country prints too much money, the value of the money decreases proportional to the amount of money that was printed. Despite no changes to the aggregate demand or supply, having too much money chasing too few goods can cause the prices of just about everything to increase. If too much money is printed, it becomes worthless to the point where objects are exchanged for goods in place of paper money (bartering).

    zimbabwe inflation

    In year 2000, Zimbabwean Government engaged in money creation activity to fund the Congo war. Coupled with the fact that the money was created with nothing to back it up to give it a value, droughts and private farm confiscation by the government further weakened the supply of food and other locally produced goods. Eventually people holding the Zimbabwean dollar (symbol: Z$) lost confidence in its ability to retain its value, and the series of events that followed led to prolonged hyperinflation between years 2004 and 2009, which ultimately ended with the demise of the Zimbabwean dollar in April 2009. The peak month of hyperinflation occurred in mid-November 2008 with a rate estimated at 79.6 billion percent per month.

    Hyperinflation is not purely a monetary phenomenon — massive supply shock often coupled with external debt denominated in a foreign currency may create a situation involving social unrest that give rise to hyperinflation. A supply shock is an event that suddenly changes the price of a commodity or service mostly due to wars or natural disasters. The collapse of the Austro-Hungarian Empire, Yugoslavia, and the Soviet Union all led to the emergence of hyperinflation.

Source: various including investopedia, wikipedia, economicshelp.org, James Montier’s writings

(To be continued ..)

Labels:





2004-2019 

This page is powered by Blogger. Isn't yours?