Skip to content

Instantly share code, notes, and snippets.

View sshnaidm's full-sized avatar
🍺
it's coding

Sergey sshnaidm

🍺
it's coding
View GitHub Profile
conf["cobbler_node_ip"] = config['servers']['build-server']["ip"]
conf["node_subnet"] = ".".join(config['servers']['build-server']['ip'].split(".")[:3]) + ".0"
conf["node_gateway"] = ".".join(config['servers']['build-server']['ip'].split(".")[:3]) + ".1"
conf["swift_internal_address"] = config['servers']['control-servers'][0]['ip']
conf["swift_public_address"] = config['servers']['control-servers'][0]['ip']
conf["swift_admin_address"] = config['servers']['control-servers'][0]['ip']
conf['mysql::server::override_options']['mysqld']['bind-address'] = config['servers']['control-servers'][0]['ip']
@sshnaidm
sshnaidm / 0_reuse_code.js
Created June 4, 2014 19:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sshnaidm
sshnaidm / python_resources.md
Created June 4, 2014 19:09 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@sshnaidm
sshnaidm / qemu create disk
Created June 8, 2014 16:52
qemu create image
qemu-img create -f qcow2 /var/lib/libvirt/images/template.qcow2 20480M
@sshnaidm
sshnaidm / virt install
Last active August 29, 2015 14:02
install box from disk
virt-install --vnc --name=jenkins --ram=4096 --disk path=/opt/qa/jenkins_disk.qcow2,format=qcow2,bus=virtio,cache=none --network=network:default,model=virtio --location=http://ftp.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/
@sshnaidm
sshnaidm / libvirt_python_china.py
Created June 8, 2014 16:59
working with libvirt and python from chinese phorum: http://my.oschina.net/guol/blog/131778
'''
Work with virtual machines managed by libvirt
:depends: libvirt Python module
'''
# Special Thanks to Michael Dehann, many of the concepts, and a few structures
# of his in the virt func module have been used
# Import python libs
import os
@sshnaidm
sshnaidm / create_snapshot_libvirt.py
Created June 8, 2014 17:03
Create snapshot on libvirt
op.snapshotCreateXML("<domainsnapshot>snap1</domainsnapshot>")
@sshnaidm
sshnaidm / new_gist_file.sh
Created June 18, 2014 20:29
Exclude tempest tests
testr list-tests '(?!.*tempest.api|tempest.cli|tempest.thirdparty)tempest'
@sshnaidm
sshnaidm / ignore ssh hosts
Created July 1, 2014 10:14
Ignore SSH known hosts
in /etc/ssh/ssh_config:
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
@sshnaidm
sshnaidm / apt lock.sh
Created July 12, 2014 16:18
lock apt for package version
1)
SET: echo "package hold" | sudo dpkg --set-selections
REMOVE: echo "package install" | sudo dpkg --set-selections
CHECK: dpkg --get-selections | grep "package"
2)
SET: sudo apt-mark hold package_name
CHECK: sudo apt-mark unhold package_name