Move WFV

Written by r2d2. Posted in PHP, Tips, Wordpress

Transfer WP file version to an other site?

You will need to recalculate the data location length.

Here is a quick made converter.

<?php

/*
Hvis WFV (WP file version) SQL-data skal flyttes til anden webside, kræves det en genberegning af direktorie+fil længe. 

a:4:{s:4:"size";s:6:"2.05Mb";s:4:"path";s:75:"/var/www/htdocs/public_html/noah.crysberg.dk/wp-content/wfv_files/Certifikater.pdf";s:4:"name";s:16:"Certifikater.pdf";s:4:"type";s:3:"pdf";}
                                          ~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Input: filename.sql
Output: NEW-filname.sql
*/

$filename="wp_wfv_files.sql";

$reg='|.*path\\\";s:([0-9]{1,3}):(\\\".*?\\\")|i';

if ($file = fopen($filename, "r")) {
	while(!feof($file)) $a[] = fgets($file);
	fclose($file);
}



$file = fopen("NEW-".$filename, "w");
foreach ($a as $key => $line) { 
	$line = preg_replace_callback(
		$reg,
		function ($matches) {
			return str_replace( 'path\\";s:'.$matches[1], 'path";s:'.(strlen($matches[2])-4), $matches[0]);
		},
		$line
	);
	fwrite($file, $line);
//	echo $line;    	
}
fclose($file);
		
?>

 

24 views

Install Google Chrome

Written by r2d2. Posted in Linux, Tips

Google Chrome isn’t in the repositories – however, Chromium is.

Google Chrome is only available for 64-bit Linux. I’ve included directions for 64 below.

To install Google Chrome, run the following:

sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb

If error messages pop up after running the command sudo dpkg -i google-chrome*.deb then run the command

sudo apt-get install -f

and then re-run the previous command. The error messages mentioned should include something similar to

google-chrome-stable depends on [lib-example]; however; Package [lib-example] is not installed.

This installs a needed library for Google Chrome, then downloads the latest version of Chrome to a temporary directory and installs it. Run google-chrome to start the browser.

During the installation a PPA is added to your system so that Google Chrome receives the latest updates whenever you check for system updates.

32 views

Unable to create symlink “/etc/pam.d/vmtoolsd” pointing to file “/usr/lib/vmware-tools/configurator/pam.d/vmtoolsd-x64”.

Written by r2d2. Posted in Linux

This Issue come from the Missing /etc/pam.d directory so to Solve is
Create it: mkdir /etc/pam.d


Before running VMware Tools for the first time, you need to configure it by
invoking the following command: “/usr/bin/vmware-config-tools.pl”. Do you want
this program to invoke the command for you now? [yes]

Unable to create symlink “/etc/pam.d/vmtoolsd” pointing to file
“/usr/lib/vmware-tools/configurator/pam.d/vmtoolsd-x64”.

Execution aborted.

62 views

Using the ESX esxcli command to power off a virtual machine

Written by r2d2. Posted in ESX

Using the ESXi esxcli command to power off a virtual machine

The esxcli command can be used locally or remotely to power off a virtual machine running on ESXi 5.x or later. For more information, see the esxcli vm Commands section in the vSphere Command-Line Interface Reference.

  1. Open a console session where the esxcli tool is available, either in the ESXi Shell, the vSphere Management Assistant (vMA), or the location where the vSphere Command-Line Interface (vCLI) is installed.
  2. Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file by running this command:esxcli vm process list
  3. Power off the virtual machine from the list by running this command:esxcli vm process kill --type= [soft,hard,force] --world-id= WorldNumber

    Notes:

    • Three power-off methods are available. Soft is the most graceful, hard performs an immediate shutdown, and force should be used as a last resort.
    • alternate power off command syntax is: esxcli vm process kill -t [ soft,hard,force] -w WorldNumber
  4. Repeat Step 2 and validate that the virtual machine is no longer running.
84 views

Synology – Hyper Backup not completing

Written by leif. Posted in Synology, Tips

Reverting to a previous version of HyperBackup fixed my problem.

I manually install the previous version of HyperBackup it can be found here: http://download.synology.com/download/Package/spk/HyperBackup/2.0.1-0384/

You need to uninstall the current version first, then manually install the previous version using the .sdk that matches your hardware.

Make sure that HyperBackup isn’t set to auto update.

I keep a backup of the last working version of HyperBackup here 😉

HyperBackup-armada38x-2.0.1-0384.spk
HyperBackup-armada370-2.0.1-0384.spk
HyperBackup-armada375-2.0.1-0384.spk
HyperBackup-armadaxp-2.0.1-0384.spk
HyperBackup-armv5-2.0.1-0384.spk
HyperBackup-armv7-2.0.1-0384.spk
HyperBackup-comcerto2k-2.0.1-0384.spk
HyperBackup-hi3535-2.0.1-0384.spk
HyperBackup-i686-2.0.1-0384.spk
HyperBackup-monaco-2.0.1-0384.spk
HyperBackup-ppc-2.0.1-0384.spk
HyperBackup-x86_64-2.0.1-0384.spk

To find out which version to download I downloaded HyperBackup from Synology.com download section for compareation.

70 views

Rapberry Pi – on-screen keyboard

Written by leif. Posted in Tips

On-Screen keyboard
Installing the on-screen keyboard is not the solution to develop software or write long text documents on the Raspberry PI, but it is a must-to-have to make complete the user interaction options. Installing the keyboard is a very simple operation that can be done with a single command from the terminal:

sudo apt-get install matchbox-keyboard

just as it is explained in the product document page on Element14. The documentation says that the keyboard (after installation and reboot) is accessible on-screen from the Menu->Accessories->Keyboard. Doing several installations I have verified that the keyboard is not always listed as a new menu option; one of the reasons depends on the previous presence of a physical keyboard connected to the Raspberry or not. To be sure that the on-screen keyboard is added to the desktop menu after installation the better choice is to manage the Raspberry PI from remote via SSH.

The on-screen keyboard can be shown by your applications or bash scripts with the command

matchbox-keyboard
149 views

gnome layout manager

Written by leif. Posted in Linux

https://github.com/bill-mavromatis/gnome-layout-manager

For the Windows 10 theme, also install this plugin:

https://extensions.gnome.org/extension/1160/dash-to-panel/

An icon taskbar for the Gnome Shell. This extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel

 

69 views

Proxmox – add new disk – quickguide

Written by leif. Posted in Linux, Proxmox, Tips

cfdisk /dev/sda
mkfs.ext3 /dev/sda1
mkdir /disk2
blkid /dev/sda1

nano /etc/fstab
indsæt UUID=”97174799-0902-43b7-86d3-e42417xxxxxx” /disk2 ext3 errors=remount-ro 0 1
mount /disk2

Proxmox – log out and then back in
Datacenter/storage/add/Directory
id: Disk2
Directory: /disk2
Content: Diskimage/Container template

106 views

Network configuration

Written by leif. Posted in Linux, Netværk

Manual configuration with root credentials of the network config file, which is the responsible for the IP information in my debian system. The file name is /etc/network/interfaces I will first make backup of my original file as /etc/network/interfaces.bak and then proceed for the changes /etc/network/interfaces

mv /etc/network/interfaces /etc/network/interfaces.bak

sudo nano /etc/network/interfaces

I will change  the value like this

auto lo
iface lo inet loopback


#My IP description
# IPv4 address
iface eth0 inet static
	address	192.168.1.100
	netmask	255.255.255.0
	network	192.168.1.0
	broadcast 192.168.1.255
	gateway	192.168.1.1
248 views