Skip to content

Instantly share code, notes, and snippets.

View hoel-bagard's full-sized avatar

Hoël Bagard hoel-bagard

  • Hitachi High-Tech
  • Tokyo
View GitHub Profile
@hoel-bagard
hoel-bagard / inhouse_python_c_packages_1.md
Last active April 26, 2022 08:54
Notes used during the inhouse presentation on python C packages.

Create the required files

mkdir inhouse_pythonc__packages
cd inhouse_python_c_packages
mkdir inhouse 
touch inhouse/inhouse.c
mkdir test
touch test/test.py
touch setup.py
@hoel-bagard
hoel-bagard / flake8_config.md
Last active April 1, 2022 10:36
Small explanation / remark on the setup.cfg config for flake8

What you (probably) already know

Setup environment

mkdir temp
cd temp
virtualenv venv
source venv/bin/activate
pip install flake8-docstrings
@hoel-bagard
hoel-bagard / inhouse_python_packages.md
Last active April 5, 2022 08:34
Notes used during the inhouse presentation on python packages.

Create the required files

mkdir inhouse_python_packages
cd inhouse_python_packages
mkdir clean_print
touch clean_print/clean_print.py
touch clean_print/__init__.py
touch setup.py
@hoel-bagard
hoel-bagard / sanno_efficientnet.md
Last active October 6, 2021 11:25
Sanno-san code review

Pep formatting

Mostly good, I think there are still some non-conform bits but it might just be that my config is stricter.
You could install more plugins like flake8-docstrings pep8-naming flake8-import-order if you want your code to be more standard (but it's not required within XC).

Functions

Too many small functions in my opinion, I feel like some of them might not be necessary. For example

def accuracy(predictions, labels):
    return float(np.sum(predictions == labels)) / labels.shape[0]
@hoel-bagard
hoel-bagard / install.md
Last active October 17, 2021 11:03
NAS Setup

NAS installation using an ODROID-HC4 and armbian.

Setup the OS

Remove Petitboot loader from the odroid

To be able to boot clean Armbian mainline based u-boot / kernel experiences, you need to remove incompatible Petitboot loader that is shipped with the board. From the Petitboot, go for “Exit to shell” and these commands to remove the Petitboot:

# flash_eraseall /dev/mtd0
# flash_eraseall /dev/mtd1
# flash_eraseall /dev/mtd2
# flash_eraseall /dev/mtd3
@hoel-bagard
hoel-bagard / ipa.md
Last active June 30, 2021 08:22
Server installation cheatsheet

Archlinux IPA

Server installation

On arch: set the systemd.unified_cgroup_hierarchy=false kernel parameter.

Cleanup just in case (if needed, might want to be careful if there is a pre-existing installation).

sudo rm -r /var/lib/ipa-data
docker stop ipa-container
docker rm ipa-container
sudo mkdir /var/lib/ipa-data
@hoel-bagard
hoel-bagard / cheatsheet.md
Last active August 17, 2021 06:20
Arch Linux install commands

Main Install

Early commands

loadkeys jp106
Check if in efi mode: ls /sys/firmware/efi/efivars (should execute without error)
timedatectl set-ntp true

Partition the disks

Create the partitions

List devices: fdisk -l
fdisk /dev/sda (or whichever device is to be used)