mardi 9 novembre 2021

Online drawing tool (excalidraw)

 https://excalidraw.com/


(From presentation by  Alex Jones and Anaïs Urlichs [Civo] / Grafana ObservabilityCon 2021 )

https://grafana.com/go/observabilitycon/2021/loki-logging-at-scale-civo/


Linux cleaning tips (systemd, apt/ubuntu, docker)

 (evolutive article where I store what's been useful to me to clean space on linux servers I'm using)

Note : my current servers are running Ubuntu.



OS / SystemD : purge logs bigger than ...

Only keep 10M of each log files handle through syslog

sudo journalctl --vacuum-size 10M


OS / apt : remove remnants

Remove automatically all unused packages Remove automatically installed packages not needed anymore (i.e. packages that were installed as dependencies of packages that have now been removed or aren't requiring this dependency anymore)

apt options :

  •   autoremove - Remove automatically all unused packages
  •   clean - Erase downloaded archive files
  •   autoclean - Erase old downloaded archive files

sudo apt-get clean autoremove autoclean



Docker : remove logs older than ...

Only keep the last 1000h of docker containers logs

sudo docker image prune --all --filter "until=1000h" -f


Docker : remove remnants

Be careful ! If your docker environments are not running they might be deleted by some of the following commands !

Remove unused volumes, containers, images, networks, etc.

sudo docker system prune -f 

sudo docker system prune -a --volumes


jeudi 28 octobre 2021

kill processes from docker-compose "container_name"

Context : 

follwing a project-name change -> renaming the directory-name/docker-compose.yml the processes that were started by docker-compose were duplicated.

From the new project :

*  impossible to see them.

From docker ps : no process listed

From OS perspective ps aux : process present.


Test 1 : kill them all !

 Step 1 : identify them

ps aux | grep $(echo "$(grep container_name docker-compose.yml | grep -v '#' | awk '{printf("%s\\|", $2)}')grep")


Step 2 : kill -9 them all


ps aux | grep $(echo "$(grep container_name docker-compose.yml | grep -v '#' | awk '{printf("%s\\|", $2)}')grep") | awk '{print $2}' | xargs sudo kill -9


-> result : when restarting docker, they're back :-( 


Test 2 : stop docker + docker-compose start

apparently working, but I lost my container's content...


lundi 11 octobre 2021

Docker : thiner images

(from  GitLab Commit at KubeCon : One Layer Builds (Docker Not Included), by Jason Plum https://gitlab.com/WarheadsSE and Will Christensen)

* use FROM Scratch, instead of FROM <distro> 


 * Explore each layer of a docker image

https://github.com/wagoodman/dive 


* use Buildah : http://buildah.io/ "A tool that facilitates building OCI container images."

mercredi 6 octobre 2021

mardi 5 octobre 2021

Shell tools : shellcheck


  • ShellCheck, a static analysis tool for shell scripts

https://github.com/koalaman/shellcheck



suggests to add this on your makefiles :

check-scripts:
    # Fail if any of these files have warnings
    shellcheck myscripts/*.sh
or this on your CI (here : .travis.yml )
script:
  # Fail if any of these files have warnings
  - shellcheck myscripts/*.sh



mardi 28 septembre 2021

Code verifications / provers

C code + ACSL annotations --( Frama-C )--> "WhyML" Why3 format Proofs  --( Why3 analyser )--> proven code





  • ACSL By Example (good learning point with plenty of exmaples) Towards a Verified C Standard Library

https://www.mimuw.edu.pl/~alx/konstruowanie/ACSL-by-Example.pdf


  • Frama-C code analyser (Framework for Modular Analysis of C programs)

https://frama-c.com/
 https://frama-c.com/html/documentation.html 


https://frama-c.com/2016/11/22/Frama-C-and-ACSL-are-on-GitHub.html



  • Why3 / WhyML :

http://why3.lri.fr/

http://why3.lri.fr/doc/starting.html

mercredi 11 août 2021

Recensement Canada 2021, Exemples d'origines ethniques ou culturelles

Lors du recensement canadien auquel j'ai eu a participer cette année, je suis tombé sur cette liste d'exemples d'origines ethniques ou culturelles, et en particulier pour la liste des origines autochtones j'ai trouvé cela intéressant.

Note : il est surement possible de retrouver cela quelque part sur le site canada.ca



  Exemples d'origines ethniques ou culturelles


Les exemples d’origines ethniques ou culturelles comprennent (sans toutefois s’y limiter) ce qui suit :

Origines autochtones


  •     Abénaki
  •     Ahousaht
  •     Algonquin
  •     Anishinaabe
  •     Apache
  •     Assiniboine
  •     Atikamekw
  •     Blood (Kainai)
  •     Castor (Dunne-za)
  •     Cayuga
  •     Chactas
  •     Chemainus (Stz’uminus)
  •     Cherokee
  •     Cheyenne
  •     Chilcotin (Tsilhqot’in)
  •     Chipewyan (Denesuline)
  •     Cowichan
  •     Cri
  •     Cri de Moose
  •     Cri des bois
  •     Cri des plaines
  •     Crow
  •     Dakota
  •     Delaware (Lenape)
  •     Déné
  •     Dene Tha’ (Esclave)
  •     Ditidaht
  •     Dzawada’enuxw
  •     Ehattesaht
  •     Gitxsan
  •     Gwa’sala
  •     Gwich’in
  •     Haïda
  •     Haisla
  •     Halalt
  •     Hän (Tr’ondëk Hwëch’in)
  •     Heiltsuk
  •     Hesquiaht
  •     Homalco
  •     Huron (Wendat)
  •     Huu-ay-aht
  •     Innu
  •     Inuit
  •     Inuvialuit
  •     Iroquois (Haudenosaunee)
  •     Kaska
  •     K’omoks
  •     Ktunaxa (Kutenai)
  •     Kwakiutl
  •     Kwakwa̱ka̱ʼwakw
  •     Kyuquot/Cheklesaht
  •     Laich-kwil-tach
  •     Lakota
  •     Lekwungen
  •     Malahat
  •     Malécite
  •     Mamalilikulla
  •     Métis
  •     Mi’kmaq
  •     Mohawk
  •     Montagnais
  •     Moskégon (cri des marais)
  •     Mowachaht/Muchalaht
  •     Musqueam
  •     Nakwaxda’xw
  •     ’Namgis
  •     Naskapi
  •     Navajo
  •     Nez Percé
  •     Nisga’a
  •     Nlaka’pamux (Thompson)
  •     Nuchatlaht
  •     Nuu-chah-nulth
  •     Nuxalk
  •     Odawa
  •     Ojibwé
  •     Oji-Cri
  •     Okanagan (Syilx)
  •     Oneida
  •     Onondaga
  •     Passamaquoddy
  •     Penelakut
  •     Pied-Noir
  •     Piikani
  •     Porteur (Dakelh)
  •     Potawatomi
  •     Premières Nations
  •     Qalipu Mi’kmaq
  •     Quatsino
  •     Sahtú (Esclave du Nord)
  •     Salish
  •     Salish de la Côte
  •     Salish du continent
  •     Saulteaux
  •     Secwepemc (Shuswap)
  •     Seneca
  •     Shawnee
  •     Shishalh (Sechelt)
  •     Siksika
  •     Sioux
  •     Snuneymuxw
  •     Squamish
  •     St’at’imc (Lillooet)
  •     Stó:lō
  •     Stoney (Nakoda)
  •     Tagish
  •     Tahltan
  •     Tla’amin (Sliammon)
  •     Tla-o-qui-aht
  •     Tlatlasikwala
  •     Tlicho (Flanc-de-chien)
  •     Tlingit
  •     Tlowitsis
  •     Tsek’ene (Sekani)
  •     Tseshaht
  •     Tsimshian
  •     T’Sou-ke
  •     Tsuu T’ina (Sarcee)
  •     Tuscarora
  •     Tutchone
  •     Ucluelet
  •     Wet’suwet’en
  •     W̱SÁNEĆ (Saanich)
  •     Wuikinuxv


Origines qui réfèrent à des pays


  •     Açoréen
  •     Afghan
  •     Albanais
  •     Algérien
  •     Allemand
  •     Américain
  •     Anglais
  •     Angolais
  •     Anguillais
  •     Antiguais
  •     Argentin
  •     Arménien
  •     Arubais
  •     Australien
  •     Autrichien
  •     Azerbaïdjanais
  •     Bahamien
  •     Bahreïnien
  •     Bangladeshi
  •     Barbadien
  •     Belge
  •     Bélizien
  •     Béninois
  •     Bermudien
  •     Bhoutanais
  •     Biélorusse
  •     Birman
  •     Bolivien
  •     Bosnien
  •     Brésilien
  •     Brunéien
  •     Bulgare
  •     Burkinabè
  •     Burundais
  •     Caïmanien
  •     Cambodgien
  •     Camerounais
  •     Canadien
  •     Cap-Verdien
  •     Centrafricain
  •     Chilien
  •     Chinois
  •     Chypriote
  •     Colombien
  •     Comorien
  •     Congolais
  •     Coréen
  •     Costaricain
  •     Croate
  •     Cubain
  •     Danois
  •     Djiboutien
  •     Dominicain
  •     Dominiquais
  •     Écossais
  •     Égyptien
  •     Équatorien
  •     Érythréen
  •     Espagnol
  •     Estonien
  •     Éthiopien
  •     Féroïen
  •     Fidjien
  •     Finlandais
  •     Français
  •     Gabonais
  •     Gallois
  •     Gambien
  •     Géorgien
  •     Ghanéen
  •     Gibraltarien
  •     Grec
  •     Grenadien
  •     Groenlandais
  •     Guadeloupéen
  •     Guatémaltèque
  •     Guinéen
  •     Guyanais
  •     Haïtien
  •     Hollandais
  •     Hondurien
  •     Hongkongais
  •     Hongrois
  •     Indien de l’Inde
  •     Indonésien
  •     Irakien
  •     Iranien
  •     Irlandais
  •     Irlandais du Nord
  •     Islandais
  •     Israélien
  •     Italien
  •     Ivoirien
  •     Jamaïquain
  •     Japonais
  •     Jordanien
  •     Kazakh
  •     Kényan
  •     Kirghiz
  •     Kittien/Névicien
  •     Kosovar
  •     Koweïtien
  •     Laotien
  •     Letton
  •     Libanais
  •     Libérien
  •     Libyen
  •     Liechtensteinois
  •     Lituanien
  •     Luxembourgeois
  •     Macédonien
  •     Malaisien
  •     Malawien
  •     Malgache
  •     Malien
  •     Maltais
  •     Mannois
  •     Marocain
  •     Martiniquais
  •     Mauricien
  •     Mauritanien
  •     Mexicain
  •     Moldove
  •     Mongol
  •     Monténégrin
  •     Montserratien
  •     Mozambicain
  •     Namibien
  •     Néo-Zélandais
  •     Népalais
  •     Nicaraguayen
  •     Nigérian
  •     Nigérien
  •     Norvégien
  •     Omanais
  •     Ougandais
  •     Ouzbek
  •     Pakistanais
  •     Palestinien
  •     Panaméen
  •     Papouasien
  •     Paraguayen
  •     Péruvien
  •     Philippin
  •     Polonais
  •     Portoricain
  •     Portugais
  •     Réunionnais
  •     Roumain
  •     Russe
  •     Rwandais
  •     Sainte-hélénien
  •     Saint-Lucien
  •     Salvadorien
  •     Samoan
  •     Saoudien
  •     Sénégalais
  •     Serbe
  •     Seychellois
  •     Sierra-Léonais
  •     Singapourien
  •     Slovaque
  •     Slovène
  •     Somalien
  •     Soudanais
  •     Sri-Lankais
  •     Sud-Africain
  •     Sud-Soudanais
  •     Suédois
  •     Suisse
  •     Surinamien
  •     Swazi
  •     Syrien
  •     Tadjik
  •     Tahitien
  •     Taïwanais
  •     Tanzanien
  •     Tchadien
  •     Tchèque
  •     Thaïlandais
  •     Togolais
  •     Tongan
  •     Trinidadien
  •     Tunisien
  •     Turc
  •     Turkmène
  •     Ukrainien
  •     Uruguayen
  •     Vénézuélien
  •     Vietnamien
  •     Vincentais
  •     Yéménite
  •     Zambien
  •     Zimbabwéen


Autres origines ethniques ou culturelles


  •     Acadien
  •     Afar
  •     Africain
  •     Africain d’Afrique centrale
  •     Afrikaner
  •     Afro-Américain
  •     Afro-Canadien
  •     Afro-Caribéen
  •     Afro-Néo-Écossais
  •     Akan
  •     Albertain
  •     Allemand de Pennsylvanie
  •     Alsacien
  •     Amhara
  •     Amish
  •     Anglo-Indien
  •     Antillais
  •     Antillais britannique
  •     Arabe
  •     Arawak
  •     Ashanti
  •     Asiatique
  •     Asiatique de l’Est
  •     Asiatique du Sud-Est
  •     Asiatique occidental
  •     Assyrien
  •     Bachkir
  •     Baloutche
  •     Bambara
  •     Bamiléké
  •     Bantou
  •     Baoulé
  •     Basque
  •     Batswana
  •     Bavarois
  •     Bengali
  •     Berbère
  •     Blanc
  •     Bohémien
  •     Bosniaque
  •     Bouddhiste
  •     Breton
  •     Britannique
  •     Britanno-Colombien
  •     Cachoube
  •     Canadien français
  •     Cap-Bretonnais
  •     Catalan
  •     Celte
  •     Centraméricain
  •     Centrasiatique
  •     Chaldéen
  •     Chin
  •     Chrétien
  •     Chypriote grec
  •     Chypriote turc
  •     Cingalais
  •     Circassien
  •     Copte
  •     Cornique
  •     Corse
  •     Créole
  •     Dinka
  •     Doukhobor
  •     Écossais d’Ulster
  •     Edo
  •     Esan
  •     Est-Africain
  •     Eurasien
  •     Européen
  •     Européen de l’Est
  •     Européen de l’Ouest
  •     Européen du Nord
  •     Européen du Sud
  •     Européen du Sud-Est
  •     Éwé
  •     Fante
  •     Flamand
  •     Franco-Ontarien
  •     Frison
  •     Ga-Adangme
  •     Galicien
  •     Gaspésien
  •     Goanais
  •     Gujarati
  •     Haoussa
  •     Harari
  •     Hawaïen
  •     Hazara
  •     Hindou
  •     Hispanique
  •     Hmong
  •     Huguenot
  •     Huttérite
  •     Hutu
  •     Igbo
  •     Igorot
  •     Ilocano
  •     Indien caraïbe (Caribe)
  •     Indien d’Amérique centrale (Autochtone)
  •     Indien d’Amérique du Sud (Autochtone)
  •     Indo-Caribéen
  •     Indo-Fidjien
  •     Indo-Guyanais
  •     Insulaire anglo-normand
  •     Insulaire du Pacifique
  •     Jat
  •     Javanais
  •     Juif
  •     Kabyle
  •     Karen
  •     Kashmiri
  •     Khmer
  •     Kikuyu
  •     Kurde
  •     Latino-américain
  •     Loyaliste de l’Empire-Uni
  •     Luba
  •     Luo
  •     Maghrébin
  •     Maharashtrien
  •     Malais
  •     Malayali
  •     Malinké
  •     Manitobain
  •     Maori
  •     Mapuche
  •     Marron
  •     Maya
  •     Mennonite
  •     Morave
  •     Mossi
  •     Moyen-oriental
  •     Musulman
  •     Ndébélé
  •     Néo-Brunswickois
  •     Néo-Écossais
  •     Noir
  •     Nord-african
  •     Nord-américain
  •     Normand
  •     Nubien
  •     Océanien
  •     Ontarien
  •     Orcadien
  •     Oromo
  •     Ouest-africain
  •     Ouïghour
  •     Pachtoune
  •     Pendjabi
  •     Perse
  •     Peul
  •     Pipil
  •     Polynésien
  •     Prince-Édouardien
  •     Québécois
  •     Quechua
  •     Rohingya
  •     Rom
  •     Ruthénien
  •     Sami
  •     Saskatchewanais
  •     Scandinave
  •     Sérère
  •     Shona
  •     Sicilien
  •     Sikh
  •     Sindhi
  •     Slave
  •     Soninké
  •     Sud-américain
  •     Sud-asiatique
  •     Swahili
  •     Tamoul
  •     Tatar
  •     Tchécoslovaque
  •     Tchétchène
  •     Telugu
  •     Terre-Neuvien
  •     Tibétain
  •     Tigrigna
  •     Transylvanien
  •     Tswana
  •     Tutsi
  •     Wallon
  •     Wolof
  •     Xhosa
  •     Yézidi
  •     Yoruba
  •     Yougoslave
  •     Zoroastrien
  •     Zoulou



mardi 3 août 2021

Box breathing technique

box breathing or four-square breathing.

Here's how it works:

  1. Breathe in for four seconds.
  2. Hold air in your lungs for four seconds.
  3. Exhale for four seconds.
  4. Hold your breath, lungs emptied, for four seconds.


from : https://getpocket.com/explore/item/beat-stress-like-a-navy-seal-with-this-ridiculously-easy-exercise

lundi 2 août 2021

MVT + Adb : how to use this consensual forensics tool to analyse whether your phone has been compromised by the pegasus/NSO discoveries. Forensics, long time no see !

Following pegasus revelations, I decided to play a bit with the tool provided by Amnesty International Security Lab in July 2021. 

Forensics, long time no see !


Sources : https://github.com/mvt-project/mvt

Doc : https://docs.mvt.re/en/latest/android/download_apks.html


Pretty strait-forward, once you have ADB installed on your computer.


the following steps are for and android phone + mac OS laptop

Step 0 : set your phone in "developper mode". For me I had to go to the settings and press 7 times on the release logo. 

Step 1 : plug your phone in USB, enabling USB debugging https://developer.android.com/studio/debug/dev-options#enable%3E

Step 2 : install ADB

brew install android-platform-tools

Check that you see your device, and then stop adb (not required after).

adb devices
adb kill-server

Step 3 : install mvt
pip3 install mvt

Step 4 : run mvt over your phone

mkdir output && mvt-android download-apks --output ./output --all-checks