dimanche 22 mai 2016

Programmation par l'exemple en Caml par Louis Gacôgne - 25 euros merveilleusements depenses

Pour ceux qui ont deja des bases en programmation, et en programmation fonctionnelle, ce petit manuel est une mine d'exercises aussi concis que generaux.

arbres, reines, graphes, hasard, lambda calcul, derivation symbolique, jamais trop de details, jamais pompeux ni trop succint... genial

http://www.decitre.fr/livres/programmation-par-l-exemple-en-caml-9782729819101.html


mardi 3 mai 2016

local ssh neighbors ?

A little bash function leveraging nmap .. mostly naive and fragile.
Until I learn how to do tcp|ip discovery.

neigh_ssh ()
{ 
    sudo nmap -v -p 22 --open --host-timeout 1 192.168.1.0/25 \
  | grep --color=auto -E -o "open port 22.*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" \
  | grep --color=auto -E -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" \
  | sort \
  | uniq
}

dimanche 1 mai 2016

systemd-nspawn and noexec flag

Trying to create customized archlinux iso (archiso, releng) I hit a lot of issues, most of them 'execv? failed, permission denied'.

Later on, just trying to run a systemd-nspawn container, again, execv permission. Boot fails.

Googling didn't get me very far, except to broaden the scope from systemd-nspawn to something more general. I try to run a binary (ls) from the container subtree. Permission denied. I md5sum container/.../ls and get the same md5 as the main linux install I'm running. I thought it could be the wrong architecture or a different binary. So if two binaries refuse to run .. maybe they're treated differently from the host OS. I then realize that my container and custom archiso were on a mounted drive.

mount | grep <mountpoint> -&gt; mount .... (...,noexec, ...)

EUREKA.

udevil mounts this drive with a lot of protective flags. udevil unmount <mountpoint>; sudo mount <device> /mnt; <container>/ ... /ls works.

systemd-nspawn -b -D <container> works.

Thanks to #archlinux for nothing (beside rubber ducking ;)</container></container></device></mountpoint></mountpoint>