Sunday, 5 November 2017

adding Linux dual boot to windows 8

http://itsfoss.com/disable-secure-boot-in-acer and
http://linux.about.com/od/howtos/ss/How-To-Dual-Boot-Windows-81-And-Debian-Jessie.htm explained it to me.

When it said that it was missing firmware for my wifi I skipped, (as I was not sure how to get hold of those files using windows and how to write them to an external USB flash in such a way that the debian installer would find them... and then the installer got my wifi working anyway.) I thought that I could just dig up an ethernet cable and plug into my router for the install.


I am a fan of encryption for everything. So should I dm-crypt my linux partition and/or my swap? Logically yes, but hard disks fail and if my backup fails then recovering files from a broken disk is sometimes possible. Recovering files from a dm-crypt disk is not realistically going to happen.


I started with X11 then used WindowMaker and then blackbox. So I selected LXDE with a plan to crunchbang it into shape after install.

As of 2015 it feels like LXDE is for those that can use a command-line and Cinnamon is for everyone else, including your grandfather.

Friday, 13 October 2017

[linux 4.13.0] Unsurmountable

Today I put on my sysadmin hat and did some

  apt-get update; apt-get upgrade

After that the list of things being held back was rather large so I started to probe by seeing what apt-get would do if I tried to install them one-by-one.

util-linux
udisks2
nvidia-kernel-support
mess
linux-image-amd64
linux-headers-amd64
licensecheck # this put my hackles up: felt very DRM
cups-filters
libspice-server1


I rebooted and once I got back to shell I found that the NFS was missing, (it should have mounted by itself, as usual.)

As Simon Tatham taught us you should freeze and do NOTHING. I did exactly that and logged into another server on the LAN that had not been updated.

mount -V told me 2.25.2 (libmount 2.25.0 ...)
(and it could mount the NAS both via -t nft and -t cifs

I went back to the broken system and ran

showmount -e NAS

which gave me the same Export list as on the working server.
So the NAS, (which hasn't been updated) seems to work, (even checked from windows 7 and 8 on the LAN and they both worked.)

I thought that I'd go back to my slackware roots and

git clone git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
./autogen.sh  ||  apt-get install -y bison ;  ./autogen.sh
./configure && make

I posted my problem to serverfault.com to see if it was a known debian 8 jessie problem. While I waited I answered a few other questions and did other SO admin, (which lead me to install  shellcheck and start testing some of my bash lib.)

I jumped onto irc to see if anyone knew of this problem and only got, "have you tried with the latest version?" (Which turned out to be fair as it seems to be a kernel bug. I haven't hit one of those in production for over 10 years.)

I tried with the latest util-linux version, (that I'd compiled) and even tried 

git checkout v2.25.2 ; ./autogen.sh ./configure && make

to see if the working version would work. Both gave the same error... which made me think that it was a kernel problem.

While I let my, (and the Internet's) grey-cells think about it I fell back on

sshfs nfs-admin@NAS:/export/backups/$(hostname) ~/backup

until I get to the bottom of this.

In the mean time I had to add 

set mouse-=a

to  the end of ~/.vimrc  because Shift+Insert (and both other "paste from clipboard" were misbehaving in "some of your string will be pasted but other characters might be interpreted as commands and might quit vim" like vim when your keyboard swaps layout and feels like its taken some recreational drugs.)

[ I think that it was a problem with lxterminal or gnome-pty-helper or screen

so I ran tmux in tilda and the problem was interestingly absent. One problem at a time; please!]


booted back into 4.12.0-1-amd64 kernel and mount.cifs and mount.nfs are working again.

so I apologise to the util-linux team for doubting them and wonder how I report my problem... 

https://bugzilla.kernel.org/show_bug.cgi?id=196599 looks like the kernel tracker might know about it, but then the question is why did the debian kernel team let a faulty kernel into stable?

For reference mount.cifs works on:

scripts/ver_linux
 

Linux acer 4.12.0-1-amd64 #1 SMP Debian 4.12.6-1 (2017-08-12) x86_64 GNU/Linux

GNU Make                4.1
Binutils                2.29.1
Util-linux              2.29.2
Mount                   2.29.2
Linux C Library         2.24
Dynamic linker (ldd)    2.24
readlink: missing operand
Try 'readlink --help' for more information.
Procps                  3.3.12
Kbd                     2.0.4
Console-tools           2.0.4
Sh-utils                8.26
Udev                    234
Modules Loaded          ac acer_wmi aesni_intel aes_x86_64 ahci appletalk arc4 async_memcpy async_pq async_raid6_recov async_tx async_xor ath ath3k ath9k ath9k_common ath9k_hw autofs4 ax25 battery binfmt_misc bluetooth bnep btbcm btintel btrfs btrtl btusb button ccm cdrom cfg80211 cifs cmac coretemp crc16 crc32c_generic crc32c_intel crc32_pclmul crct10dif_pclmul cryptd crypto_simd ctr dns_resolver drm drm_kms_helper dw_dmac dw_dmac_core ecb ecdh_generic efi_pstore efivarfs efivars ehci_hcd ehci_pci evdev ext4 falco_probe fat fscache fscrypto fuse ghash_clmulni_intel glue_helper hid hid_generic hid_multitouch i2c_algo_bit i2c_designware_core i2c_designware_platform i2c_hid i2c_i801 i915 intel_cstate intel_powerclamp intel_rapl intel_rapl_perf intel_uncore ip_tables ipx irqbypass iTCO_vendor_support iTCO_wdt jbd2 joydev kvm kvm_intel libahci libata libcrc32c linear llc lp lpc_ich mac80211 mbcache md4 md_mod media mei mei_me memstick mfd_core mii mmc_core multipath nfnetlink nfnetlink_log nfnetlink_queue nls_ascii nls_cp437 nls_utf8 nvidia nvidia_drm nvidia_modeset p8022 p8023 parport parport_pc pcspkr ppdev psnap r8169 raid0 raid10 raid1 raid456 raid6_pq rfcomm rfkill rtsx_pci rtsx_pci_ms rtsx_pci_sdmmc scsi_mod sdhci sdhci_acpi sd_mod serio_raw sg shpchp snd snd_compress snd_hda_codec snd_hda_codec_generic snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_core snd_hda_intel snd_hwdep snd_pcm snd_soc_core snd_soc_rl6231 snd_soc_rt5640 snd_soc_sst_acpi snd_soc_sst_match snd_timer soc_button_array soundcore sparse_keymap sr_mod sunrpc usb_common usbcore usbhid uvcvideo vfat video videobuf2_core videobuf2_memops videobuf2_v4l2 videobuf2_vmalloc videodev wmi x86_pkg_temp_thermal xhci_hcd xhci_pci xor x_tables

 
 

but fails with the unhelpful 

mount error(112): Host is down

on scripts/ver_linux
Linux acer 4.13.0-1-amd64 #1 SMP Debian 4.13.4-1 (2017-10-01) x86_64 GNU/Linux

GNU Make                4.1
Binutils                2.29.1
Util-linux              2.29.2
Mount                   2.29.2
Linux C Library         2.24
Dynamic linker (ldd)    2.24
readlink: missing operand
Try 'readlink --help' for more information.
Procps                  3.3.12
Kbd                     2.0.4
Console-tools           2.0.4
Sh-utils                8.26
Udev                    234
Modules Loaded          ac acer_wmi aesni_intel aes_x86_64 ahci ansi_cprng appletalk arc4 async_memcpy async_pq async_raid6_recov async_tx async_xor ath ath3k ath9k ath9k_common ath9k_hw autofs4 ax25 battery binfmt_misc bluetooth bnep btbcm btintel btrfs btrtl btusb button ccm cdrom cfg80211 cifs cmac coretemp crc16 crc32c_generic crc32c_intel crc32_pclmul crct10dif_pclmul cryptd crypto_simd ctr dns_resolver drbg drm drm_kms_helper dw_dmac dw_dmac_core ecb ecdh_generic efi_pstore efivarfs efivars ehci_hcd ehci_pci evdev ext4 falco_probe fat fscache fscrypto fuse ghash_clmulni_intel glue_helper hid hid_generic hid_multitouch i2c_algo_bit i2c_designware_core i2c_designware_platform i2c_hid i2c_i801 i915 intel_cstate intel_powerclamp intel_rapl intel_rapl_perf intel_uncore ip_tables ipx irqbypass iTCO_vendor_support iTCO_wdt jbd2 joydev kvm kvm_intel libahci libata libcrc32c linear llc lp lpc_ich mac80211 mbcache md_mod media mei mei_me memstick mfd_core mii mmc_core multipath nfnetlink nfnetlink_log nfnetlink_queue nls_ascii nls_cp437 nls_utf8 nvidia nvidia_drm nvidia_modeset p8022 p8023 parport parport_pc pcspkr ppdev psnap r8169 raid0 raid10 raid1 raid456 raid6_pq rfcomm rfkill rtsx_pci rtsx_pci_ms rtsx_pci_sdmmc scsi_mod sdhci sdhci_acpi sd_mod serio_raw sg shpchp snd snd_compress snd_hda_codec snd_hda_codec_generic snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_core snd_hda_intel snd_hwdep snd_pcm snd_soc_core snd_soc_rl6231 snd_soc_rt5640 snd_soc_sst_acpi snd_soc_sst_match snd_timer soc_button_array soundcore sparse_keymap spi_pxa2xx_platform sr_mod sunrpc usb_common usbcore usbhid uvcvideo vfat video videobuf2_core videobuf2_memops videobuf2_v4l2 videobuf2_vmalloc videodev wmi wmi_bmof x86_pkg_temp_thermal xhci_hcd xhci_pci xor x_tables



TL;DR  debian linux kernel 4.12.0 to 4.13.0 removed md4 module and gained ansi_cprng drbg spi_pxa2xx_platform  wmi_bmof and lost the ability to mount cifs vers=1.0 and my nfs
 Progress! ;-s

Tuesday, 3 October 2017

Not married to the idea

Interesting case that spans ethics, philosophy and etymology. A friend asked me if there was a word in the English language for the emotion of sadness and crushing betrayal that included manipulation despite people warning you for years that the person in question is suspicious. (I think run-on sentences are acceptable when you are balling-your-eyes-out and half of your brain seems to be flowing out of your nose.)

I honestly don't think that there is such a specific word; the closest I can find is deflation. When I suggested that, they paused and then agreed. "That makes sense - the moment the realisation hit me I collapsed like a deflated balloon."

So what happened? It was an invitation to a party.

Date: Mon, 5 Dec 2016 10:33:51 +0000
Subject: My News!

Hello ████████████,
I hope all is well with you, █{partners name spelled incorrectly}█?

I got engaged █{redacted}█ We met █{redacted}█ 3 months ago.

█{redacted}█ would you do me the honour of being my best man please?! █{redacted}█ It would not be a big affair, registry office and then retreating to a beer tent for a buffet meal, etc. Mainly friends and apart from █{daughter}█, no other family. █{redacted}█

(The purple is original, the redacting and highlighting is mine.)

My friend's suspicion was up. They thought that they were friends, but not "will you be my best man" friends. Something felt wrong. Also why not invite their partner?

Their emails expressing doubt go back and forth including one reply from the groom:

Hello ████████████,
Actually I am serious! So, I would be happy to pay for your flight to and from █{redacted}█No problem re Best Man duties, I have asked █{redacted}█ to perform for me, such as it will be...

So what's up with the "no other family". My friend said, "I do not want any contact with them."
(Clearly something that causes them pain, and from the emails it seems to be understood by both parties.)

So they saved up for months and bought their own flight, (they felt it was the least that they could do, despite having no disposable income.) Which explains why their phone does not have roaming and they could not send or receive SMS or phone calls when they got to a country where they don't speak a word.

"I felt powerless and exposed. My credit card would not work. Its a strange vulnerability we have when we travel. So much trust in the travel system and that our destination will catch us. It is a leap into darkness, and when it fails its like losing a kidney."

 They had remembered the directions and "pick you up around 5 pm" so that is how they spent over 3 hours in front of a corner bodega, (between 4pm and 6:30pm). When it started to become dark they walked to the address that they had memorised and though it was hard for them to tell me through the pain and anger, "Houses have windows" more crying "you know?"


So they had become aware that they were not needed. Their friend had plenty of family there and their presence was not of vital importance. They had been manipulated. They felt betrayed and stupid.

"Its the kind of hurt that gets worse the more you think about it."
I showed them how to add email filters to delete any messages from their former friend, so that they would not be needled by seeing messages from them. Also a temporary filter to delete any message with "wedding" or related words. (I was going to write a quick Markov model to find the relevant words from their email exchange, but they thought they knew the words to us for filtering.) I also set the ring-tone on their phone to silent for that contact and tuned off vibration so that their abuser could not further force their attention upon them.

I expect that the newly married will justify their action with a sentence containing the four letters, JUST. Interestingly my analysis of this in french turns up the same four letters as the most common fulcrum of cognitive dissonance resolution.

Sunday, 12 March 2017

Designing variable rate micro-hydroelectic plant

Generating power using water is nothing new. Find a location where water can be channelled from a high location, through a wheel, (or turbine) and released at a lower location. The difference between the high location and the exit from the wheel is known as the head, (of water). This was used even before the industrial revolution, to turn wheels that performed work, (ground grain into flour for example.)
The industrial revolution used water to perform more and more tasks. The problem was that you can't take a river with you. This is where coal empowered the steam engine. First used to drive pumps and then steam engines were mounted on rails for locomotion. More and more ideas collided with both problems and everyday tasks. The industrial revolution tried to make life easier, (though it also created inner-city slums - a problem that we still have not solved.)

Out of the industrial revolution came the industrial age. In the years from 1930 to 2030 it was still fossil fuels, (oil and coal) that were used to supply the energy needs of the growing industrialised countries. Yes we still used hydro and we had fission but for the most part it is coal and oil that cooked our food  and powers the television, (and certainly powers transportation of resources into the cities where an insect-colony level of density is observed.)

 So what is the problem? The problem is that how ever much oil there is hidden under Greenland by the year 2000 half of the oil and coal has already been consumed, (lets just presume this is true) and we can do many things with modern technology, but we can't make more oil or coal and we still can't capture the suns energy as efficiently as plants do.



(This is just a visual guide, to help my explanation.)

  So I grew up next to a small stream and love mechanical devices. The idea that water can turn a wheel that can produce electricity still makes me smile. It seems as natural and as magical as gravity, (and sometimes just as frustrating.) 
 The two problems that my location has from a hydroelectric point of view are no head, (which is why I mentioned it at the start) and a massively variable flow rate. So why is this a problem? If you are not scared off by terms like volts and amps then you can probably let me run with the idea that the head is equivalent to ampere-hours and the flow rate is equivalent to the watts. ( For this note we just need to think: amps * volts = watts ). So with this undershot design we are dependent on the flow rate.

The devices that we use today in our homes use AC current and like to have a fixed voltage, (110-240 volts depending on the country) and require 1-20 Amps, (I'm talking household appliances like a toaster or a microwave oven.)
So it should be clear why large scale hydroelectric systems seem to always have a large lake with some means of flow control. This is because the best locations for the generation have been selected, (usually locations where it is easier to build a wall to hold as much water back as possible. In the past whole villages have been moved or flooded because they occupied such locations, (Tignes, France.)
 Also hydroelectic systems do not like creating elecriticy that is not being used, (things tend to melt, in a bad way.)

I don't want to move house, and I don't have the money to either build a massive pipeline to create head, or a really long power-cable to get the electricity back from the best location on the stream. If we are going to design useful systems they are going to have to fit in with the existing landscape and be as unobtrusive as possible. (My theiroy was that if this works they could be added to any small stream, and added many times to the same stream.)

So the variable rate problem is not too hard to solve: bicycle gears - simply employ a gear system that engages higher gear ratios between the turbine and the generator as the turbine velocity increases. But that is only half of the story. If you inspect my proposed site the water level can vary by over a meter, (from zero in summer.) The stream is full of a range of limestone rocks/pebbles and every the occasional boulder. The stream is insized and creating a water chase is beyond the scope of this project. The solution that I came up with uses two vertical PVC drainage pipes with empty two liter polyethylene terephthalate drinks bottles inside. 
The bottles act as floats upon which the rig, (turbine and generator on a frame) can balance. The vertical pipes are resessed into the sides of the stream, (it is less than two meters wide) with a vertical slot cut into the face of each. As the water level rises the bottles float up and lift the rig. This means that as the flow rate increases the contraption is lifted clear of the rocks that are moving along the bottom. This protects the blades of the turbine, and though it sacrifices some of the energy of the stream, we are still in contact with the part of the flow with the least friction from the sides and bed of the stream. This all looked good when I sketched it up in freeCAD but with some rough calculations the rig was going to be too heavy. The first amendment was easy: a cable connected inside the PVC verticals to the rig. This ran to the top of the verticals, over a pully and down the outside to a counterweight. This counterweight ended up being a steel sleeve that wrapped round most of the vertical, (this kept is tidy and accessible to raise the rig for maintenance. Originally the blades of the turbine were made from plastic guttering, but to experiment with shape we had a set that we made from wood. This changes the weight of the rig, but with the location of the counterweight it was easy to tack on pieces of lead to correct the required mass.
  Then winter came. The torrent was huge, and fast - lots of lovely power ready to be collected. The second problem with the design became apparent: The buoyancy of the bottles and the turbulence of the surface meant that the rig was being bounced up and down. We could try and increase the friction between the inner surface of the PVC vertical and the bottles, but friction is something that we have been fighting to reduce, (more power less wear.) Then I remembered by sailing days and the concept of a sea-anchor. We all know anchors are heavy things connected via a rope or chain to a ship. The anchor rest on the bottom and provides a fixed connection. What happens when the water is too deep? A sea-anchor is like an under-water parachute. To begin with I tied a string to each of the corners of a pocket-hankerchief and tied the four strings to the bottle. This hankerchief-anchor rested under the bottle and in the water. When the level of the water rapidly increased this latest addition stabalised the assent. This was a good prototype, but only solved the "bu" not the "mp". Running with the idea that if it worked in one direction then it should work in the other I added another pully to the bottom of the vertical supports and ran a new line from the bottom of the counter-weight, over this new pully and out to another hankerchief-anchor shock-absorber, (by now the HASA was made of rip-stop nylon.)

Now I just have to finish the automatic gearing and measure the useful current.


p.s. Yes the turbine axel is connected to bearings that are attached to the frame of the rig. These are not shown in the above image. Also missing is the counter-weight contraption, (because that would give away the story.)

Thursday, 23 February 2017

You won't believe how surprised computer scientists were at these results!!

President of the United states of America FAILS the Turing Test!!!


 Last night the well respected team of scientists lead by Professor Et Al published their latest findings in Nature
.tumblr.com. You might not know that all world leaders are routinely screened to pre-emptively check for dementia, (no one should want a clinically insane person with their metaphorical finger on the nuclear button). One of the regular test is a tried and tested Turing Test created by the eminent Cambridge scientist Alan Turing.

 The shocking truth is that Donald Trump failed his latest Turing Test! This is the first time in history that any adult has failed to pass this test.

The elegance off these battery of tests is that each and every country can each independently run them to ensure that diplomatic discourse has a chance to maintain trade and continue our inevitable progress towards world peace.

The physical tests, such as blood tests to check for Treponema pallidum and other potentially mentally debilitating infections have to be administered locally by their native country. These results can be shared via covert diplomatic channels to quietly maintain stability.

Thankfully,  where there is animosity between the countries there is a huge collection of tests that can be applied. Some of these are statistical analysis of
verbal and written language. Thankfully, with the advent of Twitter these tests can be performed in real-time 24/7 to provide continuous results. So far it has been all clear. There have been a few close calls but yesterday was the first conclusive failure.

What does this mean for his country? There isn't currently an established channel of care to safely inform the president of his failure, which leaves all of Washington wondering how to fix this major problem.


[0] Yes this is a click-bate parody [joke/]

Wednesday, 8 June 2016

Best pen ever

You should be thankful that this blog is not in my handwriting. I've never liked my writing; It damages my artistic enjoyment of the world and scratches against my sense of beauty.  At the same time it appals me like any other revolting thing that may emanate from my corpse.

That said, from time to time I do scrawl of sheets of dead tree and when I do I want the experience to be as painless as possible.

I feel that I am a long way off from being an enthusiast, like some people, but when I find something that I like, I want to share it, (and be able to remember it, hence this entry.)

There have been three good pens in my life worth mentioning and the first, (maybe controversially) is the Pentel P205.  For those of you watching in colour, it looks like:
Pentel P205 propelling pencil

 Why might this be a shock? Because it is, <noise like="Dun Dan Duuuun"/> a pencil. The P205, (like its yellow sister P209 and blue P207, and brown P203), is a propelling pencil. The P205 takes 0.5 mm leads, (P209 takes, you guessed it 0.9 mm).

I've had three of the P205 so far, and two of them are still working, (even after years and years of use.)
(I had a P209 but I leant it to someone at school and forgot to get it back.)
Some would argue that the P205 is too light, but for me that is part of the appeal - it feels sturdy enough without needless weight. The pocket-clip is detachable, (if you need to?)

The next pen worth mentioning was a gift from a bandwidth supplier, (Above.net). It came in a nice box that looked like:

cross box

and the pen itself looked like:

Cross ATX Matte Ballpoint Pen


The Cross ATX Ballpoint pen, (not to be confused with the water-based roller-ball version, which has a cap that comes off like the fountain pen in this range), twists to retract and extend the point of the cartridge.

This one feels expensively heavy in the hand, (even though it is one of the cheapest of the Cross pens.) I really liked how it wrote, but clearly not enough... because I left it somewhere in Cambridge.
I plan to get another of these and having inspected a few reviews I would go for the same colour and the matte finish.

That leads me to the latest entry and a short story. I found a pen. I liked it. It felt like the best of the previous two, (light, wrote well, didn't feel excessively cheap, but I didn't mind lending it to someone.) I planned to make a note about this pen, using said pen, so that I would be able to get another one once I lost this one... which I promptly did. All I could remember was that it was black, wrote well and had a metal pocket clip. I searched the house a few times and then gave up. The plan was to let my unconscious remember where it was and let me know. That was 2009. Today, the fourth day of June 2012 I found it, and what is more I found out why I had missed it in my previous searches. The metal pocket clip had broken off, hiding like a two leafed clover, in with a jar of other pens. The pen that I'm talking about is the Pilot V-ball 0.5 and looks like:
Pilot V-Ball 0.5

Now if you have tried the 0.7, (which is, on some websites, sold as the 0.5) you may, like me think that this is a smudgy pen that gushes too much ink. In my hunt I found a few of the 0.7 and had surges of hope, (they were black and had a metal pocket-clip) only to be disappointed as they vomited their tar onto the page. Then this evening I noticed a black pen from which the pocket-clip had been removed... The clouds parted as divine intervention struck my brain with imagination, expectation and understanding. To be precise the barcode on this pen is: 4902505085406 (yes, I really don't want to lose this pen again - and when I say "this pen" I mean make-n-model.)


As I do very little writing, (some would argue that I do none at all and that my scrawls don't count), I would be interested in any recommendations from people that have tried one or more of these three and then found something even better.

alexx

p.s. I'll probably mention this in a few posts, but to add the images for this post I have to thank $The_Internet and openssl. The images are created from jpegs with the command:

openssl base64 -in image.jpg -out image.base64

and then added to the HTML with <img alt="What this is" src="data:image/jpg;base64,
[Paste in the data from the image.base64 file here]  "/>

Obviously, if you are using PNG then change the src to data:image/pgn;base64,

About this blog

Sort of a test blog... until it isn't