Thursday, January 18, 2018

Decrypt Files from QNAP with OpenSSL

To decrypt files that was encrypted on a QNAP, use the following command.

From the Linux terminal:

    Decrypt one file
        openssl enc -d -aes-256-cbc -k <decrypt password> -in filename.jpg -out filename.jpg

    Decrypt multiple files in a folder.
        for f in * ; do [ -f $f ] && openssl enc -d -aes-256-cbc -k <decrypt password> -in $f -out _$f;


Export a Sharepoint list to a csv using C#.

Below is the code to export a Sharepoint List to a CSV file using C#.NET

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using System.IO;

namespace export_sharepoint
{
    class Program
    {
        static void Main(string[] args)
        {
            string url = "<Site URL>" ;

            using (SPSite oSite = new SPSite(url))
            {
                using (SPWeb oWeb = oSite.OpenWeb())
                {
                    SPList oList = oWeb.Lists["<List Name>" ];

                    foreach (SPListItem oItem in oList.Items)
                    {
                         FileStream fs = new FileStream ( "C:\\Documents and Settings\\administrator.domain\\Desktop\\sites.txt", FileMode.Append, FileAccess.Write, FileShare .Read);
                         StreamWriter writer = new StreamWriter(fs);
                        // Access each item in the list... 
                        writer.Write(oItem[ "Site ID"]);
                        writer.Write( ",");
                        writer.Write(oItem[ "Column Name"]);
                        writer.Write( ",");

                        writer.Close();
                        fs.Close();
                    }

                }
            } 
        }
    }

Create a CIFS share on a Netapp from the command line.


cifs shares -add "SHARE NAME" "/vol/fw_volume1/share location/"
cifs access "AD GROUP" "ROLE_ETC" "Full Control"
cifs access -delete "Everyone"

Saturday, January 13, 2018

Finally got a Sega Saturn. Derby Stallion edition!

Sold a Neo Geo Cyberlip and a Nintendo Game and Watch to buy this console.  Wanted this console for a long time so I thought why not go for the Derby Stallion edition!  This console is awesome looking.  It's looks brand spanking new too.  The game inside is Battle Garegga!


Thursday, January 11, 2018

Reset Local Administrator Password

Here's a way to reset the local Administrator password in Windows 2008.

  1. Boot up a WIndows installer CD.
  2. Press F8 at the Local Deployment Wizard
  3. Type in 
    1. move d:\windows\system32\utilman.exe d:\
    2. copy d:\windows\system32\cmd.exe d:\windows\system32\utilman.exe
  4. Boot to normal Window.  At the log in, click on "Ease of Access" button at the bottom left.
  5. Type in:
    1. net user administrator /active:yes
    2. net user administrator <new password>



Tuesday, January 9, 2018

Add local printer via powershell

add-printerport -name 'printer_name' -printerhostaddress '192.168.0.1'
add-printerdriver -Name 'HP LaserJet 4200/4300 PCL6 Class Driver'
add-printer -Name 'printer_name' -DriverName 'HP LaserJet 4200/4300 PCL6 Class Driver' -PortName 'printer_name'



Disable SSL check on GIT

When you connect to a GIT repository, it may fail due to
Start GIT Bash
Run the following command.
     git config --global http.sslVerify false


Monday, January 8, 2018

Setting up Redhat Enterprise Virtualization Manager (RHEVM)

Steps to set up Redhat Enterprise Virtualization Manager.

1.  Install Redhat Enterprise Linux 

2.  Register to the Redhat Network
          #>Subscription-manager register
                    Type in your rhn account info.

3.  Attach all the subscriptions available to the version of Redhat Linux you're running.
          #>Subscription-manager attach --auto

4.  Install yum-config-manager utility
          #>yum install yum-utils

5.  Run yum-config-manager to add Redhat Enterprise Virtualization Manager package to the subscription.
          #>yum-config-manager --enable rhel-6-server-rhevm-3.4-rpms

6.  Run yum-config-manager to add JBoss package to the subscription.
          #>yum-config-manager --enable jb-eap-6-for-rhel-6-server-rpms

7.  Install JBoss
          #>yum install jbossas-standalone

8.  Downgrade sos package (not sure why this is required but it was complaining about the sos version is too new)
          #>yum remove sos-3.2-28.el6.noarch
          #>yum install sos-2.2-68.el6.noarch

9.  Install rhevm
          #>yum install rhevm

10. Install rhevm reporting
          #>yum install rhevm-reports

11. Run the setup wizard.
          #>engine-setup

12. Create ISO domain (Use to store .iso files so you can build the vm)

13. Upload to the ISO domain
          #>rhevm-iso-uploader --iso-domain=<ISO domain name> upload myfile.iso --insecure

14.  To be able to mount the windows drivers in the vm, run the following.
          #>yum install virtio-win
          #>yum install libvirt-devel
          #>yum install libvirt
          #>yum install virt-install




Disable SSL on VMWare Converter.

Disabling SSL on VMWare converter can result in faster conversion speeds.

Go to 
C:\ProgramData\VMware\VMware vCenter Converter Standalone\converter-worker.xml
Change   
     <useSsl>true</useSsl>
to
     <useSsl>false</useSsl>



Amazon S3 storage used calculation.

From the reports exported from Amazon S3, the value is in "TimedStorage-BytesHrs"  It's not very useful if you're doing cost analysis.  
Below is the formula to convert it to a usable GB-Months format.

TimedStorage-BytesHrs * 30 * (1 GB/ 1,073,741,824) * (1 Month/744) = GB-Months.

GB-Months x .03 = Total Cost per month.