I want to use my new USB drive exclusively with Linux, so I decided to wipe the factory default partitions and create a new ext4 filesystem on the drive. The drive uses 4096 byte physical sectors and we have to make sure that the new partition is correctly aligned. For some background information on partition alignment, see this link.
Check that we are wiping the correct drive
sudo parted /dev/sdb unit s print free
Note the details in case you want to restore the original partitioning scheme. Information on the factory default can also be found here.
There are some scenarios when a bash script will not cut it. Not even a Perl script. Not even Python. Your problem calls for C, but at the same you do not want to write a full blown C program. The Tiny C Compiler comes to the rescue.
For the XFCE desktop environment Atril is the default PDF viewer and I also use it to open any PDF files from Firefox. It is a great lightweight document viewer which does what I need most of the time. One exception is when after opening a PDF file from Firefox I decide to keep the file and select File Save As. Atril insists on saving the file in $HOME/Documents, which is practically never the directory I want to use…
About ten days ago my network connection with Virgin Media started to play up. I was experiencing significant packet loss, at times in excess of 50%, and increased latency times with peaks at more than 100ms.
Occasionally when my scanner is emailing me a PDF it gets corrupted along the way. Most of the time the individual scanned images in the PDF are either perfectly valid or at least can viewed, even though the PDF viewer refuses to open the corrupt PDF file.
The bash script below will extract the images and then combine them again into a valid new PDF file.
If you have just received an e-mail similar to the one below, read on.
Subject: The certificate for server.your.domain.org will expire in 13 days
Date: yesterday (BST)
################# SSL Certificate Warning ################
Certificate for hostname 'sws.hlan.laczik.org', in file (or by nickname):
The certificate needs to be renewed; this can be done
using the 'genkey' program.
Browsers will not be able to correctly connect to this
web site using SSL until the certificate is renewed.
Generated by certwatch(1)
The SyntaxHighlighter WordPress plug-in is used to display code ‘as is’; unfortunately WordPress again is too clever for its own good and mangles special characters like & and ” even before the text gets to the SyntaxHighlighter blocks in the Block Editor.
The solution is to add a filter function in your custom functions.php file:
I found that I use my laptop’s touch screen more frequently – it is particularly useful for image editing. However, when I work in my (home) office I also use a multi-screen set-up with three monitors. The problem is that the touch region of the laptop screen automatically gets scaled to the overall size of my screen, which spans multiple monitors.
I’ve just come in from the 12am round. The weather is not great out there, but I’ve got used to worse. The wind is steadily blowing snow, reducing visibility to less than a 100m. It is -14C, colder with the wind. Before departing I have to dress myself up. I have such a great deal of different clothes. Tonight I’ve selected my thickest gloves because yesterday my hands got cold on the walk to South Station. I have about 6 or 7 pairs to choose from, one for every situation. Its hard to judge the right clothes for this task as I am going from the snow drifts outside to the generously heated accommodation buildings. I pull on warm layers over my normal work clothes, and finish with what I think of as my Duplo man outfit. Bright orange salupettes and jacket. The plastic layer keeps the wind off, and I am not worried about breathability – I don’t plan to work up a sweat. The dayglo colours comfort me slightly – if I am lost in the snow, maybe it will help those to find me a few moments before hypothermia sets in.
Night watch is everyone’s responsibility. We take it in turns to do one week at a time. With 22 people on base, everyone does at least one week through the winter. I wake at 5pm and have dinner with the others at 6. I have a few hours to myself before starting at 10pm with a few cleaning duties. I mop the floors of our living space. There is always something to mop or sweep here. It belies the military background and I believe the lino has been worn out from continuous cleaning. I don’t think I have ever had to work on such large areas before. Everything here is set up on an industrial scale. Before I came down I imagined we would be a few hardy folks cooking a single pot of stew over an Aga. The truth is that this station can cater for a 120 people at a time, and the kitchen and stores reflect that. I mop around the dry food store, looking at the rows of sacks of flour, rice, tinned vegetables and jam. Milk powder, breakfast cereal, tea – lots of tea. Potatoes are probably the only non-processed food left on base. The fresh vegetables ran out a while ago. We have a few pickled and frozen, but soon it will be tins and frozen only. I’m already craving a piece of fruit or a crisp green salad. There is enough food here to fill two artic lorries, but it has to last the long months ahead before we are relieved by a ship in December.
The last few stragglers go to bed. It is 11pm and they have finished playing their board game in the lounge. The lounge is upstairs with sofas that over-look the North beach. This is where the sun set, and where it will eventually rise again. Looking out this way in the grey light of dawn we can see mountainous icebergs sitting solemnly amongst the greasy sludge of newly formed sea ice. Also in this building we have two TV rooms, a vast DVD library, and a library filled with books. It’s where we eat and socialise. Sleeping is done in another building, and our workshops, labs and offices dotting around in separate buildings. I’ve taken over a spare room here to use as a yoga studio. I get 4 or 5 regular attendees. I also teach computing in the same room on Thursdays.
My duties tonight also include emptying the dishwasher and some laundry. Not too much and I am soon done. Then I set off into the blowing snow to do the midnight checks. A lot of people ask, how cold is it in Antarctica? We don’t see such extreme temperatures, mainly because we are by the sea, but it is the wind that can make or break your day. The infernal, unrelenting wind. If the day is still and -10C it is pleasant to walk around in ordinary clothes, maybe with a jacket and a hat. But a tiny breeze will suck the heat off you quicker than anything. When the wind really gets up, and it’s not uncommon to have storm force winds which rock the buildings here, then it becomes unpleasant. No amount of careful dressing can keep the scouring ice crystals from stinging your face, and the snow will find its way into your clothes and boots whatever you wear. Tonight is not so bad, the snow blows along the ground, creating an eerie effect of movement in the white flood lights. I go from building to building, checking doors are secure, no windows broken, no pipe burst. I check all the plant is working, our generators and boilers that keep everyone else warm. As I think how everyone is tucked up in a warm bed I feel a little envious. I don’t mind the quietness and solitude, but my only companion for this walk is a radio. I know with one call I could have the station leader, a doctor and a highly trained mountain rescue team looking for me. Or if I find something amiss two plumbers, electricians, mechanics and a fully trained fire fighting team are only a quick call away. But the elements make me feel small as I gaze up into the swirls of blowing white snow.
The walk down to the biology labs is tricky tonight. The wind has filled in the road. No matter what construction we build, path or road we dig, the wind and the snow can return it to flat white in a matter of hours. I am slightly disorientated by the lack of a path to follow, and I make it from one flag to another, left to intentionally for this kind of weather. I have to make a journey of just 1000m to reach the furthest part of my rounds, but it feels further as I trudge in the soft knee deep snow that pulls at my boots. I check the boat sheds, the Dutch lab and I check on the sea creatures that have been pulled from the depth of the sea to rest in the scientist’s aquarium. It has been a holiday today, so no one has been at work. Everything is fine. Boilers run, alarms panels are silent. I dig my way through the snow to get to the doors of important out-houses, storage sheds and pump rooms. Every door here is constructed like a freezer door. We are on this inside in the warm and the freezing conditions are outside. However I note tonight many doors are letting the fine powder snow blow in. Some handles have failed against the pressure of snow and wind. By every door is a shovel. An American visitor asked my why the doors open inward. I laugh to myself at the memory as I kick open a door to be greeted by a deep snow drift. Later in the year we will have to dig our way out each morning. Ice axes, shovel and chisels are standing by ready for that day.
However, tonight the snow is still light and clearing it doesn’t take long. As I walk back, I see my footprints have already vanished. My digging will be in vain, I will have to dig out the same doors again at 3am and 6am before the night is out. I see the bright lights of the main station ahead. I sometimes feel this place looks like a POW camp. The arc lights and corrugated iron buildings painted in military green with nowhere to run. But tonight those bright lights are a welcoming symbol of home.
After creeping into the new accommodation to check the heating, I visit the old accommodation building. Built in the 70s from plywood and steel cladding, this place is a ghostly place of decaying Formica and cracked lino. It was condemned in the late 90s as a fire risk. But with nowhere to move to, it has remained in use as a storage building and houses a few daytime offices, and my two generously-sized workshops. I am happy to have the space. But the building has to be regularly checked – a small electrical fault would have the place ablaze, and the plumbing continually leaks. I walk from room to room, scanning the walls and ceiling with a torch. It is a spooky place in the dark – the old kitchen stands as if the last meal has just been eaten. The old bedrooms are drafty and cold, left to house spare parts and cleaning materials. Nothing decays here. I look through the dry food, checking for rats. I know there won’t be any, it is my private little joke. There is no vermin here and food does not decay when there is no bacteria or mould. I think of how fast things go bad in the tropics, just a few thousand miles and tens of degrees Celsius away from here, and I realise how nature can only operate in a narrow margin of conditions. I check the rooms for drips, leaks, funny smells. It takes a while, each door being opened and securely closed. Nothing suspicious. Just the dummy someone has dressed up and put a mask on to give jumpy people a fright. But he’s been there so long, he’s almost a familiar friend to us. My tour complete, I peel of my snow covered clothing in the boot room and consider raiding the walk-in fridge. One perk of night watch. I will hit the gym later – pumping-iron is the only way to keep fit in the bad weather. The gym itself is a windowless basement and uninspiring at best. One scientist runs weekly circuits which I make an effort to attend, and the station leader who is very gymnastical is happy to train people on the gymnastics rings or for handstands. I’ve also managed to get some climbing tips off one of the young field guides. There are some climbing holds on one wall of the field guides store. You could call it a bouldering wall, but that might be a little optimistic. Still, it has helped me a bit and I will try and go again. Tonight though, everyone is asleep, and knowing they are out of hearing-range I put on some pounding music and do a 30 minute workout. It’s something to combat the little belly I am developing as a result of 2 cooked meals a day with generous proportions and stodgy puddings. I also try not to drink too much beer, it would be tempting to always seek out the company of someone at the bar, but here, just like anywhere, temptation has to be fought.
I return to my office. I will work at the computer for the next few hours. I drink another cup of tea. Tea is probably the most oft-used word here. Tea? Tea please. Anyone want a tea? Time for tea. It helps against the cold and the dryness, and of course maintains our Britishness. I drink herbal teas, and this is my fourth in an hour. It is very dry here. My skin itches all over. I pour moisturise on to my skin a tub at a time, that is how dry it is. At night our sinus are irritated and it is hard to breathe. Other than that it is generally very healthy living so far from civilisation. We drink water straight from the sea, filtered to remove the salt. It takes less energy than melting snow. The snow is much colder than the sea. Our waste is processed before being sent back to the sea by a biological reactor. Every morning I step out into any kind of Antarctic weather and I take a deep breath. The air is too cold to carry much of a smell, but the crisp freshness that I associate with snow is always present to give my nose a tingle.