Daniel Stinebaugh

Daniel Stinebaugh

(34 comments, 112 posts)

Just your self taught nerd. I love things with blinking lights and external antenna's.

Home page: http://danstinebaugh.com

Jabber/GTalk: daniels@italktomachines.com

Posts by Daniel Stinebaugh
results of running this bat file

Vanity Bitcoin Keys

1

So it’s been a while since I’ve talked about bitcoin and I’ve recently gotten more interested now that the prices have grown significantly. So I started explaining it to some friends at school and have gotten them interested as well. So of course I wanted a nice and custom key to show off, and it’s really quite easy with tools like vanitygen by samr7 over on the bitcoin forums which is the tool that we will be using for this post.

Because it’s actually doing alot of math to figure out (or more correctly guess) at the key, the longer you want your custom key to be, the longer you will have to crunch these numbers so don’t get too crazy with it.

The tool has several options but most of them won’t be used, in fact I only use one of the possible flags below, but there are more, you can view them by running vanitygen.exe with the “-h” flag, or just save this as something like help.bat in the same folder as vanitygen.exe and double-click the .bat file to run the help command for you.

Now that you have read the options the batch file below might make more sense, we are going to ask you for the pattern you want your custom key to have, and decided if you want it case-sensitive which takes MUCH longer, and might have strings that are not allowed, but it’ll error out if it does so you can try something different.

So save this file as something like vanity.bat in the same folder as vanitygen and run it. (Change the highlighted lines 19 and 23 to reflect the executable you are going to use for your system. (ie: if on a 64 bit system you would use vanitygen64.exe, on a gpu you would use oclvanitygen.exe)

Here is what the output of the script does (note, I’ve highlighted the user input for clarity, there is no color in the actual script results, and No this key should NOT be used!):

vanity.bat result

Then create a shortcut on your desktop for vanity.bat and change the icon to something that you prefer, I’ve added the image I use below for fun, and then just run this anytime you (or a friend) want a custom wallet key!

As for wallet’s, I use the Armory wallet but for most users I would recommend multibit as it’s much faster, and much smaller, but you do give up some freedom and security relying on others where armory can offer a true TNO security standpoint, just my 2 bitcents on that topic, now get mining!

 

htop-web2

All in one webserver from the ground up. A Virtualized Debian How-to

2

< This is the only image you get, as this is going to be a very text centered post.htop-web2

I figured after virtualizing my entire network a few weeks ago and while learning alot, I also rebuilt several machines, and documented the rebuild. So from those notes, I’m going to finally get around to how to securely host and build a website, from the ground up.

We’ll start with a bare bones debian 6 install (this guide will work for ubuntu server 12.04 as well) on a virtual host.

I’m also using this guide as a walk-through for myself, so I’ve included the instructions on getting vmware-tools installed, if you’re doing this on bare metal, skip that part. :)

Most of this should be done as the root user. In ubuntu, to gain root use the command:

Also to get the basics out of the way I will be using nano as my text editor, to save in nano use the keys

or to save and exit use the command

I will assume you know how to save a file from this point forward.

To get started let’s get our environment setup, it makes life easier in the end.

Uncomment the lines in the root .bashrc file

Save and exit * I won’t be telling you this again, if the files done being edited, save and close it! :) *

Force your current session to use the new .bashrc file.

You should now have colors when displaying the contents of your directories and have a shortcut to restart apache once we have it installed.

But before we install the web server let’s finish getting prepped. (ubuntu users, don’t add the netselect-apt in the next command, it’s not available in your repos.)

If your curious on how any of these programs work in more detail, you can always turn to the “man” command. I do often, so I like my man pages in color. If you do as well, use this, and select the option that references “most” (usually 3 in my experience)

Now let’s create a normal user (ubuntu users will already have a normal user, and can skip this part)
*replace <yourname> with Your name.*

and then answer the questions it asks as best you want.

Now let’s also give this user the ability to manage this server using sudo.

Copy the syntax for the root user replacing root with your username from above.

Now Debian users with netselect installed, use this list of commands:

then

Now we can start installing the vmware-tools. First click the option on your vmware console to install tools or guest additions. This will insert a virtual cd-rom in your virtual machine. I know right!?! How deep DOES the rabbit hole go?! Anyways.

Welcome back :) Login as your normal user from here on out and gain root using “sudo su“. It’s just good practice.

Comment out the default settings for the eth0 interface as we want a static IP address for a server and add something like this (changing the values as needed for your network of course!)

Then restart your network.

You will probably get disconnected if you’re using ssh to connect. This is to be expected and you should now be able to ssh to the IP address you just set.

Now let’s set the hostname of the server.

And append the same name to the hostname file and restart the service.

Being ssh is probably going to be left open, let’s start to automate banning of brute force attempts for our ssh login (moving ssh to a non standard port is also a good idea!)

Setup the times and purge options as you see fit and then restart denyhosts.

And let’s FINALLY get to installing that webserver like I promised!

That’s it! your webserver’s installed! Now let’s configure it!

Now let’s build the config for the website you’ll be hosting.

There are alot of options you can define in here, but to get you started make sure you have the DocumentRoot, ErrorLog and CustomLog defined in this config file.

Using our example above, let’s create those directories.

And bring this site online, and remove the default site

Your website should now be online! w00t!

Let’s get the rest going so we can get something more dynamic then html websites.

Enter in a SQL root password when prompted. (SHOULDNT BE THE SAME AS YOUR ROOT PASSWORD!!!!!!!!!!!!!)

And let’s harden our SQL environment as this is not a developer server.

You don’t need to change your SQL root password if you set a good one above. if it’s the same as your normal root user’s password, change it ffs! Answer yes to the rest of the questions.

Now this next line will install php. Lot’s of php. This command should be entered in as one single line!

These settings will get you off to a good start, but more tuning can be done. Search for the following and make the needed changes in this file. (search in nano using “Ctrl+w” and typing in the keyword.

(You do remember you can type in ^ arestart ^ instead of that line throughout this gude if you used my .bashrc edits, right? ;) )

And of course a web-gui to your SQL server is super handy, so let’s add that as well.

Select apache2 when asked, and choose yes to create the default database. Enter in the SQL root password, and then leave the next password prompt blank to have a random one generated, as you won’t need it.

Almost done!

Let’s set the permissions on the folders we created.

And your set!

Let’s go one step further and setup a firewall to finish it up, just in case you’re not behind a seperate firewall (Check out untangle if you’re looking for a good one!)

This will install the “Uncomplicated Firewall” that works with iptables, and makes life alot easier!
For more help with ufw settings check out this guys site, it’s got a pretty good rundown and examples.

You should now get a result that says the following:

Of course this is the basic setup, you can further limit ssh to local connections only etc.

And your website is ready for stage 2, Content! You now have a memcached apache http server with php5 and mysql ready for the world wide web! Good luck!

(The stage 2 post will come soon!)

 

** EDIT **

After a few month’s with this setup I’ve started getting several mail objects that say:

This is a RAID status update from mpt-statusd.
The mpt-status program reports that one of the RAIDs changed state:

Report from /etc/init.d/mpt-statusd on virtual-proxy

Being it’s a virtual machine there’s no raid state to worry about (at least not from the guest side…) so unless you have a reason for it, just stop the mpt-status daemon. Do the following:

to stop it from it’s currently running state, and then

which will remove it from several startup scripts that run on boot.

That’s it, no more mail from that problem :) Hope your install is running as smoothly as mine has been!

2012-10-08_11-24-09

Remotely add a domian user to the local machines remote desktop group (win7)

0

So here’s another problem that I’ve run into at work, that I just wasn’t able to find a good resource to answer, so I’ll go ahead and post my workaround so that it might help someone, or myself sometime later.

Let me first explain the problem I was running into so that you get an idea of why and how this happened.

I work for a managed service provider, and we were just getting ready to migrate them away from their old POP3 email to office365′s hosted exchange server, and at the same time we were replacing about 20 pc’s.

The computers were built in house, and most of the work, adding updates, software, users, and enabling remote desktop etc was done locally before the computers got delivered to the remote offices as well.

The computers were delivered, and installed, and everything was going fine, their old email was setup in outlook, and they were able to connect to the main remote desktop server running a few select pieces of software just fine. Sweet!

A week goes by and it’s time to start making sure all of my ducks are in a row before pushing out the new settings for outlook to connect to the new email service, so I tried to use remote desktop (RDP herein) just to test it out. I get an error along the line’s of:

To log on to this computer, you must be granted the Allow log on through Terminal Services right. By default, members of the Remote Desktop Users group have this right…

Now first, understand I was logged in as a domain admin. This error was definitely unexpected.

I try logging in as the local machine’s admin account, and get the same error message. Now I’m starting to get worried, these remote offices are not exactly close, and I really don’t want to spend the next 2 days running all over the place to add the user to the local machines Remote Desktop Users group, but it’s starting to look like that’s what’s going to have to be done, as I can’t just call the end-user, give them the local admin’s login info, then have them start a teamviewer session so that I can add the users to the local RDP group.

But wait! Now I remember, there’s a “Run As” option in windows!

We’re going to need some kind of remote access to the machine to get this configured so I call the user, have them run the teamviewer quick support app (No I don’t get paid by them I just really love the service!) while still logged in as the domain user.

Then here’s the workaround.

Click the start button, type in powershell, but DONT click it yet!

Hold down “Shift” then right-click it. You should see an option for “Run As a different user”

Then you will get a login prompt!

Sweet! Go ahead and enter in your cred’s.

This will open a powershell prompt as the user you just entered the creds for (in my case the domain admin). Neat! Now I just need to open the local machines user and groups settings to add the users. Type in “lusrmgr”.

This will open a window I hope your familiar with,

Now you should be able to add users the same way you usually do! Nice!

If you need a hand actually adding the users to the RDP group, I’ll go ahead and finish walking you through adding a user, but for everyone else, you should be good to go! Enjoy!

To add someone to the RDP group, first click Groups in the left side window (1) in the Local Users and Groups window, then in the main window section, double-click Remote Desktop Users (2).

From this next window, Click Add:

This will open up another window, if you already know the name’s go ahead and start typing them in, click “Check names”(1) and “OK” this will add a user, I don’t usually know all the name’s so I go this route:

Click “Advanced…” (2)

Then hit the “Find Now” button to populate the list with all of the members and groups of your domain (I’ve already done this in the following picture).

Select all of the users and groups you want added and click “OK” and viola! They’ve now been added to the local machines Remote Desktop Users group, remotely, and without giving up the admin’s account info to the end-user! Yea! You should now be able to login as the users you selected to that machine, and can disconnect your teamviewer session, and continue administering that machine via RDP like you wanted to before.

Good Luck!

Also a side note, I don’t believe that Windows XP had the command “lusrmgr” so you might need some tweaking of this to make it work for you. But then again, it’s time to upgrade if you’re still using XP anyways, End of life support for XP is April 8, 2014 just in case you needed to start thinking of that!

title

My Five Dollar Raspberry Pi Case Build

1

So I just posted the pictures to Google+ and of course wanted to post them to my site as well, and of course in much better detail.

I just wanted something easy to take apart, and didn’t cost alot because I knew my friends would want one. (I’ve built 3 now, and more people keep asking..) and was strong, as I do alot of running around, and project fairs.

This has turned out better then I had expected, and am really quite pleased. It starts with a few off the shelf parts (I got mine from Lowes) and consist’s of:

  • (2) PVC Romex Handy Box Covers (with the knockout option)
  • (4) Nylon 1/4″ x .104 x 1″ spacers (two packs of two)
  • (4) 6-32 x 1 1/2″ Pan Head Steel Bolts (one bag of eight, I’ve got extras)
  • (optional) Spray Paint, Rounded 6-32 end caps (Pictured at the end)
Let’s start by getting the nylon spacers painted. lightly nail them upright into a scrap of wood, and then paint them.
Next I knocked out the hole on the box cover that was to be the top, and then cleaned up the edges with a razor knife and some sandpaper.
(this is part of the reason to go with PVC covers, it drills and cuts MUCH easier and is softer so it won’t hurt it if you go too tight during assembly or need to clean up an edge with a razor knife.)
You’ll notice I have notched the bottom part. This is to allow room for the SD Card to lay flat. I did this by melting through most of the way (from the back side) with an old soldering iron, and then trimming down the sides with a razor knife. I also melted the flange on the stock holes to allow it to sit as deep as possible in the bottom cover (and yes I did this before painting.)
Here’s the parts, ready for assembly!
(The heat sinks are about ten bucks at Frys and are for RAM if you were wondering)
It’s important that the holes next to the USB ports allow the spacers to sit close to the sides of the USB ports. This case relies on the flange at the end of the USB ports to help hold the Pi in place. Also put this side together first. It’s just easier.
(see how nicely those small flanges will keep the Pi from sliding out! Perfect!)
And that’s about it! Here’s some more pictures of the final product, and a copy of the reciept from Lowes, in case it might help you find the same parts.
Bob_Seger__The_Silver_Bullet_Band_-_Turn_the_Page-2012-07-28_03.45.08

Stream My Pi

2

Alright, so most of my friends already know, I’ve recieved one of my Raspberry Pi computers!

w00t!

So being my old love is streaming radio, I figured why not get this little guy pushing out some tunes for me!

MPD To the rescue!

Now I did a post for Ubuntu 10.04 a while ago where I had custom compiled a .deb file that included mp3 support, however the new version of MPD for the pi has it already built in! Double sweet!

So here’s how to get it started.

First install a few apps. I personally prefer ncmpcpp as my local client to control my MPD stream from the cli. And of course you’ll need to install MPD.

 

Type in “Y” when it asks if you would like to install the dependencies as well, let it run and install your requested apps.

Shucks, you’re already half way done!

Now you just need to configure your server (mpd) and client (ncmpcpp) to cut down on overhead I’ll just be using the built in httpd stream as well as the alsa mixer, however the config files are much more built out with better examples then they had on my last post, so configuring them should be quite simple these days.

In order to get MPD working as your local user “pi” in this case, we’ll first need to create some directories and files. Enter in the following commands one at a time from the pi user’s home directory.

That will create the “state” and “pid” file in your .mpd folder and the “cache” and “sticker.sql” files in your .mpd/db folder.

Now let’s backup the original mpd.conf file and then edit the original file.

You can copy it straight up if you like, as your username is most likely “pi” as well. I’ve set my default music folder to “/home/pi/Music” and Playlists to “/home/pi/Playlists” if you don’t have these directories either, go ahead and make them with the mkdir command, I’ll wait.

Alright, here’s my /etc/mpd.conf file (click it to expand, it’s kinda long):

I went and left all of the default comments in there, but of course if you want to make it more readable feel free to remove what you don’t use.

So, yea. MPD’s ready. Just restart it.

Now let’s get our client up and running so we can start playing some music!

This one’s a little more tricky as the default config file is hiding and compressed.

First let’s create the local config directory like we did for MPD.

and let’s copy the example config over to our new directory.

and then extract it.

Now go ahead and edit that file.

Again, these are the settings I used, but it’s well documented so feel free to make changes as well. Here is my config for ncmpcpp (again, click it to expand it, it’s even longer…)

So yea. That’s it! You should be up and running!

Start ncmpcpp in a tty with the logical command of “ncmpcpp” This will open the client app and allow you to start playing music! Being it’s a command line app, most of the work is done with keyboard commands. Press the number “1″ on your keyboard (NOT on the 10key if you have one to the right of your normal keyboard but the numbers above the qwerty row) and you will be shown a VERY long list of keyboard commands to control ncmpcpp, however the arrow and space and enter key’s will get you through most of it easily.

Plug it in to your amplifier, or better yet, grab your android phone and grab the free app called “MPDroid” it’s the best app I’ve found to interface with MPD. Now you can control your music from your phone, and get a stream of it sent TO your phone as well! No wires needed! (however it will be significantly buffered, so be patient when you first choose to start your stream)

Not too bad right!

Enjoy and if you have any questions, feel free to post a comment, here or in our forums, or even in my IRC hangout at italktomachines.com !

Daniel Stinebaugh's RSS Feed
Go to Top