Author: admin

  • xml2array

    This code is not written by me! /** * xml2array() will convert the given XML text to an array in the XML structure. * Link: http://www.bin-co.com/php/scripts/xml2array/ * Arguments : $contents – The XML text * $get_attributes – 1 or 0. If this is 1 the function will get the attributes as well as the tag…

  • Dump mysql tables with mysqldump

    Here is a script for dumping tables from all databases in MySql. #!/bin/bash # ************************************************************* # file: mysqldump.sh # date: 2011-12-22 00:22 # author: (c) by Mats Ahlbom – mats@ahlbom.nu # description: Get a mysqldump-file for eath table in all databases # ************************************************************* # name of database user ( must have LOCK_TABLES rights )… dbUsername=”mythtv”…

  • Mythubuntu not open port 6543

    After upgrade of MythBuntu the system do not open port 6543. After running: sudo dpkg-reconfigure mythtv-common sudo dpkg-reconfigure mythtv-database the port is open and MythBuntu are working!

  • Find string and remove file

    You can use this to find a string in a file and remove the file. find . | xargs grep -l youemail@email.com | awk ‘{print “rm “$1}’ > doit.sh Look in file doit.sh for errors. Execute the file: bash doit.sh

  • Copy partition table using dd

    dd if=/dev/source of=/dev/dest bs=512 count=1

  • mdadmin

    Rescan md-device mdadm –assemble –scan Stop md-device Stop all service using device, samba, nfs mdadm –manage –stop /dev/md0 Readd md-device mdadm –manage –add /dev/md0 /dev/sdc2 Force Assemble sudo mdadm –assemble –run –force /dev/md127 /dev/sd[abdc]3

  • Software RAID monitoring in Zabbix

    To monitor software RAID in Zabbix 1.8 you need to make following changes in Zabbix: in /etc/zabbix/zabbix-agent*.conf on client add in the end of the file: #CONTROLLO RAID UserParameter=custom.mdstat,/bin/cat /proc/mdstat | grep -c _ You need to restart zabbix Agent sudo service zabbix-agent restart On the Zabbix server add to the Linux Template: Items: Host:…

  • Uppdatera WordPress

    Efter att blivit hackad frågar man sig, varför har man inte uppdaterat WordPress tidigare? Eftersom det är enkelt att uppdatera borde man alltid ha senaste WordPress installerat! Tyvärr var det inte så, utan jag fick läsa tillbaka en gammal backup. Därför förlorade jag posterna från senaste 2 månaderna.

  • Ändra MYSQL datadir

    Som root behöver man göra följande steg för att kunna ändra mysqls databas katalog (datadir): /etc/init.d/mysql stop cp -rp /var/lib/mysql  /new/mysql/dir vi /etc/apparmor.d/usr.sbin.mysqld Lägg till dessa rader innan avslutande } : /new/mysql/dir r, /new/mysql/dir/** rwk, /etc/init.d/apparmor restart vi /etc/mysql/my.cnf Ändra datadir till din nya katalog: datadir=/var/lib/mysql till: datadir=/new/mysql/dir Starta sedan om mysql: /etc/init.d/mysql restart

  • Queues in Asterisk

    ================= Building Queues ================= Written by: Leif Madsen Initial version: 2010-01-14 In this article, we’ll look at setting up a pair of queues in Asterisk called ‘sales’ and ‘support’. These queues can be logged into by queue members, and those members will also have the ability to pause and unpause themselves. All configuration will be…