

        
    
        
            
        
    
        
        
        
    
        
        
        
    
        
            
        
    
        
        
        
    
        
            
        
        
        
            
        
        
        
        
        
    
        
            
        
    
        
        
{"version":"https:\/\/jsonfeed.org\/version\/1","title":"[Blog] Nicolas Busseneau","home_page_url":"https:\/\/nicolas.busseneau.fr\/en\/blog","feed_url":"https:\/\/nicolas.busseneau.fr\/en\/blog.json","description":"I'm a computer software\/hardware enthusiast, weightlifter, and gamer. I hope you'll enjoy what I found interesting enough to blog.","author":{"name":"Nicolas Busseneau"},"items":[{"title":"FFA graph theory","date_published":"2023-09-03T11:21:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2023\/09\/using-graph-theory-for-ffa-games","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2023\/09\/using-graph-theory-for-ffa-games","content_html":"<p><a href=\"https:\/\/www.beyondallreason.info\/\">Beyond All Reason<\/a> is an awesome <abbr title=\"Real-Time Strategy game\">RTS<\/abbr> descended from Total Annihilation&nbsp;&#129302;\nThe game is based on the <a href=\"https:\/\/beyond-all-reason.github.io\/spring\/\">Recoil<\/a> engine (formerly <a href=\"https:\/\/springrts.com\/\">SpringRTS<\/a>) and thus entirely open source, which makes it doubly interesting as players can directly participate in improving the game.<\/p>\n<p>As on all classic <abbr title=\"Real-Time Strategy game\">RTS<\/abbr> games, one of the available game modes is <abbr title=\"Free-For-All game mode: everybody for themselves!\">FFA<\/abbr> up to 16 players (extremely fun).\nIn this mode, players are automatically assigned a start position at game start, and I was slightly annoyed by the system&rsquo;s inflexibility: in a nutshell, a set of static start points is defined on each map, and on game start the system would pick the first X points and randomly assign them to players.<\/p>\n<p>In effect, when starting a 12-way <abbr title=\"Free-For-All game mode: everybody for themselves!\">FFA<\/abbr> on a 16-position map, the game would systematically pick start positions 1-12, meaning the start positions for a 12-way on this map would always be the same and positions 13-16 would never be used.\nI set out to improve this by adding the possibility to define multiple layouts per X-way per map, thus allowing for more flexibility in defining fair and unpredictable layouts for various sizes of <abbr title=\"Free-For-All game mode: everybody for themselves!\">FFA<\/abbr> on the same map.<\/p>\n<p>To illustrate, the following map allows to play fair <abbr title=\"Free-For-All game mode: everybody for themselves!\">FFA<\/abbr> matches at various sizes (3-way, 5-way, 7-way, etc.) thanks to its clever triple-concentric-rings design.\nHowever, the default system was not flexible enough to actually allow it to be played in 3-way or 5-way as it always picked the first X points for X players, resulting in unfair start positions. The new system addresses this since appropriate layouts for all <abbr title=\"Free-For-All game mode: everybody for themselves!\">FFA<\/abbr> sizes can be defined.<\/p>\n<p><a rel=\"lightbox\" href=\"\/user\/pages\/01.blog\/2023\/09\/using-graph-theory-for-ffa-games\/throne.png\"><img alt=\"Throne map with its 16 start positions\" src=\"\/user\/pages\/01.blog\/2023\/09\/using-graph-theory-for-ffa-games\/throne.png\"><\/a><\/p>\n<p>Proper layouts were as easy to figure out on most maps as in the example above, but of course some proved to be challenging, and notably asymmetrical maps.\nOne of them in particular is unique because it is the only map in the game with more than 16 start positions: it has 32.<\/p>\n<p><a rel=\"lightbox\" href=\"\/user\/pages\/01.blog\/2023\/09\/using-graph-theory-for-ffa-games\/mediterraneum.png\"><img alt=\"Mediterraneum map with its 32 start positions\" src=\"\/user\/pages\/01.blog\/2023\/09\/using-graph-theory-for-ffa-games\/mediterraneum.png\"><\/a><\/p>\n<p>Since strategic resources are available on each start point, attention should be paid to distributing players such that none has access to considerably more or less resources than another, which can naively be done by trying to avoid having 2 players starting next to each other.\nBut trying to manually figure out fair layouts on this map was a nightmare, and for good reason considering the number of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Combination\">16-combination<\/a> possible out of 32 start points:<\/p>\n<p class=\"mathjax mathjax--block\">\\[\nC(32, 16) = {32 \\choose 16} = {\\frac{32!}{16!16!}} = 601,080,390\\]<\/p>\n<p>So I decided to use graph theory to help me out.\nThe map can be represented as a graph where each start point is a node and neighbour status is materialized by an edge:<\/p>\n<div style=\"text-align: center;\">\n<p><a rel=\"lightbox\" href=\"\/images\/4\/a\/8\/0\/2\/4a8028833d0ee6c94103e8e3d0db6944113f4d98-01graph.png\"><img alt=\"Graph of the map, where each start point is a node and neighbour status is materialized by an edge\" src=\"\/user\/pages\/01.blog\/2023\/09\/using-graph-theory-for-ffa-games\/01_graph.png\"><\/a><\/p>\n<\/div>\n<p>From there, we can:<\/p>\n<ul>\n<li>Search for <a href=\"https:\/\/en.wikipedia.org\/wiki\/Maximal_independent_set\">maximal independent sets<\/a>, i.e. sets of start positions such that no start positions are adjacent and where no further start position can be added without losing that property. These are basically <abbr title=\"Free-For-All game mode: everybody for themselves!\">FFA<\/abbr> layouts that can be used as-is.<\/li>\n<li>Identify <a href=\"https:\/\/en.wikipedia.org\/wiki\/Clique_(graph_theory)\">cliques<\/a>, i.e. sets of start positions which are all adjacent to each...<\/li><\/ul>","summary":"Using graph theory to determine player layouts in FFA.","tags":["video games","mathematics"],"image":"\/user\/pages\/01.blog\/2023\/09\/using-graph-theory-for-ffa-games\/01_graph.png"},{"title":"Remove `mdadm` RAID1 while keeping data","date_published":"2021-08-01T16:21:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/08\/remove-mdadm-raid1-keep-data","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/08\/remove-mdadm-raid1-keep-data","content_html":"<p>Guide on removing a Linux <code>mdadm<\/code> <abbr title=\"Mirroring: identical data on all disks in the array.\">RAID1<\/abbr> array while preserving existing partition data, avoiding the need to reinstall or copy files around.<\/p>\n<p>If you ever end up with a similar need, here is how I did it. It goes without saying that you should back up data before doing anything, otherwise you accept the risk of losing it all. <em>Hic sunt dracones<\/em>&nbsp;&#128009;<\/p>\n<h1 id=\"context\">Context<a href=\"#context\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>A dedicated SoYouStart server with two disks, for hosting virtual machines via VMware ESXi.\nUnfortunately VMware ESXi does not support software RAID: as a workaround, it is possible to attach two VMDK (virtual disk) to each VM, with each VMDK stored on a separate datastore (hardware disk), and setup software <abbr title=\"Mirroring: identical data on all disks in the array.\">RAID1<\/abbr> directly from the VM via <code>mdadm<\/code>.<\/p>\n<p>This annoying limitation actually was one of the main motivators for <a href=\"\/en\/blog\/2021\/07\/esxi-to-proxmox-migration\">migrating from VMware ESXi to Proxmox VE<\/a>, which <a href=\"https:\/\/pve.proxmox.com\/wiki\/ZFS_on_Linux\">supports software <abbr title=\"Mirroring: identical data on all disks in the array.\">RAID1<\/abbr> over ZFS<\/a>. With RAID handled at the host level, virtual machines do not need to manage software RAID themselves anymore, and only one disk needs to be kept for each VM.<\/p>\n<h1 id=\"lazy-and-easy\">Lazy and easy<a href=\"#lazy-and-easy\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>We are going to remove devices from the array, then trick <code>mdadm<\/code> into being cool with a <abbr title=\"Mirroring: identical data on all disks in the array.\">RAID1<\/abbr> array consisting of only one device.<\/p>\n<p>First, inspect partitions and disks to identify where is what and what needs to be done:<\/p>\n<ul>\n<li>Which partitions on which disks make up the <code>mdadm<\/code> array.<\/li>\n<li>Decide which partition is going to stay.<\/li>\n<li>If there are other partitions on the same disks AND we want to ditch the disk, decide if they can be deleted or should be moved.<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># lsblk\nNAME    MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT\nsda       8:0    0  100G  0 disk\n&#9500;&#9472;sda1    8:1    0  953M  0 part  [SWAP]\n&#9492;&#9472;sda2    8:2    0 99.1G  0 part\n  &#9492;&#9472;md0   9:0    0 99.1G  0 raid1 \/\nsdb       8:16   0  100G  0 disk\n&#9500;&#9472;sdb1    8:17   0  953M  0 part  \/var\/tmp\n&#9492;&#9472;sdb2    8:18   0 99.1G  0 part\n  &#9492;&#9472;md0   9:0    0 99.1G  0 raid1 \/\n# cat \/proc\/mdstat\nmd0 : active raid1 sda2[0] sdb2[1]\n      103872512 blocks super 1.2 [2\/2] [UU]\n# mdadm --detail \/dev\/md0\nState : active<\/code><\/pre>\n<p>For example, here:<\/p>\n<ul>\n<li>We have one disk with a swap partition and the other one a <code>\/var\/tmp<\/code> partition.<\/li>\n<li>The <abbr title=\"Mirroring: identical data on all disks in the array.\">RAID1<\/abbr> partition <code>md0<\/code> is spread over <code>sda2<\/code> and <code>sdb2<\/code>.<\/li>\n<li>We want to ditch the whole <code>sda<\/code> disk and keep <code>sdb2<\/code>.<\/li>\n<\/ul>\n<p>Once everything is settled:<\/p>\n<ul>\n<li>Do whatever needs to be done with non-array partitions.<\/li>\n<li>Manually mark partitions to remove from the array as failed, then remove them from the array and delete their RAID superblock:<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># mdadm \/dev\/md0 --fail \/dev\/sda2\nmdadm: set \/dev\/sda2 faulty in \/dev\/md0\n# mdadm \/dev\/md0 --remove \/dev\/sda2\nmdadm: hot removed \/dev\/sda2 from \/dev\/md0\n# mdadm --zero-superblock \/dev\/sda2<\/code><\/pre>\n<p>In our case, we first dropped the <code>sda1<\/code> swap partition (not shown above: disabled with <code>swapoff<\/code> and an <code>\/etc\/fstab<\/code> update), and then removed <code>sda2<\/code> from the array.<\/p>\n<p>If we stopped at this stage <code>mdadm<\/code> would complain the array is degraded because it is missing a device:<\/p>\n<pre><code class=\"language-shell-session\"># cat \/proc\/mdstat\nmd0 : active raid1...<\/code><\/pre>","summary":"Guide to removing a Linux mdadm RAID1 array while preserving existing partition data.","tags":["raid","linux"]},{"title":"Migrating virtual machines from VMware ESXi to Proxmox VE","date_published":"2021-07-25T19:54:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/07\/esxi-to-proxmox-migration","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/07\/esxi-to-proxmox-migration","content_html":"<p>I recently migrated virtual machines from VMware ESXi to Proxmox VE, and hit a few quirks in the process.\nHere are my notes in case that may help.<\/p>\n<p>Both VMware ESXi and Proxmox VE support <a href=\"https:\/\/en.wikipedia.org\/wiki\/Open_Virtualization_Format\">OVF<\/a>.\nThe goal is to export a VM in OVF format from VMware ESXi and then import the OVF on Proxmox VE.<\/p>\n\n<h1 id=\"prerequisites\">Prerequisites<a href=\"#prerequisites\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>Assuming VMware ESXi is accessible from the Proxmox VE, we can use <a href=\"https:\/\/my.VMware.com\/group\/VMware\/downloads\/get-download?downloadGroup=OVFTOOL440\">VMware OVF Tool<\/a> directly from Proxmox VE in order to export and copy the OVF in one pass.<\/p>\n<ul>\n<li>Install VMware OVF Tool on Proxmox VE:\n<ul>\n<li>Download <code>.bundle<\/code> file (requires a VMware account, can create one for free).<\/li>\n<li><code>chmod +x<\/code> and run it.<\/li>\n<\/ul><\/li>\n<li>Shutdown the VM on VMware ESXi.<\/li>\n<\/ul>\n<h1 id=\"export-vm-from-vmware-esxi\">Export VM from VMware ESXi<a href=\"#export-vm-from-vmware-esxi\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>Usage:<\/p>\n<pre><code class=\"language-shell-session\"># ovftool vi:\/\/&lt;username&gt;@&lt;host&gt;:&lt;port&gt;\/<\/code><\/pre>\n<p>If using SSL with a self-signed certificate, add <code>--noSSLVerify<\/code>.<\/p>\n<p>OVF Tool will prompt for the password and list objects available:<\/p>\n<pre><code class=\"language-shell-session\"># ovftool --noSSLVerify vi:\/\/root@XXX.XXX.XXX.XXX:443\/\nEnter login information for source vi:\/\/XXX.XXX.XXX.XXX\/\nUsername: root\nPassword: ***************\nError: Found wrong kind of object (ResourcePool). Possible completions are:\n  vm1\n  vm2\n  dir1\/\n  dir2\/<\/code><\/pre>\n<p>We can recursively list objects, e.g. here for a directory:<\/p>\n<pre><code class=\"language-shell-session\"># ovftool --noSSLVerify vi:\/\/root@XXX.XXX.XXX.XXX:443\/dir1\/\nEnter login information for source vi:\/\/XXX.XXX.XXX.XXX\/\nUsername: root\nPassword: ***************\nError: Found wrong kind of object (ResourcePool). Possible completions are:\n  vm3<\/code><\/pre>\n<p>When accessing a VM, we are displayed the VM details to be exported via OVF:<\/p>\n<pre><code class=\"language-shell-session\"># ovftool --noSSLVerify vi:\/\/root@XXX.XXX.XXX.XXX:443\/dir1\/vm3\nEnter login information for source vi:\/\/XXX.XXX.XXX.XXX\/\nUsername: root\nPassword: ***************\nOVF version:   1.0\nVirtualApp:    false\nName:          vm3\n\nDownload Size:  Unknown\n\nDeployment Sizes:\n  Flat disks:   100.00 GB\n  Sparse disks: Unknown\n\nNetworks:\n  Name:        Foo\n  Description: Bar\n\nVirtual Machines:\n  Name:               vm3\n  Operating System:   debian10_64guest\n  Virtual Hardware:\n    Families:         vmx-13\n    Number of CPUs:   4\n    Cores per socket: 4\n    Memory:           6.00 GB\n\n    Disks:\n      Index:          0\n      Instance ID:    9\n      Capacity:       50.00 GB\n      Disk Types:     SCSI-VirtualSCSI\n\n      Index:          1\n      Instance ID:    10\n      Capacity:       50.00 GB\n      Disk Types:     SCSI-VirtualSCSI\n\n    NICs:\n      Adapter Type:   VmxNet3\n      Connection:     Foo\n\nReferences:\n  File:  \/12\/ParaVirtualSCSIController0:0\n  File:  \/12\/ParaVirtualSCSIController0:1<\/code><\/pre>\n<p>Once we have identified the VM to export, we can write the OVF to a local file on Proxmox VE:<\/p>\n<pre><code class=\"language-shell-session\"># ovftool --noSSLVerify vi:\/\/root@XXX.XXX.XXX.XXX:443\/dir2\/vm4 .\nEnter login information for source vi:\/\/XXX.XXX.XXX.XXX\/\nUsername: root\nPassword: ***************\nOpening VI source: vi:\/\/root@XXX.XXX.XXX.XXX:443\/dir2\/vm4\nOpening VI source: vi:\/\/root@XXX.XXX.XXX.XXX:443\/dir2\/vm4\nOpening OVF target: .\nWriting OVF package: .\/vm4\/vm4.ovf\nDisk progress: 12%\n[...]\nTransfer Completed\nCompleted successfully<\/code><\/pre>\n<h2 id=\"issues\">Issues<a href=\"#issues\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>For some VMs, I hit this error:<\/p>\n<pre><code class=\"language-shell-session\"># ovftool --noSSLVerify vi:\/\/root@XXX.XXX.XXX.XXX:443\/dir2\/vm4\nEnter login information for source vi:\/\/XXX.XXX.XXX.XXX\/\nUsername: root\nPassword: ***************\nError: Fault cause: vim.fault.FileNotFound<\/code><\/pre>\n<ul>\n<li>Diagnosis: CD\/ROM device attached to the VM references a Datastore ISO File that OVF Tool cannot access.<\/li>\n<li>Solution: detach the CD\/ROM device from the VM.<\/li>\n<\/ul>\n<h1 id=\"import-vm-to-proxmox-ve\">Import VM to Proxmox VE<a href=\"#import-vm-to-proxmox-ve\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>With the OVF available locally, we can import the VM using the <a href=\"https:\/\/pve.proxmox.com\/pve-docs\/qm.1.html\"><code>qm<\/code> command line tool<\/a>.<\/p>\n<p>Usage:<\/p>\n<pre><code class=\"language-shell-session\">qm importovf &lt;id&gt; path\/to\/file.ovf &lt;proxmox_storage&gt;<\/code><\/pre>\n<p>We may also specify <code>--format &lt;qcow2 | raw | vmdk&gt;<\/code> to use a specific disk image format on import.\n<span class=\"text-muted\">This will have no effect when importing into ZFS storage since it uses block device emulation and only allows <code>raw<\/code>.<\/span><\/p>\n<p>Example...<\/p>","summary":"Rundown of my experience migrating virtual machines from VMware ESXi to Proxmox VE, and solutions to a few quirks.","tags":["virtualization","linux"]},{"title":"Installing an ISO image on OVH \/ SoYouStart dedicated server","date_published":"2021-07-24T14:10:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/07\/ovh-soyoustart-install-iso-image","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/07\/ovh-soyoustart-install-iso-image","content_html":"<p>It&rsquo;s been several years now that OVH offers dedicated hosting under 3 brands:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.ovh.com\/\">OVH<\/a> itself, targeting high-end and enterprises willing to pay top &amp;dollar;&amp;dollar;&amp;dollar;.<\/li>\n<li><a href=\"https:\/\/www.soyoustart.com\/\">SoYouStart<\/a>, for good hardware on a reasonable budget.<\/li>\n<li><a href=\"https:\/\/www.kimsufi.com\/\">Kimsufi<\/a>, the low-cost offering.<\/li>\n<\/ul>\n<p>When spinning up a dedicated server, we can pick from installation templates tweakable to some extent (e.g. partition scheme or executing a post-install script), but we&rsquo;re out of luck if we need anything special &ndash; another operating system, a specific filesystem, etc.<\/p>\n<p><a rel=\"lightbox\" href=\"\/user\/pages\/01.blog\/2021\/07\/ovh-soyoustart-install-iso-image\/templates.png\"><img alt=\"SoYouStart installation templates\" src=\"\/user\/pages\/01.blog\/2021\/07\/ovh-soyoustart-install-iso-image\/templates.png\"><\/a><\/p>\n<p>One trick is to use IPMI, available on most servers at OVH and allowing to install an ISO image <a href=\"https:\/\/docs.ovh.com\/gb\/en\/dedicated\/use-ipmi-dedicated-servers\/\">[1]<\/a><a href=\"https:\/\/support.us.ovhcloud.com\/hc\/en-us\/articles\/360000108630-How-to-Install-an-OS-with-IPMI\">[2]<\/a>.\nSince SoYouStart is basically retired OVH hardware, some of their servers now have IPMI as well, and I expect so will Kimsufi over time.<\/p>\n<p>But if IPMI is unavailable (or doesn&rsquo;t work because of <abbr title=\"This was my case: consistent applet crash when mounting an ISO via IPMI...\">Java shenanigans<\/abbr>) and we don&rsquo;t want to pay for <a href=\"https:\/\/www.soyoustart.com\/en\/kvm-ip.xml\">KVM IP<\/a>, one solution is to boot an ISO image from rescue mode via QEMU KVM.<\/p>\n<p>This should work on both OVH, SoYouStart, and Kimsufi.<\/p>\n<h1 id=\"enable-rescue-mode\">Enable rescue mode<a href=\"#enable-rescue-mode\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<ul>\n<li>Go to the web GUI of the dedicated server.<\/li>\n<li><abbr title=\"If we don't, OVH support will be automatically alerted that our server is unavailable, see we're doing funky business, and close the alert. Let's not bother them for nothing :D\">Disable monitoring<\/abbr>.<\/li>\n<li>Switch to <a href=\"https:\/\/docs.ovh.com\/gb\/en\/dedicated\/ovh-rescue\/\">rescue mode<\/a> from the Boot \/ Netboot menu.<\/li>\n<li>Restart the server.<\/li>\n<li>Once up, we receive a mail with SSH credentials and can log in.<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># ssh root@XXX.XXX.XXX.XXX<\/code><\/pre>\n<ul>\n<li>As we can see, rescue mode is a Debian-based image:<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># uname -a\nLinux rescue.ovh.net 4.19.84-mod-std-ipv6-64-rescue #1387440 SMP Fri Aug 21 12:01:09 UTC 2020 x86_64 GNU\/Linux\n# lsb_release -a\nNo LSB modules are available.\nDistributor ID: Debian\nDescription:    Debian GNU\/Linux 8.9 (jessie)\nRelease:        8.9\nCodename:       jessie<\/code><\/pre>\n<h1 id=\"wipe-the-disks\">Wipe the disks<a href=\"#wipe-the-disks\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>Now that we&rsquo;re in rescue mode, we can wipe the disks clean before installing.\nIt&rsquo;s not strictly necessary as most installers can repartition, but this way we can handle any RAID \/ mounting issues right away.<\/p>\n<ul>\n<li>Check if the server has any software RAID:<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># lsblk\n# cat \/proc\/mdstat<\/code><\/pre>\n<ul>\n<li>If yes (<code>md0 : active raid1 sda2[0] sdb2[1]<\/code>), unmount the RAID and stop it:<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># umount \/dev\/md0\n# mdadm --stop \/dev\/md0<\/code><\/pre>\n<p><span class=\"text-muted\">If there are errors like <code>umount: \/dev\/md0: target is busy<\/code> or <code>mdadm: Cannot get exclusive access to \/dev\/md0:Perhaps a running process, mounted filesystem or active volume group?<\/code>, make sure to check volume groups via <code>vgdisplay<\/code> and <code>\/dev\/mapper\/<\/code>, removing with <code>dmsetup remove vg-name<\/code> if necessary.<\/span><\/p>\n<ul>\n<li>Wipe existing partition tables from the disks (<code>1M * 10<\/code> should be enough):<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># dd if=\/dev\/zero of=\/dev\/sda bs=1M count=10\n# dd if=\/dev\/zero of=\/dev\/sdb bs=1M count=10<\/code><\/pre>\n<h1 id=\"boot-iso-via-qemu-kvm\">Boot ISO via QEMU KVM<a href=\"#boot-iso-via-qemu-kvm\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>With the disks clean, we can prepare the actual installation.<\/p>\n<ul>\n<li>Download any ISO of our choice. In this example, I will use <a href=\"http:\/\/download.proxmox.com\/iso\/\">Proxmox VE<\/a>:<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># wget http:\/\/download.proxmox.com\/iso\/proxmox-ve_7.0-1.iso\n# sha256sum proxmox-ve_7.0-1.iso<\/code><\/pre>\n<ul>\n<li>Install QEMU, KVM, and OVMF (UEFI firmware for VMs):<\/li>\n<\/ul>\n<pre><code class=\"language-shell-session\"># apt-get update\n# apt-get install qemu qemu-kvm ovmf<\/code><\/pre>\n<ul>\n<li>Boot ISO via <code>qemu-system-x86_64<\/code>, adjusting the following parameters as desired (<a href=\"https:\/\/manpages.debian.org\/jessie\/qemu-system-x86\/qemu-system-x86_64.1.en.html\">man page<\/a>):\n<ul>\n<li><code>-enable-kvm<\/code>: enable KVM virtualization<\/li>\n<li><code>-nodefaults<\/code>: disable creation of various default devices (we will specify them ourselves)<\/li>\n<li><code>-cdrom \/root\/proxmox-ve_7.0-1.iso<\/code>: path...<\/li><\/ul><\/li><\/ul>","summary":"Using QEMU KVM to boot an ISO image on OVH \/ SoYouStart \/ Kimsufi dedicated servers and install disks over VNC.","tags":["hosting","linux"],"image":"\/user\/pages\/01.blog\/2021\/07\/ovh-soyoustart-install-iso-image\/01_tightvnc.png"},{"title":"Git: &quot;no sync&quot; branch management for contribution forks","date_published":"2021-05-15T23:34:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/05\/branch-management-in-git-forks","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/05\/branch-management-in-git-forks","content_html":"<p>Open source communities on collaborative Git platforms (such as GitHub and GitLab) usually ask contributors to submit changes to the upstream repository from a fork.<\/p>\n<p>Unlike an actual fork which branches off from upstream and has a life of its own, a <abbr title=\"A fork used exclusively for contributing to an upstream repository.\">contribution fork<\/abbr> merely is a container for contribution branches: its lifecycle is tightly coupled with the upstream.\nContributors are expected to submit changes based on a recent version of the upstream repository.\nShould the fork get outdated, they must sync with the upstream and rebase their work.<\/p>\n<p>This is where things get murky.\nThere are as many synchronization approaches as there are contributors.\nGitHub even has <a href=\"https:\/\/docs.github.com\/en\/github\/collaborating-with-issues-and-pull-requests\/syncing-a-fork\">an entry in the documentation dedicated to syncing a fork<\/a>.<\/p>\n<p>For my part, I believe that a &ldquo;no sync&rdquo; approach is best&nbsp;&#128516;<\/p>\n<h1 id=\"observation\">Observation<a href=\"#observation\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>Two branch types on a <abbr title=\"A fork used exclusively for contributing to an upstream repository.\">contribution fork<\/abbr>:<\/p>\n<ul>\n<li>Mirror branches: branches present both in the upstream and the fork, which must be kept in sync with upstream (usually, the default branch and release branches).<\/li>\n<li>Contribution branches: branches present only in the fork, which contain the changes that will be submitted to the upstream.<\/li>\n<\/ul>\n<p>In practice, mirror branches are useless: they only serve as starting point for contribution branches.\nThe need for keeping them in sync with the upstream generates branch management overhead.<\/p>\n<p>Could we contribute without needing to sync the fork at all?\nThis is the basis behind the &ldquo;no sync&rdquo; approach.<\/p>\n<h1 id=\"context\">Context<a href=\"#context\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<h2 id=\"setting-up-the-upstream-remote\">Setting up the <code>upstream<\/code> remote<a href=\"#setting-up-the-upstream-remote\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>This step is common with regular sync approaches.<\/p>\n<p>By default, when we clone a repository, an <code>origin<\/code> remote pointing to the source repository is registered in the local repository.\nHere, I am cloning a personal fork of <a href=\"https:\/\/github.com\/cilium\/cilium\">cilium\/cilium<\/a>:<\/p>\n<pre><code class=\"language-shell-session\">$ git clone git@github.com:nbusseneau\/cilium.git\nCloning into 'cilium'...\n[...]\n$ cd cilium\n$ git remote -v\norigin  git@github.com:nbusseneau\/cilium.git (fetch)\norigin  git@github.com:nbusseneau\/cilium.git (push)<\/code><\/pre>\n<p>A default local branch is automatically checked out, and tracking the <code>origin<\/code> default branch:<\/p>\n<pre><code class=\"language-shell-session\">$ git branch -vv\n* master 1070b19ab [origin\/master] Add missing Demo App reference<\/code><\/pre>\n<p>As it is a fork, we can switch to any mirror branch available:<\/p>\n<pre><code class=\"language-shell-session\">$ git switch v1.10\nBranch 'v1.10' set up to track remote branch 'v1.10' from 'origin'.\nSwitched to a new branch 'v1.10'\n$ git branch -vv\n  master 1070b19ab [origin\/master] Add missing Demo App reference\n* v1.10  75b4ed957 [origin\/v1.10] build(deps): bump docker\/setup-buildx-action<\/code><\/pre>\n<p><span class=\"text-muted\">Note: in this post I will use <code>git switch<\/code> over <code>git checkout<\/code>, <a href=\"https:\/\/stackoverflow.com\/q\/57265785\">but you can use either<\/a>.<\/span><\/p>\n<p>Since a Git repository may interact with any number of remote Git repositories, let&rsquo;s add the upstream repository as <code>upstream<\/code> remote:<\/p>\n<pre><code class=\"language-shell-session\">$ git remote add upstream git@github.com:cilium\/cilium.git\n$ git remote -v\norigin  git@github.com:nbusseneau\/cilium.git (fetch)\norigin  git@github.com:nbusseneau\/cilium.git (push)\nupstream        git@github.com:cilium\/cilium.git (fetch)\nupstream        git@github.com:cilium\/cilium.git (push)<\/code><\/pre>\n<p>We can now fetch branches from the upstream:<\/p>\n<pre><code class=\"language-shell-session\">$ git fetch upstream\n[...]\nFrom github.com:cilium\/cilium\n * [new branch]          master                                     -&gt; upstream\/master\n * [new branch]          v1.9                                       -&gt; upstream\/v1.9\n * [new branch]          v1.10                                      -&gt; upstream\/v1.10\n [...]<\/code><\/pre>\n<h2 id=\"sync-approaches\">Sync approaches<a href=\"#sync-approaches\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>Most guides recommend to keep the mirror branches of a fork in sync with upstream using a pull-push pattern:<\/p>\n<ul>\n<li>Pull (or merge,...<\/li><\/ul>","summary":"Tips for branch management when working with multiple remotes, especially from contribution forks.","tags":["git","gitlab","github"]},{"title":"ASUS TUF RTX 3080 thermal pads replacement","date_published":"2021-05-02T16:12:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/05\/asus-tuf-rtx-3080-thermal-pads-replacement","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/05\/asus-tuf-rtx-3080-thermal-pads-replacement","content_html":"<p>I&rsquo;ve been fortunate enough to own an ASUS TUF RTX 3080 OC since January.\nIt&rsquo;s a great gaming card but I was slightly surprised with the memory thermal performance, noticing <span class=\"mathjax mathjax--inline\">\\(T_{junction}\\)<\/span> spikes up to 104&deg;&#8203;C in certain circumstances (hello DLSS + Ray Tracing).\nIt seems this is still within okay-ish bounds (<a href=\"https:\/\/www.igorslab.de\/en\/gddr6x-am-limit-ueber-100-grad-bei-der-geforce-rtx-3080-fe-im-chip-gemessen-2\/\">see the excellent igor&rsquo;sLAB investigation on the matter<\/a>), but not too far from <abbr title=\"when components throttle their own performance upon hitting temperature limits\">throttling<\/abbr>&hellip;<\/p>\n<p>Since I expected the factory thermal pads were ~6-8&nbsp;W\/mK, I decided I would try to replace them with 12&nbsp;W\/mK pads (in my case, GELID GP-Extreme).<\/p>\n<h1 id=\"factory-thermal-pad-layout\">Factory thermal pad layout<a href=\"#factory-thermal-pad-layout\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>Here are my notes from an evening inspecting the card&rsquo;s internals:<\/p>\n<p><a rel=\"lightbox\" href=\"\/user\/pages\/01.blog\/2021\/05\/asus-tuf-rtx-3080-thermal-pads-replacement\/visual_guide.jpg\"><img alt=\"Factory thermal pad layout on ASUS TUF RTX 3080\" src=\"\/user\/pages\/01.blog\/2021\/05\/asus-tuf-rtx-3080-thermal-pads-replacement\/visual_guide.jpg\"><\/a><\/p>\n<p>Legend:<\/p>\n<ul>\n<li>Yellow marks the factory position of each thermal pad along with its size and thickness.<\/li>\n<li>Purple marks the corresponding contact point of each thermal pad against another part.<\/li>\n<\/ul>\n<p>List of parts, from top to bottom:<\/p>\n<ul>\n<li>Left side:\n<ul>\n<li>Bottom side of intermediate heatsink, sandwiched between PCB and main heatsink.<\/li>\n<li>Top side of PCB, with GPU in the center.<\/li>\n<li>Bottom side of the main heatsink, fans being on the opposite side.<\/li>\n<\/ul><\/li>\n<li>Right side:\n<ul>\n<li>Bottom side of PCB.<\/li>\n<li>Top side of backplate, the card markings being on the opposite side.<\/li>\n<\/ul><\/li>\n<\/ul>\n<p>The memory modules are the 10 chips around the GPU &ndash; 4 left \/ 3 above \/ 2 right \/ 1 below.\nFor these, heat is transferred both ways:<\/p>\n<ul>\n<li>Upwards: memory &rarr; pad &rarr; intermediate heatsink (&rarr; pad) &rarr; main heatsink<\/li>\n<li>Downwards: memory &rarr; bottom side of PCB &rarr; pad &rarr; backplate<\/li>\n<\/ul>\n<h2 id=\"replacing-the-thermal-pads\">Replacing the thermal pads<a href=\"#replacing-the-thermal-pads\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p><span class=\"text-muted\">Note if this is the first time you are replacing thermal pads: the existing pads may or may not break during disassembly. I recommend you plan a supply of thermal pads at various thicknesses in advance, rather than just what you think you&rsquo;ll need.<\/span><\/p>\n<p><span class=\"text-muted\">See it as you see screws: it&rsquo;s an investment, a stock to draw from whenever tinkering. You&rsquo;ll use it again for modding future cards, or to cool M.2 SSDs, etc.<\/span><\/p>\n<p><span class=\"text-muted\">You&rsquo;ll also need to replace the GPU thermal paste, so make sure to have some lying around. Likewise, it&rsquo;s a stock you&rsquo;ll be able to reuse later&nbsp;&#128521;<\/span><\/p>\n<p>I replaced most thermal pads identically, but I changed the thickness of some that did not make proper contact:<\/p>\n<ul>\n<li>Both 0.5&nbsp;mm pads on the bottom side of the backplate &rarr; 1&nbsp;mm.<\/li>\n<li>The 6 x 66 x 0.5&nbsp;mm pad on the bottom side of the intermediate heatsink, to the left &rarr; 2&nbsp;mm (but I think a 1&nbsp;mm or 1.5&nbsp;mm would have been better).<\/li>\n<li>The 12 x 67 x 1.5&nbsp;mm pad on the top side of PCB, to the left of the GPU &rarr; 2&nbsp;mm.<\/li>\n<li>The 10 x 100 x 2&nbsp;mm pad on the top side of PCB, to the right of the GPU &rarr; 3&nbsp;mm (2.5&nbsp;mm would have been better).<\/li>\n<\/ul>\n<p>The GELID GP-Extreme pads are quite squishy, hence why I decided I could get away with leaving be the pads with excess thickness.<\/p>\n<p>Anecdotal results on my end: temperature spikes dropped down to 97&deg;C, which is already great!...<\/p>","summary":"Reducing memory junction temperature on an ASUS TUF RTX 3080 by replacing factory thermal pads.","tags":["hardware"],"image":"\/user\/pages\/01.blog\/2021\/05\/asus-tuf-rtx-3080-thermal-pads-replacement\/upgrade.jpg"},{"title":"Hades ultrawide mod","date_published":"2021-04-17T18:45:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/04\/hades-ultrawide-mod","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2021\/04\/hades-ultrawide-mod","content_html":"<p>Hades is my <abbr title=\"Game of the Year\">GotY<\/abbr> for 2020 &ndash; and it seems I&rsquo;m not the only one judging by <a href=\"https:\/\/store.steampowered.com\/app\/1145360\/Hades\/\">the awards on Steam<\/a>&nbsp;&#128064;<\/p>\n<p>No surprise here: I loved Supergiant Games&rsquo; Bastion, and am a long time action roguelike, dungeon crawler, and die and retry player (Children of Morta, Risk of Rain, Crypt of the Necrodancer, Dungeon of the Endless, Hammerwatch, Teleglitch: Die More Edition&hellip;).<\/p>\n<p>Hades is just great and ticks all the right boxes for a critical hit.\nGo try it out, you might be surprised even if you think it&rsquo;s not for you as they managed to make Hades fun <em>and<\/em> accessible &ndash; and it really is no small feat for the genre!<\/p>\n<p>I could laud Supergiant Games&rsquo; Hades for quite some time, but the driving motivation behind this article is actually one single flaw: Hades does not support ultrawide resolutions.<\/p>\n<h1 id=\"context\">Context<a href=\"#context\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>Hades has a 16:9 aspect ratio with <abbr title=\"Maintain static aspect ratio and field of view, stretch as large as possible on screen, letterbox\/pillarbox as necessary.\">static scaling<\/abbr> for non-16:9 resolutions, i.e. it can only played at 16:9 no matter the display resolution.<\/p>\n<p>Supergiant Games did implement some limited support for ultrawide monitors. At <abbr title=\"Usual resolution for 21:9 34-inch ultrawide monitors.\">3440x1440<\/abbr>, the game is pillarboxed with dedicated artwork rather than plain black bars:<\/p>\n<p><a rel=\"lightbox\" href=\"\/user\/pages\/01.blog\/2021\/04\/hades-ultrawide-mod\/pillarbox_sideart_3440x1440.png\"><img alt=\"Hades pillarboxed with side art at 3440x1440\" src=\"\/user\/pages\/01.blog\/2021\/04\/hades-ultrawide-mod\/pillarbox_sideart_3440x1440.png\"><\/a><\/p>\n<p>Unfortunately, at <abbr title=\"Usual resolution for 21:9 38-inch ultrawide monitors.\">3840x1600<\/abbr> (the resolution I&rsquo;m playing at), the pillars are miscalculated and displayed offset to the top:<\/p>\n<p><a rel=\"lightbox\" href=\"\/user\/pages\/01.blog\/2021\/04\/hades-ultrawide-mod\/pillarbox_sideart_3840x1600.png\"><img alt=\"Hades pillarboxed with side art at a glitched offset at 3840x1600\" src=\"\/user\/pages\/01.blog\/2021\/04\/hades-ultrawide-mod\/pillarbox_sideart_3840x1600.png\"><\/a><\/p>\n<p><span class=\"text-muted\">Incidentally, I found the cause: I recommend reading on and <a href=\"#fixing-pillarbox-artwork-at-3840x1600\">checking out the annexes<\/a> afterwards for details. <strong>EDIT 2021-10-27:<\/strong> bug fixed in V1.38246 of the game&nbsp;&#128373;&#65039;<\/span><\/p>\n<p>I ended up playing Hades with the side art disabled:<\/p>\n<p><a rel=\"lightbox\" href=\"\/user\/pages\/01.blog\/2021\/04\/hades-ultrawide-mod\/pillarbox_noart_3840x1600.png\"><img alt=\"Hades pillarboxed with black bars at 3840x1600\" src=\"\/user\/pages\/01.blog\/2021\/04\/hades-ultrawide-mod\/pillarbox_noart_3840x1600.png\"><\/a><\/p>\n<!-- prettier-ignore -->\n<p><span class=\"text-muted\"><a href=\"#disabling-pillarbox-artwork\">See annexes<\/a> if you&rsquo;d also like to disable the artwork.<\/span><\/p>\n<p>After completing the game, while grinding heat up to 25 to unlock all bounties, the thought occurred to me: did anyone try to mod Hades and add larger <abbr title=\"The displayed visible area, with which the user interacts: it may be smaller than the resolution actually displayed in case of letterboxing\/pillarboxing.\">viewport<\/abbr> support?&nbsp;&#129300;<\/p>\n<h1 id=\"supergiant-games-stance\">Supergiant Games&rsquo; stance<a href=\"#supergiant-games-stance\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>SGG has always been transparent about the fact that its games are <a href=\"https:\/\/steamcommunity.com\/app\/462770\/discussions\/0\/1458455461494159189\/#c1458455461494325020\">designed to be played at 16:9<\/a>, and that allowing for larger viewports would <a href=\"https:\/\/steamcommunity.com\/app\/1145360\/discussions\/0\/4436564907312758813\/#c4436564907314425087\">&ldquo;[introduce] a wide variety of problems&rdquo;<\/a> (pun intended?&nbsp;&#128516;).<\/p>\n<p>This is understandable.\nFrom an independent vendor perspective, signalling customers not to buy if ultrawide support is important to them is a way more sensible and comfortable business stance than risking time and money to implement it:<\/p>\n<ul>\n<li>At present, it would only be used by an extremely minor subset of the target audience.<\/li>\n<li>No support is better than bad support: the same minority would be very upset (and rightly so) if ultrawide was marketed as supported when it actually is not.<\/li>\n<\/ul>\n<p>As an ultrawide player, it is unfortunate that ultrawide resolutions are not supported.\nAs a developer, I can guess the issues SGG would face when making sure its games properly support ultrawide resolutions.<\/p>\n<p>As a modder, it sounds like a fun challenge&nbsp;&#128519;<\/p>\n<h1 id=\"modding-research\">Modding research<a href=\"#modding-research\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>Hades modding community is very active <a href=\"https:\/\/www.nexusmods.com\/hades\">on Nexus Mods<\/a>.\nThe <a href=\"https:\/\/github.com\/SGG-Modding\">SuperGiant Games&rsquo; Games Modding Group<\/a> spearheads the community by providing tools to easily hook into the games&rsquo; <code>Content<\/code> directory, which contains the assets\/logic\/etc. &ndash; essentially everything you need for gameplay mods.\nBut as expected, engine modding is relatively absent.<\/p>\n<p>What about previous...<\/p>","summary":"Reverse engineering Hades and patching in ultrawide resolution support.","date_modified":"2022-07-24T23:00:00+02:00","tags":["video games"],"image":"\/user\/pages\/01.blog\/2021\/04\/hades-ultrawide-mod\/01_patched_2592x1080.png"},{"title":"Two-step push: accelerating Git LFS migration for big repositories","date_published":"2020-12-16T14:35:00+01:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2020\/12\/two-step-push-accelerating-git-lfs-migration-for-big-repositories","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2020\/12\/two-step-push-accelerating-git-lfs-migration-for-big-repositories","content_html":"<p>I recently had to migrate several Git repositories from one GitLab instance to another. The new instance had stricter requirements, notably a max size of 1&nbsp;GB, and one repo in particular was not making the cut, clocking in at 1.5&nbsp;GB bare total size (<code>du -sh .<\/code>) for 700K Git objects (<code>git rev-list --objects --all | wc -l<\/code>) on a fresh <code>git clone --mirror<\/code>.<\/p>\n\n<p>There are two main ways to reduce repository size:<\/p>\n<ul>\n<li>Filter Git history and prune undesirable objects (files committed by mistake, old objects that will never be needed again, etc.).<\/li>\n<li>Migrate big blobs to <a href=\"https:\/\/git-lfs.github.com\/\">Git LFS<\/a> (will not count in Git objects size, since they are on external storage).<\/li>\n<\/ul>\n<p>At the time of writing, the best tools for the job are:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/newren\/git-filter-repo\"><code>git-filter-repo<\/code><\/a> for analysis and filtering (as recommended by <a href=\"https:\/\/git-scm.com\/docs\/git-filter-branch\">the Git documentation<\/a> and <a href=\"https:\/\/docs.gitlab.com\/ee\/user\/project\/repository\/reducing_the_repo_size_using_git.html\">the GitLab documentation<\/a>).<\/li>\n<li><a href=\"https:\/\/github.com\/git-lfs\/git-lfs\/blob\/v2.13.1\/docs\/man\/git-lfs-migrate.1.ronn\"><code>git lfs migrate<\/code><\/a> for LFS migration (as recommended by <a href=\"https:\/\/github.com\/git-lfs\/git-lfs\/wiki\/Tutorial#migrating-existing-repository-data-to-lfs\">the Git LFS documentation<\/a>).<\/li>\n<\/ul>\n<p><span class=\"text-muted\">Note: if you look around, you&rsquo;ll probably find mentions of BFG Repo-Cleaner. I recommend not to use it, <a href=\"#bfg-repo-cleaner\">cf. below for more details<\/a>.<\/span><\/p>\n<p>Both methods were used to reduce the size of this specific repo. I&rsquo;ll quickly go over both steps in order to focus on an issue where the first <code>git push<\/code> after an LFS migration on a big repository may take several hours or days to complete, seemingly stuck while uploading LFS objects.<\/p>\n<h1 id=\"history-filtering\">History filtering<a href=\"#history-filtering\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<pre><code class=\"language-shell\">git-filter-repo --analyze # identify filtering candidates\ngit-filter-repo --strip-blobs-bigger-than 5M --path some-existing-dir\/ --path some-deleted-dir\/ --invert-paths<\/code><\/pre>\n<p>After analysis, I determined all blobs bigger than 5&nbsp;MB could be safely filtered, as well as a number of directories (both existing and deleted ones). The repo was now 900&nbsp;MB. Not bad! But still a bit too close to 1&nbsp;GB for my taste.<\/p>\n<h1 id=\"git-lfs-migration\">Git LFS migration<a href=\"#git-lfs-migration\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<pre><code class=\"language-shell\">git lfs info --top=25 # identify LFS candidates\ngit lfs migrate import --everything --include=\"*.ext1,*.ext2\"<\/code><\/pre>\n<p>After analysis, I selected a number of binary file extensions to be converted to LFS. Around 2600 objects were converted (<code>find lfs\/objects\/ -type f | wc -l<\/code>) for a total of 800&nbsp;MB. Great! That meant the regular Git objects were now accounting for only around 100&nbsp;MB of repo size, with the rest of the bulk as LFS objects.<\/p>\n<p><span class=\"text-muted\">Note: if this is your first LFS migration, you may want to read below about <a href=\"#git-filters-case-sensitivity\">Git filters case sensitivity<\/a> and <a href=\"#cleaning-up-after-a-lfs-migration\">cleaning up after a LFS migration<\/a>.<\/span><\/p>\n<h1 id=\"the-issue\">The issue<a href=\"#the-issue\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>The next step consisted in pushing the filtered and LFS migrated history to a remote. At first it looked fine:<\/p>\n<pre><code class=\"language-shell-session\">$ git push\nUploading LFS objects: 100% (2312\/2312), 765 MB | 4.6 MB\/s<\/code><\/pre>\n<p>&hellip;but then it stayed stuck there, at &ldquo;100%&rdquo;.<\/p>\n<p><span class=\"text-muted\">Note: this behavior is independent of the tool used: I experienced it with both BFG (deprecated) and <code>git lfs migrate<\/code>. The issue lies with the LFS blobs themselves, and not the tools used to obtain them.<\/span><\/p>\n<h1 id=\"analysis\">Analysis<a href=\"#analysis\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p><code>ps aux<\/code> was showing that <code>git-lfs<\/code> was working full throttle, and watching closely, I could indeed see the number of objects ramping...<\/p>","summary":"Workaround for an issue at the first `git push` after an LFS migration on a big repository, seemingly stuck while uploading LFS objects.","date_modified":"2020-12-21T18:06:00+01:00","tags":["git","gitlab"]},{"title":"Block search indexing for Grav URL parameters","date_published":"2020-09-29T21:49:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2020\/09\/block-search-indexing-for-grav-url-parameters","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2020\/09\/block-search-indexing-for-grav-url-parameters","content_html":"<p>If you use Grav, you probably use Grav-specific URL parameters.<\/p>\n<p>Like regular URL query parameters (<code>\/blog?key=value<\/code>), they are appended to the base URL with a <code>\/key:value<\/code> syntax and are then processed independently by Grav. Similarly, they can also be chained.<\/p>\n\n<p>As an example, collections can by default be filtered based on taxonomies, as demonstrated on this blog:<\/p>\n<ul>\n<li><a href=\"\/en\/blog\/tag:grav\"><code>\/blog\/tag:grav<\/code><\/a> will filter entries tagged with <code>grav<\/code>.<\/li>\n<li><a href=\"\/en\/blog\/archives_month:2020_09\"><code>\/blog\/archives_month:2020_09<\/code><\/a> will filter entries written in September 2020.<\/li>\n<li><a href=\"\/en\/blog\/tag:grav\/archives_month:2020_09\"><code>\/blog\/tag:grav\/archives_month:2020_09<\/code><\/a> will filter entries tagged with <code>grav<\/code> and written in September 2020.<\/li>\n<\/ul>\n<p><span class=\"text-muted\">Note: collections\u2019 taxonomy filtering can be disabled by setting <code>url_taxonomy_filters: false<\/code> in the YAML front matter.<\/span><\/p>\n<p>Even better: when using the default theme (Quark), <a href=\"https:\/\/github.com\/getgrav\/grav-theme-quark\/blob\/2.0.3\/templates\/partials\/sidebar.html.twig\">the Taxonomy List and Archives plugins<\/a> allow users to filter blog entries from the sidebar with the help of Grav parameters.<\/p>\n<p>However, if included in the sidebar, they are scrapable by search engines. It seems that at least Google treats them as separate pages, even if canonical link elements and sitemaps are present:<\/p>\n<p><a rel=\"lightbox\" href=\"\/images\/8\/c\/c\/8\/e\/8cc8e9112c717b2c5749f456daa1f19e56b6f4ad-googlesearchconsole.png\"><img alt=\"URLs with Grav parameters indexed by Google\" src=\"\/user\/pages\/01.blog\/2020\/09\/block-search-indexing-for-grav-url-parameters\/google_search_console.png\"><\/a><\/p>\n<p>As specified in <a href=\"https:\/\/support.google.com\/webmasters\/answer\/139066?hl=en\">Google\u2019s documentation<\/a>, the indexer may choose to ignore content-provided indicators:<\/p>\n<blockquote>\n<p>Google chooses the canonical page based on a number of factors (or signals), such as whether the page is served via http or https; page quality; presence of the URL in a sitemap; and any \u201crel=canonical\u201d labeling. You can indicate your preference to Google using these techniques, but Google may choose a different page as canonical than you do, for various reasons.<\/p>\n<\/blockquote>\n<p>This behavior might be undesirable. In this case, the only resort is to block indexing <a href=\"https:\/\/support.google.com\/webmasters\/answer\/93710?hl=en\">using a <code>noindex<\/code> <code>&lt;meta&gt;<\/code> tag<\/a>:<\/p>\n<!-- prettier-ignore -->\n<pre><code class=\"language-html\">&lt;meta name=\"robots\" content=\"noindex\"&gt;<\/code><\/pre>\n<p>Obviously, we\u2019d only want to block indexing for URLs with Grav parameters. Including the <code>&lt;meta&gt;<\/code> tag in a base template would not be suitable: it must be conditionally inserted. Fortunately, <a href=\"https:\/\/github.com\/getgrav\/grav\/blob\/1.6.27\/system\/src\/Grav\/Common\/Uri.php#L274\">the <code>Uri::params()<\/code> function<\/a> may be used to determine if Grav parameters are present. <a href=\"https:\/\/github.com\/getgrav\/grav-theme-quark\/pull\/162\">A PR is open<\/a> to integrate this feature as a Quark theme toggle, but until then\u2026<\/p>\n<h1 id=\"tl-dr\">tl;dr<a href=\"#tl-dr\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>URLs with Grav parameters may be indexed by search engines (notably Google), which might be undesirable. Using a conditionally-inserted <code>noindex<\/code> <code>&lt;meta&gt;<\/code> tag allows regular pages to be indexed as usual while ignoring Grav parameters:<\/p>\n<pre><code class=\"language-twig\">{% if uri.params is not empty -%}\n&lt;meta name=\"robots\" content=\"noindex\"&gt;\n{% endif %}<\/code><\/pre>","summary":"Grav URL parameters (e.g. &#039;\/blog\/foo:bar&#039;) are useful for filtering collections. However, it may be undesirable for them to be indexed by search engines.","tags":["grav"],"image":"\/user\/pages\/01.blog\/2020\/09\/block-search-indexing-for-grav-url-parameters\/google_search_console.png"},{"title":"Alleviating motion sickness in first-person video games","date_published":"2020-09-06T14:32:00+02:00","id":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2020\/09\/alleviating-motion-sickness-in-first-person-video-games","url":"https:\/\/nicolas.busseneau.fr\/en\/blog\/2020\/09\/alleviating-motion-sickness-in-first-person-video-games","content_html":"<p>Some people experience headaches or become nauseous when playing first-person video games. According to them, it is similar to motion sickness and seasickness, &ldquo;things are moving all over the place&rdquo; being a recurring sentence.<\/p>\n\n<p>Symptoms match with <a href=\"https:\/\/en.wikipedia.org\/wiki\/Virtual_reality_sickness\">virtual reality sickness<\/a>. It occurs when the player is disoriented: there is a decorrelation between simulation (what the player sees) and expectation (what the player thinks should happen). The greater the decorrelation, the more mental compensation required, which causes the symptoms.<\/p>\n<p>Doctors recommend the same treatment as for motion sickness (good sleep quality, ingestion of mint or ginger, etc.). On top of that, I noticed it is possible to alleviate and sometimes even eliminate it completely by improving gaming conditions.<\/p>\n<p>I don&rsquo;t have any evidence other than anecdotal, but I&rsquo;ve already helped a few people with these tips, and most of them won&rsquo;t cost you anything to try &#128521;<\/p>\n<p><span class=\"text-muted\">Note: in the rest of this article, I will assume PC games, but parallels can easily be drawn for console games.<\/span><\/p>\n<h1 id=\"visual-effects\">Visual effects<a href=\"#visual-effects\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h1>\n<p>First-person video games simulate various effects to mimic real camera lenses. Some of these effects can cause player disorientation.<\/p>\n<p>It is usually possible to disable them directly from graphics settings (do not be afraid to explore advanced graphics options). When not possible, there sometimes is a manual solution (example: <a href=\"https:\/\/www.pcgamingwiki.com\/wiki\/Metro_Exodus#Video\">disable motion blur on Metro Exodus via configuration file<\/a>).<\/p>\n<h2 id=\"motion-blur\">Motion blur<a href=\"#motion-blur\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Motion_blur\">Motion blur<\/a> is the blur appearing around moving objects when pausing a film or on a photograph. It appears when a captured object is moving faster than the capture lens&rsquo; exposure time.<\/p>\n<p>Blur gives an impression of speed to a still image, and smooths out a sequence of successive images. For example, a sequence of images at 24 frames per second (standard projection speed for a film) would appear visually staggered without motion blur. The more <abbr title=\"frames per second\">FPS<\/abbr> increases, the less a powerful motion blur is required to smooth the sequence.<\/p>\n<p>Problems:<\/p>\n<ul>\n<li>Motion blur is only meant to appear around moving elements. Some implementations do not correctly identify where to apply motion blur.<\/li>\n<li><abbr title=\"frames per second\">FPS<\/abbr> in a video game are variable. Some implementations do not take <abbr title=\"frames per second\">FPS<\/abbr> into account when calculating motion blur power.<\/li>\n<\/ul>\n<p>When simulated motion blur is too strong or poorly located, entire parts of the screen may blend in at the slightest movement of the camera, causing all visual cues to disappear. Hence the famous &ldquo;things are moving all over the place&rdquo;.<\/p>\n<div class=\"notices red\">\n<p>Motion blur is often the main culprit for disorientation in first-person games: turn it off first.<\/p>\n<\/div>\n<!-- prettier-ignore -->\n<h2 id=\"depth-of-field\">Depth of field<a href=\"#depth-of-field\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>The <a href=\"https:\/\/en.wikipedia.org\/wiki\/Depth_of_field\">depth of field<\/a> (DOF) is the distance interval where an image remains sharp, while it becomes blurry in closer or more distant planes. It mainly depends on the characteristics and settings of the lens.<\/p>\n<p>In a first-person shooter, it can be noticed when aiming with a weapon: the foreground and the background are blurred, while the mid-plane where the reticle is located remains perfectly clear.<\/p>\n<p>Depth of field can be used to encourage players to focus...<\/p>","summary":"First-person perspective may induce motion sickness in some players. Here are some tips to alleviate and hopefully completely eliminate it.","tags":["video games"]}]}
