Skip to content

Instantly share code, notes, and snippets.

@KhalidCK
KhalidCK / README.md
Last active June 27, 2020 08:23
set default index-url for pip on windows 10

pip.conf

The names of the settings are derived from the long command line option

Location on windows

Expected in APPDATA

Open an explorer and write: %APPDATA%\pip\pip.ini , if it does not exist, create it.

@KhalidCK
KhalidCK / juphub-helm.sh
Last active September 5, 2020 06:33
setup lab minkube with jupyterhub
# Install helm
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
helm repo update
# Deploy jupyterhub
RELEASE=jhub
NAMESPACE=default
helm upgrade --install $RELEASE jupyterhub/jupyterhub \
--namespace $NAMESPACE \
--version=0.9.0 \
@KhalidCK
KhalidCK / vm.sh
Last active December 14, 2020 14:25
micro K8s
##https://microk8s.io/docs
#https://medium.com/google-cloud/microk8s-on-google-cloud-platform-d8b7a71a3ef
INSTANCE=microkube
ZONE=europe-west1-b
gcloud compute instances create ${INSTANCE} \
--machine-type=e2-standard-2 \
--preemptible \
--zone=${ZONE} \
--tags=microk8s \
--metadata enable-oslogin=TRUE \
@KhalidCK
KhalidCK / bandit.yaml
Created January 24, 2021 16:51
basic bandit python conf
# Do not check paths including `/tests/`:
# they use `assert`, leading to B101 false positives.
exclude_dirs:
- '/tests/'
- '/.venv/'
- '/k8s/'
- '/test*'
skips:
- 'B101'
"""
Notes
- `france` est de type Pandas dataframe
- on passe en pourcentage les valeurs pour comparer les départements
pourcentage = (nb tranche d'age pour un departement) / (nombre total de personne dans un departement)
"""
france[france.departements.isin(['59', '75', '67'])]
ax = sns.barplot(x="departements",
y="pourcentage",
hue="tranche", data=france)