sed tips

sed -i ‘s/fengo/dressholic/g’ * 

sed -i ‘s/Fengo/Dressholic/g’ * 

search folders for file type recurisvely and replace text in file

find . -type f -exec sed -i.bak “s/fengo/dressholic/g” {} \; 

find . -type f -exec sed -i.bak “s/Fengo/Dressholic/g” {} \; 

delete files in folders with extension

find . -name “*.bak*” -type f -delete

In Unix, how do I find a user’s UID or GID?

In Unix, how do I find a user’s UID or GID?

To find a user’s UID or GID in Unix, use the id command. To find a specific user’s UID, at the Unix prompt, enter:

  id -u username

Replace username with the appropriate user’s username. To find a user’s GID, at the Unix prompt, enter:

  id -g username

If you wish to find out all the groups a user belongs to, instead enter:

  id -G username

If you wish to see the UID and all groups associated with a user, enter id without any options, as follows:

  id username

invalid app Id: Must be a number or numeric string representing the application id. FB.getLoginStatus() called before calling FB.init().

this was my original code

(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id; js.async = true;
js.src = "//connect.facebook.net/{/literal}{$st_lb_locale}{literal}/all.js#xfbml=1;
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

I tried to add FB.init above it with app id but I get an error that FB.init was already called.

FB.init has already been called – this could indicate a problem

“From the moment you pass parameters to the js.src like #xfbml=1&appId=X, FB SDK will auto init itself and thus FB.init will try to reinit.. So in your code, you don’t have to remove the FB.init function, just make sure you don’t pass parameters in the code that loads asynchronously the JS SDK.”

So either use all.js or use the sdk.js

so change it to

(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id; js.async = true;
js.src = "//connect.facebook.net/{/literal}{$st_lb_locale}{literal}/all.js#xfbml=1&appId=<your app id>;
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

http://stackoverflow.com/questions/10415884/fb-init-has-already-been-called

Prestashop – Create Unique Reference ID with Product Combinations Generator

I use the prestashop amazon module and Amazon requires a unique reference number per combination. To save time modifying each reference I modified the combinations generator controller. If you have tons of attributes this will save you tons of time.

I’m pretty noob at this kind of stuff but it works. If you know a better way to do this let me know.

Thanks, zeki893

Here we go:

open AdminAttributeGeneratorController.php

Look for function addAttribute

You’ll see

foreach ($attributes as $attribute)
{
$price += (float)preg_replace('/[^0-9.-]/', '', str_replace(',', '.', Tools::getValue('price_impact_'.(int)$attribute)));
$weight += (float)preg_replace('/[^0-9.]/', '', str_replace(',', '.', Tools::getValue('weight_impact_'.(int)$attribute)));
}

I modified it into

foreach ($attributes as $attribute)
{
$price += (float)preg_replace('/[^0-9.-]/', '', str_replace(',', '.', Tools::getValue('price_impact_'.(int)$attribute)));
$weight += (float)preg_replace('/[^0-9.]/', '', str_replace(',', '.', Tools::getValue('weight_impact_'.(int)$attribute)));

//get the attributes name
$sqltest = 'SELECT * FROM `attribute_lang` WHERE `id_attribute` = '. $attribute .' LIMIT 0 , 1';
if ($resultstest = Db::getInstance()->ExecuteS($sqltest))
foreach ($resultstest as $rowtest)
$id_attribute_name = $rowtest[name];

//get the attributes group id to see if its color or size
$sqltest2 = 'SELECT * FROM `attribute` WHERE `id_attribute` = '. $attribute .' LIMIT 0 , 1';
if ($resultstest2 = Db::getInstance()->ExecuteS($sqltest2))
foreach ($resultstest2 as $rowtest2)
$id_attribute_colorsize = $rowtest2[id_attribute_group];

//this will determine if the attribute is a color or size
//11 is the color group id in my mysql database
if ($id_attribute_colorsize== 11) {
$id_attribute_color=$id_attribute_name;
} 
//12 is the size group id in my mysql database
elseif ($id_attribute_colorsize == 12) {
$id_attribute_size=$id_attribute_name;
}
}

You will need to modify

$id_attribute_colorsize== 11 and $id_attribute_colorsize == 12

I checked mysql attribute_group table to find the attribute group ID of color and size.

right below it you’ll find

if ($this->product->id)
{
return array(
'id_product' => (int)$this->product->id,
'price' => (float)$price,
'weight' => (float)$weight,
'ecotax' => 0,
'quantity' => (int)Tools::getValue('quantity'),
'reference' => pSQL($_POST['reference']),
'default_on' => 0,
'available_date' => '0000-00-00'
);
}

modify

‘reference’ => pSQL($_POST[‘reference’]),

to

‘reference’ => pSQL($_POST[‘reference’]).$id_attribute_color.’_’.$id_attribute_size,

You can re-order color or size anyway you’d like.

Your results will look like this.
products combinations generator
full modified function:

protected function addAttribute($attributes, $price = 0, $weight = 0)
  {
    foreach ($attributes as $attribute)
    {
      $price += (float)preg_replace('/[^0-9.-]/', '', str_replace(',', '.', Tools::getValue('price_impact_'.(int)$attribute)));
      $weight += (float)preg_replace('/[^0-9.]/', '', str_replace(',', '.', Tools::getValue('weight_impact_'.(int)$attribute)));
      //get attribute name
      $sqltest = 'SELECT * FROM  `attribute_lang` WHERE  `id_attribute` = '. $attribute .' LIMIT 0 , 1';
      if ($resultstest = Db::getInstance()->ExecuteS($sqltest))
    			foreach ($resultstest as $rowtest)
        			$id_attribute_name = $rowtest[name];
        		//echo $id_attribute_name;
      //get attribute color or size
      $sqltest2 = 'SELECT * FROM  `attribute` WHERE  `id_attribute` = '. $attribute .' LIMIT 0 , 1';
      if ($resultstest2 = Db::getInstance()->ExecuteS($sqltest2))
    			foreach ($resultstest2 as $rowtest2)
        			$id_attribute_colorsize = $rowtest2[id_attribute_group];
        	if ($id_attribute_colorsize== 11) {
        		$id_attribute_color=$id_attribute_name;

        	} elseif ($id_attribute_colorsize == 12) {
        		$id_attribute_size=$id_attribute_name;
        	}
    }

    if ($this->product->id)
    {
      return array(
        'id_product' => (int)$this->product->id,
        'price' => (float)$price,
        'weight' => (float)$weight,
        'ecotax' => 0,
        'quantity' => (int)Tools::getValue('quantity'),
        'reference' => pSQL($_POST['reference']).$id_attribute_color.'_'.$id_attribute_size,
        'default_on' => 0,
        'available_date' => '0000-00-00'
      );
    }
    return array();
  }

This can also be done via overrides so you don’t modify the core file.

Change file and folder permissions

  1. find . -type f -exec chmod 644 {} ;
  2. find . -type d -exec chmod 755 {} ;

    below works for ubuntu
    To change permission of only files under a specified directory.
    [email protected]:/home/user$ sudo find /path/to/someDirectory -type f -print0 | xargs -0 sudo chmod 644

  3. [email protected]:/home/user$ ls -l
  4. total 3
  5. -rw-r–r–  1 user user 0 Nov 19 20:13 file1
  6. drwxrwxrwx  2 user user 4096 Nov 19 20:13 folder
  7. -rw-r–r–  1 user user 0 Nov 19 20:13 file2
    To change permission of only directories under a specified directory (including that directory):
    [email protected]:/home/user$ sudo find /path/to/someDirectory -type d -print0 | xargs -0 sudo chmod 755
  8. [email protected]:/home/user$ ls -l
  9. total 3
  10. -rw-r–r–  1 user user 0 Nov 19 20:13 file1
  11. drwxr-xr-x  2 user user 4096 Nov 19 20:13 folder
  12. -rw-r–r–  1 user user 0 Nov 19 20:13 file2

passwd: Authentication token manipulation error

Centos

[[email protected] ~]# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: Authentication token manipulation error

solved

[[email protected] ~]# /usr/sbin/useradd aa useradd: unable to open password file
[[email protected] ~]# chattr -i /etc/passwd
[[email protected] ~]# /usr/sbin/useradd aa
useradd: cannot open shadow password file
[[email protected] ~]# lsattr /etc/passwd ————– /etc/passwd
[[email protected] ~]# lsattr /etc/shadow —-i——— /etc/shadow
[[email protected] ~]# chattr -i /etc/shadow
[[email protected] ~]# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[[email protected] ~]

Latest cpanel 11.48 broke cphulkd

The system failed to add an IP address to cphulkd hosts because the “cphulkd.ip_lists” table may be corrupted and returned the following error: DBD::mysql::db do failed: Table ‘cphulkd.ip_lists’ doesn’t exist.

run

[email protected] [/var/cpanel]# /usr/local/cpanel/bin/hulkdsetup
hulkdsetup: synchronizing database schema

ALTER TABLE brutes CHANGE COLUMN BRUTETIME BRUTETIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’
# was datetime DEFAULT NULL
ALTER TABLE brutes CHANGE COLUMN EXPTIME EXPTIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’
# was datetime DEFAULT NULL
ALTER TABLE good_logins CHANGE COLUMN LOGINTIME LOGINTIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’
# was datetime DEFAULT NULL
ALTER TABLE logins CHANGE COLUMN LOGINTIME LOGINTIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’
# was datetime DEFAULT NULL
ALTER TABLE report CHANGE COLUMN logintime logintime timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’
# was datetime DEFAULT NULL
CREATE TABLE ip_lists (
STARTADDRESS varbinary(16) NOT NULL DEFAULT ”,
ENDADDRESS varbinary(16) NOT NULL DEFAULT ”,
TYPE int(1) NOT NULL DEFAULT ‘0’,
COMMENT char(255) DEFAULT NULL,
PRIMARY KEY (STARTADDRESS,ENDADDRESS)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE login_track (
USER char(128) NOT NULL,
ADDRESS varbinary(16) DEFAULT NULL,
SERVICE char(64) DEFAULT NULL,
TYPE int(1) DEFAULT NULL,
LOGINTIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
EXPTIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
NOTES text,
AUTHSERVICE char(64) DEFAULT NULL,
AUTHTOKEN_HASH char(86) DEFAULT ”,
KEY EXPTIME_ADDRESS_index (EXPTIME,ADDRESS),
KEY EXPTIME_USER_SERVICE_index (EXPTIME,USER,SERVICE)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

Radius login with Ubuntu

sudo apt-get install libpam-radius-auth

edit

$ sudo vim /etc/pam_radius_auth.conf

find

other-server    other-secret       3

change to

192.168.x.x secretkey 3

Edit your /etc/pam.d/sshd file and add the line:

auth       sufficient  pam_radius_auth.so

Just above:

# Standard Un*x authentication.
@include common-auth

had to update firewall config and configure radius to accept auths from this IP

using this to upload screenshots for evernote skitch

also installed nginx

modified default

        root /home;

        server_name vpls.in;

location ~ ^/(.+?)(/.*)?$ {
alias /home/$1/$2;
index index.html index.htm;
autoindex off;
expires 365d;
}

location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 30d;
}

also configured gzip in nginx.conf

useradd -m zeki893

nginx error connect to php5-fpm.sock failed (13: Permission denied)

PHP fixed a security bug where o had rw permission to the socket file.

  1. Open /etc/php5/fpm/pool.d/www.conf
  2. Uncomment all permission lines, like:
    listen.owner = www-data
    listen.group = www-data
    listen.mode = 0660
    
  3. Restart fpm – sudo service php5-fpm restart

Note: if your webserver runs as as user other than www-data, you will need to update the www.conf file accordingly

cpanel – change pure-ftpd port

Pure-FTP

1) Edit /etc/pure-ftpd.conf and look for the following line:

Bind

Where is a publically routable IP.  The default example, 127.0.0.1, will cause the socket to bind locally but then this connection won’t serve externally. is the new port you wish to put the service on.

2) If necessary, add the new FTP port to your server’s firewall

3) Edit /etc/chkserv.d/ftpd and change the port, which is the first comma-separated entry to the right of ‘=’ on the line in the file, to match the port you put the service on.

Finally:

/etc/init.d/pure-ftpd restart
/etc/init.d/cpanel restart (restarts tailwatchd/chkservd)

How to Setup Apache2 (HTTPD) with FastCGI and PHP on CentOS/RHEL 6/5

 

yum install mod_fastcgi
Loaded plugins: fastestmirror, replace
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.psychz.net
* epel: mirror.prgmr.com
* extras: mirrors.xmission.com
* rpmforge: mirror.webnx.com
* updates: mirrors.easynews.com
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package mod_fastcgi.x86_64 0:2.4.6-2.el5.rf will be installed
--> Finished Dependency Resolution

Dependencies Resolved
#!/bin/bash

==============================================================================================================
Package Arch Version Repository Size
==============================================================================================================
Installing:
mod_fastcgi x86_64 2.4.6-2.el5.rf rpmforge 133 k

Transaction Summary
==============================================================================================================
Install 1 Package(s)

Total download size: 133 k
Installed size: 364 k
Is this ok [y/N]: y
Downloading Packages:
mod_fastcgi-2.4.6-2.el5.rf.x86_64.rpm | 133 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mod_fastcgi-2.4.6-2.el5.rf.x86_64 1/1
# For example:
Verifying : mod_fastcgi-2.4.6-2.el5.rf.x86_64 1/1

Installed:
mod_fastcgi.x86_64 0:2.4.6-2.el5.rf

Complete!

vi /var/www/cgi-bin/php.fcgi

chmod +x php.fcgi; chown apache.apache php.fcgi

#!/bin/bash
PHPRC="/etc/php.ini"
PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000
export PHPRC
export PHP_FCGI_CHILDREN
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi
vi /etc/httpd/conf.d/cacti.conf
added
 Options +Indexes FollowSymLinks +ExecCGI
 AddHandler php5-fastcgi .php
 Action php5-fastcgi /cgi-bin/php.fastcgi

Restart apache

check phpinfo

Server API CGI/FastCGI

 

http://tecadmin.net/setup-httpd-with-fastcgi-and-php-on-centos-redhat/

mod_fcgid: can’t apply process slot for /usr/local/cpanel/cgi-sys/php5

[Fri Jan 30 10:47:40 2015] [error] mod_hostinglimits:Error on LVE enter: LVE(508) HANDLER(fcgid-script) HOSTNAME(lovetheclassic.com) URL(/index.php) TID(714206) errno (7) Read more: http://e.cloudlinux.com/MHL-E2BIG

[Fri Jan 30 10:48:19 2015] [warn] [client 198.50.247.222] mod_fcgid: can’t apply process slot for /usr/local/cpanel/cgi-sys/php5

  • Also, make sure you monitor apache error logs. If you see “can’t apply process slot for error” — it means you are hitting FcgidMaxProcesses

http://www.cloudlinux.com/blog/clnews/145.php

 

Updating servers cuz of glibc vulnerability

Ghost is a vulnerability in glibc that attackers can use against only a handful of applications right now to remotely run executable code and gain control of a Linux server. The vulnerability is a heap-based buffer overflow and affects all Linux systems, according to experts, and has been present in the glibc code since 2000. – See more at: https://threatpost.com/php-applications-wordpress-subject-to-ghost-glibc-vulnerability/110755#sthash.PJ3vrnvp.dpuf

Check if your vulnerable http://www.cyberciti.biz/faq/cve-2015-0235-ghost-glibc-buffer-overflow-linux-test-program/

Download bash script to check for vulnerability GHOST-test.sh

GIMP may be acceptable for casual doodler or cropping photos, but …

No doubt that I would agree with the parent 100%. GIMP may be acceptable for casual doodler or cropping photos, but it ultimately a complete waste of time for any professional accustomed to a plethora of serious tools and a myriad of features used daily to make a living. We don’t even have to discuss its’ intolerable user interface because GIMP’s graphic capabilities are not even in the same ballpark as Photoshop.

However, one may be able replace some of the other software depending on how you used it. The original poster framed the scenario as tools for the marketing department to use, which clearly lowers the bar in terms of expectations as to what level of competency will be applied. Marketers are not designers, so it would appear as though if Software X does a reasonable job approximating most tasks of Adobe Y, then one can adopt it.

Photoshop – You’re unlikely to replace that one. Although, someone else mentioned Pixel [kanzelsberger.com] which could possibly cut the mustard depending on your needs. Otherwise, there really is nothing to compare to Photoshop.

Illustrator – Definitely have a strong look at Inkscape [inkscape.org]. I’ve toyed with it for 2 or 3 years to keep tabs on its’ development, after being fairly impressed during my first run through. These days it has continued to advance and I’d suggest it’s ready for the professional world. You can create substantially complex pieces with Inkscape which will probably far out-pace the ability of your Marketing department to bother learning in the first place. While it might be missing a pet feature or two, the bottomline is that Inkscape is ready to be taken seriously as a replacement for Illustrator (and, previously, FreeHand).

InDesign – Professionals already use Scribus [scribus.net] to handle multipage full color layouts sent directly to commercial print houses, so it’s gotta be worth your time to look at. CMYK separation, PDF generation,and much of the toolsets you’d expect to see in Quark or InDesign; certainly more than enough power for your Marketing department.

Acrobat Pro – If you’re heavily using features like annotation, collaboration, form creation, et cetera, then you probably won’t be replacing Acrobat Professional. Nothing can touch it. However, if all you need is to be able to allow your Marketing droids to generate PDFs from documents they create in other software, then you can slap PDFCreator [pdfforge.org] on their little Windows boxen. Remember that OpenOffice already has the ability to turn any of their normal documents and spreadsheets into a PDF at a click of a button. Surely, you’ve dumped MS Office by now.

Dreamweaver – This is a tough one because you should probably rethink your environment to realize you most likely don’t really want Dreamweaver to be used. Unless you’re just using Slashdot to conveniently survey the geek mindshare, the odds are that WYSIWYG is an old paradigm no longer needed by most scenarios. What you probably want is some kind of content management engine which your key tech person(s) can administer such that your Marketing department can monkey with the website(s). One engine could be adapted to various websites, if you proposed such a need. If I were to suppose someone was trolling Slashdot, then I would mention Quanta Plus [kdewebdev.org] before realizing Marketing droids would be helplessly confined to Windows and thus I’d point to Nvu [nvu.com] as your capable hero.

But, really, if an evaluation of your technical needs leads you back to WYSIWYG, then you’ve made a logical error somewhere. The days for that hobbled solution are definitely over.

There you have it! Free and open source software is up to the challenge is most regards. Where there are shortcomings, there are adept proprietary solutions for far, far less than the onerous cost of Adobe

Photoshop -> Gimp [gimp.org]
Illustrator -> Inkscape [inkscape.org]
InDesign -> Scribus [scribus.net]
Web Design -> Kompozer [kompozer.net], which is a bugfix release of Nvu [nvu.com] (there’s actually a lot of these, I’ve also heard Microsoft Visual Web Dev Express [microsoft.com], which has a lot of praise from various people)
At least for mac users, there are quite a few very well designed and maintained products that are shareware and rival Adobe’s offerings in both features and pizazz.

RapidWeaver [realmacsoftware.com] is an industrial-strength alternative to Dreamweaver which includes an SDK, full drag-n-drop designing interface, coding panel, Flash integration, and site maintenance. Currently it’s $49.

Coda [panic.com] is the newcomer on the block, built by one of the best Mac shareware coding companies. As with the others, it allows for drag-n-drop designing and fully supports XHTML. Panic Software’s tagline “shockingly good Mac software” is evident here cause they integrate the features of Transmit (their excellent FTP utility) including site/filepath synchronization, drag-n-drop uploading from the Dock… Coda also includes a console that’s integrated into the app window that allows for split terminal shells for SSH and other functions. Coda includes a GUI CSS editor and comprehensive HTML programmer’s guide in the application itself. $79.

TextMate [macromates.com] is the Mac’s premiere enterprise-level, yet shareware price text editor that does… pretty much anything. It can handle just about as many language bundles as jEdit but is purely Mac. It integrates well with Transmit, the shell, Subversion, and has a fully customizable code snippet library for full programmer control. I can’t even begin to summarize all the features that sets this editor apart from the others, but it easily shames Dreamweaver’s code window. Just watch the screencasts on the website. It costs 39.

CSSEdit [macrabbit.com] by MacRabbit is a GUI-powered CSS editor which has a snooping mode called X-Ray that can analyze a website’s design similar to Firefox’s 3rd party Web Developer addon, except with style, polish, and features that you’ve come to expect from Mac applications. It includes a CSS “builder” workflow that allows you to use some natural language and object-oriented programming (in the most basic sense) to build CSS effects. $29.95

There are many others including Apple’s own iWeb [apple.com] (which is included with every new Macintosh, is VERY easy to use, and puts out bloated-yet XHTML compliant code) and BBEdit [barebones.com] by Bare Bones Software which is very comparable to TextMate in many ways.

http://www.pixelmator.com/

Can’t resolve *.local domain on VPN Mac Yosemite

After running

sudo discoveryutil mdnsactivedirectory yes

in the terminal we’re able to resolve .local FQDNs again. This gets it to use regular (unicast) DNS for .local domains rather than just using multicast DNS (mDNS, aka Bonjour) to look-up .local addresses.

Place the following file in /Library/LaunchDaemons: https://gist.github.com/CodingMinds/509bd12a7c7e22f0cfdd

https://discussions.apple.com/thread/6611817?start=15&tstart=0

network speedtest bench.sh

bench.sh

#!/bin/bash

cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo )
cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
freq=$( awk -F: ' /cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo )
tram=$( free -m | awk 'NR==2 {print $2}' )
swap=$( free -m | awk 'NR==4 {print $2}' )
up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }')

echo "CPU model : $cname"
echo "Number of cores : $cores"
echo "CPU frequency : $freq MHz"
echo "Total amount of ram : $tram MB"
echo "Total amount of swap : $swap MB"
echo "System uptime : $up"

cachefly=$( wget -O /dev/null http://cachefly.cachefly.net/100mb.test 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from CacheFly: $cachefly "
coloatatl=$( wget -O /dev/null http://speed.atl.coloat.com/100mb.test 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Coloat, Atlanta GA: $coloatatl "
sldltx=$( wget -O /dev/null http://speedtest.dal05.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Dallas, TX: $sldltx "
linodejp=$( wget -O /dev/null http://speedtest.tokyo.linode.com/100MB-tokyo.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Linode, Tokyo, JP: $linodejp "
i3d=$( wget -O /dev/null http://mirror.i3d.net/100mb.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from i3d.net, Rotterdam, NL: $i3d"

#linodeuk=$( wget -O /dev/null http://speedtest.london.linode.com/100MB-london.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
#echo "Download speed from Linode, London, UK: $linodeuk "
leaseweb=$( wget -O /dev/null http://mirror.leaseweb.com/speedtest/100mb.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Leaseweb, Haarlem, NL: $leaseweb "
slsg=$( wget -O /dev/null http://speedtest.sng01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Singapore: $slsg "
slwa=$( wget -O /dev/null http://speedtest.sea01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Seattle, WA: $slwa "
slsjc=$( wget -O /dev/null http://speedtest.sjc01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, San Jose, CA: $slsjc "
slwdc=$( wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Washington, DC: $slwdc "
io=$( ( dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' )
echo "I/O speed : $io"

How to Start vSAN Observer

Remote desktop to vcenter server

Open command prompt and run

C:\Program Files\VMware\Infrastructure\VirtualCenter Server\support\rvc\rvc.bat

Enter password

Enter in prompt ->

cd localhost/<Datacenter>
cd computers/<Cluster name>
vsan.observer --run-webserver --force --no-https ./

Note: Type ‘ls’ to see listing and you can also use tab for autocomplete datacenter and cluster names

Open in browser http://localhost:8010/

 

http://blogs.vmware.com/vsphere/files/2014/08/Monitoring-with-VSAN-Observer-v1.2.pdf

Headache – VMware Inventory Services – Error Starting Services

look for ds.log in “c:\programdata\vmware\infrastructure\inventory service\logs”

[2014-11-07 04:01:00,622 WrapperListener_start_runner FATAL com.vmware.vim.dataservices.WrapperListenerImpl] Error starting service:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘instanceUUID’ defined in class path resource [server/config/server-config.xml]: Cannot resolve reference to bean ‘store’ while setting bean property ‘targetObject’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘storeFactory’ defined in class path resource [server/config/query-server-config.xml]: Invocation of init method failed; nested exception is com.xhive.error.XhiveException: FEDERATION_NOT_FOUND: Federation C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap not found
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1244)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at com.vmware.vim.dataservices.DataService.getService(DataService.java:213)
at com.vmware.vim.dataservices.WrapperListenerImpl.start(WrapperListenerImpl.java:52)
at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:3560)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘storeFactory’ defined in class path resource [server/config/query-server-config.xml]: Invocation of init method failed; nested exception is com.xhive.error.XhiveException: FEDERATION_NOT_FOUND: Federation C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap not found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:276)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:901)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:815)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
… 20 more
Caused by: com.xhive.error.XhiveException: FEDERATION_NOT_FOUND: Federation C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap not found
at xDB_9_0_11.aW.bL(xdb:403)
at xDB_9_0_11.aW.<init>(xdb:173)
at xDB_9_0_11.uB.a(xdb:73)
at xDB_9_0_11.CN.a(xdb:201)
at xDB_9_0_11.CN.init(xdb:225)
at xDB_9_0_11.CN.init(xdb:238)
at xDB_9_0_11.CN.init(xdb:233)
at com.vmware.vim.query.server.store.impl.StoreFactoryImpl.init(StoreFactoryImpl.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1412)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1373)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)
… 42 more

Somehow during an update to vcenter 5.5 u2 the file xdb.bootstrap went missing I checked in the folder and there was two files named xdb.bootstrap.new and xdb.bootstrap.old. I used my best judgement and selected xdb.bootstrap.new and renamed it to xdb.bootstrap. Attempted to start the service and bam it worked!