MC_Crafty ~ $ ls -al > blog.html

Kamisama no Memo-chou

Recently I started watching an anime called Kamisama no Memo-chou in which a loli detective solves crimes from her computer. While it’s very entertaining and well written, I have one problem with it.

Her room, pictured above, is where she stays for 95% of the series. All her food is take out and delivered to this room. She’s only seen drinking soda. This is also brought to her from her fridge which is full of nothing but. She never leaves bed, and has designed her room around this principal.

This perpetuates the stereotype that hackers/programmers/NEET compsci nerds all are basement dwellers who leave bed only when absolutely necessary, only eat take out, and only drink copious amounts of caffeine. Although I know a few people this holds true for, I know more people who it doesn’t.

With the growing fear for data security and our lives becoming more centered around technology, it’s these stereotypes that hold the general public back from accepting that the people being stereotyped make their lives safer. The more flaws exposed, the more flaws patched, the less flaws exploited.



/rant

Code post today. This time we have

BashMarks.sh

One of the first sh scripts I made. This script is loaded from your shell’s profile and is used to remember directories and commands for a MUCH easier time in a CLI. I normally just remember the commands or use a perl hak for it, but I thought I’d give some sh a try and make something useful for once.

I had found some like this online, but I couldn’t find one that had a delete command or one that supported saving commands. Some of them could only save 10 dirs and some didn’t have a command to save a dir so you had to manually enter it into a text file. I didn’t like the way they worked or lack of functionality so I made my own.

It saves two files in the home dir that are just the list of BashMarks. One file for dirs and another for commands. There are some hacky fixes for how the data stream is returned from some commands, but it does what I needed it to do and that was good enough for me. It was never intended to be released, but on request of a friend, I put it out there and now out here.

Code~




#                   ::::::::          
#         :+:      :+:    :+:         
#    +++++++++++  +:+         +++++   
#       +:+      +#+         +#  +#   
#      +#+      +#+         +#        
#     #+#      #+#     +#  +#  +#     
#    ###       ########+   ####+      
#
# tCc|MC_Crafty
# mc_crafty@gmx.com
# bookmark directories and commands on a terminal. y u no long cd command?
#
# Based on work by Todd Werth - todd@toddwerth.com
#
##################################################################
# Install #                                                      #
###########                                                      #
#                                                                #
# copy:                                                          #
# source [/location/to/]bashmarks.sh                             #
# in your .bashrc file                                           #
#                                                                #
##################################################################
# Use #                                                          #
#######                                                          #
#                                                                #
# Make a BashMark (do not use spaces):                           #
# bm foo                                                         #
#                                                                #
# Delete a BashMark:                                             #
# bd foo                                                         #
#                                                                #
# cd to a BashMark:                                              #
# bc foo                                                         #
#                                                                #
# Make a BashMark for a command (do not use spaces):             #
# bmc "foo --foo -f foo" foo                                     #
#                                                                #
# Delete a BashMark for a command:                               #
# bdc foo                                                        #
#                                                                #
# Run a BashMark for a command:                                  #
# br foo                                                         #
#                                                                #
# To see a list of bashmarks:                                    #
# bs                                                             #
#                                                                #
##################################################################
#                                                                #
# Tab completion works for using BashMarks                       #
# It does not work for deletion to proctect your BashMarks.      #
# It defaults to directories and then checks commands            #
#                                                                #
##################################################################

bashmarks_file=~/.bashmarks
bashmarks_command_file=~/.bashmarks_commands

# Create bashmarks files if they doesn't exist
if [ ! -f $bashmarks_file ]; then
    touch $bashmarks_file
fi
if [ ! -f $bashmarks_command_file ]; then
    touch $bashmarks_command_file
fi

# BashMark - Create the mark
bm() {
    bashmarks_name=$1

    if [ -n "$bashmarks_name" ]; then
        bashmarks="`pwd`|$bashmarks_name" # Store the mark as folder|name
        if [ -z `grep "$bashmarks" $bashmarks_file` ]; then
            if [ -z `grep "$bashmarks" $bashmarks_command_file` ]; then
                echo $bashmarks >> $bashmarks_file
                echo "Bashmark '$bashmarks_name' saved"
            else
                echo "Bashmark '$bashmarks_name' already exists as a command"
            fi
        else
            echo "Bashmark '$bashmarks_name' already exists as a directory"
        fi
    else
        echo "Invalid name: '$bashmarks_name'"
    fi
}

# BashShow - Show the marks
bs() {
    echo "BashMarks:"
    cat $bashmarks_file | awk '{ printf "%-50s%s\n",$1,$2}' FS=\|
    echo "BashMarks Commands:"
    cat $bashmarks_command_file | awk '{ printf "%-50s%s\n",$1,$2}' FS=\|
}

# BashCd - cd into the mark
bc() {
    bashmarks_name=$1

    bashmarks=`grep "|$bashmarks_name$" "$bashmarks_file"`

    if [ -n "$bashmarks" ]; then
        dir=`echo "$bashmarks" | cut -d\| -f1`
        cd "$dir"
    else
        echo "Can not find directory for: '$bashmarks_name'"
        echo "Searching commands..."
        br $1
    fi
}

# BashDelete - Delete the mark
bd() {
    bashmarks_name=$1
    
    if [ -n "$bashmarks_name" ]; then
        bashmarks=`sed "/|$bashmarks_name$/d" "$bashmarks_file"`
        if [ -n "$bashmarks" ]; then
            rm $bashmarks_file
            echo $bashmarks | tr ' ' '\n' >> $bashmarks_file
            echo "Bashmark '$bashmarks_name' deleted"
        else
            echo "Can not find: '$bashmarks_name'"
        fi
    else
        echo "Invalid name: '$bashmarks_name'"
    fi
}

# BashMarkCommand - Create the mark
bmc() {
    bashmarks_command=$1
    bashmarks_name=$2

    if [ -n "$bashmarks_name" ]; then
        if [ -n "$bashmarks_command" ]; then
            bashmarks="$bashmarks_command|$bashmarks_name" # Store the mark as command|name
            if [ -z `grep "$bashmarks" $bashmarks_command_file` ]; then
                if [ -z `grep "$bashmarks" $bashmarks_file` ]; then
                    echo "$bashmarks" >> $bashmarks_command_file
                    echo "Bashmark '$bashmarks_name' saved"
                else
                    echo "Bashmark '$bashmarks_name' already exists as a directory"
                fi
            else
                echo "Bashmark '$bashmarks_name' already exists as a command"
            fi
        else
            echo "Invalid command: '$bashmarks_command'"
        fi
    else
        echo "Invalid name: '$bashmarks_name'"
    fi
}

# BashRun - Run the command for the mark
br() {
    bashmarks_name=$1

    bashmarks=`grep "|$bashmarks_name$" "$bashmarks_command_file"`
    if [ -n "$bashmarks" ]; then
        command=`echo "$bashmarks" | cut -d\| -f1`
        $command
    else
        echo "Invalid name: '$bashmarks_name'"
    fi
}

# BashDeleteCommand - Delete a BashMark command
bdc() {
    bashmarks_name=$1
    
    if [ -n "$bashmarks_name" ]; then
        bashmarks_check=`grep "|$bashmarks_name$" "$bashmarks_command_file"`
        if [ -n "$bashmarks_check" ]; then
            bashmarks=`grep -v "|$bashmarks_name$" "$bashmarks_command_file" | awk '{printf "%s|%s¶",$1,$2}' FS=\|`
            if [ -n "$bashmarks" ]; then
                rm $bashmarks_command_file
                echo $bashmarks | tr '¶' '\n' | awk 'NF > 0' >> $bashmarks_command_file
                echo "Bashmark '$bashmarks_name' deleted"
            else
                echo "Error on: '$bashmarks_name'\nPlease report"
            fi
        else
            echo "Can not find: '$bashmarks_name'"
        fi
    else
        echo "Invalid name: '$bashmarks_name'"
    fi
}

# TabComplete - List all marks, grep for match
_tabComplete(){
    cat $bashmarks_file $bashmarks_command_file | cut -d\| -f2 | grep "$2.*"
}
complete -C _tabComplete -o default bc br


(Source: staypozitive, via listenxandtouch-myheartbeat)

[Flash 9 is required to listen to audio.]
ISHC – ISHC Theme Song (11 plays)

Music time again. This time we have the members of NFG rearranged into:

The International Superheroes of Hardcore (ISHC)

Takin' It Ova'

This band is awesome. Period. They embrace the fun in music and show that even though you’re playing fast and heavy, you don’t have to be angry too. They’re songs are fun and usually take a comedic turn while promoting good values and acceptable behavior.

With lyrics such as, “Forget the Ghost Busters; I’ll punch a Carebear” and “Even though he rides a broom, Harry Potter’s hard core” it’s hard to not have a smile while an ISHC 7” is playing.

Code post today. First up for code is:

TranslatePage.js

This is a really simple yet effective javascript extension for http://goosh.org. To start off, Goosh is a shell emulator for Google. It didn’t have an interface to Google Translate and I wanted to translate some webpages, so I made an extension to give it this interface.

To use it, start using Goosh and type, “load http://thecuteclub.dyndns.org/js/translatepage.js

Code~




//                   ::::::::          
//         :+:      :+:    :+:         
//    +++++++++++  +:+         +++++   
//       +:+      +#+         +#  +#   
//      +#+      +#+         +#        
//     #+#      #+#     +#  +#  +#     
//    ###       ########+   ####+      
//
// tCc|MC_Crafty
// mc_crafty@gmx.com
// simple module to translate full page. y u no lang?


goosh.module.translatepage = function() {
    this.name = "translatepage";
    this.aliases = new Array("translatepage","transpage","tp");
    this.parameters = "[lang1] <lang2> <url>";
    this.help = "google page translation*";
    this.helptext = "Translate full webpages with Google, using google's 2 character language codes";

    // Adds args to google translate's url string and returns
    // "http://translate.google.com/translate?sl=SOURCE LANGUAGE&tl=TRANSLATE LANGUAGE&u=URL TO TRANSLATE"
    this.convertToURL = function(lang1, lang2, webbie, auto) {
        var newpage = "";
        newpage = webbie;
        newpage = "&u=" + newpage;
        newpage = lang2 + newpage;
        newpage = "&tl=" + newpage;
        if (auto) {
            newpage = "sl=auto" + newpage;
        }
        else {
            newpage = lang1 + newpage;
            newpage = "sl=" + newpage;
        }
        newpage = "http://translate.google.com/translate?" + newpage;
        return newpage;
    }

    // Opening function, checks args and opens window
    this.call = function(args) {
        var lang1 = "";
        var lang2 = "";
        var webbie = "";
        var auto = false;
        // 1-sl 2-tl 3-url
        if (args.length == 3) {
            lang1 = args[0];
            lang2 = args[1];
            webbie = args[2];
        }
        // 1-tl 2-url
        else if (args.length == 2) {
            lang2 = args[0];
            webbie = args[1];
            auto = true;
        }
        // If a language to translate to, and a url are not given, don't try
        else {
            goosh.gui.error("Could not translate.");
            return false;
        }
        // Format url and open in place of this page
        var goodurl = this.convertToURL(lang1, lang2, webbie, auto);
        window.open(goodurl, "_top", "", false);
    }
}

goosh.modules.register("translatepage");

Video game post. Up this time we have:

Minecraft: A Journey into Puppy Town Part 1

After making a post about my house on the new server I play on, I figured I should make a post on the old house turned town I made on my old server (last update on the server was a week or two after wolves). Then I realized the amount of detail that was put into this and figured I should split it into 2 parts. I should mention after being asked from my last post, ANY AND ALL MINECRAFT POSTS ARE DONE LEGIT. NO MAP EDITS. NO CREATIVE MODE.

Part 1: The Basic Town

I wanted to make myself a house. An awesome house that resembled one from an old timey console rpg from the ‘95 era. After wandering for a bit, I saw a mountain. Bored with not a lot happening in minecraft at the time beside the secret Friday updates, I removed the mountain. This is where I built my house. I found there was enough space, I should make a whole classic rpg feeling town. So I did. And I named it Puppy Town.

The town itself has two main roads. The first of which is Market Road. Complete with stables, cartographer, granary, stock pile, tanner, weaver, blacksmith, Fletcher, rail station and sign board for community sales. This road has the feel of a bustling marketplace and high detail. Each shop has the tools and materials needed for it’s purpose.

The second main road is House Road. After building my house here, I built a few more with the same basic design. It was going to be a town, after all. I later sold the other houses to other players on the server when the town was mostly complete. With a well at the end and the basic amenities at the time like crafting table and single chest and bed being included in all homes, it seemed very nice.

This road also includes Puppy Town Keep. A fully furnished and detailed military garrison as well as throne room. This building really helps to keep the console rpg feel, as most towns in that era of games were focused around some type of castle.

That’s all for the basics.

The fun parts will be in “Part 2: Puppy Town Mine, Secrets and Pokemon”

Video game post. This time about:

Minecraft

This is going to be a short one. To start out the games section on here, I thought I’d make a post about the start of my current house on the Minecraft server I play on. My house is on a small island, and for a while was cut off completely from the mainland, until a friend on the server built this lovely wooden bridge to connect me for easier travel.

The bridge itself is four blocks wide, with fences following each side. A simple build, but it’s so useful I thought it deserved a post and was a good way to kick things off.

The house in the background is my own. A very simple two floor design with balcony can be seen from the outside. The inside has much more and is more complex then I thought I’d be able to make it, with many secret passages and epic builds including a 32 note, 5 track, programmable music sequencer of my own general design. But that’s for another post…

[Flash 9 is required to listen to audio.]
Blood For Blood – Tear Out My Eyes (30 plays)

Music time. First up:

Blood for Blood

Blood for Blood - Outlaw Anthems

When I think of real hardcore, a few bands come to mind. Cro-mags, Void, Minor Threat, and Blood for Blood. Old school thrashing hardcore with tight riffs and street driven lyrics. I’m a big fan of the Boston hardcore scene and Blood for Blood are my favorite.

Aggressive lyrics about the downs of life and the botherhood found between people down on their luck and beaten by the system. This song is about finding out how messed up the system really is and being so disgusted by the corruption that you can’t bear to look at it anymore. It’s also one of their few clean songs.

If you like any kind of hardcore, hard rock, or metal, give them a listen. If you like what you hear, buy some of their merch.