All posts by bsdman

Currently working as an IT Manager. Worked for an OIT company as a Network Engineer in 2011. Worked for a Medical IT company as the Network Administrator 2009-2011. Worked as the Senior Systems Administrator at a computer reseller from 2005-2009. Worked as a Computer Consultant for several small companies from 2007-2009. Worked as a Computer Technician at a computer reseller from 2002-2004.

Chrome Resolving Host Slow Loading

Running Windows 7 Ent x64 fully patched. I noticed that chrome would take a while to open pages – even pages that I had already visited during the day – and I figured there was a problem with my system.

Windows updates had recently patched the system
McCrappy had been removed in favor of Kaspersky
Chrome had been updated to the latest version
Java/Flash/etc were already all up to date

Long story short, I disabled the Built-in Asynchronous DNS functionality of Chrome and noticed a substantial speed difference (gain).

Open a chrome window
navigate to chrome://flags
Find Built-in Asynchronous DNS (about halfway down the page)
Change to disable, and then restart the browser

Block IP Linux Blackhole

I used to always write up iptables to block certain IP addresses, or use hosts.allow and hosts.deny entries, but Benjamin Cane showed me the light.

Blackhole that IP with a null route!

Add the route
ip route add blackhole IPADDRESSOFOFFENDER

Show the routes
ip route show

Remove the route
ip route del IPADDRESSOFOFFENDER
ip route show

Verify the null route
ssh: connect to host IP port 22: No route to host.

Add ZIL to Nas4Free

I added a ZIL device (120GB SSD) to 2 different pools – if you only have 1 pool (or more) obviously change the directions below. AND my SSD showed up as da0, yours may be different!

Destroy the current file system on your SSD (if this command fails, move onto the next):
gpart destroy -F da0

Create GPT filesystem (if this command fails, try the previous command):
gpart create -s GPT da0

Add a partition
gpart add -s 64G -t freebsd-zfs da0
(da0p1 added)

Add a second partition (optional)
gpart add -s 32G -t freebsd-zfs da0
(da0p2 added)

Verify the partitions
gpart show da0

Add the ZIL to the appropriate pool
zpool add POOLNAME log da0p1
zpool add POOLNAME2 log da0p1

Optional: Remove the pool device
zpool remove POOLNAME DEVICENAME

Check ZIL Usage
zpool list -v
zpool iostat -v 2 300
gstat -a

***EDIT 7/25/14***
I also wanted to add a RAID10 array to my ZFS. I have a supermicro 4U chassis with 24x 3.5″ hot swap sata/sas drives with an Areca 1882i controller. I have 2x SSD in bay 0 and 1 for the ZIL, then 22x 3.5″ 3TB SATA drives. I wanted to have 2 hot spares.

zpool create -m /mnt/zfs zfs mirror da3 da4 mirror da5 da6 mirror da7 da8 mirror da9 da10 mirror da11 da12 mirror da13 da14 mirror da15 da16 mirror da17 da18 mirror da19 da20 spare da21 da22

zpool status

On nas4free I had to go to Disks|zfs|configuration|sync to have it show up in my disks to manage.

zpool set autoreplace=on POOLNAME

Add PBZIP2 to Nas4Free

I had been using bzip2 for compressing items. It was great – averaging a 9:1 compression of huge database exports. However, running 1 file at a time was taking way too long. Enter pbzip2 (parallelized)!

Since nas4free/freenas is based upon the freebsd platform, we can run the pkg_add to add this package. If you’re using the embedded version of nas4free, you may lose this install after a reboot or upgrade.

SSH to your nas4free box
pkg_add -r pbzip2

Make a symlink for ease of use
ln -s /usr/local/bin/pbzip2 /usr/sbin/pbzip2

Profit.

Now you can run “pbzip2” from anywhere in the shell.

Citrix Receiver Ubuntu Certificate

I installed the Citrix receiver (receiver.citrix.com) .deb file successfully on my newly installed 12.04.2LTS x64 laptop. Unfortunately the POC for citrix had a self-signed certificate.

I was receiving Error 61 that the certificate was untrusted and I had to quit the application.

Ended up copying the root certificate over to /usr/local/share/ca-certificates, changing the name, and running the cert update. This did not fix my issue, but it’s good to know anyway:

SSH as root, or add sudo before all commands
cp YOURCERTFILE.cer /usr/local/share/ca-certificates/
cd /usr/local/share/ca-certificates
mv YOURCERTFILE.cer YOURCERTFILE.crt
update-ca-certificates

Since that did not work, now I went on looking for the certificate store on the Citrix side:
cp YOURCERTFILE.crt /opt/Citrix/ICAClient/keystore/cacerts/

Try your xendesktop or xenapp now. Magic bananas.

Citrix XenServer Stuck VM

I had a virtual machine that was stuck trying to reboot. I attempted to force it to reboot via XenCenter, but it wasn’t working. Stuck with the yellow symbol.

Found the following commands:

All command line, so get used to SSH as root
Generally you should SSH to your primary server, but the commands below seemed to work ok on the secondaries (unless otherwise noted)

Get the UUID for your VM
xe vm-list
or
xe vm-list name-label=YOURVMGUESTNAME
Or grab the UUID from XenCenter

In my case it’s:
1dd7cc44-0dce-2149-4a9f-27425ee8eae0

Force the VM to shutdown:
xe vm-shutdown uuid=1dd7cc44-0dce-2149-4a9f-27425ee8eae0 force=true

If that fails, try this:
xe vm-reset-powerstate uuid=1dd7cc44-0dce-2149-4a9f-27425ee8eae0 force=true

I also tried to reset the toolstack on the PRIMARY XENSERVER
xe -toolstack-restart
Good to know that command, but it did nothing for me.

If that fails you may need to kill the domain (similar to removing the power from the VM):
list_domains | grep YOURUUID
The number in the front is the domain ID

Kill the Domain ID
/opt/xensource/debug/xenops destroy_domain -domid YOURDOMAINID