Tuesday, January 7, 2014

Bitcoin Mining - Playing with Raspbian and a BFL miner

I have been keeping up with the whole bitcoin scene and decided to take a crack at trying to set up a miner.

I acquired a miner from Butterfly Labs and decided to pair it up with my Raspberry Pi.  Some quick googling and searching on the BFL forums I found this post:  https://forums.butterflylabs.com/bitcoin-discussion/3238-super-tutorial-raspberry-pi-raspbian-cgminer-tightvnc-wifi-boot.html

It is a very quick and easy step-by-step guide to setting up raspbian on your Pi and getting your miner working.  Unfortunately I did not take great notes when setting it up as I was in a rush, but I did take a few notes of some things that were required for me but were not in the initial post - I found them later in the thread.  If you're reading this, hopefully it is of some help to you.  If I have the chance to revisit my configuration/setup, I will provide an update confirming my additions.

CGMiner

When installing the dependencies for CGMiner, I needed to include libusb-1.0-0 and libudev-dev:

 # sudo aptitude install libusb-1.0-0 libudev-dev

These last two commands I ran... I do not know if I needed to but I highlighted them in my notes.  They are also not in the initial post but I do not know if they are in fact needed to get going:

Add the current user to the 'plugdev' group:

 # sudo usermod -G plugdev -a `whoami`

Copy 01-cgminer.rules from the cgminer folder in the home directory into /etc/udev/rules.d/:

 # sudo cp ~/cgminer/01-cgminer.rules /etc/udev/rules.d/

TightVNC

When you are connecting to the VNC server on your Pi, be sure to specify the port!  For me, I used :1.  The address looked like this:



Friday, January 11, 2013

Windows 7 - Right-Click + C to Close Window in Taskbar

I spent many years mastering shortcuts in Windows XP.  One of the shortcuts I used frequently was right-clicking a window in the taskbar and pressing 'c' on my keyboard to close the window.  When I started using Windows 7, I was slowed down due to the fact that this did not have the same function.

When you have an open window in the taskbar, right-clicking it brings up a different context menu known as a Jump List.  Instead of a menu to manipulate the window (minimize, maximize, close, etc.), you are given a menu that is unique to the application.  Generally it will have a list of Recent files open within the program, an entry to launch the program (or another instance of the program), an option to pin this application to the taskbar, and Close window.

By pressing 'c' on this menu, if there are any items that begin with the letter 'c' they will be highlighted.  If the only item in the menu is Close window, it too becomes highlighted but is not selected.  You would still need to press enter or click Close window in order to perform the action.


I discovered that if you hold down the Shift key when right-clicking, you receive the old context menu as you did in previous versions of Windows.  With this present, you can press 'c' and it will close the window.


Rename User Profile in Windows 7


It is common to have to rename profiles on machines in various situations.  Working in a Windows XP environment, this process was easy.  Simply sign into the computer as an account with administrative rights and rename the users profile.  When they would log in, it would create a new profile and any issues that were present should be alleviated.

Once you switch to a Windows 7 environment, this process changes just a bit.  After you rename the users profile, you also need to delete the associated registry key for that profile.

Launch regedit.exe and navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

Browse through the available SID keys looking at the "ProfileImagePath" value.

Once you locate the associated registry key for the renamed profile, export the registry key as a backup, then delete the key.

When the user logs in it will create a new profile.

Thursday, January 10, 2013

Validating Windows Credentials Remotely

I occasionally work with customers that require using alternate credentials to access resources on remote machines.  These machines are sometimes part of a domain or just workgroup systems.  I wanted to throw something together to provide a few examples of testing credentials on a remote computer.

Note: Some of these commands may not work due to firewalls/restrictions in place on the remote machine.  Be sure to verify the appropriate services are enabled and permissions are set.

SMB Access

Use this command to map a remote share as a network drive; You will be prompted for credentials
 net use x: \\192.168.1.118\c$  


Use this command to remove your mapped network drive
 net use x: /delete

Use this command to map the network drive, but include credentials in a single command
 net use x: \\192.168.1.118\c$ password /user:username


WMI Access

Use this command to verify you have access to WMI on the remote machine
 wmic /node:"192.168.1.118" /user:user /password:password bios



Remote Registry

I did not know of a way via command line to test registry access, so I chose to use the example of connecting to a remote registry via regedit.exe

Launch regedit.exe

Click File > Connect Network Registry


Enter in the hostname or IP Address of the remote machine and click OK


You will be prompted for a username and password


Once authenticated, you will now see the remote machine as a separate node in your registry editor.  Navigate around to verify you can view registry keys.


Verify account is in admin group

Aside from launching a Computer Management console (compmgmt.msc) and connecting to the remote machine, here is another WMIC command that will enumerate the users and groups.  I added a piped find to look for any line with "Administrators" to single out the Administrators group.

 wmic /node:"192.168.1.118" /user:username /password:password path win32_groupuser | find /i "Administrators"



Tuesday, September 11, 2012

Clear Print Spooler on Windows

I was continuously receiving calls that some customer-facing printers were not printing receipts.  At first, the quick/easy solution was to reboot the server (desktop), but doing so would then clear the "jammed" print job and start dumping out hundreds of queued up print jobs.

I hate printing in general, but I wasn't running the business so I had to come up with a solution that wouldn't waste baby trees.  I stumbled across this post on Microsoft, How to cancel printing or to delete a print job that is stuck in the print queue in Windows XP.  It provided some commands to clear the print queue files.  I already knew that stopping/starting the service resolved the issue, but I wanted to get rid of the hundreds of queued up jobs.

Here is the code that Microsoft provided.  Per the title of the article, this was geared toward Windows XP.  The machine that we were working with was Windows 7.  Creating a batch file and running when the print queue jams got us in business!  Never found out why the proprietary software/printer combination was jamming up at least once a week (even with reboots every other night).

 net stop spooler  
 del %systemroot%\system32\spool\printers\*.shd  
 del %systemroot%\system32\spool\printers\*.spl  
 net start spooler  

Monday, September 10, 2012

Remembering Vince Offer

Vince Offer entered our lives with the Sham Wow.  I'm sure you remember it, it was practically the same thing Billy Mays was selling, Zorbeez.  I've never personally used either of these products, but I would have purchased the Zorbeez simply because it was endorsed by Billy Mays.

Later, Vince was selling the Slap Chop, direct competitor with Billy Mays' Quick Chop.  The commercial for the Slap Chop was pretty good.  DJ Steve Porter remixed it and this is what he came up with (EPIC).


With all of the fame, Vince couldn't stay away from temptation.  He was busted for assaulting a prostitute.


After some time out of the limelight, Vince decided it was time to embrace his mistake and endorse yet another competing product, the Schticky.  Now the product does seem rather amazing, even though I already own the Sticky Buddy, but the commercial is even better.

Thursday, June 28, 2012

Outlook/Exchange Sync Issues - Problems in cached exchange mode

I was helping troubleshoot a users in ability to send/receive messages within Outlook. We are running Microsoft Exchange 2010 and are using cached exchange mode within Outlook(somewhat troublesome but apparently necessary with extremely large deployments of exchange). The user deleted their entire mailbox except for about 15MB worth of mail, though they were still seeing in OWA (Outlook Web Access) that their mailbox was over the limit by about 500MB. Reviewing the folder properties in Outlook showed a discrepancy between the local cached copy and the server copy of about 500MB in the Outbox folder. Nothing that we were doing was proving successful. We tried creating a new local profile within Outlook, tried performing various tasks in OWA, nothing was working. We could not get the Outbox folder to update. Our next thought was to try and see what was in his Outbox on the server. OWA only shows the core mail folders (Inbox, Sent Items, Deleted Items, etc.) but we needed to see the Outbox. I did not want to toy around with Powershell so I turned to google... The solution ended up being to sign into OWA in using the light version, which allows you to see all folders within your mailbox (makes no sense, right?). We were able to view the Outbox folder and purge the offending mail clearing up the issue. The next step is to determine how his Outbox ended up so full of old messages that it accumulated enough to fill up his mailbox. We are currently monitoring the users cached and server copies to see if a discrepancy occurs. If I find out what caused this, I will surely post.