July 2025
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Categories

July 2025
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Installing FIGlet In Linux

Installing FIGlet In Linux
Install a FIGlet utility, to be able to convert text to ASCII Art from the Linux command line.

In Ubuntu, Debian, Linux Mint etc.
$ sudo apt-get install figlet

In CentOS, RHEL, Fedora etc.
$ yum install figlet

Generate ASCII Text Banners

o use FIGlet with its default settings, simply type :

$ figlet “Shell Hacks”
____ _ _ _ _ _ _
/ ___|| |__ ___| | | | | | | __ _ ___| | _____
\___ \| ‘_ \ / _ \ | | | |_| |/ _` |/ __| |/ / __|
___) | | | | __/ | | | _ | (_| | (__| <\__ \ |____/|_| |_|\___|_|_| |_| |_|\__,_|\___|_|\_\___/ To change the font, use the -f option, for example : $ figlet -f digital "Shell Hacks" +-+-+-+-+-+ +-+-+-+-+-+ |S|h|e|l|l| |H|a|c|k|s| +-+-+-+-+-+ +-+-+-+-+-+ Use the -c option if you would prefer centered output : $ figlet -c "Shell Hacks" List FIGlet Fonts Print a list of available FIGlet fonts : $ showfigfonts You can also download and use additional FIGlet fonts, for example : $ wget http://www.figlet.org/fonts/univers.flf $ figlet -f univers.flf "lol" 88 88 88 88 88 88 88 ,adPPYba, 88 88 a8" "8a 88 88 8b d8 88 88 "8a, ,a8" 88 88 `"YbbdP"' 88 Create ASCII Art From Text If you would like to display the output of a command using FIGlet, simply pipe the command into FIGlet : $ date +%r | figlet -f bubble _ _ _ _ _ _ _ _ _ _ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ ( 0 | 4 | : | 5 | 1 | : | 4 | 9 ) ( P | M ) \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ $ echo "WTF?" | figlet -f banner # # ####### ####### ##### # # # # # # # # # # # # # # # # # ##### ### # # # # # # # # # # # ## ## # # # If FIGlet gets its input from a file, use -p option : $ cat myfile Shell Hacks $ figlet -p < myfile ____ _ _ _ _ _ _ / ___|| |__ ___| | | | | | | __ _ ___| | _____ \___ \| '_ \ / _ \ | | | |_| |/ _` |/ __| |/ / __| ___) | | | | __/ | | | _ | (_| | (__| <\__ \ |____/|_| |_|\___|_|_| |_| |_|\__,_|\___|_|\_\___/ Now have fun, creating your own ASCII text banners from the Linux terminal. More information can be found on FIGlet official site.

Modifying Network Parameters in Solaris 10

Modifying Network Parameters in Solaris 10
My reference: The Center for Internet Security (Solaris 10 Benchmarks v4.0). To get the SMF service to run correctly, do the following:

mkdir -m 755 /var/svc/method
chown root:sys /var/svc/method
cd /var/svc/method

cat > cis_netconfig.sh << END #!/sbin/sh #IPv4 source route forwarding is disabled ndd -set /dev/ip ip_forward_src_routed 0 #IPv6 source route forwarding is disabled ndd -set /dev/ip ip6_forward_src_routed 0 #Reverse source routed packets are disabled ndd -set /dev/tcp tcp_rev_src_routes 0 #Forwarding broadcasts are disabled ndd -set /dev/ip ip_forward_directed_broadcasts 0 #Unestablished tcp connection queue are disabled ndd -set /dev/tcp tcp_conn_req_max_q0 4096 #Established tcp connection queue are disabled ndd -set /dev/tcp tcp_conn_req_max_q 1024 #Respond to ICMP timestamp request are disabled ndd -set /dev/ip ip_respond_to_timestamp 0 #Respond to ICMP broadcast timestamp request is disabled ndd -set /dev/ip ip_respond_to_timestamp_broadcast 0 #Respond to ICMP netmask request is disabled ndd -set /dev/ip ip_respond_to_address_mask_broadcast 0 #Respond to ICMP echo broadcast is disabled ndd -set /dev/ip ip_respond_to_echo_broadcast 0 #The ARP cache cleanup interval is disabled ndd -set /dev/arp arp_cleanup_interval 60000 #The ARP IRE scan rate is set to 60000 (milliseconds "1 min") ndd -set /dev/ip ip_ire_arp_interval 60000 #The IPv4 ICMP redirect is disabled ndd -set /dev/ip ip_ignore_redirect 1 #The IPv6 ICMP redirect is disabled ndd -set /dev/ip ip6_ignore_redirect 1 #Extended TCP reserved ports is set to port 6112 ndd -set /dev/tcp tcp_extra_priv_ports_add 6112 #IPv4 strict multihoming system drops any packets that appear to originate from a network attached to another interface ndd -set /dev/ip ip_strict_dst_multihoming 1 #IPv6 strict multihoming system drops any packets that appear to originate from a network attached to another interface ndd -set /dev/ip ip6_strict_dst_multihoming 1 #ICMPv4 redirects are disabled ndd -set /dev/ip ip_send_redirects 0 #ICMPv6 redirects are enabled ndd -set /dev/ip ip6_send_redirects 1 END chown root:sys ./* chmod 555 ./* Now create the service manifest for /var/svc/method/cis_netconfig.sh cat > cis_netconfig.xml << END











END

Now it is time to import the SMF service, by performing the following: svccfg import cis_netconfig.xml.

When the system is rebooted, the cis_netconfig.sh script will be executed and the appropriate network parameters will be updated. Store the file in /var/svc/manifest/site if it has to be re-imported into the system at a later date.

Note that we are creating a new script that will be executed at boot time to reconfigure various network parameters.

The file cis_netconfig.xml is an SMF manifest for the cis_netconfig service. Once imported into the SMF database, the cis_netconfig.sh will run on every system reboot to set the network parameters appropriately.

If this hinders functionality, disable this service by perform the following: svcadm -v disable svc:/site/cis_netconfig:default

anooying ^M characters

When you sometimes copy a file from Windows to UNIX/Solaris or even Linux systems, you can find these anooying ^M characters everywhere. This is because, the file from Windows is in DOS (ASCII) format and needs to be converted to ISO format.

There are many ways to do this. Let’s start with the easy one look at each of them

1. Use dos2unix utility

Solaris pre-installs dos2unix utility into the system to do this job for you. As the name says, it converts the file from DOS format to UNIX format. To do this the syntax is

# dos2unix

for instance

# dos2unix test.txt test2.txt

Where the test.txt is the file you want the ^M characters removed and test2.txt is the file stripped of the ^M characters.

You may also overwrite the existing file by mentioning the source and destination files as same:

# dos2unix test.txt test.txt

2. Using VI

Open the file with “vi” editor and type the following:

:%s/^M//g

NOTE: To get the ^M in there, you should type CTRL+V+M
3. Using “tr” utility

“tr” utility is used to translate characters. Using with “-d” deletes a listed string.

# tr -d ‘\r’

Alternatively, use its octel representation as follows:

# tr -d ‘\015’

PSORIASIS

PSORIASIS

What is psoriasis?

Psoriasis (pronounced without sounding the ‘p’) is a chronic, non-contagious skin condition whereby the skin cells multiply and are replaced too quickly. It is also accompanied by some inflammation. As such, the condition appears as red scaly patches.

What causes psoriasis?

No one really knows what causes psoriasis. There is a family pattern in one third of cases, and it is accepted that heredity plays a part. It is believed that multifactorial inheritance is involved in psoriasis. Certain environmental factors may trigger off psoriasis in persons who are predisposed genetically.

What happens in psoriasis?

There is abnormal cell growth in the skin of susceptible individuals. The turnover of normal skin cells takes place in about 28 days. In psoriasis, skin cells multiply more quickly than usual and move to the top layer of the skin in only 3 to 7 days.

As such the excessive dead skin cells heap up to form the thick white scales that we see on the red elevated patches of psoriasis.

Who gets psoriasis?

Both men and women can be affected by psoriasis equally. It affects about 0.5% to 2.0% of the population. It can also appear at any age, but mostly between the ages of 15 and 35. In Singapore, it is more common among the Indians compared to the other races.

Can diet affect psoriasis?

Although some patients claim that certain foods affect their psoriasis, this has not been confirmed by scientific studies. It is wise to keep to a balanced diet and keep yourself healthy.

Can I catch psoriasis from another affected person?

Psoriasis is not contagious and cannot be spread through touching, eating together or swimming in the same pool.

What can worsen psoriasis?

Mental stress often makes psoriasis worse. Any form of trauma to the skin can also make it worse. Skin injury e.g. cuts, burns, rubbing and scratching often lead to a worsening of psoriasis over the areas injured. Drug reactions and infections can also aggravate psoriasis.

Is there a cure for psoriasis?

Unfortunately there is no one medication that can truly cure psoriasis, but there are good and effective treatments available that can control the condition or clear the patches. The skin may remain clear for a few weeks to severaly ears.

How is psoriasis diagnosed?

It is usually diagnosed by its typical appearance. In unclear cases, a biopsy may be helpful in establishing the diagnosis.

What does psoriasis look like?

There are various forms of psoriasis and severity is variable.

Plaque psoriasis

The most common type is plaque psoriasis. It appears as red elevated patches covered by silvery/whitish scales. Lesions often appear in a symmetrical manner i.e. they appear on the same places on both sides of the body. Areas often affected are the scalp, elbows, knees, arms, legs, ears and the lower back.

On the scalp, psoriasis may appear like bad dandruff when mild; the condition may develop into thick, scaly patches when severe.

Guttate psoriasis

Guttate psoriasis is more commonly seen in children and young adults. It appears as small red elevated spots, like ‘raindrops’ on the trunk and limbs. It can appear suddenly and may be triggered by a streptococcal throat infection, a common cold, chickenpox or immunizations.

Sometimes, guttate psoriasis may reappear with successive attacks of sore throat.

Pustular Psoriasis

Sometimes small pustules (small pockets of pus) may be present on the lesions making them look ‘infected’. This is called pustular psoriasis. It may be localized to certain parts of the body, or it may be generalized. In the generalized type, the patient can be quite ill with a high fever. Generalized pustular psoriasis can be provoked by the withdrawal of steroid tablets.

Erythrodermic psoriasis (erythroderma means red skin)

In this form of psoriasis, the skin appears as a diffuse redness and scaling.

Most affected individuals start by having what looks like bad, persistent dandruff for some time. Subsequently, scaly patches may appear on the body and the face.

Others

The nails may be affected and show small pits or appear lusterless, deformed and thickened in severe cases. Joint pains may also develop in 5 to 10% of cases. This is called psoriatic arthritis.

How is psoriasis treated?

Psoriasis can be treated in several ways depending on the type, the extent and areas involved. Once the psoriasis is cleared, the treatment is generally discontinued and only restarted when the psoriasis returns. There are various methods of treating psoriasis: creams or topical treatment, ultraviolet light, tablets (systemic drugs) and biological drugs.

TOPICAL TREATMENT

Topical treatment is used for mild to moderate psoriasis. These include cortisone creams (steroids), coal tar, dithranol, calcipotriol and moisturizers. These can be used alone, or in conjunction with other treatments.

What are steroids?

Steroids commonly known as cortisone are used to treat inflammatory conditions.

In psoriasis, it is usually used as creams, ointments and scalp lotions. Generally, for psoriasis, moderately potent topical steroids are used. Steroid tablets and injections are not used in psoriasis except for very special situations. The use of steroids requires a doctor’s prescription and supervision.

Are there any side effects from using steroids?

Yes, if it is not used carefully and under doctors’ supervision.

The following changes may develop following long-term use of very potent steroid creams: thinning of the skin, stretch marks, or easy bruising. Strong steroids on the face cause persistent redness and pimples. Most of these side effects resolve when steroid treatment is discontinued, but some like stretch marks can be very persistent. Psoriasis can sometimes become worse when the daily use of potent topical steroids is suddenly discontinued. This is called the ‘rebound phenomenon’.

Systemic steroids, i.e. steroids given as tablets or through injections, are not used in psoriasis except for very special situations because of the potentially serious side effects. When systemic steroids are discontinued, the ‘rebound phenomenon’ often occurs. Limited extent psoriasis may become generalized or pustular psoriasis may develop.

What is coal tar?

Tar is derived from crude coal tar and is made into creams, ointments and shampoos. Tar can suppress division of the cells in the skin and help to keep psoriasis under control. It can be used in combination with other treatment methods. Disadvantages: tar smells and stains clothing and bed linens. The onset of improvement is often slow.

What is dithranol?

Dithranol or anthralin is a synthetic compound that is effective in clearing mild and moderately severe forms of psoriasis. It also works by slowing down the division of cells in the skin. It is available in creams or ointments of various strengths. It is to be left on the affected area for 30 minutes, then washed off in order to reduce irritation of the skin. This is not commonly used nowadays due to the irritation potential.

What is calcipotriol?

Calcipotriol is a compound that is derived from vitamin D. It has been shown to slow down the increased multiplication of cells, normalize cell maturation and the abnormal immune response that occurs in psoriasis. Calcipotriol has been found to be as effective as topical steroids, and more effective than tar or dithranol.

Calcipotriol is available in creams and ointments and also as a scalp application. Calcipotriol may cause mild skin irritation and it is not advisable to be used on the face.

Other topical preparations

An important part of treatment for psoriasis is the use of moisturizers or emollients.

Lubrication helps to soothe the skin, making it less itchy and uncomfortable. It also helps other applied medications work better. Lubrication with moisturizers after bath will help to prevent dryness of the skin.

ULTRAVIOLET LIGHT TREATMENT

What is it and how is it used?

Ultraviolet light, UVB and UVA, are both present naturally in sunlight and are used to treat psoriasis. Artificial light sources emitting either UVA or UVB are utilized.

UVA light is used in combination with a medication called Psoralen and the treatment is called PUVA (Psoralen + UVA). Ultraviolet light treatment is considered for patients who have extensive psoriasis or not responsive to topical treatment.

UVB treatment

UVB is the light that is most commonly used. It helps in 70.8% of patients with psoriasis. Treatment is usually carried out in a cabinet equipped with light tubes that emit UVB so the whole body can be treated in one exposure. Treatment is usually carried out 2 to 3 times weekly and the dose of ultraviolet radiation is gradually increased. Exposure to this light is usually short, i.e. a few minutes. Side effects from this treatment are few. An acute sunburn can sometimes occur when an overdose is administered.

Recent studies have shown that a particular portion of UVB at wavelength 313nm is more effective in clearing psoriasis than the entire UVB segment of ultraviolet light. Narrow band UVB light tubes which emit a narrow band of light at 313+/-3nm are now replacing the conventional broad band UVB lamps in the treatment of psoriasis.

PUVA treatment

UVA alone is not very useful in treating psoriasis. It is used in combination with a medication called psoralen. This treatment is called PUVA (Psoralen + UVA). A patient on PUVA takes the medication about 2 hours before exposure to UVA light. UVA is delivered in a light chamber fitted with light tubes that emit UVA light. Psoralen makes the skin much more sensitive to UVA and it also enhances the ability of UVA to reduce cell multiplication and thereby improves psoriasis.

PUVA is more effective than UVB in the clearing of psoriasis.

The most common short-term side effects of PUVA are nausea from taking the psoralen tablets and a burn resulting in redness and itch. Deep tanning of the skin develops quickly with PUVA therapy and tends to be long lasting. There is a risk of development of skin cancers if PUVA is used on a long term basis.

ORAL MEDICATIONS FOR PSORIASIS

Oral medication is an option for patients who have severe or extensive psoriasis but unable to have phototherapy or fail to respond to phototherapy. The commonly used tablets are methotrexate and cyclosporin. Other medications that are sometimes used include acitretin.

What is methotrexate?

Methotrexate is a highly potent medication which slows down the rapid multiplication of cells seen in psoriasis and helps restore the skin to a normal state. It is taken in small doses once a week. It is best used for extensive psoriasis, physically disabling psoriasis, psoriasis in the elderly and psoriasis affecting the joints.

Methotrexate is effective in more than 70% of patients; it is a convenient form of treatment and the results are usually predictable.

What are the side effects of methotrexate?

Methotrexate can potentially damage the liver especially if it is taken on a long term basis and it can also suppress the bone marrow. It is metabolized in the liver and excreted by the kidneys. As such, before commencing treatment with methotrexate, it is necessary to do blood tests to check on the blood cells count, liver function and kidney function. Periodic tests are also done while the patient is taking methotrexate. Methotrexate is not suitable for patients who drink regularly as there is a risk of liver damage. It is also not suitable for men and women planning to start a family.

Other common side effects of methotrexate are nausea, vomiting, headache and dizziness while taking the medication.

What is cyclosporin ?

Cyclosporin is a drug which suppresses immune responses. It has been found to be useful in psoriasis in low doses. It is indicated for patients with severe psoriasis not responsive to conventional treatment mentioned above, and in those whose psoriasis is physically and socially disabling.

Cyclosporin should not be used in patients with kidney disease, uncontrolled high blood pressure, history of cancer, infection, or who are pregnant or breast feeding.

Side effects include effects on the kidneys and hypertension. As it suppresses immune responses, infections can be made worse. Patients on cyclosporin should be monitored carefully by doing regular blood tests.

What is acitretin and what are the side effects?

Acitretin belongs to a group of medications called retinoids which are derived from vitamin A. It acts by normalizing the increased rate of multiplication and abnormal maturation of skin cells which occurs in psoriasis. It also has anti-inflammatory effects. Used on its own, it is effective in severe erythrodermic psoriasis and pustular psoriasis. For chronic plaque type psoriasis, excellent results can be achieved when it is used in combination with PUVA or UVB.

Side effects of the drug include dryness of the skin, lining of the nostrils, the mouth and lips. Rarely, it can affect the liver, and it can also cause a rise in the blood lipids. If women while on acitretin get pregnant, there is a risk of congenital defects in the baby. It is therefore not recommended for women who intend to get pregnant.

BIOLOGIC DRUGS

What are biologic drugs?

Biologic drugs (or biologics in short), are newer medications used to treat psoriasis by targeting specific molecules of the immune system that are driving the psoriasis on. These molecules are over-expressed (i.e. over-activated) in patients with psoriasis.

How effective are biologics and how are these drugs administered?

As biologic agents are considered ‘smart’ drugs, they are very effective in clearing the psoriasis as long as the patient is on the drug. It does not confer a cure for psoriasis. Most of the biologic drugs are administered by injections into the skin (subcutaneously) or into the vein (intravenously). The dosing schedule for these drugs vary from once a week to once every 3 months, depending on the type of drug injected.

What are the side effects of this drug?

Generally, these biologic agents are quite safe if given in the right context and proper monitoring is done. Screening blood tests to make sure that the blood counts, liver and kidney function are normal is compulsory. Any underlying infections, e.g. hepatitis B and C, HIV as well as TB (tuberculosis) should be tested for and treated if a patient is considering biologics. The risk of TB reactivation with some of the biologic agents requires the doctor to test for the presence of latent TB prior to starting these drugs. As biologic drugs are relatively new in the market, the long term (i.e. 20 years or more) side effects are not known.

What can be done about psoriasis of the joints?

Up to one-third of patients with psoriasis have psoriatic arthritis. It can affect both the small joints of the fingers and toes, or the large joints of the limbs and spine. like other forms of arthritis, affected patients experience stiffness, aches and pains. The pain and swelling can be treated with anti-inflammatory medications and if the arthritis is progressive, methotrexate or certain biologics should be considered.

Psoriasis is a chronic non-infectious skin condition which can’t be cured. However, symptoms, particularly in mild cases, can be controlled with topical creams, ointments and medication.

“Avoiding triggers such as stress, and leading a healthy lifestyle, can also prevent a relapse of psoriasis symptoms,” says Dr Pang Shiu Ming, Senior Consultant, Department of Dermatology, Singapore General Hospital (SGH), a member of the SingHealth group.

Treating psoriasis

Mild and moderate psoriasis can be treated with:

Coal tar preparations (cream or shampoo)
Dithranol cream/ointment
Salicylic acid ointment
Corticosteroids cream/ointment
Vitamin D-type drugs such as calcipotriol and calcitriol cream/ointment
Fixed dose combination of corticosteroid and calcipotriol ointment/gel
Fixed dose combination of corticosteroid and salicylic acid ointment
More severe psoriasis may require treatment with phototherapy using ultraviolet light 2-3 times a week for a period of several weeks to several months. Phototherapy can produce side effects such as dryness and burns on the skin, and increases the risk of skin cancer.

Persistent psoriasis may require oral and/or injectable medication as well as topical creams and ointments. Since oral and injectable medication presents risks to internal organs such as the kidney and liver as well as the immune system, this psoriasis treatment needs to be closely monitored.

“Psoriasis treatment involving oral and injectable medication and phototherapy can have side effects and the patient needs to be monitored with regular blood tests and follow-up visits,” says Dr Pang.

SHAMPOOS, OILS, AND SPRAYS TO TREAT PSORIASIS OF THE SCALP

SHAMPOOS, OILS, AND SPRAYS TO TREAT PSORIASIS OF THE SCALP

Shampoos, oils, and sprays to treat psoriasis of the scalp 1

Scalp psoriasis symptoms include dry or brittle hair, tremendous itching, and dandruff-like flakes falling on your clothes. If scalp psoriasis and its accompanying inflammation are severe enough, you might experience hair loss, although with proper treatment, the hair should grow back. Prescription treatments, including topical steroids, vitamin D derivatives, and tar preparations, are available as oils, gels, foams, lotions, and sprays, Dr. Ehrlich said. Trader Joe’s Tea Tree Tingle shampoo and conditioner are both sulfate-free, as are the WEN products, which Patrice also recommended. How to Cure Your Psoriasis Naturally in 3 Days! Topical SteroidsThese scalp products are usually formulated as liquids, gels, oils, foams, sprays or shampoo. You came to know how to use tea tree oil for dry scalp to treat dryness in the scalp and also to get well moisturized. Make sure that your hair doesn’t contain heavy oils as it causes buildup and also have a light spray on the scalp. This process is also applicable to treat Itchy Scalp, Scalp Psoriasis, Oily Scalp, Scalp Sores, Itchy and Flaky Scalp, Dry and Flaky Scalp, Dry and Itchy Scalp, Shampoo for Itchy Scalp, Scalp Follcultis and Scalp Ringworm.

Shampoos, oils, and sprays to treat psoriasis of the scalp 2Tea tree oil for scalp problems is one of the best remedies that help you get rid of various scalp problems like dry and itchy scalp, dandruff, scalp fungus, scalp psoriasis and scalp eczema. Tea tree oil for scalp problems is one of the best remedies that help you get rid of various scalp problems like dry and itchy scalp, dandruff, scalp fungus, scalp psoriasis and scalp eczema. However, if we go by the research status about tea tree oil for scalp problems, the test studies for effectiveness of tea tree oil in treating dandruff, itchy scalp and other scalp problems are inconclusive. Now use this mixture, the diluted tea tree oil to spray all over your scalp 2-3 times a day. From vegetable oil to apple cider vinegar to tar, there are lots of good do-it-yourself remedies for the itchiness of scalp psoriasis. If your search for relief from scalp psoriasis leaves you scratching your head, set your mind at ease. Treating Moderate to Severe Psoriasis. There is no cure for psoriasis, only various medications and treatments to help those with it cope. Shampoos containing tea tree oil are often ineffective, have nominal amounts of tea tree oil (they mislead you by adding peppermint oil or menthol for scent/that tingly feeling), and can contain sulfates. MetaDerm Scalp Care Natural Eczema, Psoriasis, Seborrhea Soothing Spray.

Topical treatment for scalp psoriasis in adults, young people and children. These tend to be lotions, gels, foams, sprays or shampoo, so they can be used more easily in hair-covered areas, are more cosmetically acceptable and are easier to wash out. Coal Tar. FDA approved ingredient for treating dandruff, scalp psoriasis & seborrheic dermatitis. Drier air can reduce the amount of oil on the scalp, which may keep flakes from sticking. Due to increased shedding, the flakes become more visible throughout the hair. Not only will this homemade hair shampoo recipe give you healthy, gorgeous hair, but it’ll be easy on your wallet too. How To Use Coconut Oil For Dry Hair, Psoriasis, and Dandruff. Diy Coconut Hair spray – for dry, frizzy and damaged hair.

Tea Tree Oil For Scalp
Shampoos, oils, and sprays to treat psoriasis of the scalp 3Treatment can be difficult for scalp psoriasis but there are some homemade scalp treatment strategies that will help manage scalp psoriasis. Look for shampoos that contain active ingredients such as salicylic acid, tar, selenium sulfide, zinc pyrithione, steroids, etc. Olive Peanut Oil Psoriasis Scalp Therapy. Once cooled, strain and place in a spray bottle. The key to combating dry scalp is to incorporate natural oils into your hair care regimen. This will help with many irritating scalp conditions like psoriasis, eczema, and dandruff. I have tried different shampoos in order to treat dry and flaky scalp. Mix it well and then pour it in an empty spray bottle. Now, spritz the scalp throughout the week at any time your scalp feels itchy and dry. This procedure is also used to deal with scalp eczema. After that, wash the hair every other day using tea tree oil shampoo. This process assists to alleviate the itch and soothes the skin and also cleanses the clogged hair follicles. If you’re not likely to make your own essential oils treatment, I can recommend two all-natural dry scalp shampoos which contain these ingredients (and more) and are toxin-free. For example, here’s how to make an all-natural hair spray at home. Use Neem Cure Oil for all of your skin care issues with amazing results. Neem may be very effective in helping soothe symptoms from Psoriasis, Eczema, to Rosacea. Wash hair and scalp with a gentle shampoo, adding 2 or 3 drops of Neem Cure to the shampoo. There are over-the-counter and prescription shampoos to treat dandruff, as well as treatments featuring rosemary oil. Sundene believes it is also effective as a scalp spray. Do not use rosemary–or any essential oil–on your scalp without diluting it with water.

Scalp Psoriasis
Some of the symptoms hemp oil psoriasis treatment can ease are the itching, inflammation, and lesions. If you’re like most psoriasis sufferers, you’ll have tried just about every cream, lotion, pill, and spray to relieve your symptoms. If you have psoriasis on your scalp, a hemp shampoo is recommended. For more intensive scalp issues, reapply and let lather absorb for five full minutes before rinsing. But we also add our exclusive Bio-Advanced Peptide Complex to protect and reconstruct the hair; Biotin to promote excellent blood circulation; and Jojoba and Safflower Oils to moisturize and draw away impurities. I have been free of dandruff and psoriasis ever since. My hair is naturally curly and dry however Joico’s Treatment Shampoo ensures that it’s in great condition and soft and healthy. Kiehl’s Scalp Purifying Pyrithione Zinc Anti-Dandruff Shampoo. The Spot Treatment: Specifically formulated for people with psoriasis or stubborn scalp spots that refuse to get better, Lush Superbalm Scalp Treatment is not messing around. The Spray: Potentially a very good desk accessory for someone who works in a free-wheeling office that wouldn’t bat an eyelash if you started spraying your head and neck from a bottle with an atomizer, the Rest rsea Revitalizing Scalp Treatment alleviates tightness and discomfort associated with scalp grime, rashes, or other maladies on contact. Psoriasis and Eczema Treatment at Walgreens. Dermarest Psoriasis Psoriasis Medicated Shampoo plus Conditioner (8 fl oz) for 7.99 – Opens a simulated dialog.

Dandruff is a commonly occurring condition of the scalp characterized by flaky skin. As such, selenium sulfide shampoos are a little more versatile because they can treat a wider range of causes. This deep purifying scalp spray purifies hair at the root, within the follicle, and polishes away build up from the scalp to ensure a healthier environment.

Solaris Tips and Tricks

Solaris Tips and Tricks
PS Long Listing
You want to see the whole command, but – how annoying – ps truncates to 80 characters.

/usr/ucb/ps augxww
gives full command listings.

If you’re only interested in one process, an excellent alternative is pargs which lists the command line arguments for a given command.

For example:
pargs 12345
Will give all the command line arguments for process ID 12345

Compressing a Tar file upon creation
The standard Solaris version of tar misses the compression options found on fruitier versions of *nix. Never mind – we can use pipes to compress and uncompress archives.

Creating and compressing a tar file:
tar cvf – /home/doug/stuff_to_backup | gzip > my_tar_file.tar.gz

Uncompressing and extracting a tar file:
gunzip -c tar_file_to_uncompress.tar.gz | tar xvf –

Netstat counts
A quick view of the state of your TCP connections can be very useful – here’’s a quick and dirty (nice and simple) way of getting that information.
bash-3.00$ echo “Total: ” `netstat | wc -l`

Total: 1756
bash-3.00$ netstat | perl -pe ‘split;$_=”$_[6]\n”‘ | sort | uniq -c | sort -n -k 1,1

1 ———–
1 Remote
1 Rwind
7
20 LAST_ACK
26 FIN_WAIT_2
130 ESTABLISHED
642 CLOSE_WAIT
946 TIME_WAIT

solaris 10 reference

solaris Release

Get the release of your OS by cat /etc/release:
OpenSolaris 2009.06 Example:
OpenSolaris 2009.06 snv_111b X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 07 May 2009
Solaris 10
Oracle Solaris 10 9/10 s10s_u9wos_14a SPARC
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
Assembled 11 August 2010
System administration

SMF

Enable/disable services

Since Solaris 10, the old (but nice ?) start/stop script in rc?.d have been replaced by SMF, the Service Management Facility.

svcs
svcs -x lists services encountering problems
svcs -a lists all services including disabled ones
svcs -l provides information concerning a specific service
Example:
svcs -l svc:/network/routing/ndp:default
fmri svc:/network/routing/ndp:default
name in.ndpd IPv6 neighbour discovery daemon
enabled true (temporary)
state online
next_state none
state_time July 20, 2013 07:52:23 PM CEST
logfile /var/svc/log/network-routing-ndp:default.log
restarter svc:/system/svc/restarter:default
contract_id 63
dependency require_all/refresh svc:/network/routing-setup (online)
svcadm
svcadm enable to enable a service. e.g svcadm enable svc:/network/samba:default
svcadm disable to disable a service.
svcadm enable -t temporary enabling/disabling a service (won’t persist over reboot)
svcadm refresh restart the service
svccfg
svccfg -s setprop set properties. Eg. svccfg -s svc:/application/x11/x11-server setprop options/tcp_listen = true
Or, for example, get the current keymap layout:
svc:/system/keymap:default> listprop keymap/layout
keymap/layout astring French
svc:/system/keymap:default> exit
svcprop
svcprop list properties for a given service.
eg.
$ svcprop svc:/application/x11/x11-server
options/default_depth integer 24
options/server astring /usr/openwin/bin/Xsun
options/server_args astring “”
options/stability astring Evolving
options/value_authorization astring solaris.smf.manage.x11
options/tcp_listen boolean true

OpenSolaris uses the SMF too. It (unfortunately ?) ships with many services and will probably need some tuning if your host is a bit slow. A nice reading on that behalf: Solaris 10 Benchmark v4.0.

Creating a manifest for a new service

See for example the SVN manifest I use.
Useful services

Name Service Name Comments
Apache Solaris: svc:/network/http:apache2, OpenSolaris: svc:/network/http:apache22 Enable to set up your own web server
Avahi Daemon Bridge to Bonjour svc:/system/avahi-bridge-dsd:default Disabled. Used by DNS Multicast
CDE svc:/application/graphical-login/cde-login:default Disabled on Solaris: I use gdm. Does not exist on OpenSolaris
DHCP dhcpagent disabled: I use static address
Fiber Channel svc:/system/device/fc-fabric:default Keep enabled or the system won’t reboot
GDM Solaris: svc:/application/gdm2-login:default, OpenSolaris: svc:/application/graphical-login/gdm:default enabled
GSS >API gss:default Disable. The GSS API is a security abstraction layer that is designed to make it easier for developers to integrate with different authentication schemes. It is most commonly used in applications for sites that use Kerberos for network authentication, though it can also allow applications to interoperate with other authentication schemes (quoted from Solaris 10 Benchmark v4.0).
IPFilter’s service ipmon Enabled. used for zones
IPv6 neighbour discovery daemon svc:/network/routing/ndp:default Disabled. I don’t use IPv6 at home !
Keyboard defaults svc:/system/keymap:default Enabled. If needed, set keyboard layout explicitly to fr.
svc:/system/keymap:default> listprop keymap/layout
keymap/layout astring French
svc:/system/keymap:default> exit
Kerberos svc:/network/security/ktkt_warn:default “While Kerberos can be a security enhancement, if the local site is not currently using Kerberos then there is no need to enable this service” (according to here)
metainit svc:/system/metainit:default disable. SVM initialization
metasync svc:/system/metasync:default disable. SVM initialization
MySQL svc:/application/database/mysql:version_51 if you don’t need MySQL you can safely disable
Multicast DNS and DNS Service Discovery multicast:default disable
N Port ID Virtualization svc:/network/npiv_config:default Do not disable or the syste, won’t reboot. N_Port_ID Virtualization (NPIV) is a method for virtualizing a FibreChannel Port. With NPIV, one physical FibreChannel port can obtain many N_Port_IDs.
PPD Cache Update svc:/application/print/ppd-cache-update:default disable
Rlogin network/login:rlogin enable this for rlogin
Samba Solaris: svc:/network/samba:default, OpenSolaris: svc:/network/smb/client:default enabled. On OpenSolaris, the Samba client is necessary for smbfs.
Sendmail svc:/network/smtp:sendmail I don’t need it. To remove sendmail packages, pkgrm SUNWsndmu and SUNWsndmr. Beware sendmail is required by fetchmail
Time Slider svc:/application/time-slider:default For ZFS Snapshots
VNC Configuration svc:/system/xvm/vnc-config:default disable
List of online services

Currently, the list of online services on my OpenSolaris host are:
STATE STIME FMRI
legacy_run 20:36:20 lrc:/etc/rcS_d/S50yukonx
legacy_run 20:36:59 lrc:/etc/rc2_d/S20sysetup
legacy_run 20:36:59 lrc:/etc/rc2_d/S47pppd
legacy_run 20:36:59 lrc:/etc/rc2_d/S72autoinstall
legacy_run 20:36:59 lrc:/etc/rc2_d/S73cachefs_daemon
legacy_run 20:37:00 lrc:/etc/rc2_d/S81dodatadm_udaplt
legacy_run 20:37:00 lrc:/etc/rc2_d/S89PRESERVE
legacy_run 20:37:00 lrc:/etc/rc2_d/S98deallocate
disabled 20:36:57 svc:/system/xvm/ipagent:default
online 20:36:04 svc:/system/svc/restarter:default
online 20:36:05 svc:/network/loopback:default
online 20:36:05 svc:/network/datalink-management:default
online 20:36:06 svc:/system/filesystem/root:default
online 20:36:06 svc:/network/physical:nwam
online 20:36:07 svc:/system/scheduler:default
online 20:36:07 svc:/system/boot-archive:default
online 20:36:07 svc:/system/identity:node
online 20:36:14 svc:/system/filesystem/usr:default
online 20:36:14 svc:/system/device/local:default
online 20:36:14 svc:/system/filesystem/minimal:default
online 20:36:15 svc:/system/identity:domain
online 20:36:15 svc:/system/hostid:default
online 20:36:15 svc:/system/name-service-cache:default
online 20:36:15 svc:/system/rmtmpfiles:default
online 20:36:15 svc:/system/resource-mgmt:default
online 20:36:15 svc:/system/cryptosvc:default
online 20:36:15 svc:/network/ipfilter:default
online 20:36:15 svc:/milestone/network:default
online 20:36:15 svc:/system/sysevent:default
online 20:36:16 svc:/system/power:default
online 20:36:16 svc:/system/picl:default
online 20:36:16 svc:/network/npiv_config:default
online 20:36:16 svc:/system/device/fc-fabric:default
online 20:36:16 svc:/milestone/devices:default
online 20:36:17 svc:/system/manifest-import:default
online 20:36:17 svc:/system/coreadm:default
online 20:36:17 svc:/network/initial:default
online 20:36:18 svc:/network/service:default
online 20:36:18 svc:/network/dns/client:default
online 20:36:18 svc:/milestone/name-services:default
online 20:36:19 svc:/network/smb/client:default
online 20:36:20 svc:/system/keymap:default
online 20:36:20 svc:/milestone/single-user:default
online 20:36:24 svc:/network/routing-setup:default
online 20:36:24 svc:/network/routing/ndp:default
online 20:36:55 svc:/system/filesystem/local:default
online 20:36:56 svc:/system/sysidtool:net
online 20:36:56 svc:/network/shares/group:default
online 20:36:56 svc:/system/boot-archive-update:default
online 20:36:56 svc:/system/cron:default
online 20:36:56 svc:/network/shares/group:zfs
online 20:36:56 svc:/network/rpc/bind:default
online 20:36:56 svc:/application/stosreg:default
online 20:36:56 svc:/system/sysidtool:system
online 20:36:56 svc:/milestone/sysconfig:default
online 20:36:56 svc:/system/sac:default
online 20:36:57 svc:/system/dbus:default
online 20:36:57 svc:/system/utmp:default
online 20:36:57 svc:/system/filesystem/autofs:default
online 20:36:57 svc:/network/inetd:default
online 20:36:57 svc:/system/console-login:default
online 20:36:57 svc:/system/filesystem/zfssnap-roleadd:default
online 20:36:57 svc:/system/dumpadm:default
online 20:36:57 svc:/application/desktop-cache/mime-types-cache:default
online 20:36:58 svc:/application/desktop-cache/gconf-cache:default
online 20:36:58 svc:/system/postrun:default
online 20:36:58 svc:/application/desktop-cache/input-method-cache:default
online 20:36:58 svc:/application/desktop-cache/pixbuf-loaders-installer:default
online 20:36:58 svc:/application/opengl/ogl-select:default
online 20:36:58 svc:/network/rpc/smserver:default
online 20:36:58 svc:/network/login:rlogin
online 20:36:58 svc:/application/pkg/update:default
online 20:36:59 svc:/system/system-log:default
online 20:36:59 svc:/network/ssh:default
online 20:37:00 svc:/application/desktop-cache/desktop-mime-cache:default
online 20:37:00 svc:/milestone/multi-user:default
online 20:37:01 svc:/system/intrd:default
online 20:37:01 svc:/system/fmd:default
online 20:37:01 svc:/milestone/multi-user-server:default
online 20:37:03 svc:/system/zones:default
online 20:37:03 svc:/application/font/fc-cache:default
online 20:37:10 svc:/application/desktop-cache/icon-cache:default
online 20:37:12 svc:/system/filesystem/zfs/auto-snapshot:daily
online 20:37:13 svc:/system/filesystem/zfs/auto-snapshot:monthly
online 20:37:13 svc:/application/graphical-login/gdm:default
online 20:37:13 svc:/network/http:apache22
online 20:37:13 svc:/system/filesystem/zfs/auto-snapshot:weekly
online 20:37:19 svc:/system/hal:default
online 20:37:19 svc:/system/filesystem/rmvolmgr:default
online 20:37:28 svc:/system/filesystem/zfs/auto-snapshot:frequent
online 20:37:28 svc:/system/filesystem/zfs/auto-snapshot:hourly
online 20:37:28 svc:/application/time-slider:default
Inetadm

Get status of an inet service:
inetadm | grep ftp
disabled disabled svc:/network/ftp:default
Enable an inet service:
pfexec inetadm -e ftp
$ inetadm | grep ftp
enabled online svc:/network/ftp:default
System Admin GUIs

The host can be graphically administered using:

SMC (Solaris Management Console): user management, hosts editing, cron batches, SMF. Launch /usr/sadm/bin/smc. On Solaris only (not OpenSolaris).
Webmin: web-based administration. Pretty good.
Visual Panels: this is an additional piece of software. I’m not a fan, but it’s there if you want it.
User management

How to add a new user

To add a new user,

use the graphical Solaris Management Console (smc&)
or manually:
make sure the home dir exists and is readable by the group,
then type:
useradd -d -g -s /usr/bin/bash
Allow a user for pfexec

# cat /etc/security/exec_attr | grep “Primary”

Primary Administrator:suser:cmd:::*:uid=0;gid=0

# usermod -P’Primary Administrator’ testuser
Logs

/var/adm/messages
/var/cron/log Cron’s log. Will also log auto snapshot actions.
/var/adm/sulog Successful or failed su logins
/var/log/syslog
Authentication

Log failed logins

Set SYSLOG_FAILED_LOGINS in /etc/default/login

Password policy

The password policy is configured in /etc/default/passwd. The default settings are reasonable. Several parameters are commented out, but they have a default value. On the contrary, an unsecure setting could be as follows:

MAXWEEKS=
MINWEEKS=
PASSLENGTH=4
HISTORY=0
MINDIFF=0
MINDIGIT=0
See more information here.

Automatic login

On Solaris 10, to have the host automatically log in as a given user:

# gdmsetup & –> set up for user you wish to log in
# vi /etc/X11/gdm/gdm.conf

SystemMenu=true
# /etc/init.d/dtlogin stop
# /usr/dt/bin/dtconfig -d
# svcadm enable gdm2-login
Now, automatic login is a bit disappointing, because you still have to provide user’s password…

On OpenSolaris 2008.11, no such issue ! Use gdmsetup and it works.

Whoami

An alternative to whoami is
/usr/xpg4/bin/id -un
System Path

The default path for Solaris 10 should be set in /etc/default/login:

PATH=/usr/sfw/bin:/opt/csw/bin:/usr/sbin:/sbin:/usr/bin:/usr/openwin/bin
SUPATH=/usr/sbin:/usr/bin
PATH is the default path for users.

SUPATH is the default path for root when running su.

Both paths are overriden by user’s .profile, .login, .cshrc or .bashrc. So, check those files out too.

System Locale

Locales are a complicated matter I haven’t completely grasped yet 😉 I would recommend using UTF-8 as much as possible as it supports English and French characters, but UTF-8 will only work if the application supports it. For example, xterm do not support UTF-8 (I read there is a workaround using efonts but I haven’t tested). Urxvt does.
If setting locale to UTF-8 fails, ISO Latin 15 (ISO-8859-15) is a good alternative to display French accents and euro symbol.
The main locale environment variables are:
LANG: general language specification
LC_ALL: language setting. If not empty, overrides LANG and other LC_ variables
LC_MESSAGES: compilation warnings, errors in the specified language
Those variables are described in man 5 environ. To check your current locale:
$ locale
LANG=C
LC_CTYPE=”C”
LC_NUMERIC=”C”
LC_TIME=”C”
LC_COLLATE=”C”
LC_MONETARY=”C”
LC_MESSAGES=”C”
LC_ALL=
If a user wishes to customize its locale, he/she should usually set LANG (or individually, each LC_ variable). However, this setting is not persistent: it must be added to user’s .bashrc.
Those settings may affect locale-dependant applications. For instance, to launch Thunderbird with English menus but French accents supports, set LANG to en_US.UTF-8. To use Thunderbird with French menus: fr_FR.UTF-8.
To set the system’s locale, modify the settings in /etc/default/init and reboot:
LANG=”en_US.UTF-8″
LC_CTYPE=”C”
LC_NUMERIC=”C”
LC_TIME=”C”
LC_COLLATE=”C”
LC_MONETARY=”C”
LC_MESSAGES=”C”
To add a new locale, use localeadm
I encountered strange lags with OpenSolaris, when launching simple applications such as xclock, xeyes etc: the computer would freeze for a few seconds, and finally the application appears.
This does not occur any longer once I set all LC_ variables to C except LANG to en_US.UTF-8 in /etc/default/init.
LANG=”en_US.UTF-8″
LC_CTYPE=”C”
LC_NUMERIC=”C”
LC_TIME=”C”
LC_COLLATE=”C”
LC_MONETARY=”C”
LC_MESSAGES=”C”
Setting the System Date

To set/correct time, do:

date -s 1334
to set clock to 13:34.

To set the timezone, use the tzselect utility. Alternatively, it is possible to do:
pfexec /usr/sbin/rtc -z Europe/Paris
Networking

To restart the network:
svcadm restart svc:/network/physical:nwam
To add a new computer, use the Solaris Management Console, Computers & Network, Computers, then selection Action / Add Computer. This basically adds an entry to /etc/hosts.
Check out files /etc/hostname, /etc/hostname. (hme0, yukonx…), /etc/nodename, /etc/inet/hosts, /etc/inet/ipnodes.
List possible interfaces: ifconfig -a plumb, then ifconfig
List routes: routeadm
GUI: network-admin
Set a static IP address

Specifying a static IP address consists in:

ethernet interface: an ether interface must exist and be named. I use the default name for mine: yukonx0
make sure the networking service is enabled: either physical:default or physical:nwam. The former is the most ‘basic’ networking service. The latter is a networking daemon that automatically configures your host. It’s worth a try: on my OpenSolaris host, it worked straight out of the box and I consequently did not have to configure networking manually. On Solaris u5, however, I had to do it manually.
configure a few files (with nwam, most of these steps should be automatically done):
/etc/hostname.: specify your host’s name:cify your host’s name:
$ more /etc/hostname.yukonx0
boureautic
/etc/hosts: set the loopback address and your static IP address:
$ cat /etc/hosts
#
# Internet host table
#
#::1 localhost loghost boureautic
127.0.0.1 localhost loghost
192.168.0.2 boureautic
/etc/resolv.conf: set the appropriate DNS servers (those are the ones used by Free):
nameserver 212.27.40.240
nameserver 212.27.40.241
/etc/nsswitch.conf: make sure the line hosts sets “files” before “dns”.
hosts: files dns
for physical:default, set the default gateway: route add default 192.168.0.254. And then, automatically add the route at each reboot writing a script /etc/rc2.d/S99route
For a manual try, add the network interface with ifconfig:
ifconfig yukonx0 192.168.0.2 netmask 255.255.255.0 up
Eavesdropping network packets

No need to install Ethereal: on Solaris, there’s snoop. Example 1:
pfexec snoop 192.168.0.2 and 192.168.0.3 and tcp > trace.txt
This will record all TCP packets which mention 192.168.0.2 and 192.168.0.3. Example 2:
pfexec snoop -d yukonx0 -o smbfs.snoop 192.168.0.2 and 192.168.0.3 and tcp
The output is written to smbfs.snoop, and we listen only on network card yukonx0.
Enable Rlogin

To add the rlogin network service:

svcs -l rlogin
svcadm enable network/login:rlogin
Note that svcadm enable -t network/login:rlogin only performs a temporary enable of rlogin (won’t persist over reboot).

X

Display windows remotely

This is basic on X Window, but from time to time I however encounter problems to do it.

For remote display:

export DISPLAY=:0.0
Also use /usr/openwin/bin/xauth list to list which entities are authorized.

XScreensaver

There’s a known bug on Solaris 10 u5: when you log on, a message is displayed: “failed to execute child process “xscreensaver” (no such file or directory) screesaver functionality will not work in this session”.

To get rid of this message, do

ln -s /usr/openwin/bin/xscreensaver /usr/bin/xscreensaver
GDM

To add FVWM to possible sessions, modify /usr/share/xsessions/fvwm.desktop
[Desktop Entry]
Encoding=UTF-8
Name=FVWM
Name[fr]=FVWM 2.5.26
Comment=This session logs you into FVWM 2.5.26
Exec=/usr/local/bin/fvwm
Icon=
Type=Application
On Solaris 10, stop dtlogin to use gdm:

# /etc/init.d/dtlogin stop
# /usr/dt/bin/dtconfig -d
# svcadm disable cde-login
# svcadm enable gdm2-login
On OpenSolaris 2008.11, gdm refers to the service svc:/application/graphical-login/gdm:default. There is no CDE login.

On OpenIndiana, to add FVWM as a possible session, edit .dmrc:

[Desktop]
Session=fvwm
Language=C
Layout=
XDMCP

To configure XDMCP, launch gdmsetup then click on the remote tabs and activate ‘same as local’.

The logs of XDMCP are sent to the console. Make sure that only GDM is launched not also CDE (disable service cde-login for gdm2-login).
On OpenIndiana, activate XDCMP in /etc/gdm/custom.conf
[xdmcp]
Enable=true
DisplaysPerHost=2
Fonts

To display usable fonts, use xfontsel
To use a given font in a xterm, use -fn:
xterm -fn -*-fixed-medium-*-*-*-14-*-*-*-*-*-*-* &
or create an ~/XTerm file (or in ~/.Xdefaults) and specify the fonts, size (etc) you wish to use:

XTerm*font: 9×15
corresponds to:
xterm -font 9×15 &
Fonts are typically located in /usr/X11/lib/X11/fonts/misc/
Software Management

Package management Typical install directories Local package database Comments
pkgadd etc /usr, /usr/sfw, /opt/sfw /var/sadm/pkg Default package management utility on Solaris. Does not handle dependencies. SUN’s packages are prefixed by SUNW (eg SUNWvbox).
pkg-get /opt/csw “Old” Blastwave package management. Close to apt-get. Handles dependencies. Blastwave’s package are prefixed by CSW (eg CSWperl).
pkgutil /opt/csw New Blastwave package management. Close to apt-get. Handles dependencies. Install using pkgadd -d http://get.opencsw.org/now, which fetches CSWpkgutil.
To install the new PKI:
/opt/csw/bin/cswpki –import –force
pkg New package management of OpenSolaris. I don’t like it very much, it takes ages to run. Packages are prefixed with IPS (eg IPSgnutls)

Commands Solaris pkg-get pkgutil IPS (OpenSolaris)
Add / Install pkgadd -d
1/ unzip the package (gunzip, bunzip2, unzip…) and 2/ pkgadd. pkg-get install (automatically downloads and installs dependencies) pkg install
Remove pkgrm packagename pkg-get remove packagename
Upgrade
pkg-get upgrade packagename
This will upgrade all packages for which a new version exists. It consists in uninstalling the old version (remove) and then installing the new version (install). At first, seeing a remove operation may be surprising, but in the end, it works.
Get package details pkginfo -l packagename
$ pkginfo -l SUNWopenssl-commands
PKGINST: SUNWopenssl-commands
NAME: OpenSSL Commands (Usr)
CATEGORY: system
ARCH: i386
VERSION: 11.11,REV=2008.10.30.20.37
VENDOR: Sun Microsystems, Inc.
DESC: OpenSSL Commands (Use)
HOTLINE: Please contact your local service provider
STATUS: completely installed

pkg info package
$ pkg info -l SUNWxwplt
Name: SUNWxwplt
Summary: X Window System platform software
Category: System/X11
State: Installed
Publisher: opensolaris.org
Version: 0.5.11
Build Release: 5.11
Branch: 0.111
Packaging Date: Fri May 8 16:45:51 2009
Size: 14.34 MB
FMRI: pkg:/SUNWxwplt@0.5.11,5.11-0.111:20090508T164551Z

List contents of a package pkgchk -l (also lists details) pkg contents
Example:
pkg contents xsane/sane-backends
usr/lib/sane/libsane-pixma.so.1
usr/lib/sane/libsane-pixma.so.1.0.19
usr/share/man/man5/sane-pixma.5
Search in which package a command belongs to grep xxx /var/sadm/install/contents or /usr/sbin/pkgchk -l -p thecommand pkg search -r
Search for packages starting with a given name pkgutil -a blah
List all available packages on the server pkgutil -l
Locate software repositories pkg publisher
Verify an installation pkg verify package
This will tell you for instance if a link is broken:
pkg verify web/browser/firefox
PACKAGE STATUS
pkg://openindiana.org/web/browser/firefox ERROR
link: usr/bin/firefox
Target: ‘/opt/sfw/lib/firefox/firefox’ should be ‘../lib/firefox/firefox’

There’s a nice comparison between Debian’s apt-get and IPS or pkgadd / IPS: here.
Patches

On Solaris: use the Sun Connection Update Manager (last version is currently 1.0.4). To do so, it is mandatory to register Solaris. The command line tool is /usr/sbin/updatemanager (run as root). This will ask for registration if you haven’t done so yet). This is a graphical interface.
I encountered a serious problem with patches: I patched the system with security or recommended patches, some of those patches failed, and then at the next reboot: kernel crash (impossible to boot, except in single user mode). So beware… See Sun’s Forums and Google Groups: looks like others encountered the same problem…

On OpenSolaris: launch /usr/sbin/updatemanager
pkg-get

To install pkg-get,
Get pkg-get from Blastwave.
Install it: pkgadd -d pkg_get-3.8.4-SunOS5.8-all-CSW.pkg. The procedure is perfectly described on Blastwave’s site. Check its digest with:
digest -v -a md5 pkg_get.pkg
Then configure it in /opt/csw/etc/pkg-get.conf. Set up the mirror to use, the tree version (stable, unstable, testing), and the download directory (by default: /var/pkg-get/donwloads).
url=http://ibiblio.org/pub/packages/solaris/csw/unstable
PKGGET_DOWNLOAD_DIR=/tmp
Then use pkg-get to install Blastwave packages.
pkgutil

Blastwave has recently replaced pkg-get by pkgutil. To install pkgutil,

get the package
do: pkgadd -d then use pkgutil to handle other packages.
Using other packages

Unpack a debian package:

/usr/xpg4/bin/ar x package.deb
gunzip data.tar.gz
tar -xvf data.tar
Kernel module

List which kernel module is installed: modinfo
Load a kernel module: modload
Developer’s corner

Bash

A very simple .bashrc on Solaris:
export PATH=/usr/bin/amd64:$PATH:/opt/csw/bin:.
export PS1=”[\u@\w] ”
On OpenSolaris:
PS1=’${LOGNAME}@$(/usr/bin/hostname):$(
[[ “${LOGNAME}” == “root” ]] && printf “%s” “${PWD/${HOME}/~}# ” ||
printf “%s” “${PWD/${HOME}/~}\$ “)’

export PATH=$PATH:/usr/local/bin:/usr/share/bin
32-bit vs 64-bit

To know whether your architecture is 32 or 64 bit: isainfo -b

There’s a very interesting article on Blog’o thnet.

To summarize, on 64-bit processors, the kernel, device drivers and some key applications (or those with a high performance issue) are 64-bit, but all other applications are usually 32-bit. There are no emulation libraries on Solaris 64 to run 32-bit libraries: there are two different system calls.

To check whether a given application is 32 or 64 bit, run file:

$ file /usr/bin/amd64/ls
/usr/bin/amd64/ls: ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, stripped
This also means that on 64-bit hosts, you should set your PATH to locate 64-bit applications before 32-bit ones. For example /usr/bin/amd64 should be set before /usr/bin.

Compilers etc

For Solaris, there’s a very interesting article on the subject here. Mainly, what I get of out it is:
no need to install a gcc package (such as CSWgcc) because gcc is usually installed by default in /usr/sfw (mine is version 3.4.3).
no need to install gmake (3.80) either: it’s already installed in /usr/sfw.
put /usr/sfw/bin at the top of your path, and remove /usr/ucb (or leave it at the end of your path – because it points to an ‘old’ cc).
install Sun Studio to get cc (among other things). Actually, cc is said to be better than gcc (faster code), but gcc is perhaps better known by GNU/Free addicts. Anyway, if cc is installed, add /opt/SUNWspro/bin to your path.
For example,

export PATH=/usr/bin/amd64:/usr/sfw/bin:/opt/csw/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/bin:/bin:.
export LD_LIBRARY_PATH=/usr/sfw/lib/amd64:/lib/amd64:/usr/lib/amd64:/usr/sfw/lib:/lib:/usr/lib:/opt/csw/lib:.
export MAKE=gmake
For OpenSolaris, install SUNWgcc and SUNWgmake.
Library path

According to Rich Teer’s article, programs should actually be linked with the -R option. This strategy reduces the need for a LD_LIBRARY_PATH.

However, in situations where the program hasn’t been linked that way, there are 2 different ways to configure your library path on Solaris:

set the common LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 environment variables
or use the crle (Configuration Runtime Linker Environment) command.
To list your current paths: crle or crle -64 To set new paths: crle -l -l …

Typical required paths are: /lib, /usr/lib, /opt/csw/lib, /opt/SUNWspro/lib.

GRUB

The menu to edit is in /rpool/boot/grub/menu.lst. You get its location by typing bootadm list-menu
Modifying GRUB live

When the system starts and the GRUB selections shows, edit the boot entries by typing ‘e’. Other commands:
‘d’ to delete a line
‘b’ to boot
Those modifications are temporary.
Restoring GRUB

To restore GRUB (and be able to boot Solaris) when @## someone/something has scratched it, do:

boot from the install CD of Solaris
For Solaris 10, select “6” for a prompt, single user mode
restore the boot loader
installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0
NB. installboot is now obsolete.

See more information on BigAdmin.

Updating GRUB

The command is:
/mnt/boot/solaris/bin/update_grub -R /mnt
where /mnt is the root one wants to boot.
Booting with or without boot information text

By default, OpenSolaris configures GRUB so that there is a ‘nice’ graphical splash screen. Unfortunately, when you’re fine tuning your OS, this prevents you from seeing the messages, so you might prefer to move back to text boot.
To do so, first, locate the GRUB menu file:
$ bootadm list-menu
the location for the active GRUB menu is: /a/rpool/boot/grub/menu.lst
default 0
timeout 10
0 OpenSolaris 2008.11 snv_101b_rc2 X86 With Splash Screen
Notice in my case, the menu file is located in /a/rpool/boot/grub/menu.lst. Edit that file with your favorite text editor so that such an entry
title OpenSolaris 2009.06 snv_111b With Splash Screen
findroot (pool_rpool,1,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris-1
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
becomes like this:
title OpenSolaris 2009.06 snv_111b text boot
findroot (pool_rpool,1,a)
bootfs rpool/ROOT/opensolaris-1
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
i.e remove the splashimage, foreground, background and console=graphics from the file.
It’s done ! You can reboot. However, I recommend you always backup your old GRUB menu. NB. This can be modified ‘live’ at boot time, by typing e to edit the GRUB menu when it displays.
Select the default GRUB menu

pfexec bootadm set-menu default=3
The GRUB menu can be located using bootadm list-menu.
Boot environments

It is possible to create several boot environments and boot different versions of Solaris, using a utility named beadm. In particular, the upgrade process actually creates a new boot environment for the new upgrade. Beadm seamlessly handles the tasks of copying all relevant file systems and updating GRUB. To list boot environments
$ beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
opensolaris – – 7.57G static 2009-01-03 13:18
opensolaris-1 NR / 3.59G static 2009-07-20 22:38
To mount an unmounted boot environment, do
$ beadm mount name /some/where
To destroy a boot environment (deletes the corresponding dataset with all files in it, but only unshared files):
beadm destroy name
For instance, if you destroy opensolaris,
$ beadm destroy opensolaris
$ beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
opensolaris-1 NR / 11.80G static 2009-07-20 22:38
You can also get information on disk space using:
$ df /
Filesystem 1K-blocks Used Available Use% Mounted on
rpool/ROOT/opensolaris-1
14266663 7646247 6620416 54% /
reboot

Quick reboot:
reboot -f
This command should be faster… To transition between BEs, use the init 6 / luactivate command.
Partitioning

Solaris cuts partition into slices. Those slices are numbered 0 to 7 and they correspond to the ‘s’ of the device (c0t0d0s3 refers to slice number 3). Slice number 2 is reserved and refers to the entire disk by convention.

Slices of a given partition may be listed with format.

On Solaris 10, use the command ‘print’ to show the current layout of a given disk.
partition> print
Current partition table (unnamed):
Total disk cylinders available: 39691 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 – 27046 13.00GB (27047/0/0) 27263376
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 39690 19.08GB (39691/0/0) 40008528
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

partition> 3

Part Tag Flag Cylinders Size Blocks
3 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 27047
Enter partition size[0b, 0c, 27047e, 0.00mb, 0.00gb]: 39690e
partition> print
Current partition table (unnamed):
Total disk cylinders available: 39691 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 – 27046 13.00GB (27047/0/0) 27263376
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 39690 19.08GB (39691/0/0) 40008528
3 unassigned wm 27047 – 39690 6.08GB (12644/0/0) 12745152
4 unassigned wm 0 0 (0/0/0) 0

5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

partition> label
Ready to label disk, continue? yes

partition> quit

format> volname
Enter 8-character volume name (remember quotes)[“”]:secondar
Ready to label disk, continue? yes

On OpenSolaris, use verify.
axelle@boureautic:~# format
Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c3d0

To show the disk partitions (not slices), use parted (or gparted).
$ parted /dev/dsk/c5t1d0p0
GNU Parted 1.8.8
Using /dev/dsk/c5t1d0p0
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) print
print
Model: Generic Ide (ide)
Disk /dev/dsk/c5t1d0p0: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary ntfs boot
2 106MB 115GB 115GB primary ntfs
3 115GB 273GB 157GB primary
4 273GB 500GB 227GB extended lba
5 273GB 377GB 105GB logical
6 377GB 500GB 123GB logical solaris
ZFS

ZFS is awesome !
Pools

Pool creation

The good news about ZFS is that it’s as great as expected. Storage units may span over partitions: several disks, devices, partitions and even files can be gathered in a single zfs pool, and then, from that pool virtual disk spaces can be provided the way you want.

zpool create -f pool c0d0s6 c0d0s7
Devices can easily be set for mirroring or RAIDZ. It’s as simple as adding a keyword to the command. However, make sure mirroring or raidz is what you need. For instance, my c0d0s6 slice has 15G and c0d0s7 has 17G. If I mirror them, I basically “lose” 2G in the second array. That’s not something I want at home (at work, the answer might be different).

zpool create -f pool raidz c0d0s6 c0d0s7
zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool 87K 15,3G 24,5K /pool
zfs destroy pool
zpool create -f pool c0d0s6 c0d0s7
zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool 87K 32,5G 24,5K /pool
Trying ZFS on simulated disks

Don’t have any available disk slices but want to try ZFS ? It’s possible to simulate pools with a file:
mkfile 100m /disk1
Compression

It’s very easy to set compression

zfs set compression=on pool
For example:

# zpool create -f pool c0d0s6 c0d0 s7
# zfs create pool/axelle
# zfs create pool/opt
# zfs set mountpoint=/opt pool/opt
# zfs set compression=on pool
# zfs set mountpoint=/export/home/axelle pool/axelle
Note before creating the pool, the two slices c0d0s6 & c0d0s7 should be backuped, unmounted and removed from /etc/vsftab. Then, once the pool is created, the original content can be restored. Also, mountpoints are acceptable only if they exist: make sure /export/home/axelle exists first. To see if a given pool has compression on,
$ zfs list -o name,compression
NAME COMPRESS
backup off
backup/backup1 on
rpool off
Quota, Reservations

To see if there is a quota on a ZFS pool:
$ zfs get quota rpool
NAME PROPERTY VALUE SOURCE
rpool quota none default
It’s a good idea to set quotas to make sure your partitions are not 100% full which is a problem (I tested…). To do so, ZFS talks of “reservations”: you reserve a given amount on the partition that should always be free.
$ pfexec zfs set reservation=500m rpool
$ zfs get reservation rpool
NAME PROPERTY VALUE SOURCE
rpool reservation 500M local
Share a pool on NFS

To share a pool on NFS:
zfs set sharenfs=on mypool
zfs get sharenfs mypool
sharemgr show -vp
Pool Status

$ zpool status
pool: rpool
state: ONLINE
status: The pool is formatted using an older on-disk format. The pool can
still be used, but some features are unavailable.
action: Upgrade the pool using ‘zpool upgrade’. Once this is done, the
pool will no longer be accessible on older software versions.
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c3d0s0 ONLINE 0 0 0
Listing file systems

This is the configuration I currently use on OpenSolaris:
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 41.3G 6.71G 1.42G /a/rpool
rpool/ROOT 5.78G 6.71G 18K legacy
rpool/ROOT/opensolaris 5.78G 6.71G 5.32G /
rpool/dump 895M 6.71G 895M –
rpool/export 32.3G 6.71G 19K /export
rpool/export/home 32.3G 6.71G 551M /export/home
rpool/export/home/axelle 31.7G 6.71G 31.3G /export/home/axelle
rpool/swap 895M 7.50G 88.3M –
The REFER column is the size of the file system if it stood alone.
The MOUNTPOINT column indicates where the file system is to be mounted. It does not indicate the file system is actually mounted. To list more options, such as whether the file system is mounted or not, mountable or not etc, do:
$ zfs list -o name,mountpoint,canmount,mounted
NAME MOUNTPOINT CANMOUNT MOUNTED
rpool /a/rpool on yes
rpool/ROOT legacy off no
rpool/ROOT/opensolaris / noauto no
rpool/ROOT/opensolaris-1 / noauto yes
rpool/dump – – –
rpool/export /export on yes
rpool/export/home /export/home on yes
rpool/export/home/axelle /export/home/axelle on yes
rpool/swap
Snapshots

This is a great feature of ZFS:
Setting up snapshots: time-slider-setup
Mounting a ZFS pool:
zfs import -r Listing snapshots in a given pool:
zfs list -t snapshot
or even: zfs list -t snapshot -o name,used
Destroying a given snapshot (if your system is 100% full and you absolutely need some space):
zfs destroy thesnapshot
Restoring a given snapshot:
zfs rollback -rRf
Troubleshooting ZFS pools

If disks in the pool have changed names (sda, sdb…), the pool won’t be available. To fix, that:
export the pool: sudo zpool export pool
get the id of the disk (if you want to import by disk-id):
$ sudo zpool import
pool: pool
id: 12116846563890507123
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

pool ONLINE
ata-WDC_WD5000AADS-00S9B0_WD-WCAV90510116-part6 ONLINE
import the disk by id:
$ sudo zpool import -d /dev/disk/by-id 12116846563890507123
System crash dump

$ pfexec dumpadm
Dump content: kernel pages
Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash/boureautic
Savecore enabled: no
To set the size for the dump on ZFS
zfs set volsize=2G rpool/dump
Swap

$ swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 182,2 8 1832952 1832952
Mounting partitions

To mount existing partitions:

UFS: default file system for Solaris, no need to specify file system type: mount /dev/dsk/… /mountpoint
FAT: use ‘pcfs’ file system type. If the partition is located in a primary partition (number N – for PCs between 1 and 4), you can simply mount that partition:
mount -F pcfs /dev/dsk/c0d0pN /mountpoint
where p0 means the whole disk and p1 to p4 refer to the primary fdisk partitions.
However, there’s another way to mount that partition: c0d0p0:. The letter ranges from c to z, and the number starts at 1. To select the first FAT partition: c0d0p0:1 or c0d0p0:c will do the trick. To select the second partition: c0d0p0:2 or c0d0p0:d. Note it’s always p0. Beware: the letter won’t always match the Windows unit drive. If your first unit drive (C:\) is a NTFS, then D:\ is FAT and E:\ is FAT, the first FAT partition is D:\ … but to mount it in Solaris use c0d0p0:1 or c0d0p0:c !

This method is particularly useful to mount partitions located within extended partition, because there’s no way to address the partition directly with a c0d0pN.

NFS: useful command: sharemgr show -vp
NTFS: not supported by Solaris
For automatic mounting, add an entry to /etc/vfstab:

/dev/dsk/c0d0p3 /dev/rdsk/c0d0p3 /mnt/win_e pcfs 3 yes
To mount a file as a filesystem, use lofiadm (loopback file driver). I haven’t tried that yet, but see instructions here.

Samba: this is a nice solution to mount remote Windows shares.
pfexec mount -F smbfs -o uid=username //host/share /mntpoint
The partition will be mounted for the specified username.
To do so, the samba client service must be started:

pfexec svcadm enable svc:/network/smb/client:default
NB. Samba uses the following packages:
system SUNWsmbau samba – A Windows SMB/CIFS fileserver for UNIX (Usr)
system SUNWsmbfskr SMB/CIFS File System client support (Kernel)
system SUNWsmbfsr SMB/CIFS File System client support (Root)
system SUNWsmbfsu SMB/CIFS File System client support (Usr)
for server:
system SUNWsmbskr SMB Server (Kernel)
system SUNWsmbsr SMB Server (Root)
system SUNWsmbsu SMB Server (Usr)
system SUNWsmbau samba – A Windows SMB/CIFS fileserver for UNIX (Usr)
Mounting a USB card

Plug it in, and then check where it has been mounted using df -h. My mobile phone is mounted in /rmdisk/noname .

Mounting a USB IOMEGA drive

Plug it in. It automatically mounts in /media/IOMEGA_HDD on my system.

Zones

Zones are sorts of virtual environments. You can run different ‘branded’ OS in each zones, in particular other Solaris or… a Linux. The zones (normally) don’t communicate with each other, so it’s a safe (or safer) way to isolate systems. This page explains how to install a Linux Zone on OpenSolaris. Below, I shall rather detail a few common zone commands. Listing zones:
$ zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
– lzonelinux installed /a/rpool/zones/lzonelinux lx shared

$ zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 lzonelinux running /a/rpool/zones/lzonelinux lx shared
running: means the OS in the zone is up and running
installed: means the zone is operational, but it is not running currently
Viewing the configuration for a zone:
$ zonecfg -z lzonelinux
zonecfg:lzonelinux> export
create -b
set zonepath=/rpool/zones/lzonelinux
set brand=lx
set autoboot=false
set ip-type=shared
add net
set address=x.y.z.w/24
set physical=yukonx0
end
add attr
set name=kernel-version
set type=string
set value=2.6
end
Other solution: zonecfg, then info.
zonecfg -z lzonelinux
WARNING: you do not have write access to this zone’s configuration file;
going into read-only mode.
zonecfg:lzonelinux> info
zonename: lzonelinux
zonepath: /a/rpool/zones/lzonelinux
brand: lx
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
net:
address: x.y.z.w/24
physical: yukonx0
defrouter not specified
attr:
name: kernel-version
type: string
value: 2.6
Note that it is not possible to modify the zone path for an installed zone. The zone must first be uninstalled:
pfexec zoneadm -z lzonelinux uninstall
Are you sure you want to uninstall zone lzonelinux (y/[n])? y
To boot an (installed) zone:
pfexec zoneadm -z lzonelinux boot
Then login:
pfexec zlogin lzonelinux
[Connected to zone ‘lzonelinux’ pts/7]
Welcome to your shiny new Linux zone.

To stop (halt) a zone:
pfexec zoneadm -z lzonelinux halt

Detecting hardware

To scan PCI devices, do scanpci (as root).

# /usr/X11/bin/scanpci -v
or
# prtconf -v -p
or
# prtdiag
To list connected hardware

cfgadm -al
To get status of hardware

iostat -En

To detect new hardware

touch /reconfigure
To list USB devices (or removable devices):
$ rmformat -l
Adding a hard disk

When adding a new hard disks, the following tasks should be done:

connect the hard disk and detect it (touch /reconfigure). It is detected when new entries in /dev/rdsk appear, such as c0t1d0*. This can also be confirmed by the format command, which displays all visible disks.
make sure the disk is formatted using the format command: the message “disk formatted” should be displayed
partition the hard disk as desired, using the format command. To list partitions, use the format command. The flag wm means “writable and mountable”, wu “writable but unmountable”, rm “read-only and mountable”.
label the disk once partitions are correct. Use the format command. Then, the prtvtoc command should display the correct layout of partitions.
create a new file system, using newfs (newfs /dev/rdsk/c0t1d0s0). This creates a UFS file system.
mount it ! (using mount) (mount /dev/dsk/c0t1d0s0 /backup)
Network card installation

My network card:

pci bus 0x0002 cardnum 0x00 function 0x00: vendor 0x11ab device 0x4364
Marvell Technology Group Ltd. Device unknown
CardVendor 0x105b card 0x0e0a (Card unknown)
STATUS 0x0010 COMMAND 0x0047
CLASS 0x02 0x00 0x00 REVISION 0x20
BIST 0x00 HEADER 0x00 LATENCY 0x00 CACHE 0x01
BASE0 0x00000000fddfc004 addr 0x00000000fddfc000 MEM 64BIT
BASE2 0x0000ee01 addr 0x0000ee00 I/O
MAX_LAT 0x00 MIN_GNT 0x00 INT_PIN 0x01 INT_LINE 0x0a
BYTE_0 0x00 BYTE_1 0x00 BYTE_2 0xf0 BYTE_3 0x01
Download the Solaris package (I tried version 8.19.2.3), gunzip it, untar. Finally, do pkgadd -d . YUKONXsolx. Then, configure the network.

/etc/rcS.d/S50yukonx
/kernel/drv/amd64/yukonx
/kernel/drv/yukonx.conf
/usr/sbin/yukonx_vlan_config
/usr/share/man/man7d/yukonx.7d
[ verifying class ]
[ verifying class ]
## Executing postinstall script.
add_drv yukonx
starting network interfaces …
yukonx0 started
My Firewire card:

pci bus 0x0003 cardnum 0x06 function 0x00: vendor 0x104c device 0x8024
Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
CardVendor 0x105b card 0x0e0a (Foxconn International, Inc., Card unknown)
STATUS 0x0210 COMMAND 0x0006
CLASS 0x0c 0x00 0x10 REVISION 0x00
BIST 0x00 HEADER 0x00 LATENCY 0x40 CACHE 0x01
BASE0 0xfdbff000 addr 0xfdbff000 MEM
BASE1 0xfdbf8000 addr 0xfdbf8000 MEM
MAX_LAT 0x04 MIN_GNT 0x02 INT_PIN 0x01 INT_LINE 0x0a
MAC address

$ arp -a
Apple Time Capsule

Time Capsules are shared using Samba. To discover an existing time capsule, do:
$ smbclient –no-pass -L 192.168.0.13
Domain=[WORKGROUP] OS=[Apple Base Station] Server=[CIFS 4.32]
Sound card

My sound card:

pci bus 0x0000 cardnum 0x14 function 0x02: vendor 0x1002 device 0x4383
ATI Technologies Inc SB600 Azalia
CardVendor 0x105b card 0x0e0a (Foxconn International, Inc., Card unknown)
STATUS 0x0410 COMMAND 0x0006
CLASS 0x04 0x03 0x00 REVISION 0x00
BIST 0x00 HEADER 0x00 LATENCY 0x40 CACHE 0x01
BASE0 0x00000000fe024004 addr 0x00000000fe024000 MEM 64BIT
MAX_LAT 0x00 MIN_GNT 0x00 INT_PIN 0x01 INT_LINE 0x0b
BYTE_0 0x00 BYTE_1 0x00 BYTE_2 0x02 BYTE_3 0x00
On Solaris 10, I use the OSS driver oss-solaris-v4.1-rc2-i386.pkg. On OpenSolaris, the sound card is automatically recognized 🙂
pkgadd -d oss-solaris-v4.1-rc2-i386.pkg
[…]
## Installing part 1 of 1.
/etc/oss/devices.list
/etc/oss
/etc/oss/version.dat
/kernel/drv/amd64/oss_hdaudio
/usr/bin/osstest
/usr/bin/ossxmix
/usr/include/oss/oss_userdev_exports.h
/usr/include/oss
/usr/include/sys/soundcard.h
/usr/man/man1/ossinfo.1
/usr/man/man7d/oss_hdaudio.7d
/usr/sbin/ossdetect
/usr/sbin/ossdevlinks
/usr/sbin/osslic
/usr/sbin/ossupdate
/usr/sbin/savemixer
/usr/sbin/soundoff
/usr/sbin/soundon
/usr/sbin/vmixctl
## Executing postinstall script.
Setting up Open Sound System….please wait
unloaded osscommon
can’t unload the module: Device busy
add_drv -m ‘* 0666 root sys’ osscore
add_drv -m ‘* 0666 root sys’ -i ‘”pci1002,4383″‘ oss_hdaudio
devfsadm: driver failed to attach: oss_hdaudio
Warning: Driver (oss_hdaudio) successfully added to system but failed to attach
add_drv -m ‘* 0666 root sys’ -i ‘”usbif,class1″‘ oss_usb
devfsadm: driver failed to attach: oss_usb
Warning: Driver (oss_usb) successfully added to system but failed to attach
add_drv -m ‘* 0666 root sys’ oss_sadasupport
devfsadm: driver failed to attach: oss_sadasupport
Warning: Driver (oss_sadasupport) successfully added to system but failed to attach

Then reboot, and try /usr/bin/osstest and see which devices works correctly.

Sound subsystem and version: OSS 4.2 (b 2005/201108060332) (0x00040100)
Platform: SunOS/i86pc 5.11 snv_111b

*** Scanning sound adapter #-1 ***
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front
– Performing audio playback test…
left OK OK OK
/dev/oss/oss_hdaudio0/pcm1 (audio engine 1): HD Audio play rear
– Performing audio playback test…

Then, rename /dev/dsp:
ln -sf /dev/oss/oss_hdaudio0/pcm4 /dev/dsp
See Tips and tricks of OSS for more details.

To disable the system beep: xset -b

To set volume: if you have Gnome: gnome-volume-control

On OpenSolaris, I experienced after a while some warning messages when booting (the OSS driver was complaining about undefined symbols). To solve this issue,
backup /etc/oss/installed_drivers
remove the line with ossusb in that file (it’s old and obsolete and one reason for the errors — see this forum
remove the oss driver:
pfexec rem_drv oss_usb
If you do modinfo, you should not see oss_usb any longer.
then, restart the oss driver:
chmod u+x /etc/init.d/oss
pfexec ./oss stop
pfexec ./oss start
To get some information on what’s installed concerning OSS sound drivers:
$ ossinfo
Version info: OSS 4.2 (b 2006/201202040133) (0x00040100)
Platform: SunOS/i86pc 5.11 snv_111b (boureautic)

Number of audio devices: 8
Number of audio engines: 12
Number of MIDI devices: 0
Number of mixer devices: 1

Device objects
0: osscore0 OSS common devices
1: oss_hdaudio0 ATI HD Audio interrupts=855 (1871)
HD Audio controller ATI HD Audio
Vendor ID 0x10024383
Subvendor ID 0x105b0e0a
Codec 3: ALC888 (0x10ec0888/0x105b0e0a)
2: oss_sadasupport SADA compatibility layer
Video card

OpenSolaris
For the ATI card:
remove any xorg.conf you may have (unless specific settings), the default settings are fine for this card
remove NVidia drivers if any (pkgrm NVDAgraphicsr NVDAgraphics)
reboot — -r
For the NVidia card (I have a Nvidia PCI Express N9400GT 512M DDR2)
get Solaris drivers from NVidia’s site (NVDAgraphicsr and NVDAgraphics) and install them
configure X for Nvidia: nvidia-xsettings
reboot — -r
NVidia provides helpful documentation to install its drivers on Solaris.
Screen resolution

Solaris:
Show acceptable screen configurations (SPARC ONLY):

ffbconfig -prconf
Try a given resolution (SPARC ONLY):

ffbconfig -res xxyyz try
If ffbconfig fails to set the correct resolution (bug), use eeprom:

eeprom ouput-device=r1024x768x60
To set 24 bit mode:

ffbconfig -deflinear true
Keyboard

To change the keyboard layout, do:
# svccfg
svc:> select keymap:default
svc:/system/keymap:default> setprop keymap/layout = German
svc:/system/keymap:default> exit
# svcadm refresh keymap:default
Printers

On OpenIndiana: Canon Pixma MP160 is automatically recognized (at hot plug) by CUPS using driver: Canon PIXMA MP160 – CUPS+Gutenprint v5.2.4.

I still can’t get Canon Pixma MP230 to work on OpenIndiana though.
Scanners

On OpenIndiana: My scanner is found, but I can’t manage to scan 🙁
$ sane-find-scanner
found USB scanner (vendor=0x04a9 [Canon], product=0x1714 [MP160]) at libusb:/dev/usb:4a9.1714/0
$ scanimage -L
device `pixma:04A91714_75413F’ is a CANON Canon PIXMA MP160 multi-function peripheral
Advanced Lights Out Manager

Copyright 2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.

Sun(tm) Advanced Lights Out Manager 1.6.6

Please login: USERNAME
Please Enter password: **************

astra_> poweron
SC Alert: Host System has Reset

astra_> console
Misc commands

Getting the location of the CD or DVD burner:
cdrecord -scanbus
scsibus5:
5,0,0 500) ‘HL-DT-ST’ ‘DVD-RW_GSA-H41N ‘ ‘RA00’ Removable CD-ROM
Ejecting a CD: eject
Boot prompt: stop-A at any moment to get there
boot -m verbose -> to understand what’s happening
boot cdrom -> to boot on CD-ROM !

Installing Solaris

On a Sparc

on prompt ‘ok’ (stop-A to get there), type ‘boot cdrom’… to boot the Solaris 10 CDs !
check the compatibility list with Sun’s Device Detection Tool: download the Sun Download Manager first, then launch the detection tool: javaws sddtool_20.jnlp &
make sure all network interfaces (hme0, hme1…) are plugged to the local network
for network configuration, beware that using DHCP means the network interfaces are expected to receive their IP address AND hostname from the DHCP server. If hostname is not sent, a script is mandatory to set it at each boot. Otherwise use static IP addresses, setting the gateway and the network mask.
default install is okay to use. It creates 3 partitions
c0t0d0s0 for / (5059 MB in my case)
c0t0d0s1 for the swap (512 MB)
c0t0d0s7 for /export/home (13885MB)
for software installation, select the Entire Group of Solaris 10 Software. Companion Software (freeware utilities such as gcc, make, xpdf etc) are nice to have.
On x86

The first thing to do is check one’s hardware is compatible with Solaris. Sun offers a Java based detection tool . It requires installation of a JRE 1.5. This tool worked fine on my host.

Then, the installation basically goes as follows. Most of the time, default selects are appropriate and there are no changes to do. That’s cool.

GNU Grub install : select Solaris (default)
Select Solaris interactive installation (default).
Select English as language. Actually, I usually hate to chose any other language, because translations are so poor I have to ‘reverse’ back to English to hope to understand what’s going on… My advice here is definitely, select English, unless you really don’t understand English (but then, I wonder how you cope everyday as a computer science engineer).
Set your hostname.
Set timezone, and root password
Ask for a Standard Installation (not Flash)
Configure for automatic eject and reboot
Then, select Locale: initial locale POSIX C looks fine
select solaris software: entire distribution (4740 MB)
select disks to install Solaris (they are labeled cXdY). It’s possible to use fdisk to create a Solaris Partition.
Installing OpenSolaris

Download and burn the latest CD of OpenSolaris. The current release (2008.11) fits on a single CD. It is both an installation CD and a Live CD. Let OpenSolaris boot from the CD, then click on “Install OpenSolaris” to get the work started.

Upgrading OpenSolaris

The only thing you need to do is:
pfexec pkg install SUNWipkg
Then, relaunch the update manager from a GNOME environment, and have it download all updates. It’ll download approximately 800Mb, so depending on your bandwidth, it may take time. Once all packages are downloaded, it’s quite quick to update. It’ll configure a new boot environment. Reboot, everything’s fine ! Yeeeaaah !
The upgrade process actually creates a new boot environment so that, once the upgrade is complete, you can still boot the old (or the new) version.
$ beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
opensolaris – – 7.57G static 2009-01-03 13:18
opensolaris-1 NR / 3.59G static 2009-07-20 22:38
On a ZFS point of view, the boot environments correspond to two different file systems:
$ zfs list -o name,mountpoint,canmount,mounted
NAME MOUNTPOINT CANMOUNT MOUNTED

rpool/ROOT/opensolaris / noauto no
rpool/ROOT/opensolaris-1 / noauto yes
Note that, of course, only one of these file systems is actually mounted. In my case, the new file system with 2009.06 is rpool/ROOT/opensolaris-1.
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT

rpool/ROOT/opensolaris 7.18G 5.42G 6.75G /
rpool/ROOT/opensolaris-1 3.43G 5.42G 7.40G /
There are shared blocks between both file systems, because not all files change when a system is upgraded, so they are not updated, and get shared between both file systems. Keeping both boot environments takes disk place. If you are short of disk space, you can safely remove the old boot environment and will get back the size of the unshared, no longer used files (don’t expect 7G back). The command is :
$ beadm destroy opensolaris
$ beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
opensolaris-1 NR / 11.80G static 2009-07-20 22:38
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 42.2G 5.76G 1.42G /a/rpool
rpool/ROOT 10.3G 5.76G 18K legacy
rpool/ROOT/opensolaris-1 10.3G 5.76G 7.41G /
rpool/dump 895M 5.76G 895M –
rpool/export 28.7G 5.76G 19K /export
rpool/export/home 28.7G 5.76G 654M /export/home
rpool/export/home/axelle 28.1G 5.76G 27.7G /export/home/axelle
rpool/swap 895M 6.55G 88.3M –
Which version of OpenSolaris do I have ?

Do uname -a, and have a look at the “snv” version.
Version uname label
2008.05 snv_86_rc3
2008.11 snv_101b
2009.06 snv_111b
Another solution is to cat /etc/release.
Release or Developer versions ?

Like Ubuntu and Debian have stable and unstable versions, OpenSolaris has a release version (stable) and a developer branch (unstable). To install and download packages from the release version, have the package manager (/usr/bin/packagemanager) use this URL:
http://pkg.opensolaris.org/release
or this one for the developer version:
http://pkg.opensolaris.org/dev
Updating OpenSolaris

pfexec pkg image-update -v
or updatemanager. or packagemanager (for packages).
Upgrading Solaris 10

u4 to u5

You need the u5 DVD (available from Sun’s website). The other alternative is to perform a live upgrade, but it seems somewhat complicated, you need a backup disk etc: try it for servers you can’t stop.

With the u5 DVD, it’s very simple:

boot on the DVD
the beginning is like a normal installation: set hostname, timezone, root password…
specify this is an upgrade and not a full re-install. The upgrade procedure will remove your u4 patches and proceed with u5 installation.
let the system install reboot (remove the DVD)
After reboot, the system failed to mount my ZFS partitions (/usr/sbin/zfs mount -a). It complained /opt wasn’t empty: indeed, the installation procedure had put Star Office 8 in /opt, whereas I already have a ZFS /opt partition: so the ZFS /opt failed to mount. This has been easily fixed by temporarily moving Star Office to /, mounting the ZFS partition, and then moving back Star Office to the new ZFS /opt.

Apart from this slight problem, upgrade proceeded without any problem. It even kept my specific network driver, and of course did not overwrite any other partition than /.

u5 to u6

The nice thing with u6 is that it supports ZFS boot. If possible, do not use CDs but DVDs: there’s a known bug on CD 2 that occurs from time to time.

Enabling Remote root login Solaris 10.

Enabling Remote root login Solaris 10.

It is neither recommended nor suggested to allow remote root logins for security reasons.
For Test servers, Non-production servers or other servers, you may want to allow remote root login via SSH.

Usually you get “Access denied” errors when accessing a Solaris server as root when logging on remotely.

You just have to edit two entries in two files.

First:
/etc/default/login

Comment the following line in /etc/default/login by putting a # sign before the line.

CONSOLE=/dev/console

This will enable remote root logins to the system.

Second:
/etc/ssh/sshd_config

Comment the following line in /etc/ssh/sshd_config by putting a # sign before the line.

PermitRootLogin no

Then add the following line just below the above line.

PermitRootLogin yes

Find pid in Solaris 10

Find pid in Solaris 10

If you do not know the pid of a process, you can use “pidof” command in Linux. In case of Solaris, its not available.

Here’s how you can find it:

#ps -ef | grep nscd | grep -v grep | cut -c12-19
123

Here, it will find the pid of nscd. the cut command will cut characters from 12 to 19 from output of ‘ps -ef’ command.
or

#ps -ef | grep nscd | grep -v grep | awk ‘{print $2}’

Here, we use awk to print second column of ps.

after Solaris 10 installation

after Solaris 10 installation

1. Set BASH as default shell for root:
This is first thing I really do! Because bash has multiple advantages for day to day use and scripting too, over other shells.
For this you can simply edit /etc/passwd file and change the shell from very first line.
By default it is /sbin/sh, you can change it to /bin/bash

2. Change the hostname from “unknown”
To change the hostname temporarily:
hostname SERVER01
To change the hostname so that it is persistent across reboots:
echo SERVER01 > /etc/nodename
However, the changed hostname is re-set when you run sys-unconfig command to reset the configuration of the system.

3. Disable GUI Login:
/usr/dt/bin/dtconfig -d
For more, see here about disabling and enabling GUI login in Solaris

4. Configure loghost:
You might get messages such as “loghost could not be resolved.”. To be able to resolve loghost you must configure DNS Server or you can add entry in /etc/hosts such as “127.0.0.1 loghost”.

5. Disable sendmail:
You can disable sendmail by issuing a simple command,
svcadm disable sendmail
Hmm… not everybody uses sendmail…

6. Set PS1 variable (This is only for people using BASH):
It is solely user’s choice to set this variable. Solaris has it as PS1=’\s-\v\$ ‘ by default.
However, I set it as PS1=”$LOGNAME@$HOSTNAME# ” so that it will be displayed as:
root@SERVER01# _
For more information on PS1 environment variable check

Read more at http://kaustubhghanekar.blogspot.com/2012/08/5-things-you-probably-want-to-do-after.html#tdpUO6dXDOIeo9jA.99