Installing the correct Intel NIC driver for Windows PE and a bare-metal restore situation

When disaster strikes, a real bare-metal restore bootable USB drive may be your only rescue. And most decent manufacturers of NAS and SAN (Synology in this case) units will have some sort of “bootable media creation tool” available for you. These typically create a minimal bootable environment, from which you bootstrap the computer and then load the bare-metal restore data from a NAS or a SAN.

One issue you may encounter is actually finding the correct network card (NIC) driver so that your about-to-be-restored computer can actually talk to the rest of the world, or at least to the rest of your world. This is painfully obvious in Windows and Windows PE environments.

I recently ran into such a case and thought “How hard could it be to just check the motherboard manufacturer information, find the exact name of the NIC, and then download the driver from the web?” Well, it turns out this can get quite messy for a number of reasons.

In many cases, the operating system will know where to find NIC drivers, and which one to load for a given hardware setup. When you need to manually choose from a list of tens or hundreds of adapters, it not so much fun anymore.

Having checked the web for “Intel I219-V” wasn’t all that exciting, and downloading a “driver package for Windows 10 x64” from Intel wasn’t much better. But Intel does include, in my case, some useful software in their downloads. Most executables in the Intel driver package cannot be executed from within Windows PE. But one, really useful tool, turned out to be SetupBD.exe. It’s located in \APPS\SETUP\SETUPBD in the (executable) archive, and it can run in the Windows PE environment.

Suprisingly enough, all I had to do to get the proper driver loaded was to run SETUPBD.EXE from the CLI, and it proceeded to load the correct driver. My bare-metal Windows PE environment could now talk to the NAS and the bare-metal restore could begin.

(I had previously extracted the contents of the PROWinxt64.exe file to \INTEL on the bootable USB drive. So the actual location of SetupBD.exe in my case was \INTEL\APPS\SETUP\SETUPBD.)

Image credit: www.pngflow.com

Nextcloud and WebDAV “SEARCH” requests

Using WebDAV to access Nextcloud resources is a pretty nice way to write integrations for Nextcloud. While adding support for Nextcloud file browsing in a service we’re constantly improving, I ran into a minor snag: How to format the WebDAV “SEARCH” request when interfacing with Nextcloud.

1. The example in the official documentation is correct. You just have to read it carefully. In particular, pay attention to this:

Search requests can be made by sending a SEARCH http request to https://cloud.example.com/remote.php/dav/ with a content type of text/xml and the query as xml in the request body.

2. Make sure you structure your XML data properly, in particular, you need to make sure you include a d:prop of which “field” you want your search data to be applied to.

<d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:basicsearch>
    <d:select>
      <d:prop>
        <oc:fileid/>
        <d:displayname/>
        <d:getcontenttype/>
      </d:prop>
    </d:select>
    <d:from>
      <d:scope>
        <d:href>/files/testuser/</d:href>
        <d:depth>infinity</d:depth>
      </d:scope>
    </d:from>
    <d:where>
      <d:like>
        <d:prop>
          <d:displayname/>
        </d:prop>
        <d:literal>Nextcloud%</d:literal>
      </d:like>
    </d:where>
    <d:orderby/>
  </d:basicsearch>
</d:searchrequest>

This would search for files beginning with Nextcloud and return fileid, displayname, and the content type; the search will be made in the folders that testuser has access to.

And that’s that.

 

Webmin, Virtualmin and APT for Ubuntu and Debian

I often use Webmin and Virtualmin to manage basic stuff on Linux servers, mostly so because others sometime need to change minor settings on these servers, and they may or may not be very familiar with doing things from the CLI.

You can, of course, update Webmin and Virtualmin manually, from within Webmin. But if you’re using APT, there is an automated, better, way of keeping these lovely software packages up to date.

Webmin

Create a file in /etc/apt/sources.list.d/ like webmin.list

Add the following line to that file:

deb https://download.webmin.com/download/repository sarge contrib

Add Jamie Cameron’s GPG key for the repository like so:

cd /root
wget https://download.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc

Finalize everything with

apt-get install apt-transport-https
apt-get update

You may now install/update Webmin with via APT (apt-get, aptitude, etc).

Virtualmin

Create a file in /etc/apt/sources.list.d/ like virtualmin.list

For Ubuntu 18.04.LTS (“Xenial”), add the following to that file:

deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-xenial main
deb http://software.virtualmin.com/vm/6/gpl/apt virtualmin-universal main

There are, of course, sources available for other distributions too. Simply replace xenial above, with the name of the distribution you’re running. You can find a list of the Debian based distributions here: software.virtualmin.com/vm/6/gpl/apt/dists/

Add the virtualmin GPG key for the repository like so:

cd /root
wget http://software.virtualmin.com/lib/RPM-GPG-KEY-virtualmin-6
apt-key add RPM-GPG-KEY-virtualmin-6

Finalize everything with

apt-get update

You may now install/update Virtualmin via APT (apt-get, aptitude, etc). You can find some more information about this in relation to Virtualmin on the Virtualmin forum.

WordPress Plugin Stopsign 1.0.0

Using the APIs over at trafiklab.se can yield some quite useful results. I needed to be able to display the commute stop departure times for public transport in a given place, so I wrote this WordPress plugin called Stopsign. It uses the Trafiklab.se API. The plugin is free (GPLv2) and open source.

Knock yourself out: github.com/joho1968/Stopsign

Talking to the Folding@Home client interface

There are a number of ways to control the Folding@Home client. For me, one of the more useful things I can do by sending a command to the web client interface is to pause and resume the operation of the client. In particular, this is useful when running other CPU consuming tasks in automated scripts, etc.

So, from the prompt on the host running the Folding@Home client you can, for example, issue:

echo -e "pause 0\nquit" | nc localhost 36330

to pause the client. And then issue:

echo -e "unpause 0\nquit" | nc localhost 36330

to unpause (resume) the client. You can also access the control interface via telnet with this:

telnet localhost 36330

Type help <Enter> at the prompt for a list of commands and options.

När man outsourcar sunt förnuft

Under flera årtusenden har jordens befolkning drabbats av krig och kris i mer eller mindre omfattande skala. I många situationer ser naturligtvis de industrier som producerar och tillverkar produkter relaterade till dessa situationer ett uppsving i tillverkningen och ekonomisk omsättning. Företag behöver anställa fler människor för att möta de behov som uppstår; allt från vapen och ammunition till gasbinda och livsmedel.

De länder som har förlitat sig på utländska företag för denna produktion och tillverkning upptäcker ganska snart problem, inte minst när man står i direkt konflikt med de länder där tillverkningen sker. Men vad gör man när det inte finns en geopolitisk fiende? Vad gör man när krisen är global i formen av t ex en pågående pandemi?

Krigsfot, eller (allmän) mobilisering är något vi förknippar med krig och väpnad konflikt. Likväl finns det ett beredskapstillstånd för just detta i många länder även för samhällskriser och pandemier.

Pratar man med männsikor om förberedelser och framsynthet blir man ofta bemött som en sk “prepper” eller paranoid människa. Jag tycker inte det stämmer särskilt bra och jag blir enormt besviken när jag ser hur vi snabbt tappar fattningen både bland “vanliga människor” och på myndighetsnivå. Jag pratar inte om att ha fyra hundra liter vatten i plastdunkar i källaren eller tre hundra burkar ärtsoppa i skafferiet. Jag pratar om en vilja att tänka hela vägen ut i hörnen.

Kina har de senaste hundra åren gått från ett ekonomiskt underutvecklat land till att vara världens fabrik. Väldigt många produkter vi tar för givna har sitt ursprung i Kina, även om vi nu ser många industrier i resten av världen öka sin produktion eller försöka ställa om sin tillverkning till mer nödvändiga produkter så finns det ingen egentlig plan. Varför finns det ingen plan? Har vi outsourcat allt sunt förnuft?

Efter avslutad utbildning inom Försvarsmakten utsänds en skriftlig krigsplaceringsorder. Av ordern framgår en persons befattning, inställelseplats, fältpostadress, m.m. (Wikipedia: “Krigsplacering”).

Nu lever vi i en tid i ett land där väldigt många människor inte har genomgått Försvarsmaktens utbildning, men likväl skulle kunna vara behjälpliga inom totalförsvaret i civil form. Vi har även en mängd människor som har förlorat och kommer att förlora sitt jobb.

Vi har fabriker i Sverige. Vi har industrier i Sverige. Många av dessa tillverkar produkter som helt eller delvis saknar efterfrågan i en pandemi som den pågående COVID19-krisen. Människor förlorar sina arbeten, företag går i konkurs och samhället vi alla lever i är den stora förloraren, i dubbel bemärkelse.

Media rapporterar om företag och personer som tagit initiativet att ställa om sin tillverkning och sin vardag till att hjälpa en av de sektorer inom vårt samhälle som av förklarliga skäl går på knäna i en sådan här situation, det vill säga sjukvården. Det är fantastiskt att höra och bevittna. Varför finns det ingen utarbetad plan för omställning av produktion, tillverkning och anställning?

Jag inser att alla problem inte går att lösa på detta sätt, men det råder ganska uppenbara brister på materiel inom just sjukvården nu. Varför arbetar inte MSB och andra myndigheter med en plan där lämpliga tillverkningsindustrier helt enkelt tvingas ställa om sin (ofta helt eller delvis) automatiserade tillverkning av en produkt till en annan produkt som vi behöver just nu? I de fall detta kräver mer personal är jag helt säker på att de stackars människorna som blir av med sina jobb kan tänka sig att skolas om till “produktionstekniker” för ny verksamhet under den tid krisen pågår. Detta skulle också innebära att företagen som ställer om enligt plan har en betydligt bättre möjlighet att överleva.

Vid ett givet läge i en kris kan “omställningsplanen” aktiveras och snabbt fylla på förråd med nödvändiga produkter som skyddsutrustning och sjukvårdsmateriel. Likaså bör man regelbundet uppdatera en plan för att på relativt kort tid göra om större byggnader till “beredskapssjukhus”.

Det finns många andra sektorer där vi ser stora brister som t ex utbildning på distans med alla parametrar och variabler det innebär, men vi ser än en gång hur eftersatt tänket kring vården är i många länder.

Det är lätt att vara efterklok, men man behöver inte outsourca allt sunt förnuft.

Ta hand om er och varandra; hör av er om det är något jag kan hjälpa till med.

Bildkälla: streamlineicons.com

Stop bitching about having to “work from home”

To those of you who bitch about having to “work from home”, please take a deep breath, chew on some toilet paper, and consider that:

There are people out there that are working in the “direct line of fire”, because they have to. It’s their job. And they’re doing it, many of them are doing it for you and the society you live in. They are not calling in sick, they are not whining about the virus, and most of them don’t have the energy to post “funny” COVID-19 posts.

There are people out there, that have already been hit so hard by cancelled concerts, cancelled cleaning contracts, cancelled trips, cancelled hotel bookings, cancelled whatever and are not part of any government hand-out or “favorable loan” program (because it’s not good enough “optics” for the tossers in power); they are now having to beg people for money (try doing that a few times and see how it makes you feel).

I’m by no means innocent of posting memes and other “funny” COVID-19 posts, nor am I innocent of bitching about Corona, and I do realize people need to handle this in any which way that works for them. But when you get that wake-up call from a friend or relative that cannot make ends meet because their next 20 jobs/assignments have been cancelled due to this, and they’re asking if you can lend them money to pay rent, it feels quite a bit more real.

You may now go back to hording toilet paper. Stay safe and be nice, or at least not un-nice 🙂

 

Trains, planes, and COVID-19

There has been a lot of talk about necessary medical equipment getting stuck in road based transports because borders are getting shut down. So a lot of these transports are caught in queues of up to 40 km due to unbelievable traffic jams. Some of them may never reach their final destination, or at least not until it’s too late to make a difference.

At the same time, we are hearing reports about airlines needing assistance, airline employees being laid off or given notice, and in need of bail-out support from governments because flights are being cancelled as we want to keep travel to a minimum.

Why is the EU and others not coordinating the use of private, semi-private and state owned airlines to transport necessary supplies from where they are manufactured to where they should be delivered? Given the load capacity of a “normal” (small to medium) airplane, it should be able to transport a lot of medical equipment in its normal cargo holds without much change. There are, of course, other reasons for products never reaching their destination (such as countries deciding they are more useful to keep for themselves than when they’re exported to another country), but to uphold commercial transactions seems a far better decision on a global scale than being narrow minded.

For people that absolutely must travel between countries, such as medical experts, officers of the states and diplomats, and so on, these flights could shuttle them too. Screening a handful of passengers is surely not that much of an issue. But even without any passengers, it would keep a certain (limited) amount of planes operating, pilots and some other staff working, and to some extent uphold cash flow.

By grounding everything, the governments will need to hand out massive loans and other financial support in an attempt to soften the blow to a rather large industry that has come to a complete halt. Why not use some of that money, and some of that capacity, for something we actually need: air transport.

By the way, if you’re not already “Folding @ Home”, put some of your computer’s idle CPU cycles to good use here: foldingathome.org (and feel free to join Team Yujo, #235992).