Skip to content

Instantly share code, notes, and snippets.

View xlogerais's full-sized avatar

Xavier Logerais xlogerais

View GitHub Profile
@xlogerais
xlogerais / mount-cgroup-systemd
Created September 14, 2017 14:03
Gentoo init script cgroup systemd
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
prepare_mountpoint() {
if ! [ -d /sys/fs/cgroup/systemd ]; then
ebegin "Creating mountpoint /sys/fs/cgroup/systemd"
mkdir -p /sys/fs/cgroup/systemd
eend $?
fi
# Log format
git config --global format.pretty oneline
# Color
git config --global color.ui true
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
@xlogerais
xlogerais / Gentoo Init script for lxc-net
Last active May 31, 2017 14:01
Gentoo init script wrapper for lxc-net
#!/sbin/runscript
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
lxcnet_script=/usr/libexec/lxc/lxc-net
depends() {
need net
}
#!/bin/bash
BINDIR="$HOME/bin/docker"
export PATH="$BINDIR:$PATH"
DOCKER_MACHINE_DRIVER="kvm"
CLUSTERNAME="test"
BACKEND="consul"
MANAGER="swarm-manager"
#!/bin/bash
BINDIR="$HOME/bin/docker"
DOCKER_CLIENT_VERSION="1.12.3"
DOCKER_MACHINE_VERSION="v0.8.2"
DOCKER_COMPOSE_VERSION="1.8.1"
DOCKER_MACHINE_KVM_DRIVER_VERSION="v0.7.0"
# Create $BINDIR directory if it doesn't exists
#!/bin/bash
BASEDIR=$( cd $(dirname $0) && pwd )
# Check arguments
if [ $# -ne 1 ]; then
echo "Usage : $0 vm_name";
exit 1;
fi;
@xlogerais
xlogerais / DHT-to-influxdb.bash
Last active August 29, 2015 14:07
Raspberry Pi temp and humidity sensor DHT22
#!/bin/bash
while true
do
output=$( python /home/pi/DHT_read.py )
temperature=$(echo $output | cut -d\ -f1)
humidity=$(echo $output | cut -d\ -f2)
#echo "output : ${output}"
echo -e "$(date) \t Température : ${temperature} \t Humidité : ${humidity}"
curl -X POST "http://play.influxdb.org:8086/db/test/series?u=user&p=password" -d "[{\"name\":\"sensor\",\"columns\":[\"temperature\",\"humidity\"], \
1/ set rvm env
2/ install bundle
gem install bundler
3/ install tools with bundler
create Gemfile
add gem 'rake'
ssh hostname ffmpeg -f x11grab -s 1680x1050 -i :0.0 -vf "scale=800:600" -vcodec libx264 -f avi 'udp://targethost:1234'
# Install acl package
aptitude install acl
# Allow www-data user to cross repo
setfacl -m u:www-data:x /srv
setfacl -m u:www-data:x /srv/repositories
setfacl -m u:www-data:x /srv/repositories/git
# Recursively grant right to www-data user
setfacl -Rm u:www-data:rwx /srv/repositories/git