Archives pour la catégorie ‘Administration’

OpenSSH : accès au prompt

Raccourci-clavier : [Entrée] + [~] + [?]

~?
Supported escape sequences:
 ~.   - terminate connection (and any multiplexed sessions)
 ~B   - send a BREAK to the remote system
 ~C   - open a command line
 ~R   - request rekey
 ~V/v - decrease/increase verbosity (LogLevel)
 ~^Z  - suspend ssh
 ~#   - list forwarded connections
 ~&   - background ssh (when waiting for connections to terminate)
 ~?   - this message
 ~~   - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

Boto : gérer le logging

Pour activer le log de debug :

import logging
logging.basicConfig(filename="boto.log", level=logging.DEBUG)

Pour supprimer tout le logging (par exemple avec S3) hormis les erreurs critiques :

import logging
logging.getLogger('boto').setLevel(logging.CRITICAL)

Amazon EC2 : scripts de gestion des disques éphémères

Voici les scripts et unités systemd que j’utilise pour gérer les disques éphémères de mes instances Amazon EC2.

Docker : activer les restrictions RAM & swap

# vim /etc/default/grub 
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
# update-grub
# vim /etc/default/docker
DOCKER_OPTS="--exec-opt native.cgroupdriver=cgroupfs"
# shutdown -r now

Debian : fix startup Docker 1.7 & kernel 4.1

sept. 20 19:34:19 muse systemd[1]: Started Docker Application Container Engine.
sept. 20 19:34:19 muse docker[18643]: time="2015-09-20T19:34:19.773439875+02:00" level=error msg="[graphdriver] prior storage driver \"aufs\" failed: driver not supported"
sept. 20 19:34:19 muse docker[18643]: time="2015-09-20T19:34:19.773487551+02:00" level=fatal msg="Error starting daemon: error initializing graphdriver: driver not supported"
# rm -rf /var/lib/docker/aufs
# systemctl start docker

Debian : fix crash Netbeans 8

# vim /etc/java-8-openjdk/accessibility.properties
#assistive_technologies=org.GNOME.Accessibility.AtkWrapper

MongoDB : déployer rapidement un replicat set local

https://github.com/allanbank/mongodb-tricks

https://github.com/allanbank/mongodb-tricks/blob/master/src/main/scripts/replica-set-start.sh

Linux : afficher la consommation swap par processus

# for file in /proc/*/status ; do awk '/^(VmSwap|Pid|Name)/{printf $2 " " $3}END{ print ""}' $file; done | sort

Git : prompt bash

Un prompt bash spécialisé pour l’utilisation de Git :

https://github.com/magicmonty/bash-git-prompt

Linux : tester les performances I/O

# hdparm -t -T /dev/sda
# dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync
# bonnie++ -d /mnt -r 8000 -u toto
Haut de page