Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Easter Paintings: 2 The Crucifixion

By: hoakley
19 April 2025 at 19:30

In this second of my three articles devoted to paintings of Easter, I cover the Crucifixion, from Christ’s ascent to calvary bearing his cross, to the entombment of his body.

Way of the cross

tintorettoascentcalvary
Jacopo Tintoretto (c 1518-1594), Ascent to Calvary (E&I 128) (1566-67), oil on canvas, 285 x 400 cm, Albergo, Scuola Grande di San Rocco, Venice, Italy. Image by Sailko, via Wikimedia Commons.

Jacopo Tintoretto’s Ascent to Calvary (E&I 128) is unusual among paintings of this phase of the Passion for its inclusion of all three of those to be crucified bearing their crosses. Christ is naturally prominent in the upper half of a composition dominated by diagonals, formed by the winding path and the crosses themselves. He and the two thieves are each given assistants who help them with the burden of the crosses.

In the upper distance are banners declaring the oversight of the Roman authorities, in their inscriptions of SPQR. Tintoretto links this with the Crucifixion with the inclusion of the tradesmen and their tools who were shortly to be responsible for the mechanics of the executions. Here the thick ropes bind the figures together, as they are used to attach the crosses to their bearers, and to draw the three along to their deaths.

corinthchristcarryingcross
Lovis Corinth (1858–1925), Christ Carrying the Cross (1909), oil, dimensions not known, Städelsches Kunstinstitut und Städtische Galerie, Frankfurt. Wikimedia Commons.

Lovis Corinth’s Christ Carrying the Cross (1909) explores Christ’s Passion in real terms. Although this contains most of the usual elements seen in traditional depictions, his language is contemporary, almost secular. Two men, one of them apparently African, are helping Christ bear his exhausting load, while a couple of soldiers are whipping him on, and threatening him with their spears. A third soldier is controlling the crowd at the upper left, and behind is a mounted soldier and one of the disciples.

Crucifixion

tintorettocrucifixionsanrocco
Jacopo Tintoretto (c 1518-1594), The Crucifixion (E&I 123) (1565), oil on canvas, 536 x 1224 cm, Albergo, Scuola Grande di San Rocco, Venice, Italy. Wikimedia Commons.

Tintoretto’s Crucifixion (E&I 123) (1565) is over 5 metres (17 feet) high, and 12 metres (40 feet) across. The artist makes use of space with a narrative technique based on the traditional ‘multiplex’ form popular during the Renaissance: its single image shows events at more than a single point in time, in an ingenious and modern manner.

tintorettocrucifixionsanroccod1
Jacopo Tintoretto (c 1518-1594), The Crucifixion (detail) (E&I 123) (1565), oil on canvas, 536 x 1224 cm, Albergo, Scuola Grande di San Rocco, Venice, Italy. Wikimedia Commons.

Naturally, the painting centres on Christ crucified, but the two thieves executed beside him are not shown, as would be traditional, already hanging from their crosses. Instead, to the right of Christ, the ‘bad’ thief is still being attached to his cross, which rests on the ground. To the left of Christ, the ‘good’ thief is just being raised to the upright position.

Spaced out around the canvas are relevant sub-stories from that whole. At the foot of Christ’s cross is his group of mourners, including the Marys. Each of the crosses has attendant workers, busy with the task of conducting the crucifixion, climbing ladders, hauling on lines, and fastening each victim to his cross. This mechanical and human detail brings the scene to life, adding to its credibility and grim process.

tissotlordsawfromcross
James Tissot (1836-1902), What Our Lord Saw from the Cross (1886-1894), opaque watercolor over graphite on gray-green wove paper, 24.8 × 23 cm, Brooklyn Museum, New York, NY. Courtesy of Brooklyn Museum, via Wikimedia Commons.

James Tissot’s What Our Lord Saw from the Cross is a uniquely innovative and narrative depiction of the crucifixion.

Descent from the Cross

rubensdescentfromcross
Peter Paul Rubens (1577–1640), Descent from the Cross (centre panel of triptych) (1612-14), oil on panel, 421 x 311 cm, Onze-Lieve-Vrouwekathedraal, Antwerp, Belgium. Image by Alvesgaspar, via Wikimedia Commons.

Peter Paul Rubens painted a huge panel showing the Crucifixion, although in this case it’s strictly speaking a Deposition: this centre panel, Descent from the Cross (1612-14), is from his triptych commissioned by the Confraternity of the Arquebusiers of Antwerp for the Cathedral of Our Lady in that city. This remains one of Rubens’ greatest religious paintings.

corinthdeposition
Lovis Corinth (1858–1925), The Deposition (1895), oil on canvas, 95 × 102 cm, Wallraf-Richartz-Museum, Cologne. Wikipedia Commons.

The Deposition (Descent from the Cross) (1895) was one of Lovis Corinth’s major paintings from his time in Munich, and won a gold medal when it was exhibited in the Glaspalast in Munich, in 1895. It shows the traditional station of the cross commemorating the lowering of the dead body of Christ from the cross, attended by Joseph of Arimathea and Mary Magdalene.

This work is a thoroughly modern approach to this classical theme, in its framing, composition, and the faces. Its close-in cropped view suggests the influence of photography, and the faces shown appear contemporary and not in the least historic. These combine to give it the immediacy of a current event, rather than something that happened almost two millennia ago. Corinth returned to the subject of the Deposition, and the theme of the Crucifixion, in many of his paintings.

Pietà

moreaupieta1876
Gustave Moreau (1826–1898), Pietà (c 1876), oil on panel, 23 x 16 cm, National Museum of Western Art 国立西洋美術館 (Kokuritsu seiyō bijutsukan), Tokyo, Japan. Wikimedia Commons.

Gustave Moreau painted several versions of the Pietà (c 1876), this one on a tiny panel. It incorporates some of the more radical imagery which was appearing in his mythological paintings, with a blue wing in the centre.

Entombment

The Entombment c.1805 by William Blake 1757-1827
William Blake (1757–1827), The Entombment (c 1805), ink and watercolour on paper, 41.7 x 31 cm, The Tate Gallery (Presented by the executors of W. Graham Robertson through the Art Fund 1949), London. © The Tate Gallery and Photographic Rights © Tate (2016), CC-BY-NC-ND 3.0 (Unported), http://www.tate.org.uk/art/artworks/blake-the-entombment-n05896

William Blake’s The Entombment (c 1805) refers to the gospel of Luke, chapter 23 verses 53 and 55:
And he took it [the body of Jesus] down, and wrapped it in linen, and laid it in a sepulchre that was hewn in stone, wherein never man before was laid.
And the women also, which came with him from Galilee, followed after, and beheld the sepulchre, and how his body was laid.

Easter Paintings: 1 The Passion

By: hoakley
18 April 2025 at 19:30

Easter is one of the two landmarks in the Christian calendar. This weekend I devote three articles to paintings of the Passion, Crucifixion and Resurrection of Jesus Christ. Although these don’t sync perfectly with the calendar, they should provide better coverage of events that are the most painted in European art. Today, on Good Friday, these cover the Passion prior to the Crucifixion; tomorrow, paintings show the Crucifixion itself, and on Easter Sunday I end with the Resurrection.

Christ’s triumphal entry into Jerusalem

dorechristsentryjerusalem
Gustave Doré (1832–1883), Christ’s Entry into Jerusalem (before 1876), oil on canvas, 98.4 x 131.4 cm, Private collection. Wikimedia Commons.

Now known almost exclusively for his fine engravings for books, Gustave Doré was in his time as well known for his paintings. This is a preparatory sketch for one of his several versions of Christ’s Entry into Jerusalem. This shows the conventional Christian account in the Gospels, of Christ entering Jerusalem in triumph, on the back of a donkey, as the start (‘Palm Sunday’ because of the palm fronds usually involved) of the series of processes leading to his Crucifixion. A popular biblical narrative in European painting, few finished works can match Doré’s at 6 by 10 metres size.

Cleansing of the Temple

previatidrivingmerchants
Gaetano Previati (1852–1920), Christ Driving the Money-Changers from the Temple (date not known), oil on canvas, 116 × 108 cm, Private collection. Wikimedia Commons.

Gaetano Previati’s undated and sketchy painting of Christ Driving the Money-Changers from the Temple appears to predate his Divisionism. It shows the Cleansing of the Temple, in which Jesus expelled merchants and money-changers from the Temple of Jerusalem, as described in the Gospel of Matthew, chapter 21, verses 12-17.

Anointing of Jesus by a woman

blakemarywashingchristsfeet
William Blake (1757–1827), Mary Magdalene Washing Christ’s Feet (c 1805), pen and ink and watercolor over graphite on paper, 34.9 x 34.6 cm, Philadelphia Museum of Art (Gift of Mrs. William Thomas Tonner, 1964), Pennsylvania, PA. Courtesy of Philadelphia Museum of Art.

William Blake’s Mary Magdalene Washing Christ’s Feet is one of the biblical series he painted for his patron Thomas Butts in about 1803-05. It shows the scene during the supper at the house of Martha and Mary, which prefigured the Last Supper in several ways. This is told in the gospel of John, chapter 12 verses 1-8:

Then Jesus six days before the passover came to Bethany, where Lazarus was, which had been dead, whom he raised from the dead. There they made him a supper; and Martha served: but Lazarus was one of them that sat at the table with him. Then took Mary a pound of ointment of spikenard, very costly, and anointed the feet of Jesus, and wiped his feet with her hair: and the house was filled with the odour of the ointment.

Then saith one of his disciples, Judas Iscariot, Simon’s son, which should betray him, “Why was not this ointment sold for three hundred pence, and given to the poor?” This he said, not that he cared for the poor; but because he was a thief, and had the bag, and bare what was put therein. Then said Jesus, “Let her alone: against the day of my burying hath she kept this. For the poor always ye have with you; but me ye have not always.”

Presumably the man sat in the centre, wearing blue, is intended to be Lazarus; Mary and Jesus look awkward together: it has been proposed that this results from meanings that Blake attached to left and right, but here it’s almost inevitable given the composition. This does, though, provide a full view of the curved and compacted figure of Mary, and her wiping of Jesus’ feet using her luxuriant hair.

The Last Supper

giampietrinocopylastsupper
Giampietrino (1495–1549), copy after Leonardo da Vinci (1452–1519), The Last Supper (c 1520), oil on canvas, 298 x 770 cm, The Royal Academy of Arts, London. Wikimedia Commons.

The most famous painting of The Last Supper, and one of the best-known works in the European canon, is of course Leonardo da Vinci’s. Giampietrino’s copy from about 1520 gives the closest impression today of what the original must have looked like. Even this copy has been horribly mutilated: the upper third was cut off, and its width reduced, but at least what remains gives a better idea of the original’s appearance.

Leonardo’s composition wasn’t entirely revolutionary for the time. Previous paintings of The Last Supper had spread the apostles along the length of a table, with Christ at its centre. However, Judas Iscariot was usually placed alone on the near side, his back to the viewer, and sometimes with his bag of silver visible behind his back.

Leonardo shows the moment of surprise and denial when Christ announces that one of those sat around the table would betray him. In this he was perhaps the first artist to assemble the apostles into small groups, a feature that has been repeated in innumerable images following this. For not only must this be one of the greatest works of European art, it must also have spawned more copies and parodies than any other.

tintorettolastsuppersantrovaso
Jacopo Tintoretto (c 1518-1594), The Last Supper (E&I 95) (c 1563-64), oil on canvas, 221 x 413 cm, Chapel of the Sacrament, San Trovaso, Venice, Italy. Image by Sailko, via Wikimedia Commons.

Jacopo Tintoretto’s version from 1563-64 is so radically informal that it still shocked John Ruskin when he saw it three centuries later. Its table is almost square and low-set, with Jesus leaning back and talking quite casually. Twelve apostles sit, lounge, slump and lean around the table, of which one at the right is even eating his meal from his lap. There’s a rough assortment of seating, with a chair resting on its side under the table, as if hurriedly abandoned, which is perhaps a reference to Judas Iscariot.

The Garden of Gethsemane

This has posed the greatest problems for paintings, in that the action in the garden took place in the dark.

The Agony in the Garden c.1799-1800 by William Blake 1757-1827
William Blake (1757–1827), The Agony in the Garden (1799–1800), tempera on iron, 27 x 38 cm, The Tate Gallery (Presented by the executors of W. Graham Robertson through the Art Fund 1949), London. © The Tate Gallery and Photographic Rights © Tate (2016), CC-BY-NC-ND 3.0 (Unported), http://www.tate.org.uk/art/artworks/blake-the-agony-in-the-garden-n05894

William Blake’s The Agony in the Garden is an unusual moment from the popular sequence of the Passion. Although much of it is inevitably dark, Blake’s imagery is as radical as those in his watercolours. The story is a composite from the gospels of Matthew, Mark, and Luke, and shows the instant just before Christ’s betrayal by Judas and his arrest. An angel appeared from heaven, to strengthen Jesus, and “his sweat was as it were great drops of blood falling down to the ground.”

Christ’s head is tilted in the extreme to face the angel, who grasps him under the armpits. The angel has descended from a brilliant red burst at the top of the painting, while the disciples are seen asleep among the dark tree-trunks.

The Trials of Jesus

tissotjesusbeforepilate
James Tissot (1836–1902), Jesus Before Pilate, First Interview (1886-1894), opaque watercolor over graphite on gray wove paper, 16.8 x 28.6 cm, Brooklyn Museum, New York, NY. Courtesy of Brooklyn Museum, via Wikimedia Commons.

James Tissot’s huge series of watercolours showing the life of Christ includes the Passion in great, and sometimes graphic, detail. Jesus Before Pilate, First Interview shows the episode from Luke 23:1-4 and John 18:33-38 in which Pilate, the Roman governor at the time, questions Jesus and concludes that there is no basis for any charge against him. Technically one of the most brilliant paintings of the series, it is easy to mistake this for being painted in oils.

Crowning with Thorns

boschchristcrownedwiththorns
Hieronymus Bosch (c 1450–1516), The Crowning with Thorns (c 1490-1500), oil on oak panel, 73.8 x 59 cm, The National Gallery, London. Wikimedia Commons.

In Hieronymus Bosch’s The Crowning with Thorns from about 1490-1500, there are four men around the head and body of Jesus Christ. At the top left, a crossbowman dressed in a green cloak and wearing full armour on his right hand holds, in that hand, the crown of thorns, so as to place it on Christ’s head. At the top right, an older man, whose right arm rests on Christ’s right shoulder, has a more concerned expression, his brows knitted, almost as if trying to reassure Christ.

At the lower right, another older man is seen in profile, looking up at Christ, and clutching at his white robe with both hands. At the lower left, a much older man also appears in profile, looking up at Christ, his left hand holding the top of a stick, his right touching Christ’s body. Christ looks directly at the viewer, his face appearing calm and resigned. He wears a thin, white linen robe, from which his right hand protrudes.

antonellochristcolumn
Antonello da Messina (c 1430–1479), Christ at the Column (c 1478), oil on panel, 29.8 x 21 cm, Musée du Louvre, Paris. Wikimedia Commons.

Antonello da Messina’s Christ at the Column, painted in about 1478, is one of the masterpieces of European oil painting. The head of Christ here is almost identical to that of the artist’s pieta, to the point where he is thought to have used the same cartoon for both, but here showed the eyes open and looking up to the heavens.

Amazingly, this painting didn’t appear until 1863, when it was bought by the chief curator at the South Kensington Museum in London from a dealer in Granada, Spain. It was originally attributed to Andrea Solario, and wasn’t recognised as Antonello’s until the twentieth century. After display in the National Gallery in London, it was bought by the Louvre in 1992.

Reading Visual Art: 202 Rabbit & Hare

By: hoakley
1 April 2025 at 19:30

As today is the first day of April, it’s a double danger: as the first of the month you should say rabbit or white rabbit when you first wake up, and it’s All Fools’ Day as well. I have no hoaxes for you this year, I promise, but I do have rabbits, some of them white, and a few hares as well. Rabbits and hares are relatively infrequent in paintings, and where they do occur they seldom have any deeper reading.

Because they’re so familiar, they appear in animal gatherings.

boschgardenearthlydelightsltmid
Hieronymus Bosch (c 1450–1516), The Garden of Earthly Delights (left panel, detail) (c 1495-1505), oil on oak panel, central panel 190 × 175 cm, each wing 187.5 × 76.5 cm, Museo Nacional del Prado, Madrid. Wikimedia Commons.

In the left panel of Hieronymus Bosch’s Garden of Earthly Delights (c 1495-1505) is a curious mixture of real and imaginary creatures. There’s an elephant and a giraffe, both early depictions of those species, together with monkeys, brown bears, rabbits, and more, even a white unicorn drinking at the lake on the left.

potterorpheusanimals
Paulus Potter (1625–1654), Orpheus and Animals (1650), oil on canvas, 67 x 89 cm, Rijksmuseum, Amsterdam. Wikimedia Commons.

Among the many superb animal paintings of Paulus Potter, Orpheus and Animals from 1650 is one of his most unusual, showing a wide range of different animal species, some of which weren’t well-known at that time, and one of which (the unicorn) didn’t even exist. Those seen include a Bactrian camel (two humps), donkey, cattle, ox, wild pig, sheep, dog, goat, rabbit, lions, dromedary (one hump), horse, elephant, snake, deer, unicorn, lizard, wolf, and monkey.

tintorettocreationanimals
Jacopo Tintoretto (c 1518-1594), Creation of the Animals (1550-53) (E&I 55), oil on canvas, 151 × 258 cm, Gallerie dell’Accademia, Venice, Italy. Wikimedia Commons.

In Tintoretto’s Creation of the Animals, the first of his Old Testament cycle for the Scuola della Trinità in Venice, God flies along as he creates pairs of different species of bird, fish, and animal, from cormorants to rabbits.

Among their leading roles is in Elihu Vedder’s delightful painting of the unfortunate Marsyas.

veddermarsyashares
Elihu Vedder (1836–1923), Young Marsyas (Marsyas Enchanting the Hares) (1878), oil on canvas, dimensions not known, Private collection. The Athenaeum.

Late in 1877, Carrie Vedder, the artist’s wife, recorded in a letter that her husband had been thinking about Marsyas, and considered that, before the contest with Apollo, Marsyas must have proved his skill with the aulos. He therefore came up with the idea that this must have at least been charming hares with the instrument. He started this painting early in 1878, setting it in the New England winter. This was shipped to Paris for show at the Exposition Universelle later that year, but Vedder was disappointed that it didn’t do well there.

The hare is known from fable for its speed, although not so much when racing against a tortoise.

snydershareandthetortoise
Frans Snyders (1579–1657), The Fable of the Hare and the Tortoise (1600-57), oil on canvas, 112 x 84 cm, Museo Nacional del Prado, Madrid. Wikimedia Commons.

At some time during the first half of the seventeenth century, Frans Snyders painted the still popular Fable of the Hare and the Tortoise. The tortoise and the hare disputed which of the two was the faster, so agreed to run a race against one another. Although the hare was much faster when running, he laid down beside the path and slept. The tortoise, being aware of his relative slowness, ran as fast as he could, past the sleeping hare, until he won. Snyders shows the hare at full pelt, and the tortoise crawling away in the distance, giving little clue as to the surprising outcome or its cause.

JMW Turner alludes to this fable in his Rain, Steam and Speed – The Great Western Railway from 1844.

turnerrainsteamspeedgwr
Joseph Mallord William Turner (1775–1851), Rain, Steam and Speed – The Great Western Railway (1844), oil on canvas, 91 x 121.8 cm, The National Gallery, London. Wikimedia Commons.

Running ahead of this very early steam locomotive as it crosses the River Thames at Maidenhead is a hare, barely visible at the lower right.

Albrecht Dürer, Hare, 1502, watercolour and bodycolour on paper, 25 x 22.5 cm. Albertina, Vienna (WikiArt).
Albrecht Dürer (1471-1528), Hare (1502), watercolour and bodycolour on paper, 25 x 22.5 cm. Albertina, Vienna. WikiArt.

Perhaps the most famous painted hare appears in one of Albrecht Dürer’s watercolour masterpieces, dated to 1502.

liljeforsharestudies
Bruno Liljefors (1860–1939), Hare Studies (1885), paper, 32 × 24.5 cm, location not known. Wikimedia Commons.

Following this tradition, one of Bruno Liljefors’ favourite species was the elusive hare. This page of Hare Studies from 1885 shows a tiny part of the image library he assembled, as well as their spring antics.

liljeforswinterhare
Bruno Liljefors (1860–1939), Winter Hare (1910), oil on canvas, 92 × 78 cm, Private collection. Wikimedia Commons.

Unlike the common rabbit, some hares become white for the winter. This is one of the many paintings that Liljefors made of a Winter Hare, here from 1910.

Both hares and rabbits have been traditional meats, and there are several still life and hunting paintings depicting them dead and being prepared for a meal.

NM 785
Jean-Baptiste-Siméon Chardin (1699–1779), Rabbit and Copper Pot (date not known), oil on canvas, 59 x 56 cm, Nationalmuseum, Stockholm, Sweden. Wikimedia Commons.

Several of Chardin’s small output of about 200 paintings included hanging game, here an undated Rabbit and Copper Pot, elsewhere hares and others.

The rise of the sciences during the nineteenth century didn’t spare rabbits from being used in physiological experiments.

lhermitteclaudebernard
Léon Augustin Lhermitte (1844–1925), Claude Bernard and His Pupils (1889), copy of original by unknown artist, oil on canvas, 86.5 x 112.5 cm, Wellcome Library no. 45530i, London. Courtesy of Wellcome Images, via Wikimedia Commons.

Following the death of the physiologist Claude Bernard, the Sorbonne (where he had taught) commissioned Léon Lhermitte to paint his portrait in 1886. Sadly I’ve been unable to trace an image of the original, but Claude Bernard and His Pupils is a faithful copy of the painting that Lhermitte exhibited at the Salon in 1889. This shows Bernard in the midst of performing an experiment on a rabbit, his students discussing its results, and one writing the experimental observations in the laboratory daybook.

Rabbits have been favourites with children, and kept as domestic pets. From there they appear in some of the most surprising places.

zeissigchineseshadows
Johann Eleazar Zeissig (1737–1806), A Family Making Chinese Shadows (date not known), oil on canvas, 55.3 x 45.7 cm, location not known. Wikimedia Commons.

Johann Eleazar Zeissig shows A Family Making Chinese Shadows in his painting from the late 1700s. A family are entertaining themselves late in the evening with the aid of a lamp as a point source of light. An older boy is tracing the silhouette of his mother on a sheet of paper which he holds on the wall behind her. At the upper right are examples of his ‘shadowgraph’ drawings. Three younger children are holding up their hands to form the silhouettes of a rabbit and a cat, clichés of childhood.

mackelittlewalterstoys
August Macke (1887–1914), Little Walter’s Toys (1912), media not known, 50 x 60 cm, Städelsches Kunstinstitut und Städtische Galerie, Frankfurt, Germany. Wikimedia Commons.

August Macke’s Little Walter’s Toys from 1912 includes two of the favourite family pets, a rabbit and guinea pig.

My last guest appearance of a white rabbit is the most curious of all.

The Bay of Baiae, with Apollo and the Sibyl exhibited 1823 by Joseph Mallord William Turner 1775-1851
Joseph Mallord William Turner (1775–1851), The Bay of Baiae, with Apollo and the Sibyl (1823), oil on canvas, 145.4 x 237.5 cm, The Tate Gallery (part of the Turner Bequest 1856), London. © The Tate Gallery and Photographic Rights © Tate (2016), CC-BY-NC-ND 3.0 (Unported), http://www.tate.org.uk/art/artworks/turner-the-bay-of-baiae-with-apollo-and-the-sibyl-n00505

JMW Turner painted this narrative landscape of The Bay of Baiae, with Apollo and the Sibyl in 1823. Apollo is on the left, with his lyre, and the dark-haired Sibyl has adopted an odd kneeling position. She’s holding some sand in the palm of her right hand, asking Apollo to grant her as many years of life as there are grains. Opposite the couple, on the other side of the path, under the trees, is a white rabbit.

Maybe it was just the first day of the month.

Two Duchesses: Paintings of the Duchess of Ferrara

By: hoakley
2 March 2025 at 20:30

To follow yesterday’s account of the painting patronage of Isabella d’Este (1474-1539), Duchess of Mantua, today I look at her husband’s lover and one of the most famous femmes fatales, Lucrezia Borgia (1480-1519), Duchess of Ferrara, Modena and Reggio. She had no aspirations as a patron of the arts, and instead has been portrayed in several paintings.

Her father was Cardinal Rodrigo de Borgia, later to become Pope Alexander VI, and her mother was one of his several mistresses who were kept discreetly outside the city of Rome. She was born on 18 April 1480, and received an unusually broad education, becoming proficient in four main languages, as well as being able to read Latin and Greek.

Before she was even eleven years old, marriage was arranged for her, first with a Valencian noble, then with the Count of Procida. After her father became Pope, that was changed again to a second-rank count in the House of Sforza. Lucrezia married him when she was just thirteen, for the Pope’s political gain.

The papal court soon lost interest in the Sforzas, so the Pope ordered her husband’s execution. Lucrezia warned him, enabling him to flee, and their marriage was annulled on the basis of non-consummation, sparing his life. It’s generally thought that, while awaiting the annulment, Lucrezia had an affair resulting in her pregnancy, and the birth of a son, Giovanni Borgia, although two papal bulls were issued contradicting that, and one another.

When she was eighteen, Lucrezia was married a second time, to Alfonso d’Aragon, the Neapolitan half-brother of her brother-in-law. The following year it was she, rather than her husband, who was appointed governor of Spoleto, and a year later, in 1500, her husband was murdered, apparently on the orders of Lucrezia’s brother Cesare because of changing political allegiances.

Her father, the Pope, then arranged a third marriage, to Alfonso d’Este, the Duke of Ferrara, which proved both more lasting and productive of eight children. However, neither husband nor wife was faithful in the slightest: Lucrezia had a long and thoroughly physical affair with her brother-in-law Francesco Gonzaga, the Marquess of Mantua, Isabella d’Este’s husband, which he had to terminate when his syphilis became too overt to hide any longer.

Lucrezia also had a more emotional affair with the poet Pietro Bembo, who is now commemorated in the font of that name. She fell seriously ill after the birth of her tenth child in June 1519, and died on 24th of that month.

dossoilucreziaborgia
Dosso Dossi (Battista Dossi) (c 1486-1541/2) (attr), Lucrezia Borgia, Duchess of Ferrara (1519-30), oil on wood panel, 74.5 x 57.2 cm, National Gallery of Victoria, Melbourne, Australia. Wikimedia Commons.

The closest that we have to a portrait of Lucrezia is this panel attributed to Dosso Dossi, and claimed to show Lucrezia Borgia, Duchess of Ferrara from some time between 1519-30. Inevitably that remains a matter of dispute, and doesn’t match contemporary descriptions of her having long and thick blonde hair.

pinturicchiostcatherinesdisputation
Pinturicchio (1454–1513), St Catherine’s Disputation (1492-94), fresco with gold leaf, dimensions not known, Appartamento Borgia, Palazzi Vaticani, Vatican City. Wikimedia Commons.

It has been proposed that Lucrezia modelled for the title role of Pinturicchio’s wonderful fresco of St Catherine’s Disputation in the Borgia Apartments in the Vatican Palace. She would therefore be the woman wearing a red cloak over a patterned blue dress to the left of the centre foreground. As this was painted between 1492-94, she would only have been 12-14 at the time, and in the throes of her first marriage.

There are two other contemporary portraits claimed to be of Lucrezia, both painted by Bartolomeo Veneto, and otherwise unidentified.

venetoyounglady
Bartolomeo Veneto (fl 1502–1555), Portrait of a Young Lady (c 1500-10), oil on wood, 55.5 x 44.2 cm, The National Gallery (Salting Bequest, 1910), London. Courtesy of and © The National Gallery, London.

Veneto’s early Portrait of a Young Lady, probably from about 1500-10, has been thought to have a Ferrarese origin, and one of the beads worn by her is inscribed ‘SAP’. Her hair isn’t blonde, and she’s dressed in sombre clothing bearing emblems of the Passion. If the dating of this work is correct, Lucrezia would have been in her twenties at the time.

venetocourtesanasflora
Bartolomeo Veneto (fl 1502–1555), Idealised Portrait of a Courtesan as Flora (c 1520), tempera and oil on poplar panel, 43.6 x 34.6 cm, Städelsches Kunstinstitut und Städtische Galerie, Frankfurt, Germany. Image by Anagoria, via Wikimedia Commons.

The second of Veneto’s paintings claimed to show Lucrezia is more scandalous, and was probably completed shortly after her death. Known as an Idealised Portrait of a Courtesan as Flora (c 1520), it does at least show a blonde, but the Duchess of Ferrara exposing her left breast?

Had those been the only paintings possibly of Lucrezia Borgia, she would hardly have made her mark in art. But Dante Gabriel Rossetti developed an obsession with her, and revived her image on several of his watercolours in the late nineteenth century.

rossettiborgias1851
Dante Gabriel Rossetti (1828–1882), The Borgias (1851), watercolour, 23.1 x 24.7 cm, Tullie House Museum and Art Gallery, Carlisle, England. Wikimedia Commons.

In the first, The Borgias painted in 1851, Rossetti has Lucrezia playing a lute in the midst of her family, two of her children dancing in front. All the figures look disturbingly sinister, particularly the man leaning on her right shoulder.

rossettilucreziaborgia1861
Dante Gabriel Rossetti (1828–1882), Lucrezia Borgia (1860–61), graphite and watercolour on paper, 43.8 x 25.8 cm, The Tate Gallery (Presented in memory of Henry Michael Field by Charles Ricketts through the Art Fund 1916), London. © The Tate Gallery and Photographic Rights © Tate (2016), CC-BY-NC-ND 3.0 (Unported), https://www.tate.org.uk/art/artworks/rossetti-lucrezia-borgia-n03063

In 1860, Rossetti returned to her when his interest in her family was rekindled. In Lucrezia Borgia (1860–61), he shows Lucrezia washing her hands in a small sink after she has poisoned her husband Alfonso d’Aragon in 1500. Shown in cameo, in a reflection in the upper left, are Lucrezia’s father, the Pope, helping her husband to walk in order to hasten the effects of the poison and bring about his death. Rossetti revised her face at a later date.

rossettilucreziaborgia1871
Dante Gabriel Rossetti (1828–1882), Lucrezia Borgia (1871), watercolour and gouache with heavy gum varnish on cream wove paper, 64.2 x 39.2 cm, Fogg Art Museum, Harvard University, Cambridge, MA. Wikimedia Commons.

Ten years later, in 1871, Rossetti returned to this same scene and composition, and painted Lucrezia Borgia again. The only minor change is the decoration on the tall pot under the sink.

Among Lucrezia’s children who survived to adulthood, one was the Duke of Ferrara for over fifty years, a second became Archbishop of Milan, and another – Leonora d’Este – was a nun and probably the composer of religious motets. The d’Este family, particularly Isabella, wife of Lucrezia’s lover and brother-in-law Francesco Gonzaga, were major patrons of art in the Renaissance. Isabella was patron to Bellini, Leonardo da Vinci, Mantegna, Perugino, Raphael, Titian, Correggio, Dosso Dossi, and others, but it was Lucrezia who inspired artists as recent as Dante Gabriel Rossetti.

Reference

Wikipedia.

Reading Visual Art: 189 Lightning of the gods

By: hoakley
11 February 2025 at 20:30

If there’s one thing sure to put the fear of God into someone it’s a nearby bolt of lightning. One of the most understandable associations of lightning is thus with deities, particularly those who are as swift to anger and avenge as a sudden thunderstorm. In the myths of classical Greece and Rome, that could only mean Zeus or Jupiter, whose bundle of thunderbolts has even survived into computer technology.

cossiersjupiterlycaon
Jan Cossiers (1600–1671), Jupiter and Lycaon (c 1640), oil on canvas, 120 × 115 cm, Museo Nacional del Prado, Madrid. Wikimedia Commons.

Jan Cossiers’ impressive Jupiter and Lycaon from about 1640 shows Jupiter’s eagle vomiting thunderbolts at Lycaon, who is hurrying away as he is being transformed into a wolf, becoming the prototype for the werewolf of the future. These thunderbolts resemble arrows with shafts that zigzag like lightning in the sky, and are preserved today in the symbol used for Thunderbolt.

tintorettojupitersemele
Tintoretto (Jacopo Comin) (attr) (1518–1594), Jupiter and Semele (1545), oil on spruce wood, 22.7 × 65.4 cm, National Gallery (Bought, 1896), London. Photo © The National Gallery, London.

Tintoretto’s Jupiter and Semele (1545) shows an early moment in the myth of the mortal woman who was raped by the god, then destroyed by his thunderbolts when in late pregnancy. She reclines naked under a red tent. Jupiter has evidently just revealed himself, and rolls of cloud are rushing out from him. There are thunderbolt flames licking at Semele’s tent, and around the clouds surrounding Jupiter, but no sign of them touching Semele yet.

The myth of Philemon and Baucis also revolves around Jupiter visiting mortals, this time in innocuous human form and in company with Mercury. After the elderly couple have entertained the two gods, they go outside and ascend a mountain while the land below becomes flooded.

rubenslandscapepandb
Peter Paul Rubens (1577–1640), Stormy Landscape with Philemon and Baucis (c 1625?), oil on oak, 146 × 208.5 cm, Kunsthistorisches Museum, Vienna. Wikimedia Commons.

Peter Paul Rubens’ Stormy Landscape with Philemon and Baucis (c 1625?) is a dramatic landscape with storm-clouds building over the hills, bolts of lightning, a raging torrent pouring down the mountainside, and the four figures on a track at the right. Philemon and Baucis are struggling up the track with their sticks, as they’re being taken to safety from the rising flood by Jupiter and Mercury.

wilsondestructionniobeschildren
Richard Wilson (1714–1782), The Destruction of Niobe’s Children (1760), oil on canvas, 166.4 x 210.8 cm, Yale Center for British Art, New Haven, CT. Wikimedia Commons.

Richard Wilson’s Destruction of Niobe’s Children from 1760 is a classical history-in-landscape, with a bolt of lightning in the centre far distance, a chiaroscuro sky, and rough sea below. Wilson shows this myth when Apollo is still killing Niobe’s sons. The god is at the top of a steep bank on the left, with Niobe among her children down below.

poussinthunderstormpyramusthisbe
Nicolas Poussin (1594–1665), Landscape during a Thunderstorm with Pyramus and Thisbe (1651), oil on canvas, 274 × 191 cm, Städelsches Kunstinstitut und Städtische Galerie, Frankfurt, Germany. Wikimedia Commons.

Nicolas Poussin’s setting of a Landscape during a Thunderstorm with Pyramus and Thisbe (1651) shows the city of Babylon in the distance, along a picturesque and pastoral valley. But the peacefulness of this landscape has been transformed by the sudden arrival of a thunderstorm: the gusty wind is already bending the trees, and near the centre of the view a large branch has broken with its force. Two bolts of lightning make their way to the hills below.

There’s frantic activity in response not only to the storm, but to a lioness attacking a horse, whose rider has fallen. An adjacent horseman is about to thrust his spear into the back of the lioness, while another, further ahead, is driving cattle away from the scene. Others on foot, and a fourth horseman, are scurrying away, driven by the combination of the lioness and the imminent storm.

In the foreground, Pyramus lies dying, his sword at his side, and his blood flowing freely on the ground, down to a small pond. Thisbe has just emerged from sheltering in the cave, has run past the bloodied shawl at the right, and is about to reach the body of her lover. She is clearly distraught.

martindestructiontyre
John Martin (1789–1854), The Destruction of Tyre (1840), oil on canvas, 83.8 x 109.5 cm, Toledo Museum of Art, Toledo, OH. Wikimedia Commons.

The apocalyptic British painter John Martin told the semi-historical story of The Destruction of Tyre in this relatively small painting of 1840. Tyre was the great Phoenician port on the Mediterranean coast, claimed to have been the origin of navigation and sea trade. The prophet Ezekiel (chapter 26) foretold that one day, many nations would come against Tyre, would put the city under siege, break her walls down, that the fabric of the city would be cast into the sea, and it would never be rebuilt. Martin brings the forces of nature in to help destroy the port, with a storm great enough to sink many vessels, leaving their prows floating like sea monsters. In the distance is his standard lightning bolt.

poussinwinter
Nicolas Poussin (1594–1665), Winter or Flood (c 1660-64), oil on canvas, 118 x 160 cm, Musée du Louvre, Paris. Wikimedia Commons.

Poussin used the great flood in Genesis as the underlying narrative in his late painting of Winter (c 1660-64), from his series of the four seasons. Lightning crackles through the sky as a few survivors try to escape the rising waters.

wingethorsfight
Mårten Eskil Winge (1825–1896), Thor’s Fight with the Giants (1872), oil on canvas, 26 x 32.7 cm, Nationalmuseum, Stockholm, Sweden. Wikimedia Commons.

In Norse mythology it’s the god Thor who wields the thunderbolts. Mårten Eskil Winge’s painting of Thor’s Fight with the Giants (1872) shows this lesser-known battle in rich detail, including the two goats drawing the god’s chariot, and lightning bolts playing around his mighty hammer, the cause of thunder.

lytovchenkocharon
Alexander Dmitrievich Litovchenko (1835-1890), Charon Carrying Souls Across the River Styx (1861), oil on canvas, dimensions not known, Russian Museum, Saint Petersburg, Russia. Wikimedia Commons.

In Dante’s Inferno, when the author visits Hell with Virgil as his guide, there’s a lightning strike where souls are being ferried across to eternal torment. As the pair are trying to convince the ferryman Charon to take them both across, there is a violent gust of wind, a red bolt of lightning, and Dante becomes unconscious. This is shown in Alexander Litovchenko’s painting of Charon Carrying Souls Across the River Styx from 1861.

martinmacbeth
John Martin (1789–1854), Macbeth (1820), oil on canvas, 86 x 65.1 cm, Scottish National Gallery, Edinburgh, Scotland. Wikimedia Commons.

In John Martin’s 1820 painting of the witches scene from William Shakespeare’s tragedy Macbeth, three witches materialise from a swirl of mist and lightning bolts on the left, and Macbeth and Banquo appear surprised at their sudden arrival. Winding around the shores of the distant lake is the huge army, and Martin has turned the Scottish Highlands into rugged Alpine scenery as an indication of the much greater outcome of this meeting.

Tomorrow I’ll show a range of landscape paintings featuring lightning.

How to VLAN

By: Erease
10 November 2019 at 08:00

介绍VLAN的基本概念和几种场景下的应用,而OpenWrt下VLAN处理机制和一般交换机有些不同,这里做了一个对比并给出了一种两台路由器之间的单线复用的方案

问题

计算机网络的教材对VLAN一笔带过,作业的却要用到交换机互联,之前看的VLAN的文章貌似都对应不到OpenWrt上去,也就很难有实践的机会;下面根据个人在宿舍组网上遇到的问题,一步步来探究VLAN的用法

后面又看到了N1盒子基于VLAN的单臂路由,又做了一些补充

多线接入

宿舍是上床下桌,每一张桌子下面有一个百兆的网口,通过负载均衡,很早就可以把网速跑到100Mbps了,这显然不够啊,因为宿舍WiFi是共用的,自然而然想到连接相邻的两个床位的网口,这样就有300Mbps了,这也是多线拨号的第一步

上图就是将LAN3与LAN4作双线接入,通过VLAN分别对应到eth0.3和eth0.4

此时LAN4与WAN是“直通”的,效果上来说,就是LAN4也可以插网线用电脑拨号了,如果是要给路由器做双线接入的话,则需要添加VLAN,再把一个LAN口添加到新VLAN中,最后建立接口拨号即可

交换

然而舍友还是需要网口拨号的,所以如果需要长期占用的话偶尔肯定是不太方便的,所以需要交换机来扩展一下网口,这一步已经可以通过简单的修改下OpenWrt路由器的Switch来实现,將LAN4和WAN划到同一个VLAN,两个接口就相当于在同一交换机下:

单线复用

然而,仅仅通过untagged只能实现多条线路的“汇聚”,能够达到100Mbps+的只有一台路由器而已,并没有实现“互通”,即每一台路由器都可以上到100Mbps+;不仅如此,还要实现相邻床位的路由器之间只用一根线连接就可以达到同样的网速,更具体的就是在一根网线传输不同的来源(网口)的数据

而VLAN的一个重要的功能恰好就是实现交换机之间的互通

单臂路由

这个需求源于有一台N1,之前看过VLAN的接入网络的方法,觉得网络结构更清晰,以此可以解决主路由算力不足的问题,但之前一直没有刷上OpenWrt,刷完之后发现居然没有交换机的Switch选项,赶紧翻出了之前看到的帖子:N1做主路由,新3做AP的最正统vlan连法教程,想起之前文档刚好有部分没看懂,刚好可以补充上

概念

首先还是OpenWrt的文档:VLAN,很早就读过,但是因为缺少具体的有解释的例子,当时没弄清楚VLAN tagged的机制

所以这里先结合华为的文档了解下基础的概念

VLAN Tag

首先需要理解VLAN标签是被添加到以太帧内部的一个4个字节的片段,其中VID也就是常说的VLAN ID

在一个VLAN交换网络中,以太网帧主要有以下两种形式:

  • 有标记帧(Tagged帧):加入了4字节VLAN标签的帧
  • 无标记帧(Untagged帧):原始的、未加入4字节VLAN标签的帧

常用设备中:

  • 用户主机、服务器、Hub只能收发Untagged帧(Linux系统可以通过安装软件实现收发Tagged帧)
  • 交换机、路由器和AC既能收发Tagged帧,也能收发Untagged帧
  • 语音终端、AP等设备可以同时收发一个Tagged帧和一个Untagged帧

VID & PVID

VID也就是数据帧中的12bit的VLAN ID,表示该数据帧所属VLAN的编号,而PVID(Port Default VLAN ID)又称为缺省VLAN,可以用于和VID做比较来判断Tag的情况

应用

最主要的应用是划分广播域,这部分可以参考图文并茂VLAN详解,然而和本文的关系不是很大

为了提高处理效率,设备内部处理的数据帧一律都是Tagged帧,例如在交换机内部的,在数据帧进入交换机的时候可能会按照一定的规则被打上VLAN Tag以方便下一步的处理,OpenWrt的Old Wiki的一张图很好地体现了这一点:

以太帧进入端口后被打上VLAN Tag,之后在传输的CPU的线路内(Port5-CPU),就同时传输带两种VLAN Tag的包

另外在交换机之间,可以在一条链路上使用两个VLAN也叫做Ethernet trunking,也有人称作单线复用,常见的应用:

  • 单臂路由(只有一个网口的路由器)
  • 使用一根网线同时传输IPTV和宽带的数据

交换机

这里参考的是上面的华为的交换机的文档,不同交换机可能有些不一样

Incoming & Outgoing

以收发的设备作为主体,指的是数据帧到达接口而没有完全进出交换机内部,举个例子:

  • 数据帧到达某一个接口时,路由器会对数据帧的VLAN情况做判断
  • 如果符合通过的规则,则放行做后续处理,不符合则丢弃
  • 后续处理可能就是剥离或者打上标签

链路类型和接口类型

配置VLAN:为了适应不同的连接和组网,设备定义了Access接口、Trunk接口和Hybrid接口3种接口类型,以及接入链路(Access Link)和干道链路(Trunk Link)两种链路类型,如下图所示

根据接口连接对象以及对收发数据帧处理的不同,以太网接口分为:

  • Access接口

Access接口一般用于和不能识别Tag的用户终端相连,只能收发Untagged帧,且只能为Untagged帧添加唯一VLAN的Tag

  • Trunk接口

Trunk接口一般用于连接交换机、路由器、AP以及可同时收发Tagged帧和Untagged帧的语音终端。它可以允许多个VLAN的帧带Tag通过,但只允许一个VLAN的帧从该类接口上发出时不带Tag(即剥除Tag)

  • Hybrid接口

Hybrid接口可以允许多个VLAN的帧带Tag通过,且允许从该类接口发出的帧根据需要配置某些VLAN的帧带Tag(即不剥除Tag)、某些VLAN的帧不带Tag(即剥除Tag)

Hybrid接口和Trunk接口在很多应用场景下可以通用,但在某些应用场景下,必须使用Hybrid接口。比如一个接口连接不同VLAN网段的场景(如图所示的Router连接Hub的接口)中,因为一个接口需要给多个Untagged报文添加Tag,所以必须使用Hybrid接口。

  • 接入链路只可以承载1个VLAN的数据帧,用于连接设备和用户终端
  • 干道链路可以承载多个不同VLAN的数据帧,用于设备间互连

处理机制

OpenWrt对VLAN Tag的处理机制见后文引用文档的加粗部分,此处暂作为理解的参考

  • Access端口

  • Trunk端口

  • Hybird端口

OpenWrt VLAN

OpenWrt的文档没怎么提及接口类型的概念,OpenWrt对VLAN设置的组织形式和普通的交换机有所不同,从机制介绍来看是比较接近Trunk端口的:发出的数据帧只有一个VLAN的数据帧不带Tag

OpenWrt文档所提到的:An untagged port can have only 1 VLAN ID 反映在:OpenWrt中的Switch设置VLAN时单个untagged Port无法再再其他VLAN上为Untagged,否则回提示:LAN 1 is untagged in multiple VLANs!

故抛开之前的端口类型,遵守VLAN的规则,兼容且实用就行

另外,不是所有OpenWrt设备都有Switch这个LuCI的配置选项,比如N1就没有,但是照样可以配置VLAN,位置在Interface的接口物理配置部分,由于无法像Switch那样有Tag之类的选项,

Tag机制

官方文档对Tag机制的介绍如下(散落在两处):

  • Tagged on “CPU (eth0)” means that the two VLAN ID tags used in this example (1, 2) are sent to the router CPU “as tagged data”. Remember: you can only send Tagged data to VLAN-aware devices configured to deal with it properly.
  • Untagged means that on these ports the switch will accept only the incoming traffic without any VLAN IDs (i.e. normal ethernet traffic). The switch will remove VLAN IDs on outgoing data in such ports. Each port can only be assigned as “untagged” to exactly one VLAN ID.
  • Off: no traffic to or from the tagged ports of this VLAN ID will reach these ports.

Ports can be tagged or untagged:

  • The tagged port (t is appended to the port number) is the one that forces usage of VLAN tags, i.e. when the packet is outgoing, the VLAN ID tag with vlan value is added to the packet, and when the packet is incoming, the VLAN ID tag has to be present and match the configured vlan value(s).
  • The untagged port is removing the VLAN ID tag when leaving the port – this is used for communication with ordinary devices that does not have any clue about VLANs. When the untagged packet arrives to the port, the default port VLAN ID (called pvid) is assigned to the packet automatically. The pvid value can be selected by the switch_port section.

特别指出,但是一般也用不上,在LuCI界面上看不到的PVID设置,设置具体在uci network switch_port部分:

Port PVID; the VLAN tag to assign to untagged ingress packets

无Switch配置

官方文档的位置在 Creating driver-level VLANs 一节,配置方式是通过在接口设置,选择自定义接口,在名称在做文章:如在物理网卡eth1上,通过自定义eth1.2接口的方式建立一个VLAN ID为2的接口,在使用Switch设置VLAN,如添加VLAN ID为3的VLAN之后,接口处也会出现eth0.3,逻辑上还是统一的;下面来看下文档对处理机制的描述:

If the incoming packet arrives to the interface with software VLANs (incoming packet to eth1) and has a VLAN ID tag set, it appears on the respective software-VLAN-interface instead (VLAN ID 2 tag arrives on eth1.2) – if it exists in the configuration! Otherwise the packet is dropped. Non-tagged packets are deliveded to non-VLAN interface (eth1) as usual.

即处理流入的包:接口只接收有相应Tag的包,相当于Switch中的VLAN在该接口设置为Tag

这样一来,一个物理网口可以同时收发带Untagged帧和Tagged帧,故使用VLAN来实现单臂路由也就很好理解了,配置的方式也不唯一

解决方案

回到本文开头提到的问题,仿照上面的Switch内部VLAN机制的图的形式,画了一张两台OpenWrt路由器通过VLAN互通,进而实现让两台路由器可以得到宿舍三个网口合计300Mbps的接入

需要说明的是:

  • 因为所有的VLAN都需要为拨号服务,所以这里略去了VLAN到CPU的一段
  • 格式为了照顾LuCI的设置界面显示,可能看起来有些不寻常
  • VLAN ID的外层意义就是接入的网口的标识,中间的TRUNK链路如何并不重要
  • 对WAN Interface的命名就相对随意了,例如Router 1的WAN_1应该命名为WAN_21更合适一点

最后的在宿舍的书桌背后的路由器如图

How to VSCode

By: Erease
19 September 2019 at 08:00

还记得初见Atom的惊艳以及日久感受到的速度慢和占用高,记得VSCode刚推出时的“难用”,现已今非昔比,本文主要介绍VSCode的一些简单的应用:部分实用的插件以及调试C,Python代码的方法

最初为了写LaTeX而使用 Atom + 插件 来作为代码编辑器(积累了些经验之后转而使用TeXStudio),之后也就顺其自然的用Atom写了作业的大部分代码(装插件还要看网络环境),之后就是遇到了幽灵和熔断漏洞的影响,笔记本的性能越来越力不从心,使用Atom打开大文件特别慢,运行也并不流畅,才发现Atom的性能问题被诟病已久,有人推荐了微软的VSCode —— 和Atom的主题、插件基本通用,但是性能好太多,于是我就换下了Atom,一直用到了现在

现代代码编辑器最基本的功能:Git,多语言支持,丰富的效率插件,VSCode都是有的,而它出彩的地方还是在于开发方面(其实我就是写下作业)

准备

安装VSCode的时候记得勾选使用VSCode打开文件夹,因为VSCode的对工作空间要求比较严格的,另外对于Atom迁移而来的,可以选择Atom主题“One Dark Pro”以实现一个“平缓的过渡”

在调试代码和使用方面,常用的插件有:

  • Code Runner
  • Terminal
  • Resource Monitor

考虑到配置繁杂,重装或者有多台电脑迁移配置不便,可以用Setting Sync插件通过Github提供的服务以实现配置的同步

Remote-SSH

常规插件其实各大代码编辑器都差不多,对于VSCode来说,个人接触到的,最惊艳的插件当属Remote-SSH:

开发环境或者说代码运行的环境在远程或者其他的系统上,需要使用SSH客户端连接到远程,使用SCP或者SFTP来传输文件,这里面SSH客户端是一个重要的角色,最开始使用Atom编辑加上脚本完成“本地编辑,远程调试”的过程,后面遇到了一度让我觉得“相见恨晚”的FinalShell,解决了SSH时的一些列问题,但是作为一个独立开发者维护的闭源软件,稳定性和安全性是一般般的

而Remote-SSH相当于把VSCod搬到了服务器上,同时解决了运行环境和文件传输两个问题,尽管类似的问题可能早就有成熟的方案,但是在常用的代码编辑器中就能实现还是相当感动的,安装完成本地的客户端之后在VSCode的左下角有一个蓝色的标记,点击之后按照提示添加服务器就好(遇到SSH的config文件权限的问题,换用另外一个ssh的config文件就好),初次使用连接服务器之后会在服务器端自动下载和安装VSCode的相关组件(常用的LInux发行版没什么问题,也不需要root权限,ARM架构也支持),之后再手动把需要的插件安装下就好

初次连接时打开文件夹需要重连,直接打开另外一个文件夹也会重连,感觉不方便的话,可以在打开文件夹之后再添加另外一个文件夹到工作空间中(会重新连接),文件夹一栏会变成了工作空间,之后添加文件夹就不需要重连了,工作空间的配置可以保存以便下次使用;文件的上传下载分别是拖拽和右键菜单,体验算是很好了

如果在远程跑代码可以安装Resource Monitor用于监测CPU和内存占用,其他的细枝末节的部分搜索下就有

WSL支持

这里就不造轮子了,已经有人做的很好了,Dev on Windows with WSL,其中主要使用了Remote-WSL插件,虽然个人一度觉得WSL是未来,但是使用了一段时间之后还是觉得不如Docker或虚拟机来得方便,尤其是和Remote-WSL一起推出的Remote-SSH诞生之后

Docker支持

无意中又看到Remote插件多了一个Docker,之前的docker插件在VSCode侧边栏可以方便的查看镜像容器的情况,而Remote插件可以直接把VSCode的运行环境放到容器内,并且可以直接接入正在运行的容器(也就是不需要预先安装SSH和开放端口),尤其对编译环境下修改代码比较方便

另外还有个有趣的地方,可以让Win下的Docker支持图形化界面(勉强可用)

  • 安装vcxsrv,运行xlanuch,设置勾选最后一页的最后一项(Disable Access Control)
  • 获取本机的一个让容器可以到的IP,可取宿主机的WAN IP

这里直接把IP保存为变量了:

$DISPLAY=(ipconfig|findstr "IPv4")[1].split(" ")[-1]+":0.0";
docker run -it --net=host -e DISPLAY=$DISPLAY ....

调试代码

VSCode全称Visual Studio Code,调试代码方面算是对得起Visual Studio之名了,权威的配置过程还是参考VSCode官方文档,本文介绍的是个人配置在Windows下的配置尝试,点几下就配置好了,故分享出来,仅供参考

C语言

有些作业要求用C语言写,最开始追求新奇,用的Visual Studio 2015以及Clang,看中的是强大的调试功能,但是对于写个简单的作业来说太费事,Clang的报错常常不理解

之后转而使用了更常见的Dev C++,基于GCC,照抄书上的代码也不会莫名报错了,在很长一段时间里都是用Atom写代码,Dev C++做运行和调试,

到了VSCode当然会想要接近Visual Studio的体验,编译器肯定不用Clang了,至于GCC,WSL里有,Win上的GCC的版本不知道用哪个好,看网上的博客配置tasks.json (build instructions),launch.json (debugger settings)依然颇为繁琐

直到后面遇到了Scoop,安装就很简单了:scoop install gcc,查看版本后发现是MinGW的GCC,安装CodeRunner扩展后就可以运行代码了

注:代码及工作目录的路径不要有中文

调试功能则需要C/C++扩展,Debug功能在VSCode的左侧应该是自带的,对新目录来说Debug一栏的左上角绿色三角形旁边会显示”No COnfiguration”,Debug时配置gcc.exe作为代码的编译器,GDB作为代码的调试器的关键就在这里了:

  • Add Configuration的时候选C++(GDB/LLDB),之后再选gcc.exe build and debug active file设置完成后会在工作目录下生成一个.vscode/launch.json的文件,文件定义了gdb作为exe的调试器,需要注意的是这里的preLaunchTask,定义了在执行调试在前需要使用gcc对代码进行编译,也就是下一步

  • 回到C的源文件,点击Debug一栏的左上角绿色三角形开始调试,会提示Could not find the task ‘gcc.exe build active file’ ,点击Configure Task,再选gcc.exe debug active file,软件就会创建并打开.vscode/task.json,其中定义了gcc.exe编译的过程,也就是上一步的preLaunchTask

  • 以上的文件在做了选择之后就自动生成好了,之后该文件夹内的C代码都可以透过VSCode的Debug来调试了,设置断点,查看变量体验还是比较现代的~

已知问题

自带的运行代码和调试的terminal窗口对部分编码支持的不太好,调试的时候会闪退

使用WSL GCC可以参考下面的链接(和上个链接的WSL Remote还是有些不同的): VSCode使用WSL环境开发C语言配置

Python

首先在VSCode窗口的左下角,可以设置当前使用的Python解释器,运行依然是CodeRunner,在代码编辑窗口右键选择各种运行方式包括交互式。重点还是调试,这个时候可以选择创建一个新文件夹了(平时把Python代码都放到一个文件夹…),在新文件夹的情况下,点击调试会提示选择Debug Configuration:包括了Python File和Module以及其他没见过的类型

显然对于只会用调试Python File的情况,每次都做一次选择显然不太方便,那么可以选择Add Configuration,工作目录下会生成一个.vscode/launch.json的文件:

        {
            "name": "Python: 当前文件",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }

在Debug的选项中也就有“Python: 当前文件”的选项了,如果想要在已经有launch.json的文件夹中调试,添加这一段到其中即可

调试Python文件的时候比较慢,比如调用Python还需要先激活Conda环境(选择Python解释器)

在编辑器窗口的右键选项中还有使用Jupyter-notebook作为交互式运行的选项,需要在Conda环境中准备:

conda install ipykernel
python -m ipykernel install --user --name 环境名称 --display-name "Python (环境名称)"

网页版

有上面的Remote-SSH,加上VSCode也是基于electron的,自然会想到能不能在浏览器中使用,偶然的一次机会还真的看到了这样的一个项目:Code-Server

这样一来,只要有一台配置OK的Linux的服务器,使用iPad之类的设备也可以在VSCode中看/写代码(随着iPad逐渐强调生产力,对键鼠支持的越来越好)

主题

Name: Vibrancy
Id: eyhn.vscode-vibrancy
Description: Vibrancy Effect for Visual Studio Code

拖动有些卡顿,打开的时候窗口大小有些异常,不过,不影响代码体验~(笔记本上可能对GPU负担太大从而影响续航)

最近发现有个网站收集了很多微软的壁纸:Wallpaper Hub

最重要的是,网站有一些Fluent Design的元素,最明显的就是Acrylic的效果了

其他插件

  • markmap,将Markdown转换为树状的思维导图
  • drawio,对于常见的流程图和框图,往往不需要特别重量级的工具,只需要创建.drawio的新文件就可以VSCode内画框图了
  • Marp,由Markdown生成slide,写slide也可以轻松地专注内容

How to Scoop

By: Erease
5 September 2019 at 08:00

Scoop作为Windows下的命令行包管理工具,在之前的文章里用到的非常多,最近又看了下Scoop的说明,这里简要的介绍下更新后的特性,附带一些常用的命令行工具

Github:lukesampson/scoop的README对Scoop有了大概的介绍,我初次接触到是读到了 再谈谈 Scoop 这个 Windows 下的软件包管理器

缘由

  • 安装常见命令行工具
  • 自带配置环境变量,方便配置简易的开发环境
  • 有脚本自动化执行的优势,方便快速部署(比如重装系统的时候)

需要注意的是如果Scoop安装的软件和Powershell的命令或者别名重合,Powershell的命令依然被优先使用

安装

可以使用管理员模式打开powershell运行

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# or shorter
iwr -useb get.scoop.sh | iex

多线程下载支持

部分软件源在Github之类的连接性不太好的地方,偶尔下载很慢而且易报错,现在Scoop推荐默认使用aria2进行多线程下载,只需要安装aira2即可开启多线程下载

scoop install aria2

添加额外的仓库

参考SpencerWoo的文章添加的软件仓库基本上够用了

scoop bucket add extras
scoop bucket add java
scoop bucket add dorado https://github.com/h404bi/dorado
  • 默认的main仓库以命令行工具为主(比如收录的cmder是个有GUI的终端软件),例如Linux常用的sed, grep, gawk,vim可以大大方便Powershell的日常使用
  • extra仓库收录的高质量的gui软件比较多,比如说googlechrome,typora,vscode
  • java仓库收录了多种多版本的JDK,结合下文的scoop reset,可以便捷的切换环境变量下的JDK
  • dorado仓库收录了相当一部分国内常用的软件如微信,网易云,besttrace,因为下载源在国内下载速度很OK

常用软件

除去上面介绍的一些,其实想得到软件都可以在Scoop中使用scoop search找下看看

$ scoop list
Installed apps:

  7zip 19.00
  chromedriver 76.0.3809.126
  cmder-full 1.3.11
  concfg 0.2019.03.09
  ffmpeg 4.1.3 #编码工具
  gawk 3.1.7
  gcc 8.1.0
  gdrive 
  git 2.21.0.windows.1
  grep 2.5.4
  innounp 0.48
  iperf3 3.1.3 #网速测试工具
  nodejs 12.5.0
  pshazz 0.2019.04.02
  R 3.6.0
  sed 4.2.1
  tesseract 4.1.0.20190314 #OCR工具
  vim 8.1.1302 
  youtube-dl 2019.05.20 #偶尔下载视频
  trafficmonitor #任务栏网速,CPU内存占用监测
  screentogif #Gif录屏软件
  ntop #类似htop的的终端下的资源监视器(但是做不到htop那么强大)
  glow #终端下的Markdown Render
  openjdk #添加java仓库后,默认安装最新版的openjdk
  openjdk9 #java9

sudo

部分命令是无法在普通模式下运行的,一般的方法是打开一个新的管理员模式的窗口,相对来说不太方便,scoop可以安装sudo来实现对单一命令的赋权

比如设置禁用eth0接口的别名

scoop alias add ethd 'sudo netsh interface set interface eth0 disabled' 'disable eth0' 

输入scoop ethd之后就会弹出用户账户控制的弹窗,提示需要管理员权限,用键盘确认就好,省去了再开一个窗口的麻烦(如果是长串命令都需要管理员权限的话还是开一个吧)

ffmpeg

只介绍常用的简单指令

录制直播

面对没有加密的m3u8直播录制,IPTV用的较多,m3u8的地址可以通过浏览器的检查工具找到

ffmpeg -i m3u8 'test.ts'  

合并音频和视频

现在越来越多的网站选择把音频和视频分开,使用IDM下载两个文件可以直接用ffmpeg做快速的合并(复制)

ffmpeg -i v.mp4 -i a.mp4 -c copy output.mkv

当然如果youtube-dl支持视频网站的话使用youtube-dl更方便

提取视频中的音轨

常用于提取BGM,不做重编码的情况

ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac

-vn没有视频 -acodec copy说使用已经存在的相同的音频流

注意事项

scoop依然有许多不成熟的地方,在高可靠性要求的环境下依然是不推荐的,最经常遇到的莫非是软件安装因为网络等问题终端,安装状态会返回成功,如果需要重新安装的话需要先进行卸载

再一个就是环境变量的问题,scoop可以在安装的时候配置好一些环境变量,但是卸载却不一定会移除,这就导致一些重要的软件在Scoop卸载之后再在其他位置安装会出现环境变量错误的问题

部分高度依赖于安装目录,权限以及关联众多的软件不推荐使用scoop安装,如Chrome

使用Scoop提供的别名

Powershell的别名设置不方便,直接使用WSL的自定义别名(.bashrc)调用Windows下的程序又不能直接在Powershell中运行,直到发现Scoop可以自由的添加“环境变量”,想起来Scoop alias来设置程序运行的scoop别名

本来的用法应该是为Scoop内的操作添加别名:

# Install app
scoop alias add i 'scoop install $args[0]' 'Innstall app'
scoop alias add add 'scoop install $args[0]' 'Install app'

# Uninstall app
scoop alias add rm 'scoop uninstall $args[0]' 'Uninstall an app'
scoop alias add remove 'scoop uninstall $args[0]' 'Uninstall an app'

# List apps
scoop alias add ls 'scoop list' 'List installed apps'

# Update
scoop alias add u 'scoop update $args[0]' 'Update apps, or Scoop itself'
scoop alias add upgrade 'scoop update $args[0]' 'Update apps, or Scoop itself'

但是这个格式看起来就很自由:

比如说给WinMTRCmd添加一个scoop mtr的别名

scoop alias add mtr '~/winMTRCmd $args[0]' 'MTR tools for Win CMD'

之后使用scoop mtr [host]就可以愉快的使用mtr工具了

使用Scoop切换软件版本

这里以切换Java版本为例,例如在安装了openjdk和openjdk9之后,从默认的openjdk9切换到openjdk16

$ java -version
openjdk version "9.0.4"
OpenJDK Runtime Environment (build 9.0.4+11)
OpenJDK 64-Bit Server VM (build 9.0.4+11, mixed mode)

$ scoop reset openjdk
Resetting openjdk (16.0.1-9).
Linking ~\scoop\apps\openjdk\current => ~\scoop\apps\openjdk\16.0.1-9

$ java -version
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

群晖使用Docker安装MQTT服务端 mosquitto

By: 小皮子
20 August 2021 at 22:38

以下方法经本人验证通过,环境如下:

群晖 DS918+ DSM 6.2.4

mosquitto version 2.0.11

MQTTBox Version 0.2.3


前言:MQTT(Message Queuing Telemetry Transport)是一种基于发布/订阅(publish/subscribe)模式的”轻量级”通讯协议。客户端的发布者不直接将消息传递给订阅者,而是服务端(MQTT Broker)进行分发,一个客户端既可以是发布者,也可以是订阅者,更多介绍请参看维基百科上的词条 。以智能家居的情形简单举例,人体感应器(发布者)感应到有人时发布主题为”有人“的消息到服务端,而由于摄像头订阅了该主题,因此收到消息,开始录像,此时摄像头角色为(接收者),同时摄像头也作为(发布者)发布”监控异动“消息到服务器,而我们手机订阅了此主题,作为(接收者)便可收到消息。

目前有很多机构提供MQTT Broker服务,有免费的也有收费的。作为个人用户用于智能家居服务,我决定用已有NAS服务器自己搭建一个。参考了网上的一些文章,但大都写得有些复杂,对一般小白不是很友好,因此我尝试自创了一个极简的方法来实现,并记录下来供由需要的朋友学习。

第一步:管理员账号登陆群晖,在Docker中选择 “注册表”,搜索 “eclipse-mosquitto”,搜索结果中选择第一个,点击下载,选择标签latest。此时系统开始下载,可在“映像”中查看下载进度

第二步:下载完毕后,在“映像”里选择已下载的 eclipse-mosquitto 映像 ,点击启动按钮打开创建容器窗口。点击高级设置按钮,打开高级设置页面。

在高级设置中,勾选“启动自动重新启动”

在卷中,点击添加文件夹,在docker目录下新建文件夹 “mosquitto”并选择该文件夹,装载路径填写”/mosquitto/config”

在网络中,勾选“使用与 Docker Host 相同的网络”

确认应用后点击下一步,取消”向导完成后运行此容器“,然后应用

第三步:新建一个mosquitto.conf文件,并将该文件上传到 docker目录的 “mosquitto” 文件夹内。文件内容如下:

persistence true
listener 18831
allow_anonymous true
  • listener 为端口号,默认是1883,我机器上该端口被占用了,所以自己改了一个
  • allow_anonymous true 表示支持匿名用户,此次为了教程简单因此开启匿名用户

文件上传后,再docker容器中启动第二步添加的 eclipse-mosquitto 容器

第四步:测试mosquitto服务

mqtt测试工具很多,我选择的是MQTTBox ,用chrome打开下列地址,添加应用后打开

https://chrome.google.com/webstore/detail/mqttbox/kaajoficamnjijhkeomgfljpicifbkaf?hl=zh-CN

点击”Create MQTT Client”,取一个名字,Protocol 选mqtt/tcp ,Host 填写你的主机地址和 mosquitto 服务端口 ,保存后可看到显示为Connected 表示已经正确连接上我们新建的mosquitto服务端

接着,添加一个订阅,主题随便写一个,我这里填FEEUS.COM,点击”Subscribe“完成订阅

在发布端发布一个订阅端一样的主题,这里也是 FEEUS.COM ,然后输入发布的消息,点击”Publish“后完成发布,该主题的订阅者即可收到该条消息


如果您喜欢这篇文章,或者它给您带来了帮助,您可以请我们喝一杯咖啡,我们将非常感谢您的支持!

❌
❌