Mumble Server Log-rotate

I run a Mumble server for my friends and myself. It’s running off of a VPS, so I like to have the log files sent via email for easy access, so I came up with a manual method of emailing and clearing the mumble-server log file using a bash script and cron.

The first thing I wanted the script to do was put the content of the log into the body of an email and send it.


#!/bin/bash
# Mail old log
mail -s "Mumble-server log" [email protected] < \
/var/log/mumble-server/mumble-server.log

This sends an email with the subject “Mumble-server log”, a destination of [email protected], and the contents of the log as the body. Now since I like to have the time the log was rotated put into the log, so there will always be at least one line in the email that is sent out. For that, we define a timestamp function and insert it into the log.


# Define a timestamp function.
timestamp() {
 date +'%Y-%m-%d %T'
 }

echo "< *> $(timestamp) Log rotated successfully" > \
/var/log/mumble-server/mumble-server.log

Now just add the script to run daily in cron, and you’re good to go! I have mine set to run around 3:00 every morning, because everyone is usually off the server by then and connect/disconnect pairs won’t be split across emails. Since we sometimes share links via chat, I also patched the server to log messages that are sent, so the email serves as a handy way to find a shared link if I forget to save it.

Compiling cgminer for the Raspberry Pi and Butterfly Labs “Jalapeño”

These instructions are for compiling cgminer on Raspian (a debian distro for the Raspberry Pi).

First, dependencies have to be installed:


sudo apt-get update
sudo apt-get install build-essential git pkg-config libtool \ libcurl4-openssl-dev libncurses5-dev libudev-dev autoconf \ automake

Next clone the source files from github:

git clone https://github.com/ckolivas/cgminer.git

Once you have the source files, move to that directory and compile the code:

cd cgminer
./autogen.sh
CFLAGS="-O2 -Wall" ./configure --enable-bflsc
make
sudo make install

All that’s left is to plug in your Jalapeño (or any other BFL device) and run cgminer with:

./cgminer

If you encounter any problems, it’s likely because your build environment is different (or I forgot something). Leave a comment or message me and I can try to help.

Raspberry Pi: Current System Information

I’ve written a simple bash script to show the current temperature, voltage, and core clock on my Raspberry Pi (Model B running Raspbian). I had to install bc (a basic calculator) as it wasn’t installed by default. You can get it by running the command

sudo apt-get install bc

Then run this code:

#!/bin/bash
echo Raspberry Pi System Information
echo -------------------------------
temp_measured=`sudo /opt/vc/bin/vcgencmd measure_temp`
temp_centigrade=`echo $temp_measured| cut -d '=' -f2 | sed 's/..$//'`
temp_fahrenheit=$(echo "scale=2;((9/5) * $temp_centigrade) + 32" |bc)
core_measured=`sudo /opt/vc/bin/vcgencmd measure_clock arm`
core_cut=`echo $core_measured| cut -c15-`
core_mhz=$(echo "scale=1;($core_cut / 1000000)" |bc)
volt_measured=`sudo /opt/vc/bin/vcgencmd measure_volts core`
volt_cut=`echo $volt_measured| cut -d '=' -f2 | sed 's/.$//'`
echo Temperature = $temp_centigrade\*C \($temp_fahrenheit\*F\)
echo Voltage = $volt_cut V
echo Core clock = $core_mhz MHz

The output should like this:
rpi_sysinfo

Welsh Biscuits

I took the opportunity on my recent visit home for Thanksgiving to try out a recipe for Welsh Cakes in preparation for this year’s International Festival. After making two batches, the first of which was devoured shortly after leaving the griddle, I can safely pronounce them a rousing success!

What is great about them is that they are easy and quick to make; once you make them a few times, it only takes about 35 minutes from start to finish. The ingredients are also simple to come by: nothing far out of the ordinary.

Welsh Cakes

Makes 9 squares.

Ingredients:Freshly baked welsh cakes.

  • 1 cup self-rising flour
  • 1 stick (4 oz.) unsalted butter, refrigerated
  • 1 large egg
  • 1/3 cup caster sugar
  • 1/3 cup raisins or currants
  • Zest from half a lemon
  • 1 teaspoon of mixed spice
  • A pinch of salt

Directions:

  1. Sift the flour, mixed spice, and salt into a bowl. Cut up the stick of butter into chunks. Then press the butter into the flour mixture by hand or pulse it a few times in a food processor. It should be sort of crumbly. Add in the caster sugar, lemon zest, and raisins.
  2. Crack the egg into a ramekin or small cup and beat it with a fork until the yolk is mixed with the whites. Stir the egg into the flour-mixture. If the dough seems too dry, add a small amount of milk. It should be firm and slightly sticky.
  3. Roll or press the dough onto a floured surface to approximately a 1/4 inch thick. Personally, I find pressing it into a large square and cutting into 9 pieces is easiest, but you can also use a round cutter.
  4. Cook the cakes on a medium-hot griddle or heavy frying pan for about four minutes per side. They should be golden on both side and soft in the middle. Then dust with caster sugar.
They taste fantastic while hot off the pan, but can be saved for about a week in an airtight container (though I don’t know how they would last that long without being eaten). You can also eat them with a little butter or jam on top.
Mixed Spice, Caster sugar, Self-rising flour
These three things are not typically found in the average kitchen in the US, so here’s how to make them.
  • Mixed Spice: Mix together 2 teaspoons allspice, cloves, ginger, and nutmeg. Add in 1 tablespoon of cinnamon and 1 teaspoon each cardamom and coriander.
  • Caster sugar: This is super-fine (but not powdered) sugar. All you need to do is take regular granulated sugar and stick it in a food processor or blender for a few seconds. At $5 a pound at the supermarket, it’s a lot cheaper this way.
  • Self-rising flour: This is easy to make as well. 1 cup of all-purpose flour, 1/2 teaspoon of salt, and 1.5 teaspoons baking powder. That’s it!

‘East Coker’ and the Great Wars

St. Michael's at East Coker
St. Michael's Church in East Coker

‘East Coker’ and the Great Wars

During the course of the Great War, many traditions of the British were forsaken in light of the rapidly changing times. The horrors and alterations brought by a world at war affected more than just social constructs— they went as far and deep as changing and restructuring literary tradition. The writers in this new ‘Modernist’ period of literature sought to revive tradition by, ironically, dismissing older forms and subjects. The new experiences of large-scale and civilian warfare, of “a new patriotism, richer, nobler, and more exalted”[1], and of rapid changes in culture and morals brought into play fresh subject matter for the prose and poetry of a budding century. Whereas the central theme of the preceding Victorian era was the conflict between faith and doubt, the Modernists contemplated the topics of their day, which nearly always stemmed from the unprecedented scale of the wars that filled the first half of the century. T.S. Eliot’s poem “East Coker” embodies this new archetype of literary tradition by incorporating experiences from both World War I and II, and in doing so helps to shape the path of Modernist literature.

The first stanza of “East Coker” speaks of destruction and rebuilding, in a way embodying the sentiment of post-War England.  Eliot writes:

Houses rise and fall, crumble, are extended,
Are removed, destroyed, restored, or in their place
Is an open field, or a factory, or a by-pass.
Old stone to new building, old timber to new fires,
Old fires to ashes, and ashes to the earth
Which is already flesh, fur and faeces,

Here Eliot paints a scene of the war ravaged British isles, many of its structures ripped asunder by the German bombers. The air raids throughout the Great War were a real and present danger alive in the minds of all the British citizens. Every night was filled with fear that a bomb would hit the family home— the children were sent to live deep in the countryside. In the first three lines Eliot adeptly makes use of enjambment to amplify the effect of the broken houses and fear. By splitting the sentence across lines without punctuation, it breaks the flow of the poem, echoing the brokenness of dwellings. Eliot also speaks to how society was never able to truly recover to its pre-war state. Indeed, according to the War Cabinet, Reconstruction “was ‘not so much a question of rebuilding society as it was before the war, but of moulding a better world out of the social and economic conditions which [had] come into being during the war’.”[3] Just as new social and economic conditions changed during the war, so did the literary form and matter in the mind of Eliot. When he mentions, “Old stone to new building, old timber to new fires” he is signifying this change, suggestive of how many buildings were converted to factories to aid the war effort during both World Wars.

The second stanza of the poem weaves an eerie, almost hypnotic, description of a silent country village. In particular, they are reminiscent of the many contested hamlets on the Western Front. Consider the following excerpt:

In my beginning is my end. Now the light falls
Across the open field, leaving the deep lane
Shuttered with branches, dark in the afternoon,
…In a warm haze the sultry light
Is absorbed, not refracted, by grey stone.
The dahlias sleep in the empty silence.[4]

Again, Eliot uses line enjambment to echo the broken fields and villages that could be found anywhere caught in the crossfire of the Great War. Towns were left in “empty silence,” the inhabitants evacuated, leaving behind a solitude in between skirmishes. Here he also uses multiple stressed syllables to break from the usual iambic pentameter, such as, “deep lane,” and “afternoon.”[5] Eliot breaks from using iambic feet like many other poets do and it gives the poem and unusual twist, causing the reader to focus in on the lines and drawing you into this mysterious, silent village.

Another theme that T.S. Eliot may have been commenting on is the degradation in morals that Britain underwent in the early twentieth century as a result of the World Wars, namely a sharp increase in promiscuous behavior and illegitimate children. Whereas the Victorians had very strict views against sexual contact outside marriage, the horrors of the wars deteriorated the religious objections held by many. We read that, “the religious teaching that the body was the temple of the Holy Ghost could mean little or nothing to those who saw it mutilated and destroyed in millions by Christian nations engaged in war.”[6] In “East Coker” Eliot writes about, “The association of man and woman / In daunsinge, signifying matrimonie— / A dignified and commodious sacrament”.[7] By using archaic spelling here, he could be drawing a connection to how the idea that sexuality was to be kept for marriage is an old convention and unneeded—at least in the eyes of the lower and middle-classes. The traditional theme of a struggle between faith and doubt takes on a different focus when viewed through the lens of a post-War poet. In merely a few lines we get a sense of how much the hostilities affected the core of British culture by effecting a change in religious mores.

Thus it is that we see how Eliot adeptly uses a change in literary form and theme to revitalize literature and weave a new tradition that relies upon incorporating the grand social changes that were born out of the Great War rather than employing the structures of old tradition. His use of enjambment to convey the brokenness of a war-torn Europe is especially striking, as is his utilization of antiquated spelling and words to remark upon the revolution of religious morals— chiefly regarding sexuality. Ironically, Eliot’s move from the old traditions was able to bring in fresh ideas presented with more depth and breadth than was formerly done; it is a lesson we would do well to remember.


[1]Arthur Marwick, The Deluge; British Society and the First World War (New York: Norton, 1970) 49.

[2] T.S. Eliot, “East Coker” Handout, 123.

[3] Marwick 239.

[4] Ibid.

[5] Ibid.

[6] Marwick 108.

[7] Eliot 124.

The Eucatastrophic Day!

On Faerie Stories

A passage from Tolkien’s Letter #89 to his son Christopher, 8 November 1944. Very appropriate for Easter Day.

And I concluded by saying that the Resurrection was the greatest ‘eucatastrophe’ possible in the greatest Fairy Story – and produces that essential emotion: Christian joy which produces tears because it is qualitatively like sorrow, because it comes from those places where Joy and Sorrow are at one, reconciled, as selfishness and altruism are lost in Love. Of course I do not mean that the Gospels tell what is only a fairy-story; but I do mean very strongly that they do tell a fairy-story: the greatest. Man the story-teller would have to be redeemed in a manner consonant with his nature: by a moving story. But since the author of it is the supreme Artist and the Author of Reality, this one was also made to Be, to be true on the Primary Plane. So that in the Primary Miracle (the Resurrection) and the lesser Christian miracles too though less, you have not only the sudden glimpse of the truth behind the apparent Anankê [destiny] of our world, but a glimpse that is actually a ray of light through the very chinks of the universe about us.