Quantcast
Channel: ISPIRE.ME
Viewing all 50 articles
Browse latest View live

Fix for broken vnc console on Openstack Essex under Debian/Ubuntu

$
0
0

Fix for broken vnc console on Openstack Essex under Debian/Ubuntu

Fix for broken vnc console on Openstack Essex under Debian/Ubuntu

The Openstack dashboard novnc console broke after the last two security release of essex openstack (2012.1.1-14/2012.1.1-15). Here is the solution Fix for broken vnc console on Openstack Essex under Debian/Ubuntu.

 

You will see an Error Message like this in your /var/log/nova/nova-consoleauth.log:

AUDIT nova.consoleauth.manager [req-6eb532ae-b024-4ada-8bb5-95ebc132dd2f None None] Checking Token: 32373fb4-c9ac-4f87-9418-7a6f13606874, True)
ERROR nova.rpc.amqp [req-6eb532ae-b024-4ada-8bb5-95ebc132dd2f None None] Exception during message handling
TRACE nova.rpc.amqp Traceback (most recent call last):
TRACE nova.rpc.amqp   File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 253, in _process_data
TRACE nova.rpc.amqp     rval = node_func(context=ctxt, **node_args)
TRACE nova.rpc.amqp   File "/usr/lib/python2.7/dist-packages/nova/consoleauth/manager.py", line 102, in check_token
TRACE nova.rpc.amqp     if token_valid and self._validate_console(token):
TRACE nova.rpc.amqp   File "/usr/lib/python2.7/dist-packages/nova/consoleauth/manager.py", line 91, in _validate_console
TRACE nova.rpc.amqp     console_valid = self.compute_api.validate_vnc_console(context,
TRACE nova.rpc.amqp NameError: global name 'context' is not defined
TRACE nova.rpc.amqp
ERROR nova.rpc.amqp [req-6eb532ae-b024-4ada-8bb5-95ebc132dd2f None None] Returning exception global name 'context' is not defined to caller
ERROR nova.rpc.amqp [req-6eb532ae-b024-4ada-8bb5-95ebc132dd2f None None] ['Traceback (most recent call last):n', '  File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 253, in _process_datan    rval = node_func(context=ctxt, **node_args)n', '  File "/usr/lib/python2.7/dist-packages/nova/consoleauth/manager.py", line 102, in check_tokenn    if token_valid and self._validate_console(token):n', '  File "/usr/lib/python2.7/dist-packages/nova/consoleauth/manager.py", line 91, in _validate_consolen    console_valid = self.compute_api.validate_vnc_console(context,n', "NameError: global name 'context' is not definedn"]

So I’ve looked for quick solutions to get rid with the broken python scripts and built this diff patch out of two merged fixes i found in the openstack git reviews repository.

To fix your nova-consoleauth do following steps:

First of all download the patch set: openstack_novnc.tar.gz  into a directory of your choice.

unpack the archive:

tar xvzf openstack_novnc.tar.gz


apply the patch diffs by running this commands on your root shell:

patch -p0 < api.py.diff
patch -p0 < manager.py.diff
patch -p0 < test_compute.py.diff

 

and one more important part is to restart the services after patching them:

service nova-api restart
service nova-console restart
service nova-consoleauth restart

The post Fix for broken vnc console on Openstack Essex under Debian/Ubuntu appeared first on ISPIRE.ME.


WordPress WP Tracklink Plugin

$
0
0

WordPress WP Tracklink Plugin

Wordpress WP Tracklink PluginWordPress WP Tracklink Plugin. Today i would like to introduce you my first Plugin. WP Tracklink Plugin tracks referrer links plus how often they have clicked and displays them on your WordPress widget sidebar. This will increase your page ranking due to backlink. Most clicked links gets an higher position in sidebar. Disabling specific links is possible via the settings tab.


You can download this plugin from this link: here or get it from the official wordpress.org plugin page.

Link to static page: here

Have fun!

The post WordPress WP Tracklink Plugin appeared first on ISPIRE.ME.

LVM on top of linux zfs to use Openstack with nova-volume

$
0
0

LVM on top of linux zfs to use Openstack with nova-volume

LVM on top of linux zfs to use Openstack with nova-volume
Did you ever wanted to know how to setup LVM on top of linux zfs to use Openstack with nova-volume? In this article i will describe this in a few easy steps based on my earlier mentioned how to about zfs on linux.


A common problem when using ZFS as storage for openstack is the lack of plugins that will cover as interface between nova-volume/cinder-volume and the block storage types. The volume service needs an LVM Volume group called nova-volumes as default.

In this how-to i will explain you step by step a workaround how to create an block storage device with zfs and get it into lvm.

Prerequisites:

 

Create a ZFS filesystem you will later use as LVM Group:

zfs create -V 500G storage/your_new_volume

The -V switch defines the size of the new created file-system. Change “storage” to you pool name.

Lets see how it looks like:

zfs list
Command Output:
NAME                            USED  AVAIL  REFER  MOUNTPOINT
storage/your_new_volume   516G  1.78T    76K  -

There you see your new created file-system without an mountpoint.

We now need to get its real device path:

file /dev/zvol/storage/your_new_volume
Command output: 
/dev/zvol/storage/your_new_volume: symbolic link to `../../<strong>zd0</strong>'

So our real device path is: /dev/zd0

Let’s do the magic part:

losetup /dev/loop2 /dev/zd0

And create a partition on that device:

fdisk /dev/loop2
(and hit: n p 1 ENTER ENTER t 8e w)

Finally we can create our LVM volume group:

pvcreate /dev/loop2
vgcreate nova-volumes /dev/loop2

 

We now need to make clear that the loop device gets mounted on the next boot:

Modify the file called /etc/rc.local in your preferred editor and enter following:

exec losetup /dev/loop2 /dev/zd0

And that’s it!

The post LVM on top of linux zfs to use Openstack with nova-volume appeared first on ISPIRE.ME.

Fix yosemite rtc alarm wakeup issue

$
0
0

Fix yosemite rtc alarm wakeup issue

Fix yosemite rtc alarm wakeup issue
Fix yosemite rtc alarm wakeup issue

After installing new Apple Mac OS X 10.10 Yosemite i ran into an issue were my Macbook Pro wokeup every few hours with lid closed which was very irritating me. After every periodical wakeup my Macbook Pro showing me messages like “Wake reason: RTC (Alarm)” in my syslog. In this snippet i tell you howto Fix yosemite rtc alarm wakeup issue.

First of all, we backup the original file to be safe if something going wrong or for the case we wanna revert the changes later. Open your terminal app and copy following:

To check what causes the wake up of your Mac you can use following handy command in your terminal:

syslog |grep -i "Wake reason"

So if the wakeup reason is something like “Wake reason: RTC (Alarm)” it might be the bonjour multicast feature which prevents your Mac to stay chill in sleep mode.

Backup:

sudo [ -f ~/Downloads/com.apple.discoveryd.plist ] && echo "File already there. Not overwriting it" || cp -a /System/Library/LaunchDaemons/com.apple.discoveryd.plist ~/Downloads/

To disable and prevent the wake reason, we need to edit the plist file with your prefered editor like:

sudo vi /System/Library/LaunchDaemons/com.apple.discoveryd.plist

Next move down to the key “ProgramArguments” and append this string to it:

<string>--no-multicast</string>

so it finally looks like this:

       <key>ProgramArguments</key>
        <array>
                <string>/usr/libexec/discoveryd</string>
                <string>--udsocket</string>
                <string>standard</string>
                <string>--loglevel</string>
                <string>Basic</string>
                <string>--logclass</string>
                <string>Everything</string>
                <string>--logto</string>
                <string>asl</string>
                <string>--no-multicast</string>
        </array>

Be sure to have no typos or misleading characters e.g. inserted into plist file or your Mac won’t boot anymore. So better make a backup of that file before changing it.

To make sure that the plist changes are correct you can check the file syntax by entering following command:

plutil /System/Library/LaunchDaemons/com.apple.discoveryd.plist

If everything looks fine. Reboot your system, so it loads the new plist file. Now you have to re-enable Wifi and connect to your Accesspoint. After that change you will realize that the Wifi signal icon won’t show its signal strenght anymore but Wifi is still connected and seem to work fine. So a waking up Mac was a bader option for me than this wakeup fix.
One more note: Printer and NAS/NFS/Samba/AFP Shares e.g. will still reachable by it’s IP/Hostname.
So you can add it again by its IP adress/netpath without auto discovery service.

If something still went wrong or to Restore the changes to original ones you have to enter this command which copies the backup file back to its origin location which we saved by Backup task before:

sudo cp -a ~/Downloads/com.apple.discoveryd.plist /System/Library/LaunchDaemons/

Update:
I found another way to automate this task by using the MacOS internal command PlistBuddy.

So all you have to do now is executing following command in your terminal app:

sudo /usr/libexec/PlistBuddy -c "Add :ProgramArguments: string --no-multicast" /System/Library/LaunchDaemons/com.apple.discoveryd.plist

and reboot the system or run following:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist

To revert the last change if something went wrong enter this command:

sudo /usr/libexec/PlistBuddy -c Revert /System/Library/LaunchDaemons/com.apple.discoveryd.plist

12/22/2014: Update — Testers wanted!
Please try my new suggestion to solve this issue and report!

I was playing around with the same issue one more time and disabled the date/time automatic sync and timezone detection on my Macbook.
Date & Time > Disable/Uncheck: Set date and time automatically
Time Zone > Disable/Uncheck: Set time zone automatically using current location

And guess what?
My Macbook did not woke up yet. Finally looks like it having the same effect than disabling Multicast but without all the flaws that came with the previous workaround.

So finally it should look like this:
fix-yosemite-rtc-alarm-wakeup-issue-date-time

and this (select your suitable Timezone if field is empty!):
fix-yosemite-rtc-alarm-wakeup-issue-timezone

Leave me a comment which solution works for you please!

Extra Bonus: I have encountered one more switch in new discoveryd.
Wondering: Why computer name changing constantly?

Here is the fix: http://ispire.me/computer-name-changing-constantly-yosemite/

Thats all folks!

The post Fix yosemite rtc alarm wakeup issue appeared first on ISPIRE.ME.

Computer name changing constantly Yosemite

$
0
0

Computer name changing constantly Yosemite

If you have ever wondered why Computer name changing constantly Yosemite i give you some short explantation to prevent MacOS X doing this.

The behavior is controlled by new discoveryd which replaces mDNSResponder on Yosemite and i found out that there is a switch called no-namechange which isn’t even documented on the internal man page of the discoveryd command.
To control strings for discoveryd i use the internal MacOS X command called PlistBuddy to enable this feature.

So what we will need to get this switch enabled is, entering following command in your Terminal app:

sudo /usr/libexec/PlistBuddy -c "Add :ProgramArguments: string --no-namechange" /System/Library/LaunchDaemons/com.apple.discoveryd.plist

And restart your Mac or run following command:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist

If you want to undo this for whatever reason just enter:

sudo /usr/libexec/PlistBuddy -c Revert /System/Library/LaunchDaemons/com.apple.discoveryd.plist

And it will revert the previous change to the previous modified plist file.

Cheers!

If you having trouble with waking up Mac on Yosemite every 2 hours, here is a temporary fix for that: Fix yosemite rtc alarm wakeup issue

The post Computer name changing constantly Yosemite appeared first on ISPIRE.ME.

[:en]Configure zfs to start before proxmox or openstack[:]

$
0
0

[:en]

Configure zfs to start before proxmox or openstack

configure zfs to start before proxmox or openstackIf you followed my previous articles: Native ZFS for Linux on Proxmox or Native ZFS for Linux on Openstack and encountered some problem that daemons seems fail to start on server boot up, it could be that the zfs mounting process starting to late. In this article i will explain you how to Configure zfs to start before proxmox or openstack.

 

This effect causing services accessing the zfs mounts won’t start properly.

Your zfs init script have to be fixed to run really before all other init scripts getting executed.

So this is what we gonna do now.

Prerequisites:

  • /etc/init.d/zfs lsb script
  • text editor to modify lsb script
  • command insserv

 

Modify your /etc/init.d/zfs with your favored text editor that it look like this:

### BEGIN INIT INFO
# Provides: zfs
# Required-Start: mountkernfs $local_fs
# Required-Stop: $local_fs
# X-Start-Before: console-setup networking
# Default-Start:     S
# Default-Stop:      0 6
# Should-Stop:
# Short-Description: Mount/umount the zfs filesystems
# Description: ZFS is an advanced filesystem designed to simplify managing
#              and protecting your data.  This service mounts the ZFS
#              filesystems and starts all related zfs services.
### END INIT INFO

Some notes: I’ve added the required-start mountkernfs $local_fs changed the required-stop $local_host the x-start-before: console-setup networking
Most important change is the default-start to value: S and default-stop to value: 0 6
so zfs init will execute in a very early stage of booting before all the network and console stuff.

After you have fixed the lines you need to reinit the lsb script by running:

insserv zfs

And that should do it.

Finally restart your system to see if the script is starting correct.[:]

The post [:en]Configure zfs to start before proxmox or openstack[:] appeared first on ISPIRE.ME.

Configure zfs to start before proxmox or openstack

$
0
0

Configure zfs to start before proxmox or openstack

configure zfs to start before proxmox or openstackIf you followed my previous articles: Native ZFS for Linux on Proxmox or Native ZFS for Linux on Openstack and encountered some problem that daemons seems fail to start on server boot up, it could be that the zfs mounting process starting to late. In this article i will explain you how to Configure zfs to start before proxmox or openstack.

 

This effect causing services accessing the zfs mounts won’t start properly.

Your zfs init script have to be fixed to run really before all other init scripts getting executed.

So this is what we gonna do now.

Prerequisites:

  • /etc/init.d/zfs lsb script
  • text editor to modify lsb script
  • command insserv

 

Modify your /etc/init.d/zfs with your favored text editor that it look like this:

### BEGIN INIT INFO
# Provides: zfs
# Required-Start: mountkernfs $local_fs
# Required-Stop: $local_fs
# X-Start-Before: console-setup networking
# Default-Start:     S
# Default-Stop:      0 6
# Should-Stop:
# Short-Description: Mount/umount the zfs filesystems
# Description: ZFS is an advanced filesystem designed to simplify managing
#              and protecting your data.  This service mounts the ZFS
#              filesystems and starts all related zfs services.
### END INIT INFO

Some notes: I’ve added the required-start mountkernfs $local_fs changed the required-stop $local_host the x-start-before: console-setup networking
Most important change is the default-start to value: S and default-stop to value: 0 6
so zfs init will execute in a very early stage of booting before all the network and console stuff.

After you have fixed the lines you need to reinit the lsb script by running:

insserv zfs

And that should do it.

Finally restart your system to see if the script is starting correct.

The post Configure zfs to start before proxmox or openstack appeared first on ISPIRE.ME.

Fix for broken vnc console on Openstack Essex under Debian/Ubuntu

$
0
0

Fix for broken vnc console on Openstack Essex under Debian/Ubuntu

Fix for broken vnc console on Openstack Essex under Debian/Ubuntu

The Openstack dashboard novnc console broke after the last two security release of essex openstack (2012.1.1-14/2012.1.1-15). Here is the solution Fix for broken vnc console on Openstack Essex under Debian/Ubuntu.

 

You will see an Error Message like this in your /var/log/nova/nova-consoleauth.log:

AUDIT nova.consoleauth.manager [req-6eb532ae-b024-4ada-8bb5-95ebc132dd2f None None] Checking Token: 32373fb4-c9ac-4f87-9418-7a6f13606874, True)
ERROR nova.rpc.amqp [req-6eb532ae-b024-4ada-8bb5-95ebc132dd2f None None] Exception during message handling
TRACE nova.rpc.amqp Traceback (most recent call last):
TRACE nova.rpc.amqp   File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 253, in _process_data
TRACE nova.rpc.amqp     rval = node_func(context=ctxt, **node_args)
TRACE nova.rpc.amqp   File "/usr/lib/python2.7/dist-packages/nova/consoleauth/manager.py", line 102, in check_token
TRACE nova.rpc.amqp     if token_valid and self._validate_console(token):
TRACE nova.rpc.amqp   File "/usr/lib/python2.7/dist-packages/nova/consoleauth/manager.py", line 91, in _validate_console
TRACE nova.rpc.amqp     console_valid = self.compute_api.validate_vnc_console(context,
TRACE nova.rpc.amqp NameError: global name 'context' is not defined
TRACE nova.rpc.amqp
ERROR nova.rpc.amqp [req-6eb532ae-b024-4ada-8bb5-95ebc132dd2f None None] Returning exception global name 'context' is not defined to caller
ERROR nova.rpc.amqp [req-6eb532ae-b024-4ada-8bb5-95ebc132dd2f None None] ['Traceback (most recent call last):n', '  File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 253, in _process_datan    rval = node_func(context=ctxt, **node_args)n', '  File "/usr/lib/python2.7/dist-packages/nova/consoleauth/manager.py", line 102, in check_tokenn    if token_valid and self._validate_console(token):n', '  File "/usr/lib/python2.7/dist-packages/nova/consoleauth/manager.py", line 91, in _validate_consolen    console_valid = self.compute_api.validate_vnc_console(context,n', "NameError: global name 'context' is not definedn"]

So I’ve looked for quick solutions to get rid with the broken python scripts and built this diff patch out of two merged fixes i found in the openstack git reviews repository.

To fix your nova-consoleauth do following steps:

First of all download the patch set: openstack_novnc.tar.gz  into a directory of your choice.

unpack the archive:

tar xvzf openstack_novnc.tar.gz


apply the patch diffs by running this commands on your root shell:

patch -p0 < api.py.diff
patch -p0 < manager.py.diff
patch -p0 < test_compute.py.diff

 

and one more important part is to restart the services after patching them:

service nova-api restart
service nova-console restart
service nova-consoleauth restart

The post Fix for broken vnc console on Openstack Essex under Debian/Ubuntu appeared first on ISPIRE.ME.


WordPress WP Tracklink Plugin

$
0
0

WordPress WP Tracklink Plugin

Wordpress WP Tracklink PluginWordPress WP Tracklink Plugin. Today i would like to introduce you my first Plugin. WP Tracklink Plugin tracks referrer links plus how often they have clicked and displays them on your WordPress widget sidebar. This will increase your page ranking due to backlink. Most clicked links gets an higher position in sidebar. Disabling specific links is possible via the settings tab.

You can download this plugin from this link: here or get it from the official wordpress.org plugin page.

Link to static page: here

Have fun!

The post WordPress WP Tracklink Plugin appeared first on ISPIRE.ME.

LVM on top of linux zfs to use Openstack with nova-volume

$
0
0

LVM on top of linux zfs to use Openstack with nova-volume

LVM on top of linux zfs to use Openstack with nova-volume
Did you ever wanted to know how to setup LVM on top of linux zfs to use Openstack with nova-volume? In this article i will describe this in a few easy steps based on my earlier mentioned how to about zfs on linux.

A common problem when using ZFS as storage for openstack is the lack of plugins that will cover as interface between nova-volume/cinder-volume and the block storage types. The volume service needs an LVM Volume group called nova-volumes as default.

In this how-to i will explain you step by step a workaround how to create an block storage device with zfs and get it into lvm.

Prerequisites:

 

Create a ZFS filesystem you will later use as LVM Group:

zfs create -V 500G storage/your_new_volume

The -V switch defines the size of the new created file-system. Change “storage” to you pool name.

Lets see how it looks like:

zfs list
Command Output:
NAME                            USED  AVAIL  REFER  MOUNTPOINT
storage/your_new_volume   516G  1.78T    76K  -

There you see your new created file-system without an mountpoint.

We now need to get its real device path:

file /dev/zvol/storage/your_new_volume
Command output: 
/dev/zvol/storage/your_new_volume: symbolic link to `../../<strong>zd0</strong>'

So our real device path is: /dev/zd0

Let’s do the magic part:

losetup /dev/loop2 /dev/zd0

And create a partition on that device:

fdisk /dev/loop2
(and hit: n p 1 ENTER ENTER t 8e w)

Finally we can create our LVM volume group:

pvcreate /dev/loop2
vgcreate nova-volumes /dev/loop2

 

We now need to make clear that the loop device gets mounted on the next boot:

Modify the file called /etc/rc.local in your preferred editor and enter following:

exec losetup /dev/loop2 /dev/zd0

And that’s it!

The post LVM on top of linux zfs to use Openstack with nova-volume appeared first on ISPIRE.ME.

Downgrade from Debian SID to Stable from Jessie to Wheezy

$
0
0

Downgrade from Debian SID to Stable from Jessie to Wheezy

Downgrade from Debian SID to Stable from Jessie to Wheezy

Logo of the Debian GNU/kFreeBSD project Credit: Debian/Open Use Logo Licence.

Downgrade from Debian SID to Stable from Jessie to Wheezy. This Tutorial describes the downgrade process you need to run to ge back stable rel after sid upgrade. Recently, a problem occurred on my server after i had upgraded my system with the SID repository in my sources.list. The Debian release jessie came out and after upgrading to this release some services no longer ran properly anymore. So I had to run a task to get back to Wheezy to recover the failing services.

So here are the few easy steps you will need to downgrade a Debian SID release to Wheezy or any kind of other release you like:

Important Update Note: Since new SID/Jessie release gets delivered with systemd as default,
It is important to switch back from systemd to sysv first before the downgrade process by doing:

apt-get install sysvinit-core sysvinit sysvinit-utils

Then reboot your server and remove all the systemd stuff!

apt-get remove --purge --auto-remove systemd

And continue with the previous downgrade tutorial steps:

First of all you have to remove or replace all SID tags from your /etc/apt/sources.list to your preffered target release

Mine sources.list file looks like this after changes have made:

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

deb http://cdn.debian.net/debian/ wheezy main contrib non-free
deb-src http://cdn.debian.net/debian/ wheezy main contrib non-free

Now we have to use the Apt-Pinning feature to get the correct default release tag for our apt downgrade

Modify or create the file /etc/apt/preferences and put following text in it:

Package: *
Pin: release a=stable
Pin-Priority: 1001

Important Update note: Replace a=stable with n=wheezy if you are running not the SID but Jessie final release!

At the next step we have to run the apt update and upgrade process for downgrading all packages

So you will need to enter these two commands to finish the downgrade process:

apt-get update
apt-get upgrade
apt-get dist-upgrade

Apt will ask you for downgrading all packages now.
Just say yes, let it go and pray that all packages getting installed and downgraded properly!

If some packages failing on downgrade you have to purge them by doing:

apt-get purge yourfailingpackage

And reinstall them with apt-get install yourfailingpackage after purging it.

The post Downgrade from Debian SID to Stable from Jessie to Wheezy appeared first on ISPIRE.ME.

Polling Observium Unix agent with SSH

$
0
0

Polling Observium Unix agent with SSH

Polling Observium Unix agent with SSH
 

In this How-To i will tell you how to receive the polling data from the UNIX agent: observium_agent over SSH. Especially if you need to monitor remote machines like amazon ec2 instances or other virtual machines the unix agent xinetd solutions which the project delivers seems not the securest way.

 

Prerequisites:

On Observium host:

  • php ssh2 module: libssh2-php
  • patchset for: unix-agent.inc.php

On target host:

  • snmpd daemon
  • /opt/observium/scripts/observium_agent goes to /usr/bin/
  • /opt/observium/scripts/agent-local goes to target dir see Wiki

 

Prepare your Target Host

apt-get install snmpd

See config example in:/opt/observium/snmpd.conf.example
And follow the steps as described in UNIX Agent Wiki expect the xinetd part!

 

Prepare your Observium Server

apt-get install libssh2-php

Patchset

What we now have to do is to modify the php code of the unix agent.
The easiest way doing this is to grab my patchset for the latest svn (tested with Revision: 4167) trunk.

Get it from this: link and unpack it into a directory of your choice.

unpack the archive:

tar xvzf observium.agent_.patch_.tar.gz

and apply the patch diffs to your php code:

patch -p0 < unix-agent.inc.php.diff

Create an authentication key for your remote SSH connection

mkdir /opt/observium/.ssh
ssh-keygen -t dsa -f /opt/observium/.ssh/id_dsa

and hit enter twice.

Set permissions of the ssh folder and transfer your pub key to the remote host:

chmod -R 0400 /opt/observium/.ssh
ssh-copy-id -i /opt/observium/.ssh/id_dsa.pub root@your.target.host.name

Check if SSH auth via newly created auth key works:

ssh -i /opt/observium/.ssh/id_dsa root@your.target.host.name

*Gotcha*


Important notice:
Think about how to make the key files and run of the observium_agent
on remote machine more secure by adding an independent user, change access privileges, use of sudo e.g if you are planing to run the observium server on public ip.

Finally we add the SSH Port from your listening remote machine to the config.php

For example:

vi /opt/observium/config.php

and apply this line in the config:

$config['unix-agent']['port'] = 22;

and the polling via secure shell is ready to run.

Final note: I’m aware of that my code is not perfect and probably buggy in special cases. So i would appreciate any suggestions for improvement!

Cheers!

The post Polling Observium Unix agent with SSH appeared first on ISPIRE.ME.

Cannot find device br-ex fix for openvswitch on openstack

$
0
0

Cannot find device br-ex fix for openvswitch on openstack

Cannot find device br-ex fix for openvswitch on openstack

During the installation of OpenStack on Debian Wheezy I noticed an unusual Behave. While booting up the networking task Debian complained about: Cannot find device br-ex. In this shortie i will give you an solution for that.

Since the upstart scripts are very susceptible in timing on Debian i tought myself why not start openvswitch before the networking script is loading?

So this is what we do now!

Prerequisites:

  • editor: your preferred one
  • insserv for enabling new init script
  • init script config tool: update-rc.d

Network interfaces like described in Openstack tutorial:

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255

auto eth1
iface eth1 inet manual
        up ifconfig $IFACE 0.0.0.0 up
	up ip link set $IFACE promisc on
	down ip link set $IFACE promisc off
        down ifconfig $IFACE down

auto br-ex
iface br-ex inet static
        address 1.2.3.2
        netmask 255.255.255.0
        network 1.2.3.0
        broadcast 1.2.4.254
        gateway 1.2.3.1
        dns-nameservers 8.8.8.8
        dns-search your.name

First of all we need to smash out the old LSB symlinks:

update-rc.d -f openvswitch-switch remove

make sure that the symlinks are gone by entering:

ls /etc/rc[0-9].d/*openvswitch-switch

if everything is clean do backup the original script:

cp /etc/init.d/openvswitch-switch /etc/init.d/openvswitch-switch.orig

Now here comes the magic:

The original LSB header part of openvswitch-switch looks like this:

### BEGIN INIT INFO
# Provides:          openvswitch-switch
# Required-Start:    $network $named $remote_fs $syslog
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Open vSwitch switch
### END INIT INFO

But we want to look it like this:

### BEGIN INIT INFO
# Provides:          openvswitch-switch
# Required-Start:    mountkernfs $local_fs urandom
# Required-Stop:     $local_fs
# X-Start-Before:    networking
# Default-Start:     S
# Default-Stop:      0 6
# Short-Description: Open vSwitch switch
### END INIT INFO

after you have edited openvswitch-switch and saved the changes you finally have to run update-rc.d again to get the symlinks corrected.

Enable it by running command:

insserv openvswitch-switch

and check if /etc/rcS.d/*openvswitch-switch exists.

You are ready to reboot now and check the results.

Happy fixing!

The post Cannot find device br-ex fix for openvswitch on openstack appeared first on ISPIRE.ME.

Tell Varnish to not cache Nginx or Apache HTTPAuth Requests

$
0
0

Tell Varnish to not cache Nginx or Apache HTTPAuth Requests

Tell Varnish to not cache Nginx or Apache HTTPAuth Requests

The Problem of having Varnish in front of Nginx or Apache is that Basic HTTP Authentication requests will be cached once you logged in. So every successful login session applys to all other clients also who visit your website. That is what we don’t want and might be in some situations a security risk.

So to passthrough HTTP Authorization requests without caching them, we need to add one more acl rule.

Simply extend your sub vcl_recv section with following code snippet:

    # dont cache httpauth
    if (req.http.Authorization || req.http.Authenticate) {
        return(pass);
    }

and restart your varnish instance then all should be fine!

The post Tell Varnish to not cache Nginx or Apache HTTPAuth Requests appeared first on ISPIRE.ME.

Install Mountain Lion 10.8.5 on Haswell ASRock Z87E-ITX Hackintosh

$
0
0

Install Mountain Lion 10.8.5 on Haswell ASRock Z87E-ITX Hackintosh

Install Mountain Lion 10.8.5 on Haswell ASRock Z87E-ITX Hackintoshsince Haswell CPU is now natively supported by Mountain LION 10.8.5 it is very easy to
All you need for that is a legal copy of Mountain Lion 10.8.5 from the App Store, the patched BIOS for your Asrock Z87E-ITX Mainboard, Unibeast 2.1 and USB Stick with 8GB space.

Prerequisites:

  • Asrock Z87E-ITX Mainboard
  • I used for my project energy efficiency 35 Watt CPU: Intel i5-4570T
    My whole system is consuming only 22 Watts at mid range load in that combo!
  • Mountain LION from App Store
  • Unibeast 2.1
  • PMPatched Z87E-ITX Bios
  • 8GB USB Stick

Optional like my Low Wattage Setup:

First of all we need to prepare our Mainboard with compatible BIOS which we can download here

Download and extract the content of the zip file to your USB Stick and plug it in your PC.
On boot up hit F6 and flash the shown Bios Update.

Now its time to prepare the Mountain Lion Installer USB Stick:

Insert your USB Stick to you Mac again and open the Disk Utility application.
Click on the USB Drive on the left pane then on the partiton tab to the right.
Choose:
Partition Layout: 1 Partition
Click Options choose: Master Boot Record
Format: Mac OS Extended (journaled)
then: Apply

Eject your USB Stick and reattach it to your Mac

Download Unibeast 2.1 from here and run it.

Choose your USB Stick as Destination and Choose Mac App Store Mountain Lion 10.8
Click continue and enter your password.

Now it will take some time to complete the preparation process.

Eject the stick after the process has completed and plug it in your PC.
Hit F11 on system powerup and boot your USB Stick.

After some time the Mac OS Installation screen will appear.

Before you can install Mountain Lion on your PC you have to prepare your Target disk first.
Goto Disk utility on the upper tab and follow the steps again as shown above again but choose your target hdd but select GUID partition scheme under options instead of Master Boot Record.
Apply then start the installation process and Choose your new partitioned HDD as target.

After the system have completed the install process it will reboot.

The important part now is to boot your System into safe mode with boot flags: -x because else it will hang on Apple loading screen. So at the boot loader prompt choose your hdd and just enter: – following x and hit enter.

After we have successfully booted up into Mountain Lion we finally have to download and install latest Multibeast 5.5 and install chimera 2.2 from there so booting from hdd without your attached prepared usb stick is possible, kext utility and add drivers for our new platform.

Install Mountain Lion 10.8.5 on Haswell ASRock Z87E-ITX Hackintosh

Results

Recommended Multibeast 5.5.3 Packages:

  • UserDSDT/DSDT-Free Installation
  • Drivers & Bootloaders > Bootloaders > Chimera v2.2.1 r2248
  • Drivers > Network > Intel hnak’s AppleIntelE1000e
  • Drivers > Misc > FakeSMC & FakeSMC Plugins
  • Customization > Generate CPU States
  • Customization > 1080P Display
  • Customization > Use KernelCache

For Audio/WLAN/Bluetooth:

  • HDAEnabler1.kext, audio_ALC1150 and audio_hdmi_8series from github by toleda Not necessary anymore since ALC1150 kext now included in newest Multibeast release 5.5.3
  • Bluetooth/Wifi: get the latest from osx86.net

If something went wrong after installing kext files and/or misconfigured Multibeast and System hanging in a boot loop,
i recommend you to plug your USB Stick again to your System and boot from the old bootloader with boot flag -x to get back into safe mode.

The post Install Mountain Lion 10.8.5 on Haswell ASRock Z87E-ITX Hackintosh appeared first on ISPIRE.ME.


I want to adopt Cloud but Where do I start?

$
0
0

I want to adopt Cloud but Where do I start?

I want to adopt Cloud but Where do I start?

Today, all that is related to the ICT world has heard of Cloud. No one questions whether or not the future or the benefits to an organization. But what is not yet clear is how to start the transition from IT models that currently have the organizations towards cloud models.
When you begin planning the transition to cloud computing models should always keep in mind the following:

Not be carried all at once to a cloud model, you can and should do so gradually . Each organization must decide its roadmap depending on the characteristics of your business, services provided, its strategic plan, etc..
Do not be all IT resources into a single deployment model. Moreover, most likely you will choose to have mixed deployment models – some resources in public cloud models and other private cloud models.
There are various service models and cloud application can be moved to a SaaS model (bring a self-developed application to a SaaS business application equivalent) or IaaS model (machines host the application in cloud environments).
Not everything has to be on cloud service models. Some resources will remain for a while in traditional models – for example business-critical applications don’t migrate until they gain experience within the organization in these models and generate enough confidence.

For the adoption of cloud models possible, should be a guideline in the process of provision and management of all IT resources (applications, platforms and infrastructure) that can be taken to a cloud service model.
When making the transition can take several methodologies. In essence all come to apply similar criteria. The important thing is to choose an already proven and apply.
The steps to follow:
Analyze what I have and what I have : What is my current situation?, what are the needs that I have to cover? What I have marked on my systems plan? What are the guidelines of the strategic plan of my company? All this will allow me to know what situation I am in, that I have set goals and commitments must fulfill.
Prioritize services to move Cloud solutions : prioritize when each organization should take into account the parameters that are most important to it depending on your business, goals, life cycle, etc.. The prioritization is based on global criteria related to the value it brings – benefits of migration to the cloud service (service quality, efficiency, etc..) – And the effort involved, resources required to make the migration (cost, time , etc.) -. The result will be a prioritization matrix to check the roadmap to follow in the transition.
Designing Roadmap : Once prioritized services provides an implementation strategy and planning migrations structured in short, medium and long term. Starting with those with a high value, low effort.
When available, the roadmap should assess IT provider which made hiring service models and deployment model. Important aspects to consider are the SLA’s, strength of the supplier, experience, etc..

With this in mind, I want to point out a few moments of forced cloud deployment models:

  • New projects
  • Technology refreshes cycles and obsolescence
  • Need test environments, pre-and / or training
  • Moments environments downsizing
  • Purchase of IT infrastructure (renovation, extensions)
  • Ultimately … all time that is being valued make a new investment

___________________________________________________________________________________

Author info : Asher ross is an expert technical writer from UK web hosting company eUkhost LTD. eUkhost has completed 11 successful years in Web hosting industry and specialized in deploying Cloud hosting solutions, Dedicated hosting and many more with free tech support and complete web hosting satisfaction.

The post I want to adopt Cloud but Where do I start? appeared first on ISPIRE.ME.

Remove query strings from static resources on WordPress

$
0
0

Remove query strings from static resources on WordPress

Remove query strings from static resources on WordPressSince page loading speed becoming more and more important for extending your google page rank,caching your blog pages on wordpress is a must and should be taken very seriously. But before you can cache content on your WordPress blog you need to prepare files to get cached successfully.

One part you could do and i describe here is caching your css and js files which you should deliver always staticly. But the main problem of caching these links is the version tag at the end of each file link, cache mechanism won’t just recognize it as cachable content. To prevent loading static content like css and js files dynamicly we have to get rid with the version tag “?ver=x.xx” by Remove query strings from static resources on WordPress Links.
In this short tutorial i will describe a possible solution for wordpress and show you how to do this automaticly by strip off these version tags out of your links to get a better result in caching.

 
I hope you already have created a child-theme out of your primary theme template. This should be preferred because changes you apply to your files won’t get overwritten on next Theme update.

All we are going to do now is extending your functions.php with a specific replace code.

So open your functions.php with your preferred file editor and add the following code at the end of the file:

// remove version query string by https://ispire.me
function _remove_query_string( $src ){
        $parts = explode( '?ver=', $src );
        return $parts[0];
}
add_filter( 'script_loader_src', '_remove_query_string', 15, 1 );
add_filter( 'style_loader_src', '_remove_query_string', 15, 1 );

After applying this codeset, wordpress is replaces each occuring “?ver=” tag automaticly.

Have Fun with it!

The post Remove query strings from static resources on WordPress appeared first on ISPIRE.ME.

The Hackers Guide to Python – Interview with Julien Danjou

$
0
0

The Hackers Guide to Python – Interview with Julien Danjou

The Hackers Guide to Python - Interview with Julien Danjou

Julien published his first book The Hackers Guide to Python and of course i didnt want to miss out on my chance to ask him some questions about his new work, Python and future plans.

So Julien, now you are asked to give me some input to fill up this Post 😉

Interview with Julien Danjou:

What made ​​you decide to write this book?
Julien: While discussing with other Python developers, I realized that many concepts and solutions I was talking them about were things they never heard about or didn’t thing it would be possible to do.

While working on OpenStack (a cloud computing platform written in Python) for 2 years I realized that we were working with a lot great Python hackers, and driving part of the innovation in the Python world.

We built and used a lot of tools to scale our millions of lines of Python code and make it work.

So I decided to compile all the information I had and the experience I gained into a book.

Who exactly should read this book? Which skills and knowledge should people have to read this book?
Julien: Any Python developer that already knows the language basics. It’s not an introduction to Python, the book does not explain the syntax or what a class is – it assumes you already know. I tried to write the book I would have read – and I’ve been doing Python for a few years now.
It covers more advanced topics and tools you want to use to build solid architecture.

How do you handle the Python GlobalInterpreter Lock? Or did it never bothered you? 😉
Julien: I basically don’t, and that’s what the book says. It’s not something you can’t avoid, so just ignore it and don’t try to do multithreading.
There’s other solutions, like using multiprocessing and service-oriented architecture which scales better.

What advantages do you see in Python compared to Node.js and similar?
Julien: The great force of Python is its philosophy of “batteries included” and its large ecosystem of library that have been there for a long time. I consider platform as Node.js and the Javascript language still young.
When it comes down to the language, they both are their pros and cons. I don’t think that either of them is a magic bullet for every situation.

Are you planning to write another book? Maybe about OpenStack?
Julien: Clearly written a book about OpenStack crossed my mind. I think that most people want to read books about how to deploy and operates OpenStack, and that’s not something I could write properly. I do develop OpenStack all day long, but I barely operate it.
However, if you want to develop on OpenStack, reading the Hacker’s Guide to Python can be really helpful.

Are there any new projects on which you engaged?
Julien: Not for now, though I still have a few ideas I would like to try in the next months. I admit that writing a book kept me busy for the last months and prevented me for starting anything else – but hopefully that’ll change!

I thank Julien for his short interview and hope i will hear something more about the future projects!

The Book The Hacker’s Guide to Python is available at http://julien.danjou.info/books/the-hacker-guide-to-python

Paperback Version: The Hackers Guide to Python

___________________________________________________________________________

About Julien Danjou:
Julien Danjou is a great expert in linux system engineering, software development especially python and works as an free software consultant in Paris/France. Julien is developing for interresting free software and open source projects like Debian Linux and is contributing to OpenStack and FreeDesktop.

The post The Hackers Guide to Python – Interview with Julien Danjou appeared first on ISPIRE.ME.

Replace WP-Cron with real cronjob for high traffic sites

$
0
0

Replace WP-Cron with real cronjob for high traffic sites

Remove query strings from static resources on WordPressYou all already know the pseudo cron which comes with wordpress is a pain and get called to often, to be honest at every visit of your blog. So i will give you some guidance to solve this issue.

The most described solution i found on the internet was doing cronjob for wp-cron.php by fetching the url: http://your.url/wp-cron.php?doing_wp_cron via wget/curl or equal.

But for me that was not sufficient since you can ran into problems when your blog using some security plugins which prevents remote execution of wp-cron. Remember the time as wp-cron.php got compromised a lot in past.

Another solution some other blogs describe is to do it by changing to wordpress webroot location and executing the script directly.

Well thats fine but since i wanted to automate this task even more and apply to multiple wordpress installations on same server i solved this by writing a small wrapper script which gets executed by the cronjob and then doing all the path finding to the wp-cron.php location itself.

First of all here is an example how your multiple server directory structure should look like on your webserver:

/storage/website.one/htdocs
/storage/website.two/htdocs
/storage/website.three/htdocs

We also asume in this tutorial that our webserver is running with userid/group: www-data and php cli is located at: /usr/bin/php

So let’s do it!

First of all open a empty file like wp-cronjob.php with your preferred text editor and save it to /storage/wp-cronjob.php with the following content:

<?php
// replace this search pattern to match your path
$vhostpath = '/storage/*/htdocs/wp-cron.php';

foreach (glob("{$vhostpath}") as $wpcron) {
     if(file_exists($wpcron))
     {
         //file found, we change dir and execute it
         chdir(dirname($wpcron));
         include $wpcron;
     }
};
?>

We need to give our cron wrapper the right privileges like we want to run our cronjob with same rights as the webserver userid/group:

chown www-data:www-data /storage/wp-cronjob.php

Edit and attach following code snippet before the line: “/* That’s all, stop editing! Happy blogging. */” in your wp-config.php file:

define('DISABLE_WP_CRON', 'true');


And finally we prepare the linux cronjob to run our wrapper every 10 minutes by opening empty file:
/etc/cron.d/wp-cronjob in our preferred text editor and attaching this line:

*/10 * * * * www-data /usr/bin/php /storage/wp-cronjob.php >/dev/null

Replace WP-Cron with real cronjob for high traffic sites

A good description about the cronjob scheduling definitions you can read: Here

Now check if your cron task is running correctly every 10 minutes by watching the syslog:

tail -f /var/log/syslog

And there we go!

The post Replace WP-Cron with real cronjob for high traffic sites appeared first on ISPIRE.ME.

Fix yosemite rtc alarm wakeup issue

$
0
0

Fix yosemite rtc alarm wakeup issue

Fix yosemite rtc alarm wakeup issue

Fix yosemite rtc alarm wakeup issue


After installing new Apple Mac OS X 10.10 Yosemite i ran into an issue were my Macbook Pro wokeup every few hours with lid closed which was very irritating me. After every periodical wakeup my Macbook Pro showing me messages like “Wake reason: RTC (Alarm)” in my syslog. In this snippet i tell you howto Fix yosemite rtc alarm wakeup issue.

First of all, we backup the original file to be safe if something going wrong or for the case we wanna revert the changes later. Open your terminal app and copy following:

To check what causes the wake up of your Mac you can use following handy command in your terminal:

syslog |grep -i "Wake reason"

So if the wakeup reason is something like “Wake reason: RTC (Alarm)” it might be the bonjour multicast feature which prevents your Mac to stay chill in sleep mode.

Backup:

sudo [ -f ~/Downloads/com.apple.discoveryd.plist ] && echo "File already there. Not overwriting it" || cp -a /System/Library/LaunchDaemons/com.apple.discoveryd.plist ~/Downloads/

To disable and prevent the wake reason, we need to edit the plist file with your prefered editor like:

sudo vi /System/Library/LaunchDaemons/com.apple.discoveryd.plist

Next move down to the key “ProgramArguments” and append this string to it:

<string>--no-multicast</string>

so it finally looks like this:

       <key>ProgramArguments</key>
        <array>
                <string>/usr/libexec/discoveryd</string>
                <string>--udsocket</string>
                <string>standard</string>
                <string>--loglevel</string>
                <string>Basic</string>
                <string>--logclass</string>
                <string>Everything</string>
                <string>--logto</string>
                <string>asl</string>
                <string>--no-multicast</string>
        </array>

Be sure to have no typos or misleading characters e.g. inserted into plist file or your Mac won’t boot anymore. So better make a backup of that file before changing it.

To make sure that the plist changes are correct you can check the file syntax by entering following command:

plutil /System/Library/LaunchDaemons/com.apple.discoveryd.plist

If everything looks fine. Reboot your system, so it loads the new plist file. Now you have to re-enable Wifi and connect to your Accesspoint. After that change you will realize that the Wifi signal icon won’t show its signal strenght anymore but Wifi is still connected and seem to work fine. So a waking up Mac was a bader option for me than this wakeup fix.
One more note: Printer and NAS/NFS/Samba/AFP Shares e.g. will still reachable by it’s IP/Hostname.
So you can add it again by its IP adress/netpath without auto discovery service.

If something still went wrong or to Restore the changes to original ones you have to enter this command which copies the backup file back to its origin location which we saved by Backup task before:

sudo cp -a ~/Downloads/com.apple.discoveryd.plist /System/Library/LaunchDaemons/

Update:
I found another way to automate this task by using the MacOS internal command PlistBuddy.

So all you have to do now is executing following command in your terminal app:

sudo /usr/libexec/PlistBuddy -c "Add :ProgramArguments: string --no-multicast" /System/Library/LaunchDaemons/com.apple.discoveryd.plist

and reboot the system or run following:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist

To revert the last change if something went wrong enter this command:

sudo /usr/libexec/PlistBuddy -c Revert /System/Library/LaunchDaemons/com.apple.discoveryd.plist

12/22/2014: Update — Testers wanted!
Please try my new suggestion to solve this issue and report!

I was playing around with the same issue one more time and disabled the date/time automatic sync and timezone detection on my Macbook.
Date & Time > Disable/Uncheck: Set date and time automatically
Time Zone > Disable/Uncheck: Set time zone automatically using current location

And guess what?
My Macbook did not woke up yet. Finally looks like it having the same effect than disabling Multicast but without all the flaws that came with the previous workaround.

So finally it should look like this:
fix-yosemite-rtc-alarm-wakeup-issue-date-time

and this (select your suitable Timezone if field is empty!):
fix-yosemite-rtc-alarm-wakeup-issue-timezone

Leave me a comment which solution works for you please!

Extra Bonus: I have encountered one more switch in new discoveryd.
Wondering: Why computer name changing constantly?

Here is the fix: https://ispire.me/computer-name-changing-constantly-yosemite/

Thats all folks!

The post Fix yosemite rtc alarm wakeup issue appeared first on ISPIRE.ME.

Viewing all 50 articles
Browse latest View live




Latest Images