Wednesday, March 26, 2014

BITS service is missing

The other night I encountered something I've never seen before, the Background Intelligent Transfer Service(BITS) was completely missing from a Windows 2003 Server.. yup, gone, non-existent. This was most likely due to the fact that someone pushed a WSUS update out that disabled and or stopped the BITS and wuauserv service on all the servers in the domain.

If the Automatic Updates service is missing:
      1. Open an Elavated PowerShell prompt
      2. Type the following command:
%windir%\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %windir%\inf\au.inf

If Background Intelligent Transfer Service is missing:
     1. Open an Elavated PowerShell prompt
     2 . Type the following command:
%windir%\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %windir%\inf\qmgr.inf

If you are prompted to insert your operating system CD, type the following path in the Copy files from box as this is where the most recently updated service pack files are stored.:

Take a look at services.msc and you should now have all services. At this time I ran the following command:

wuauclt /detectnow /register /reportnow

 This will make the server you are logged onto check into WSUS. All done, onto the next server.... 

Another thing that could help -- re-registering the various dll files that Windows Update requires to run.

regsvr32 wuapi.dll
regsvr32 wups.dll
regsvr32 wuaueng.dll
regsvr32 wucltui.dll
regsvr32 atl.dll
regsvr32 msxml3.dll

Wednesday, March 19, 2014

Expand a Basic Drive with Dell ExtPart

Last night I was assigned the task of expanding the C: drive on a Windows Server 2003 virtual machine. But wait, when I right click on the C: drive within Disk Management I'm not seeing the option 'Expand Drive'....

What to do now...

First we must Increase the virtual machines c: drive space from within VMware.

Right click the VM > Click 'Edit Settings' > Increase the size to the size you would like to expand the drive to.
From the computer you are expanding the drive on you can open a PowerShell prompt and type:
"rescan" | diskpart 
which will in turn pipe the Diskpart command(rescan) into Diskpart. Pretty neat huh?

 Now you should be able to see the unallocated space that you just assigned to this computer in VMware. 

Now for the really fun part..

Since this C: drive is a basic disk we won't be able to expand this drive via the GUI or with Diskpart(Diskpart cannot expand C: drives)
Download and save the Dell Extpart utiltiy to a location of your choosing (I always choose C:\Dell\ExtPart\).
1. Open an elevated command prompt > browse to the extpart.exe location . In my case C:\Dell\ExtPart by typing "cd c:\dell\extpart\". Now hit 'Enter' and type "extpart.exe".

2. Type the Drive letter which you want to extend and then the number of MB's you would like to add
C: <MB to expand drive by>
which will expand the drive specified by 60 GB.

3. Now specify how many MB you would like to expand your C: drive by. We have 60 GB of unallocated space so I specified  61440 MB which will hopefully consume all of the unallocated space..
The drive has now been extended and is showing a new volume size of 81981 MB! 

Looks like we have 16 MB hanging around yet...
That's easy, follow the same steps as above only this time there shouldn't be much math involved, just run the command:

extpart.exe c: 16

Boom, our C: drive has been successfully expanded!!

SystemName Drive Size (GB) FreeSpace (GB) PercentFree
---------- ----- --------- -------------- -----------
COMPUTERNAME C:    80.0      61.6           77.06 %

Friday, February 21, 2014

How PowerShell helps me make $100+ a month

Just like Gold and other precious medals, Bitcoin and Litecoin are obtained through a process called mining. Mining for litecoins however does not require any ground to be moved.

The best one line description to explain what a litecoin mining is:
"It's kind of like rounding up the world's greatest minds and making them do Sudokus for nickels."

Litecoin mining is simply configuring you computer to solve algorithmic equations, the beefier the computer's CPU or GPU is the more Kh/s you will receive from that device. As of today, not many people even bother mining with a CPU because a top of the line CPU will only give you around 10 Kh/s where my AMD R9 280X will output about 725 Kh/s. With that being said I was able to pay of my new GPU in about 3 months of mining.

However there are some costs and risks to mining;
  • Mining Hardware is pretty expensive.
  • Mining is like slowly earning a stock in litecoin(LTC).
  • The market could crash any day.
  • Everything earned can be lost
  • Hardware failure can occur

The Script

Below is the little script or function I wrote that configures my miner to specific settings. This could easily all fit on a few lines however I like to use the back-tick(`) with this script to make it really easy to find the configuration item that I'd like to adjust.

function GOLD_Digger {
    Matthew A. Kerfoot
    Mines Litecoins from ltcrabbit at ~750KH/s
    Mines litecoins from `
    full link is needed to create first`    account.
               [string]$FilePath = "C:\Users\Matthew\Desktop\`
CGMiner-LTCRabbit-V1\CGMiner LTCRabbit V1\cgminer-3.7.2-windows\",
               [string]$miner_path = "C:\Users\Matthew\Desktop\`


Set-Location $FilePath
.\cgminer.exe -o stratum+tcp:// `
              -u mkerfoot.worker2 `
              -p password `
              -w 384 `
              -I 13 `
              -g 2 `
        --gpu-powertune 13 `
        --temp-hysteresis 3 `
        --lookup-gap 2 `
        --shares 0 `
        --thread-concurrency 8191 `
        --gpu-engine 1050 `
        --gpu-memclock 1500 `
        --queue 0 `
        --expiry 1 `
        --scan-time 1 `
        --temp-cutoff 87 `
        --temp-overheat 80 `
        --temp-target 70 `
        --api-port 4028 `
    --no-submit-stale `
    --auto-fan `
    --api-listen `
    --api-network `
    --no-pool-disable `
    --scrypt `
--config "$miner_path"
} GOLD_Digger