Sunday, February 17, 2019

PowerShell Check Sum

Get-FileHash

When doing those file downloads Get-FileHash is an easy way to do those check sums. The documents for Get-FileHash are a great reference.

Example


Get-FileHash  .\apache-maven-3.6.0-bin.zip



Tuesday, November 6, 2018

Updating Azure Hosted Minecraft Server

Update the Server

Introduction

Currently we maintain a Minecraft server and it needs to be updated with the latest jar file from time to time. This post will track that so I don't have to keep looking it up.  This assumes that you have set up ssh and a passphrase for a Linux VM in Azure and a File Storage resource.

Step One - Get server.jar file

First step is to get the latest jar file and here is the server address to get the jar file. Download the latest to your local drive.

Step Two - Upload server.jar file to File Storage

Using the Azure portal access the File Storage that is the resource you use to hold files. Upload the jar file from your local drive to the Azure File Storage using the portal interface.

Step Three - Move the file from File Storage to the Linux VM

Using the Azure Cloud Shell use the scp command to send the file from File Storage to the Linux VM home directory of the user. Open up the Azure Cloud Shell and move to the cloud storage directory. Use ls to see the cloud storage and cd to move to that directory. In there you should see the new jar file that was uploaded. Use the following scp

scp ./minecraft_server.1.14.3.jar username@domain.com:/home/username

Replace with your ssh username and the domain address to the Linux Virtual Machine. You will know it worked when it asks for pass phrase. If the passphrase is right, but getting denied, drop the /home

Step Four - Move the jar file to the server folder

Use ssh and the passpharse to get to the Linux VM

ssh username@domain

Once in home directory using ls you should see the jar file. Use the mv command to move the file to the ../../srv/minecraft_server folder. Use sudo.

Step Five - Update the service file

Stop the service using the following command.

sudo systemctl stop minecraft-server

That will stop the service. Go to /etc/systemd/system/ and using the ls should see the minecraft-server.service file. Open with nano using the following command

sudo nano minecraft-server.service

This will open up the service file. Update the jar file name to have the new file name. Use the commands to exit and save the file. Then run this command to reload.

sudo systemctl daemon-reload

Then run

sudo systemctl start minecraft-server

That should be all there needs to be done. If a refresh from the client doesn't work. Try restarting the Linux VM. 


Monday, January 23, 2017

How I ran jQuery in Chrome dev tools

Today I wanted to run some jQuery code in the snippets window of the Developer Tools in Chrome.  I tried a few different things with adding a script tag and it didn't really work out for me.  So I went to the latest jQuery CDN page, opened the min source code in a new tab. Copy paste that code and create a new Snippet.  Place the code in there and run it.  Then you have jQuery.  I have it saved off and then just update the file when jQuery updates.

Thursday, December 29, 2016

Used Python to Find Diamond Ore in Minecraft

I have been working on learning Python by creating mods in Minecraft.  Working my way through this Learn to Program With Minecraft book and I decided to modify one of the missions in chapter four that talks about posting a message to the users.  Well one message that I have always wanted to see is if there are diamonds around me.  I wrote a script with some loop nesting and slow as can be, but it finds diamond ore and posts a message with position values so I can find them.  Below is that script.

from mcpi.minecraft import Minecraft
from mcpi.minecraft import Block
mc = Minecraft.create()

pos = mc.player.getPos()
distance = 10
totalCheck = 0
for x in range(int(pos.x), int(pos.x + distance)):
    for y in range(4, 17):
        for z in range(int(pos.z), int(pos.z + distance)):
                blockId = mc.getBlock(x, y, z)
                totalCheck += 1
                if (blockId == 56):
                    mc.postToChat("block: " + str(blockId) + "x: " + str(x) + " y: " + str(y) + " z: " + str(z))

mc.postToChat("Total blocks checked: " + str(totalCheck))



Saturday, December 3, 2016

Time To Be Prolific

I keep forgetting to blog!  LOL, not forgetting, just haven't.  And since I don't really produce much, it doesn't really matter.  But this is about to change, I am going to become prolific.  I am going to start doing so many things, something is bound to succeed.

I am going to start coding on my own projects again

Make a mobile app - Xamarin
Convert my API - Java -> c#
Put more cool JS on my site -> not sure yet, need ideas
Do something with FB -> need some ideas
MOD Minecraft with Python

Said it before, but going to do it this time, going to stay on it.


Friday, December 6, 2013

Have Not Blogged

I haven't written anything for awhile.  And most of that isn't very good.  It isn't good at all.  Someday, I am going to write something worth reading.

Thursday, March 7, 2013

Windows Media Player and KRCL Live Stream

I love my community radio station KRCL.  They used to have a live stream that has never really worked well with Windows Media Player.  But they now have a new stream!  This stream seems to work really well with Windows Media Player.  The instructions here explain that all you have to do is CTRL+U and drop in the stream links for KRCL .  Scroll to the bottom for the internet radio instructions.  All the details are here with the links for the stream.  Thanks KRCL for making my Beatbox with Bluetooth connection that much cooler.

Update, they have a player that works great.  Those links are dead 404s now.