A quick note, there are actually 3 modes, not two when it comes to the drivers in use:
HVM: unmodified kernel and drivers using software emulated devices
PV-HVM: unmodified kernel with paravirtualized (Xen specific) disk and network drivers
PV: modified kernel and drivers
For a Xen guest/DomU you can do a very basic uname and lsmod with a grep to list the modules in use:
uname -a
lsmod | grep xen
If uname -a lists a kernel with the string "xen" in it, then you have a modified kernel and it's likely a PV guest, and you will see output from the lsmod command to confirm it. If you have output from the grep on lsmod but no sign of a modified kernel then you are PV-HVM. Without any sign of either, it's a straight HVM.
Note: Generally you can do more with VMs that have the PV tools installed, so that can be quite an obvious pointer, however you can fake the presence of the PV tools to allow suspend/resume etc. so you cannot rely on that in general.
Pour avoir plusieurs certificats
If a directory name is used instead of a PEM file, then all files found in
that directory will be loaded in alphabetic order unless their name ends with
'.issuer' or '.ocsp' (reserved extensions). This directive may be specified
multiple times in order to load certificates from multiple files or
directories. The certificates will be presented to clients who provide a valid
TLS Server Name Indication field matching one of their CN or alt subjects.
Wildcards are supported, where a wildcard character '*' is used instead of the
first hostname component (eg: *.example.org matches www.example.org but not
www.sub.example.org).
If no SNI is provided by the client or if the SSL library does not support
TLS extensions, or if the client provides an SNI hostname which does not
match any certificate, then the first loaded certificate will be presented.
This means that when loading certificates from a directory, it is highly
recommended to load the default one first as a file or to ensure that it will
always be the first one in the directory.
L'appel d'une fonction peut se faire avec ou sans parenthèse :
foo() ou foo
Ensuite, un Hash peut avoir plusieurs formes..
{'a' => 12}
où 'a' peut être n'importe quoi : string (comme ici), mais aussi objet,
symbol : exemple :
{:a => 12}
La nouvelle syntaxe, valable uniquement si les clés sont des symboles :
{a: 12, b: 'toto'}
Et enfin quand on call une méthode qui peut prendre un hash en argument (entre autre), pas besoin de mettre les { }
foo({a: 12, b:14})
ou
foo(a: 12, b:14)
ou
foo a: 12, b:14
Sympa ce workflow de protection de login
man apt_preferences
Alternative au apt-mark hold xx :
Package:
Pin: origin ""
Pin-Priority: -1
man systemctl
man systemd.service
Certains paquets sont livrés avec leur .service qu'on ne veut pas forcément utiliser
Par exemple pour redis, on peut vouloir fiare tourner plusieurs redis sur la même machine (en créant nos .service dans /etc/systemd/system)
Du coup, le .service fourni de base n'est pas vraiment utile :
systemctl disable redis-server
Si on veut qu'il n'apparaisse plus du tout dans le listing systemctl :
rm /lib/systemd/system/redis-server.service
systemctl reset-failed redis-server
css/grafana.dark.min.5aa0b879.css
.histogram-chart{min-height:250px;
/me découvre les cherry-pick
Ne pas nommer une méthode de controller rails "requete"
:D
Une web interface pour visualiser les data dans influxdb (par influxdb)
Petite concurrence à Grafana pour le coup
Tiens j'avais loupé ça vu que j'étais en vacances. Donc un nouvel agent de collecte pour envoyer vers influxdb
How to make --no-ri --no-rdoc the default for gem install?
.gemrc :
gem: --no-document
Custom configuration in Rails 4.2 with x namespace
(Petite note pour ne pas oublier)
Les ORM c'est cool.. mais franchement le temps que ça prend à maitriser... je me demande si ça en vaut vraiment la peine.
Là, je viens de passer plus d'une heure à debug car je voulais faire un update dans le cas d'un has_many entre foo et bar :
- foo = Foo.find(42)
- set une collections d'objets : foo.bars = [bla,ble,blo]
- puis foo.save
Seulement le foo.save est de trop : dès l'instant ou la collection est set, l'objet est sauvé en base (update)
Donc sans les validations de minimum et de maximum décrite dans le model foo.
Et tout ça seulement dans le cas d'un update (dans le cas d'un create, ça ne trigger rien).
pouah
gitlab a racheté gitorious il y a un moment, donc on a pour résumer :
- gitlab
- gogs
en mode insert : ^V et le code ascii
exemple :ctrl V 003
/set activity_hide_targets #channel #channel2 #channel3
/set activity_hide_level QUITS JOINS PARTS KICKS MODES TOPIC NICKS
/IGNORE -network FREEN * PARTS
/IGNORE -network FREEN * QUIT
/IGNORE -network FREEN * JOIN
http://www.irssi.org/documentation/manual
voir 10.
Message notifier
Panel osd
taskbar
topicons
github releases Brubeck, a statsd compatible metric aggregator!!
A quick look at the /proc/net/dev-generated graphs on the machine made the situation very obvious: slowly but steadily over time, the percentage of UDP packets that were being dropped in our monitoring server was increasing. From 3% upwards to 40%. We were dropping almost half of our metrics!
:-)
rsync -ai source/ dest/ | grep -vE '^.'
L'option -i ajoute des informations pour chaque fichier (voir man)
Ici on filtre tout ce qui commence par un point == les fichiers/dossier qui n'ont pas été transférés