Skip to content

Instantly share code, notes, and snippets.

View DaffyDuke's full-sized avatar

Olivier Duquesne DaffyDuke

View GitHub Profile
@DaffyDuke
DaffyDuke / listing_files.md
Created June 14, 2017 21:40
Lister les fichiers récursivement par date de modification From http://www.deltasight.fr/lister-fichiers-recursivement-date-modification/

_

@DaffyDuke
DaffyDuke / Foreman.md
Created May 31, 2017 08:46
Foreman tips

Delete dans Foreman avec clean des certifs

On passe la machine en "managed" :

curl -k -s -u $user:$pass -H "Accept: version=2,application/json" -H "Content-Type: application/json" -X PUT  -d {\"host\":{\"managed\":true}} https://$foreman/api/hosts/$fqdn 

Puis on la supprime :

curl -k -s -u $user:$pass  -H "Accept: version=2,application/json" -H "Content-Type: application/json" -X DELETE https://$foreman/api/hosts/$fqdn 
@DaffyDuke
DaffyDuke / check_systemd.sh
Created March 7, 2017 22:33
Nagios check for systemd failed units
#!/bin/bash
# Source http://lzone.de/blog/Nagios+Check+for+Systemd+Failed+Units
if [ -f /bin/systemctl ]; then
failed=$(/bin/systemctl --failed --no-legend)
failed=${failed/ */} # Strip everything after first space
failed=${failed/.service/} # Strip .service suffix if [ "$failed" != "" ]; then
echo "Failed units: $failed"
exit 1
else
echo "No failed units."
@DaffyDuke
DaffyDuke / harddisk_model.md
Last active March 6, 2017 13:08
Find your hardisk model
@DaffyDuke
DaffyDuke / holidays_fr.pl
Created March 6, 2017 12:50
Congés et jours fériés en script
#!/usr/bin/perluse strict;
# source : http://forum.hardware.fr/hfr/Programmation/Divers-6/resolu-calendrier-perpetuel-sujet_141270_1.htm
use warnings;
use DateTime;
use Date::Holidays::FR;
foreach my $month (1..12) {
foreach my $day (1..31) {
if (my $holi = is_fr_holiday(2014, $month, $day)) {
my $dt = DateTime->new(year => 2014, month => $month, day => $day);
my $dow = $dt->day_of_week();
@DaffyDuke
DaffyDuke / cfgmgmtcamp2017.md
Last active November 27, 2017 21:04
Notes Configuration Management Camp 2017

#Keynote 650 personnes Ansible devant puppet en 2017

Is a solved problem ?

I'm sorry from the States @lusis Disait en 2011 is a solved problem with a panel service matters, not servers for what : package, daemons, files, templates, users

@DaffyDuke
DaffyDuke / susecon2016.md
Last active February 28, 2018 22:35
Notes SuseCon 2016 - Washington

SAP-HANA : system replication, Matthieu Fattrez

clb pacemaker fait le job moins d'une minute de bascule pour une base de 800G SAP HANA

Utilisation de Suse Manager

exemple : patch la machine standby, bascule cluster, puis patch de la machine front, eventuellement retour en position nominale stonith method => sbd meilleure lecture du crm_mon

SELECT
CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(
GROUP_CONCAT(field_name ORDER BY field_name SEPARATOR ','),
',', 95/100 * COUNT(*) + 1), ',', -1) AS DECIMAL) AS `95th Per`
FROM table_name;
@DaffyDuke
DaffyDuke / lpar_installation_with_nim.md
Created March 5, 2017 17:31
AIX : LPAR installation with NIM

#. Create partition Via HMC : configuration, create partition, AIX profile_name ~ partition name_normal (best practice) Processors : notion EC nominal, VP max possible => le plus souvent config en shared (intégration dans un pool de CPU, ex: un pool de CPU Oracle pour les licences) Weight = Dispo(EC)*EC/somme(EC) Class :

  • 254 pour un VIO
  • 32 pour une machine de production
  • RAM : mini = désiré 8 G , max x2 => gestion pas auto, action de configuration en profil actif Attention, si max trop élevé, impact sur page d'allocation de l'hyperviseur