Skip to content

Instantly share code, notes, and snippets.

@zioproto
zioproto / qtranslate_wordpress39.patch
Created April 17, 2014 10:11
Fix qTranslate plugin for Wordpress 3.9
diff --git a/wp-content/plugins/qtranslate/qtranslate_core.php b/wp-content/plugins/qtranslate/qtranslate_core.php
index 17b4669..9ac128a 100644
--- a/wp-content/plugins/qtranslate/qtranslate_core.php
+++ b/wp-content/plugins/qtranslate/qtranslate_core.php
@@ -414,6 +414,7 @@ function qtrans_updateTermLibrary() {
function qtrans_strftime($format, $date, $default = '', $before = '', $after = '') {
// don't do anything if format is not given
+ return $default;
@zioproto
zioproto / create_external_datagroup_file_bigip_f5_bigsuds.py
Last active August 29, 2015 14:12
Upload a file to F5 BIGIP using bigsuds
"""
This script will create an external file datagroup.
This is the same of creating the data group from the web interface at:
System -> File Management -> Data Group File List
Create on your computer a file called datagroup.txt with the following content:
"name1" := "value1",
"name2" := "value2",
"name3" := "value3",
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/Users/your_name/Dropbox/backup/tweets/" # you need to create this folder
TWITTER_USER = "your_twitter_username"
diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py
index 7dae2ec..f1d4d85 100644
--- a/cinder/volume/drivers/rbd.py
+++ b/cinder/volume/drivers/rbd.py
@@ -710,9 +710,27 @@ class RBDDriver(driver.VolumeDriver):
with RBDVolumeProxy(self, volume_name) as volume:
try:
volume.unprotect_snap(snap_name)
+ except self.rbd.InvalidArgument:
+ LOG.info(_LI("Unable to unprotect snapshot %s. InvalidArgument"), snap_name)
commit 4858cd7cb97354ae54f8e7d47aeaaddad714c9dd
Author: Dustin Lundquist <dustin@null-ptr.net>
Date: Mon Jul 6 13:53:46 2015 -0700
Ensure floating IPs only use IPv4 addresses
Description:
Presently Neutron doesn't validate the address family of floating IP
addresses or the internal addresses they are associated with. It merely
associates the first IP of the floating IP's port with the first IP of
#!/bin/bash
case $(id -u) in
0)
echo first: running as root
echo doing the root tasks...
add-apt-repository -s ppa:ubuntu-cloud-archive/tools
add-apt-repository -s cloud-archive:mitaka
apt-get update
export DEBIAN_FRONTEND=noninteractive
commit 74252dd0915310013dbdf7b53fe813590bb4ca0a
Author: Saverio Proto <saverio.proto@switch.ch>
Date: Thu Apr 21 16:50:07 2016 +0200
Check if namespace exists before exec commands
If a neutron router has no ports defined, its namespace is deleted.
It is required to check if the namespace exists before calling
exec commands against the namespace.
It is not enough for the string of the namespace uuid to be defined,
@zioproto
zioproto / howto_deb_repackage.txt
Created May 13, 2016 13:00 — forked from shamil/howto_deb_repackage.txt
Howto repackage deb packages
Use folowing steps to repackage dep package:
1: Extract deb package
# dpkg-deb -x <package.deb> <dir>
2: Extract control-information from a package
# dpkg-deb -e <package.deb> <dir/DEBIAN>
3. After completed to make changes to the package, repack the deb
# dpkg-deb -b <dir> <new-package.deb>
@zioproto
zioproto / update_chroots
Created August 30, 2016 13:55
Keep update ubuntu chroots
#!/bin/bash
for d in `schroot -l | grep -- '^source'`
do
sbuild-update -udcar $d
done
@zioproto
zioproto / rbd-replication.md
Created October 19, 2016 12:03 — forked from jbernard/rbd-replication.md
Cinder RBD Replication Guide

Replication Notes

Assumption: You have two clusters, access to both, and a pool that exists in both clustsers and you wish to replicate some or all images in that pool to the other cluster.

Mirroring in both directions is required for Cinder to properly implement failover and failback.

Make sure you have the rbd-mirror package installed.