Skip to content

Instantly share code, notes, and snippets.

@yalex2011
yalex2011 / glibc-2.17_centos6.sh
Created September 27, 2017 08:59 — forked from harv/glibc-2.17_centos6.sh
update glibc to 2.17 for CentOS 6
#! /bin/sh
# update glibc to 2.17 for CentOS 6
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
@yalex2011
yalex2011 / hosts.yml
Created November 13, 2017 12:07
Ansible setting of hostname from inventory, but ignoring IP addresses
- name: Ensure hostname set
hostname: name={{ inventory_hostname }}
when: not inventory_hostname|match('(\d{1,3}\.){3}\d{1,3}')
- name: Ensure hostname is in /etc/hosts
lineinfile:
dest=/etc/hosts
regexp="^{{ ansible_default_ipv4.address }}.+$"
line="{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}"
@yalex2011
yalex2011 / fix-1c-lib.sh
Last active April 15, 2018 21:21
Запуск 1С 8.3 ubuntu 17.10
sudo mv /opt/1C/v8.3/i386/libstdc++.so.6 /opt/1C/v8.3/i386/libstdc++.so.6.orig
sudo ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6.0.24 /opt/1C/v8.3/i386/libstdc++.so.6
@yalex2011
yalex2011 / vagrantfile
Created September 19, 2018 07:27
Vagrant: libvirt, (Multi-)Multi-Machine and AnsibleCreate
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# Example vagrant greate multi-box vms
#
# ---- Configuration variables ----
servers=[
@yalex2011
yalex2011 / lxd_set_locales_and_time.md
Last active September 28, 2018 19:11 — forked from petergloor/lxd_set_locales_and_time.md
LXD - set locales and time zone
 lxc exec <container> -- dpkg-reconfigure locales
 lxc exec <container> -- sudo dpkg-reconfigure tzdata
 lxc config set <container> environment.LC_ALL ru_RU.UTF-8
#!/usr/bin/env ansible-playbook
- name: Test
hosts: all
serial: 1
order: sorted
gather_facts: no
tasks:
- debug:
@yalex2011
yalex2011 / ansible-check-python
Created December 17, 2018 11:53
ansible-check-python
---
- hosts: all
gather_facts: False
become: yes
pre_tasks:
- name: Install python for Ansible
raw: bash -c "test -e /usr/bin/python || (apt -qqy update && apt install -qqy python-minimal)"
register: output
changed_when: output.stdout != ""
@yalex2011
yalex2011 / lxd-fix-privileged
Created December 18, 2018 10:14
lxd root privileged
lxc config set u3 security.privileged true
@yalex2011
yalex2011 / rescan_scsi_bus
Created January 15, 2019 17:40
rescan_scsi_bus ubuntu
#!/bin/bash
for hostdir in /sys/class/scsi_host/host*; do
echo "- - -" > $hostdir/scan
done
- set_fact:
result: {}
- name: Get uname -a
raw: uname -a
register: uname
- debug:
var: uname