How to open Vmware ESX firewall for zabbix
Create a file in /etc/vmware/firewall/zabbix.xml
Contents of zabbix.xml
<configroot>
<br />
<service id="4000"></service>
<id>zabbix</id>
<rule id="0000"></rule>
<direction>inbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>10050</port>
<enabled>true</enabled>
<required>true</required>
Refresh the ESX cli firewall ruleset
# esxcli network firewall refresh
Tuesday, June 4, 2013
Sunday, November 25, 2012
AeroFS and symlinks
Start an Administrator Command shell CMD.EXE. Use mklink to create a directory symbolic link of your Pictures folder inside the AeroFS folder. This way your Pictures Folder will peer2peer sync between your computers.
Change directory to your AeroFS document folder:
C:\> cd C:\Users\username\Documents\AeroFS
C:\Users\username\Documents\AeroFS> mklink /D Pictures C:\User\username\Pictures\
//Christian
Change directory to your AeroFS document folder:
C:\> cd C:\Users\username\Documents\AeroFS
C:\Users\username\Documents\AeroFS> mklink /D Pictures C:\User\username\Pictures\
//Christian
Wednesday, November 21, 2012
How to template eth0 ip address with Saltstack Jinja
You can test the output of salt network interfaces with
# salt 'some-machine' network.interfaces
Here is the Salt state file, we will write /etc/haproxy/haproxy.cfg with the context of the eth0 ip address
Below is the content of haproxy.sls
#
# Write /etc/haproxy/haproxy.cfg
#
/etc/haproxy/haproxy.cfg:
file.managed:
- source: salt://files/etc/haproxy/haproxy.cfg
- user: root
- group: root
- mode: 640
- template: jinja
- context:
ip: {{ salt['network.interfaces']()['eth0']['inet'][0]['address'] }}
file referenced in source: salt:// above content of files/etc/haproxy/haproxy.cfg
the important part is to write the variable in thise case ip as {{ variable }}
listen stats {{ ip }}:10000
Saturday, October 20, 2012
Getting the sound to work on Alienware M17xR4 laptop with Ubuntu 12.10
Getting the sound to work on Alienware M17xR4 laptop with Ubuntu 12.10 and kernel 3.6.0-030600-generic.
I've installed kernel 3.6 from the kernel PPA
# wget -nd http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-image-3.6.0-030600-generic_3.6.0-030600.201209302035_amd64.deb
# dpkg -i linux-image-3.6.0-030600-generic_3.6.0-030600.201209302035_amd64.deb
Edit the file /etc/modprobe.d/alsa-base.conf and add a snd-hda intel line at the end.
snd-hda-intel index=0 model=dell-m6-amic
Reboot
Enjoy both speakers, headphones and sound input works.
I've installed kernel 3.6 from the kernel PPA
# wget -nd http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-image-3.6.0-030600-generic_3.6.0-030600.201209302035_amd64.deb
# dpkg -i linux-image-3.6.0-030600-generic_3.6.0-030600.201209302035_amd64.deb
Edit the file /etc/modprobe.d/alsa-base.conf and add a snd-hda intel line at the end.
snd-hda-intel index=0 model=dell-m6-amic
Reboot
Enjoy both speakers, headphones and sound input works.
Sunday, February 26, 2012
How to convert from Oracle Virtualbox virtual machines to VmwWare Fusion on Mac OS X
How to convert virtual machines from Oracle Virtualbox to VmwWare Fusion on Mac.
I have tested succesful virtual machine export from Virtualbox to VmWare fusion with Centos 6
& Windows 7. Here are the instructions
In Virtualbox first export your virtual machines as a ova files using the Export tool.
The .ova files Virtualbox exports are standard UNIX tar balls.
Open a Mac terminal windows.
type $ tar xvf virtualmachine.ova
you will now get a virtualmachine-disk1.vmdk
Go ahead an uninstall Virtualbox and then install VmWare Fusion
In VmWare Fusion, Choose New
* Use an existing harddisk
Point to virtualmachine-disk1.vmdk
Pick the choice
* Make a separate copy of the harddisk
VmWare Fusion will prompt you that the harddisk was created with an earlier version
of VmWare/Virtualbox and ask if you would like to convert the harddisk to the new film format?
Choose Yes.
You should now be at Use an existing virtual disk.
Click Continue.
Choose the operating system that the viretalbox virtual machine used.
Click Finish!
That is it.
Saturday, June 4, 2011
Lets replicate ZFS with GlusterFS 3.0.8
Lab example cluster of 2x ZFS server nodes ubuntu and ubuntu2 with ZFS distributed via Gluster in RAID1 fashion.
I saw som strange sized files on the glusterfs client when powering down one of the server nodes deliberately.
Installing GlusterFS
# apt-get install libibverbs1
# wget -nd http://download.gluster.com/pub/gluster/glusterfs/3.0/3.0.8/Ubuntu/glusterfs_3.0.8-1_amd64.deb
# dpkg -i glusterfs_3.0.8-1_amd64.deb
Make sure both server/client nodes have the same /etc/host info
root@ubuntu:~# cat /etc/hosts
127.0.0.1 localhost
192.168.1.120 ubuntu
192.168.1.149 ubuntu2
node ubunu
# zpool create tank sdb
node ubunu2
# zpool create tank sdb
node ubuntu
# zfs create tank/neo
node ubuntu2
# zfs create tank/trinity
# glusterfs-volgen -n myvol --raid=1 ubuntu:/tank/neo ubuntu2:/tank/trinity
Copy config files created by volgen
# cp ubuntu-myvol-export.vol /etc/glusterfs/glusterfsd.vol
# scp ubuntu2-myvol-export.vol ubuntu2:/etc/glusterfs/glusterfsd.vol
Start up Gluster
root@ubuntu:~# /etc/init.d/glusterfsd start
* Starting glusterfs server glusterfsd
...done.
root@ubuntu2:~# /etc/init.d/glusterfsd start
* Starting glusterfs server glusterfsd
...done.
# mount -t glusterfs myvol-tcp.vol /mnt/glusterfs/
# echo morpheus > /mnt/glusterfs/test.file
Thanks LLNL & GlusterFS developers
I saw som strange sized files on the glusterfs client when powering down one of the server nodes deliberately.
Installing GlusterFS
# apt-get install libibverbs1
# wget -nd http://download.gluster.com/pub/gluster/glusterfs/3.0/3.0.8/Ubuntu/glusterfs_3.0.8-1_amd64.deb
# dpkg -i glusterfs_3.0.8-1_amd64.deb
Make sure both server/client nodes have the same /etc/host info
root@ubuntu:~# cat /etc/hosts
127.0.0.1 localhost
192.168.1.120 ubuntu
192.168.1.149 ubuntu2
node ubunu
# zpool create tank sdb
node ubunu2
# zpool create tank sdb
node ubuntu
# zfs create tank/neo
node ubuntu2
# zfs create tank/trinity
# glusterfs-volgen -n myvol --raid=1 ubuntu:/tank/neo ubuntu2:/tank/trinity
Copy config files created by volgen
# cp ubuntu-myvol-export.vol /etc/glusterfs/glusterfsd.vol
# scp ubuntu2-myvol-export.vol ubuntu2:/etc/glusterfs/glusterfsd.vol
Start up Gluster
root@ubuntu:~# /etc/init.d/glusterfsd start
* Starting glusterfs server glusterfsd
...done.
root@ubuntu2:~# /etc/init.d/glusterfsd start
* Starting glusterfs server glusterfsd
...done.
# mount -t glusterfs myvol-tcp.vol /mnt/glusterfs/
# echo morpheus > /mnt/glusterfs/test.file
Thanks LLNL & GlusterFS developers
Installing ZFS in Ubuntu 10.04
This a one row install of ZFS in Ubuntu(tested on 10.04)
# apt-get -y install build-essential gawk alien fakeroot linux-headers-$(uname -r) zlib1g-dev uuid-dev libblkid-dev libselinux-dev parted lsscsi && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1EE8660B && echo deb http://ppa.launchpad.net/dajhorn/zfs/ubuntu $(uname -r) main > /etc/apt/sources.list.d/zfs.list && apt-get update && apt-get -y install zfsThursday, May 26, 2011
Ubuntu ZFS backup server with dedup
----- Ubuntu 10.04 Backup Server ZFS install -----
Get ZFS on Linux from Lawrence Livermore National Laboratory thanks! :)
Get ZFS on Linux from Lawrence Livermore National Laboratory thanks! :)
# apt-get install build-essential gawk alien fakeroot linux-headers-$(uname -r) zlib1g-dev uuid-dev libblkid-dev libselinux-dev parted lsscsi
# echo "deb http://ppa.launchpad.net/dajhorn/zfs/ubuntu lucid main" > /etc/apt/sources.list.d/zfs.list
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0D18601A1EE8660B
# apt-get update && apt-get install zfs spl
----- Backup Server ZFS setup -----
# zpool create backup raidz1 sdc sdf sdg sdh spare sdi
# zfs create backup/admin-mac-mini
# zfs set dedup=on backup
------ Backup Server /etc/rsyncd.conf ------
numeric ids = true
read only = false
secrets file = /etc/rsyncd.secrets
uid = root
[admin-mac-mini]
# Owner: Christian Nygaard
path = /backup/admin-mac-mini
log file = /backup/admin-mac-mini/backup.log
auth users = admin-mac-mini
post-xfer exec = /usr/local/bin/zfs-snapshot $RSYNC_MODULE_PATH
---- Backup Server /etc/rsyncd.secrets ----
admin-mac-mini:secretpassword
---- Backup Server /usr/local/bin/zfs-snapshot ----
#!/bin/bash
#
# Usage: /usr/local/bin/zfs-snapshot /backup/zfsfilesystem
#
ZFSVOL=`echo $1 | sed -e 's+^/++g'`
zfs snapshot $ZFSVOL@`date "+%F_%R"`
----- Backup client backup -----
RSYNC_PASSWORD=secretpassword rsync -a --delete /Users/chris admin-mac-mini@backup.example.org::admin-mac-mini
----- Backup client restore -----
rsync admin-mac-mini@backup.example.org::admin-mac-mini /Users/chris/restore
----- Backup Server list backups ----
# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
backup/admin-mac-mini@2011-05-26_13:16 0 - 91.4G -
backup/admin-mac-mini@2011-05-26_13:31 43.4K - 91.4G -
Thursday, April 21, 2011
Asterisk recepie for Openwrt
$ opkg update
$ opkg install asterisk18 asterisk18-codec-ulaw asterisk18-codec-g726 asterisk18-codec-g722 asterisk18-codec-alawroot@OpenWrt:~# cat /etc/asterisk/sip.conf
[general]
port = 5060
bindaddr = 0.0.0.0
context = default
[1000]
type=friend
secret=1000
#qualify=yes ;latency must be under 2000ms.
nat=yes
host=dynamic ; the devices can be registered with different IPs each time
canreinvite=no ; Asterisk by default redirects
context=internal ; the context of the extensions.conf file
[1001]
type=friend
secret=1001
#qualify=yes ;latency must be under 2000ms.
nat=yes
host=dynamic ; the devices can be registered with different IPs each time
canreinvite=no ; Asterisk by default redirects
context=internal ; the context of the extensions.conf file
[1002]
type=friend
secret=1002
#qualify=yes ;latency must be under 2000ms.
nat=yes
host=dynamic ; the devices can be registered with different IPs each time
canreinvite=no ; Asterisk by default redirects
context=internal ; the context of the extensions.conf file
root@OpenWrt:~# cat /etc/asterisk/extensions.conf
[others]
[internal]
exten => 1000,1,Dial(SIP/1000)
exten => 1001,1,Dial(SIP/1001)
exten => 1002,1,Dial(SIP/1002)
# /etc/init.d/asterisk restart
Firewall
add the following to /etc/config/firewall to allow SIP traffic
config rule
option src wan
opption proto tcp
option dest_port 5060
option target ACCEPT
Reload your firewall rules
# /etc/init.d/firewall reload
Examine firewall rules and check that 5060 is accepted on zone WAN
# iptables -L -v
Install dyndns.org update script
opkg update
opkg install ddns-scripts
vi /etc/config/ddns
Wednesday, April 20, 2011
Asterisk recepie for Ubuntu
This guide will show how to install a small asterisk PBX in the cloud on a VPS that you and your friends can use to call each other for free using SIP applications on Android, Iphone and Ipad. I have tested this configuration with Sipdroid(Android) and Acrobits Softphone(Iphone,Ipad).
file asterisk.pp, please change node name styx to your hostname, please change secrets
###########
class asterisk
{
package { "asterisk": ensure => installed }
exec { "sip.conf" : command => "/bin/echo '
[general]
port = 5060
bindaddr = 0.0.0.0
context = default
[1000]
type=friend
secret=1000
#qualify=yes ;latency must be under 2000ms.
nat=yes
host=dynamic ; the devices can be registered with different IPs each time
canreinvite=no ; Asterisk by default redirects
context=internal ; the context of the extensions.conf file
[1001]
type=friend
secret=1001
#qualify=yes ;latency must be under 2000ms.
nat=yes
host=dynamic ; the devices can be registered with different IPs each time
canreinvite=no ; Asterisk by default redirects
context=internal ; the context of the extensions.conf file
[1002]
type=friend
secret=1002
#qualify=yes ;latency must be under 2000ms.
nat=yes
host=dynamic ; the devices can be registered with different IPs each time
canreinvite=no ; Asterisk by default redirects
context=internal ; the context of the extensions.conf file
' > /etc/asterisk/sip.conf"
}
exec { "extensions.conf" :
command => "/bin/echo '
[others]
[internal]
exten => 1000,1,Dial(SIP/1000)
exten => 1001,1,Dial(SIP/1001)
exten => 1002,1,Dial(SIP/1002)
' > /etc/asterisk/extensions.conf"
}
}
node styx
{
include asterisk
}
$ sudo puppet -d asterisk.pp
After this you may need to restart asterisk
$ sudo service asterisk restart
Subscribe to:
Posts (Atom)