ZFS

#!/bin/bash

format_cryptodisk() {
    # 1000 msec (= 100 MB)
    password="$1"
    device="$2"
    echo "$password" |
        time -v cryptsetup -y -v luksFormat --sector-size 4096 \
             --pbkdf-memory 4000000 --pbkdf argon2id --iter-time 1000 \
             "$device"
}
export -f format_cryptodisk
format_cryptodisks() {
    parallel -q format_cryptodisk "$password" {} \
             ::: /dev/disk/by-id/ata-WDC_WD80E*[^0-9]
}

open_cryptodisk() {
    password="$1"
    device="$2"
    shortname=$(basename "$device")
    echo "$password" |
        cryptsetup luksOpen "$device" crypto-"$shortname"
}
export -f open_cryptodisk
open_cryptodisks() {
    parallel -q open_cryptodisk "$password" {} {/} \
             ::: /dev/disk/by-id/ata-WDC_WD80E*[^0-9]
}

close_cryptodisk() {
    cryptodevice="$1"
    if [ -e /dev/mapper/"$cryptodevice" ] ; then
        cryptodevice=/dev/mapper/"$cryptodevice"
    fi
    if [ -e /dev/mapper/crypto-"$cryptodevice" ] ; then
        cryptodevice=/dev/mapper/crypto-"$cryptodevice"
    fi
    cryptsetup luksClose "$cryptodevice"
}
export -f close_cryptodisk
close_cryptodisks() {
    parallel -q close_cryptodisk ::: /dev/mapper/crypto-*
}
close_zfs() {
    zpool export rpool
}

format_zfs() {
    zpool create -f -o ashift=12 -O acltype=posixacl -O canmount=off \
          -O dnodesize=auto -O normalization=formD -O relatime=on \
          -O xattr=sa rpool raidz /dev/mapper/crypto-*
    zfs create -o mountpoint=/data rpool/DATA
}

format_zpool() {
    password="$1"
    format_cryptodisks
    open_cryptodisks
    format_zfs
}

zfs_replace_disk() {
  olddevice="$1"
  newdevice="$2"
  zero_zfs_superblock() {
      dev="$1"
      dd if=/dev/zero of="$dev" bs=512 count=10
      dd if=/dev/zero of="$dev" bs=512 seek=$(( $(blockdev --getsz "$dev") - 4096 )) count=1M
  }
  export -f zero_zfs_superblock
  if [ -e /dev/mapper/"$newdevice" ] ; then
      newdevice=/dev/mapper/"$newdevice"
  fi
  if [ -e /dev/mapper/"$olddevice" ] ; then
      olddevice=/dev/mapper/"$olddevice"
  fi
  zero_zfs_superblock "$newdevice"
  zpool replace rpool "$olddevice" "$newdevice" 
}

replace_disk() {
    oldid="ata-WDC_WD80EMAZ-00WJTA0_2SGGB3JW"
    newid="ata-WDC_WD80EMAZ-00WJTA0_2SGGB3JW"
    oldshortname="crypto-$oldid"
    newshortname="crypto-$newid"
    oldcryptodevice="/dev/mapper/$oldshortname"
    newcryptodevice="/dev/mapper/$newshortname"
    newdevice="/dev/disk/by-id/$id"
    stop_cryptodisk "$oldcryptodevice"
    format_cryptodisk "$password" "$newdevice" "$newshortname"
    open_cryptodisk "$password" "$newdevice" "$newid"
    zfs_replace_disk "$oldcryptodevice" "$newcryptodevice"
}

zfs_status() {
    #  # Replace dead drive:
    #  # zpool status
    #    pool: rpool
    #   state: DEGRADED
    #  status: One or more devices are faulted in response to persistent errors.
    #          Sufficient replicas exist for the pool to continue functioning in a
    #          degraded state.
    #  action: Replace the faulted device, or use 'zpool clear' to mark the device
    #          repaired.
    #    scan: none requested
    #  config:
    #  
    #          NAME                                          STATE     READ WRITE CKSUM
    #          rpool                                         DEGRADED     0     0     0
    #            raidz1-0                                    DEGRADED     0     0     0
    #              crypto-ata-WDC_WD80EMAZ-00WJTA0_1EG575KZ  ONLINE       0     0     0
    #              crypto-ata-WDC_WD80EMAZ-00WJTA0_1EHU5BJZ  FAULTED      6    64     0  too many errors
    #              crypto-ata-WDC_WD80EMAZ-00WJTA0_2SGGB3JW  ONLINE       0     0     0
    #              crypto-ata-WDC_WD80EMAZ-00WJTA0_2YJ5N8WD  ONLINE       0     0     0
    #              crypto-ata-WDC_WD80EZAZ-11TDBA0_2SG9J57J  ONLINE       0     0     0
    #  
    #  errors: No known data errors
    zpool status
}

make_zfs_swap_device() {
    zfs create -V 8G -b $(getconf PAGESIZE) -o logbias=throughput -o sync=always -o primarycache=metadata -o com.sun:auto-snapshot=false rpool/SWAP
    mkswap /dev/rpool/SWAP
    swapon /dev/rpool/SWAP
}

zfs set com.sun:auto-snapshot=true rpool/DATA
zfs set com.sun:auto-snapshot=hourly rpool/DATA
apt install zfs-auto-snapshot

Posted in Uncategorized | Leave a comment

Install Kiwix and KA-lite for old laptops

Kiwix

Kopier .zim til /usr/lib/kiwix

KA-lite

Install https://learningequality.org/r/deb-bundle-installer-0-17 from: https://ka-lite.readthedocs.io/en/latest/installguide/install_all.html#linux

Put videos in ~ka-lite/.kalite/content

Scan videos. Vent timer.

 

 

 

Posted in Uncategorized | Leave a comment

Reduce size of LV and PV in GNU/Linux LVM

 

We want this 32G PV to be smaller
# pvs --segments
PV        VG         Fmt  Attr PSize   PFree Start SSize
/dev/sda1 lubuntu-vg lvm2 a--  <32.00g 1.04g 0     7680
/dev/sda1 lubuntu-vg lvm2 a--  <32.00g 1.04g 7680  244
/dev/sda1 lubuntu-vg lvm2 a--  <32.00g 1.04g 7924  267

# vgs
VG         #PV #LV #SN Attr   VSize   VFree
lubuntu-vg 1   2   0   wz--n- <32.00g 1.04g

# lvs
WARNING: Cannot find matching striped segment for lubuntu-vg/swap_1.
LV     VG         Attr       LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root   lubuntu-vg -wi-ao---- 30.00g
swap_1 lubuntu-vg -wi-XX--X- 976.00m

When mounting the LV we can see only 5.3 GB is used, 
so let us resize that from 30 GB to 10 GB
# df
Filesystem                   1K-blocks Used    Available Use% Mounted on
/dev/mapper/lubuntu--vg-root 29915044  5382188 22943616  20%  /

Before starting, the file system needs to be checked
# fsck -f /dev/mapper/lubuntu--vg-root

Resize filesystem to 9GB so we are sure we are below the limit
# resize2fs /dev/mapper/lubuntu--vg-root 9G
resize2fs 1.44.1 (24-Mar-2018)
Resizing the filesystem on /dev/mapper/lubuntu--vg-root to 2359296 (4k) blocks.
The filesystem on /dev/mapper/lubuntu--vg-root is now 2359296 (4k) blocks long.

Resize LV to 10G
# lvreduce -L 10G /dev/mapper/lubuntu--vg-root
WARNING: Reducing active logical volume to 10.00 GiB.
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lubuntu-vg/root? [y/n]: y
Size of logical volume lubuntu-vg/root changed from 30.00 GiB (7680 extents) to 10.00 GiB (2560 extents).
Logical volume lubuntu-vg/root successfully resized.

Resize the file system to all available space (9 GB -> ~10GB)
# resize2fs /dev/mapper/lubuntu--vg-root

Now file system and LV are resized
# lvs
LV     VG         Attr       LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root   lubuntu-vg -wi-a----- 10.00g
swap_1 lubuntu-vg -wi-a----- 976.00m

Try resizing PV to 12GB (10G for file system, 1GB for swap 
and 1 GB free)
# pvresize /dev/sdb1 --setphysicalvolumesize 12G
/dev/sdb1: Requested size 12.00 GiB is less than real size <149.05 GiB. Proceed? [y/n]: y
WARNING: /dev/sdb1: Pretending size is 25165824 not 312578048 sectors.
/dev/sdb1: cannot resize to 3071 extents as later ones are allocated.
0 physical volume(s) resized / 1 physical volume(s) not resized

If that fails, move extents that are above 3071 below extent 3071
# pvs --segments
PV        VG         Fmt  Attr PSize   PFree  Start SSize
/dev/sdb1 lubuntu-vg lvm2 a--  <32.00g 21.04g 0     2560
/dev/sdb1 lubuntu-vg lvm2 a--  <32.00g 21.04g 2560  5120
/dev/sdb1 lubuntu-vg lvm2 a--  <32.00g 21.04g 7680  244
/dev/sdb1 lubuntu-vg lvm2 a--  <32.00g 21.04g 7924  267

# pvmove --alloc anywhere /dev/sdb1:3000-$((7924+267-1)) \
    /dev/sdb1:1-3000

Then try again
# pvresize /dev/sdb1 --setphysicalvolumesize 12G
/dev/sdb1: Requested size 12.00 GiB is less than real size <149.05 GiB. Proceed? [y/n]: y
WARNING: /dev/sdb1: Pretending size is 25165824 not 312578048 sectors.
Physical volume "/dev/sdb1" changed
1 physical volume(s) resized / 0 physical volume(s) not resized

Done

 

Posted in Uncategorized | Leave a comment

Parallelization – is it faster?

I have earlier written about parallelizing I/O. It is not that surprising that you can overload your disk with parallel requests and get worse I/O than serial access. What may be more surprising is that parallelizing CPU intensive tasks may not benefit from hyperthreading.

# Compress /dev/zero for 5 seconds
doit() { seq $1 |parallel -N0 –timeout 5 -j$1 -u zstd ‘<‘ /dev/zero | wc -c ; }
export -f doit
seq $(parallel –number-of-threads) | parallel -j1 –shuf –tag doit :::: – ::: {1..5} 2>/dev/null

This computes how much data `zstd` generates when run for 5 seconds. It does this with different number of jobs in parallel. On my system with 4 cores/8 threads you might expect a big increase from 1 to 4 jobs in parallel and a small increase from 5 to 8 jobs.

That is not what is happening.

I see the big increase from 1 to 4 jobs in parallel (as expected), but more than 4 jobs in parallel is actually slower than running 4 in parallel.

On my 2 core/4 thread machine the performance increases until 3 jobs are run in parallel – both 2 and 4 jobs in parallel are slower.

`zstd` is not a representative tool – normally you will get an increase in performance up to the number of threads – less and less increase for each thread. `gzip` behaves more like one would expect:  On my 2 core/4 thread machine gives 1 job = 50%, 2 jobs = 75%, 3 jobs = 90%, 4 jobs in parallel = 100%.

 

Posted in Uncategorized | Leave a comment

Excuses for not installing GNU Parallel

Over the time I have seen people, who could benefit from using GNU Parallel, give excuses why they should not use GNU Parallel. I believe most of the reasons are based in a lack of due diligence: To avoid doing a little work now, they end up doing a lot of work later.

Here are the most popular excuses I have met so far:

“GNU Parallel is not installed everywhere”

It is true that GNU Parallel is not installed everywhere. But it is designed to be extremely easy to install. We are literally talking a matter of seconds:

$ (wget -O - pi.dk/3 || lynx -source pi.dk/3 || curl pi.dk/3/ || \
  fetch -o - http://pi.dk/3 ) > install.sh
$ sha1sum install.sh | grep 67bd7bc7dc20aff99eb8f1266574dadb
12345678 67bd7bc7 dc20aff9 9eb8f126 6574dadb
$ md5sum install.sh | grep b7a15cdbb07fb6e11b0338577bc1780f
b7a15cdb b07fb6e1 1b033857 7bc1780f
$ sha512sum install.sh | grep 186000b62b66969d7506ca4f885e0c80e02a22
6f25960b d4b90cf6 ba5b76de c1acdf39 f3d24249 72930394 a4164351
93a7668d 21ff9839 6f920be5 186000b6 2b66969d 7506ca4f 885e0c80
e02a2244 40e8a43f
$ bash install.sh

Or if you want full control over the process: http://git.savannah.gnu.org/cgit/parallel.git/tree/README

“I do not have root access”

GNU Parallel does not require root access to do a personal installation, so you do not need root access to install it. Just do:

./configure --prefix=$HOME && make && make install

or:

$ (wget -O - pi.dk/3 || lynx -source pi.dk/3 || curl pi.dk/3/ || \
  fetch -o - http://pi.dk/3 ) > install.sh
$ sha1sum install.sh | grep 67bd7bc7dc20aff99eb8f1266574dadb
12345678 67bd7bc7 dc20aff9 9eb8f126 6574dadb
$ md5sum install.sh | grep b7a15cdbb07fb6e11b0338577bc1780f
b7a15cdb b07fb6e1 1b033857 7bc1780f
$ sha512sum install.sh | grep 186000b62b66969d7506ca4f885e0c80e02a22
6f25960b d4b90cf6 ba5b76de c1acdf39 f3d24249 72930394 a4164351
93a7668d 21ff9839 6f920be5 186000b6 2b66969d 7506ca4f 885e0c80
e02a2244 40e8a43f
$ bash install.sh

GNU Parallel can also be embedded in a shell script on a system that has GNU Parallel installed by doing this:

parallel --embed > newscript

Edit the end of newscript and copy newscript to the other system.

“I am not allowed to install software”

If you are allowed to run your own scripts, you can run GNU Parallel just like you would any of your own scripts. All you need to do is to copy the file parallel and use it the same way you would your own scripts.

“Using GNU Parallel is overkill”

Overkill usually means that setting up the program and running it will take longer than just running the job in a different way. Setting up GNU Parallel can be done in 10 seconds, so the risk is quite limited.

“Keeping GNU Parallel up to date is too hard”

By installing even an old version you most likely will save time by using it. The basic functionality has remained the same for years.

You only need to upgrade if you need some of the newer functionality or if you are being hit by a bug that is fixed in newer versions. Most of the recent bugs are related to rare race conditions and will never affect most people.

Updating to the newest version is also a matter of seconds:

$ (wget -O - pi.dk/3 || lynx -source pi.dk/3 || curl pi.dk/3/ || \
  fetch -o - http://pi.dk/3 ) > install.sh
$ sha1sum install.sh | grep 67bd7bc7dc20aff99eb8f1266574dadb
12345678 67bd7bc7 dc20aff9 9eb8f126 6574dadb
$ md5sum install.sh | grep b7a15cdbb07fb6e11b0338577bc1780f
b7a15cdb b07fb6e1 1b033857 7bc1780f
$ sha512sum install.sh | grep 186000b62b66969d7506ca4f885e0c80e02a22
6f25960b d4b90cf6 ba5b76de c1acdf39 f3d24249 72930394 a4164351
93a7668d 21ff9839 6f920be5 186000b6 2b66969d 7506ca4f 885e0c80
e02a2244 40e8a43f
$ bash install.sh

“I do not understand Perl”

Unless you are going to change GNU Parallel you do not need to know Perl to use the tool – just like you do not need to learn kernel programming to use Linux.

“GNU Parallel is too hard to compile and install”

This excuse is typically from users who never even tried to install it. GNU Parallel is written in Perl and is compatible with even very old versions of Perl. So even if your system is too limited to do the ‘./configure && make && make install’ then you should always be able to do the ‘cp parallel $HOME/bin’.

If wget, gpg, sha1sum, and bzip2 are installed this ought to work:

$ (wget -O - pi.dk/3 || lynx -source pi.dk/3 || curl pi.dk/3/ || \
  fetch -o - http://pi.dk/3 ) > install.sh
$ sha1sum install.sh | grep 67bd7bc7dc20aff99eb8f1266574dadb
12345678 67bd7bc7 dc20aff9 9eb8f126 6574dadb
$ md5sum install.sh | grep b7a15cdbb07fb6e11b0338577bc1780f
b7a15cdb b07fb6e1 1b033857 7bc1780f
$ sha512sum install.sh | grep 186000b62b66969d7506ca4f885e0c80e02a22
6f25960b d4b90cf6 ba5b76de c1acdf39 f3d24249 72930394 a4164351
93a7668d 21ff9839 6f920be5 186000b6 2b66969d 7506ca4f 885e0c80
e02a2244 40e8a43f
$ bash install.sh

“My software should not depend on non-standard software”

Why not distribute GNU Parallel next to your software? The beauty of free software is that you are in fact allowed to do this – even if your software is non-free.

SM is an example of software co-distributing GNU Parallel https://github.com/sm/sm/blob/master/README.md

GNU Parallel can also be embedded in a shell script using:

parallel --embed > newscript

Edit the end of newscript.

“GNU Parallel is not as well tested as xargs”

I have seen this argument from people who then did something like this:

find mydir -print |
  grep -f file_with_some_stuff |
  tail |
  xargs -n1 -P 10 mycommand |
  grep other_stuff

So while xargs may be well tested they basically screwed themselves over by using xargs in a way that is not safe – by design.

The above has 2 major issues:

  • If file names in mydir contain space, ‘ or ” xargs will interpret these and mycommand will not be run on those files. And it is quite common for users (especially GUI users) to create files with space, ‘ or “.
  • The output from the parallel running mycommands is not guaranteed to not mix, so you risk having half a line from one instance of mycommand with the rest of the line from another instance.

These are both risks you avoid by using GNU Parallel. The scary part is that they most likely will not notice the problem on their test set, and the problem will therefore only be discovered after their script has been put into production.

There is also a minor issue:

  • If the file names in mydir contain \n (newline).

This will fail in GNU Parallel, too (unless using -0). But I have yet to see a file name with a newline in it that was created by normal users. This only happens with malicious users.

Dealing with the problems from xargs

Some are aware of the problems with xargs and then spend a lot of effort trying to fix them:

  • They quote ‘ ” and space (though sometimes they forget some of them).
  • They try to un-mix the output by wrapping the output with markers and then post process the output based on these markers, but they never manage to fix the half-line issue.

So while xargs is well tested, their fixups are not, thereby defeating the purpose of only using well tested software. All in all they spend much more effort on building their own fixup around xargs than it would take to simply install GNU Parallel.

– o –

Being the developer of GNU Parallel I am of course biased: I think everyone using the command line owe it to themselves and to their command line to have GNU Parallel in their toolbox.

Posted in Uncategorized | Leave a comment

Luk pengekassen for tilflyttere til socialt belastede områder

Kan vi lave bedre integration for de samme midler? Vi kunne prøve at lukke pengekassen, hvis man flytter til socialt belastede områder.

Danmarks Statistik laver hvert år en undersøgelse af indvandrere. Gang på gang viser tallene, at når man korrigerer for socioøkonomisk status, så er folk fra Mellemøsten og Afrika overrepræsenterede blandt de kriminelle, mens folk fra Sydøstasien er underrepræsenterede. (F.eks. http://www.dst.dk/Site/Dst/Udgivelser/GetPubFile.aspx?id=20704&sid=indv2016 side 86)

Det er mit indtryk, at hvis indvanderne bliver opsuget i samfundet, så er der færre problemer. Det bygger jeg på landsbyen, som jeg kommer fra. Her har man flere gange modtaget flygtninge, der svarer til 1% af hele landsbyens størrelse, og det er lykkedes at få disse til at blive en helt naturlig del af landsbysamfundet. Når jeg taler med lokale, så mener de, at det skyldes, at det ikke var muligt for flygtningene at holde sig for sig selv: De havde ikke en mulighed for at leve hele deres liv omgivet af folk med deres egen baggrund.

Jeg tror, vi kan modtage langt flere flygtninge og indvandrere, men ikke på den måde vi gør idag: Vi har ghettoer med sociale problemer, og disse er vi nødt til at gøre noget ved.

Jeg er ikke særlig glad for tvang, men har ikke noget imod at give (store) økonomiske incitamenter.

Mit forslag er: Fjern den offentlige forsørgelse for folk, der flytter til områder med sociale problemer.

Det er vigtigt at understrege, at man ikke rører ved støtten for folk, der ikke flytter. Man rører heller ikke ved støtten for folk, der flytter til områder, der ikke er socialt belastede. Det er også helt i orden at flytte til socialt belastede områder, men så skal man kunne klare sig uden offentlig forsørgelse.

Så ønsker du offentlig forsørgelse, så må du finde dig i, at hvis du vil flytte, så kan du kun flytte til 95% af Danmarks areal.

Hvis boligerne i ghetto-områderne ikke længere kan “fyldes op” med socialt belastede, så skulle markedskræfterne gerne over tid få boligerne i ghetto-områderne til at falde i pris, og på sigt blive så billige, at velfungerende borgere får lyst at flytte dertil. Og de borgere, der er knapt så velfungerende vil være spredt over et langt større område: Vi kan som lokalsamfund sagtens klare, at 1% kræver ekstrahjælp, men det kan virke drænende, hvis det er 25%.

 

Posted in Uncategorized | Leave a comment

Tidsbestemt elpris

Hvorfor er forhøjet elpris kl 18 en grøn ide? Eet ord: kogepuklen

Danskerne forbruger ikke el jævnt hen over døgnet. Lige omkring kl. 18 topper danskernes daglige elforbrug. Denne top kalder man populært for kogepuklen, da den bl.a. skyldes madlavning.

Kogepuklen betyder, at forbruget ikke kan dækkes af vedvarende energi, men at kulværker og gasturbiner sættes igang. Med andre ord er strømmen omkring kl. 18 den mest svinende og CO2-udledende.

Derfor er det grøn tænkning at flytte sit elforbrug væk fra denne periode.

Incitament

Hidtil har der ikke været nogen økonomisk grund til at ændre vaner, men nu forhøjer Radius sin elpris kl. 17-20 i vinterhalvåret.

Dermed bliver der også et økonomisk incitament til at flytte forbruget.

Flyt dit forbrug

Som moderne menneske kan du naturligvis ikke flytte hele dit el-forbrug væk fra perioden 17-20, men visse ting er faktisk ret nemme at flytte.

Alle moderne opvaskemaskiner har udskudt start (også kaldet tidsforvalg). Så istedet for at starte maskinen lige efter du har spist, så lad den vaske op midt om natten. Eller (hvis din opvaskemaskine larmer meget) få den til at vaske næste formiddag.

Alle moderne vaskemaskiner har også udskudt start. De larmer typisk så meget, at man ikke kan sove, når de centifugerer. Men de kan fint køre om eftermiddagen, så vasken lige er færdig, når man kommer hjem fra arbejde. Lige til at hænge op.

Hvis du har en vasketørremaskine, så kan du endda bede den om både at vaske og tørre, så tøjet er klar, når du kommer hjem fra arbejde. Tørretumbleren er nemlig også en strømsluger.

Har du en fryser, så sæt et tænd-og-sluk ur på, så fryseren ikke får strøm i de 3 timer 17-20. Fryseren kan sagtens holde varene kolde i de 3 timer. Hvis du ikke åbner dit køleskab hele tiden, så kan de fleste køleskabe også holde varene kølige i 3 timer uden strøm.

Problemfrit?

For de fleste vil det være problemfrit at ændre vaner, så noget af elforbruget flyttes uden for 17-20.

Men helt problemfrit er det ikke: De elmålere, der sættes op, respekterer ikke dit privatliv. De kan aflæses af elselskabet nårsomhelst, og det kan have ret voldsomme privatlivskonsekvenser. Man kan sagtens lave elmålere, som beskytter dit privatliv. Derfor skal du insistere på, at den fjernaflæste måler du får er baseret på Privacy-by-Design.

 

Posted in Uncategorized | Leave a comment

Testforberedelse

45 stk

20 min

3×3

Aldrig diagonal

6 muligheder

Start i midten.

Understreg kandidater, så de kan vælges ved 1 min mark.

Posted in Uncategorized | Leave a comment

Grønstsagsblandingstest

Vores bønneblanding: 8
Vores orientalsk inspireret wokblanding: 7 (med kokosmælk)
Vores ratatouille med krydderier: 7 (med ketchup)
Vinterblanding med rug: 7
Vores indisk inspirede grøntsagsblanding: 4
Vores romanescoblanding: 2
Vores grøntsagsblanding: 3

Posted in Uncategorized | Leave a comment

Python with braces

I have tried using Python for more serious work, but has been thrown off by its forced whitespace indentation. In Emacs I want to press TAB and get to the correct indentation level – no matter the code, so I have several times tried looking for a way to add braces to Python.

I would prefer if my preference for braces did not affect people who do not like braces, so I would like a conversion between the two systems. It could be an Emacs package, that fixed the braces after loading/before saving, so the saved file always contained whitespace, but the loaded file would be with braces.

I have now found a few projects that try to implement braces.

Pybraces

https://github.com/thatch/pybraces – tested 2017-06-29

Good

  • Nothing

Bad

  • demo0.py fails.

Python-with-braces

http://python-with-braces.appspot.com/ – tested 2017-06-29

Good

  • Nothing

Bad

  • failed to compile.

Bython

https://github.com/mathialo/bython – tested 2017-06-29

Good

  • Simple programs work.
  • Shebang works.
  • Compiling to no-braces (-c).

Bad

  • Mixing with indented code fails.
  • No way of converting no-braces => braces.
  • No man page.

 

 

Posted in Uncategorized | Leave a comment