Almost a year…

Posted on by

Pre-warning, this post may just jump randomly from topic to topic and might not even be coherent to some people. I’m writing this in the order it flows in my head, so I can’t even keep all of it straight. P.S. I’m writing this on my iPad, so there’s bound to be random autocorrects that I don’t catch.

It’s been almost a year since I last posted on here. Mainly because when I do have the time to write, I can’t remember what I needed to say and when I do remember it’s when I’m not near a device to type it on and I forget by the time I’m near something.
I think because of my new medication some of my doctors are getting what they asked for from me and that’s the fact I think I’ve gained roughly 15 pounds in the last three weeks, yet I’m still below where they tell me I need to be. The good news is that all of the side effects these drugs have, the worse I’ve really come across so far is that I have to pee like all the time (but that just proves my new ‘gut’ isn’t just water weight or something).

My main server (not my hosting servers) died back in mid September and I haven’t had the money to fix it yet, so the last few months have been kind of boring and taking a toll on my depression. Don’t get me wrong, I do get out once in awhile and I have a few friends I kind of hang out with, but my life is far from ‘social’ mainly because I either can’t afford to go anywhere and do stuff or I always feel like I’m a burden on others, like making people wait around because I move slower than I used to… Or more often than not at a store when you can never seem to find an employee to help you have to rely on strangers to get stuff off shelves you can’t reach. Most people are nice about it but it only takes that one asshole that gives you the look like “Yeah, alright” or “Bet you’re probably faking it” since it’s not as common to see a guy in his 30’s riding around in the electric wheelchair, and for those that don’t know me personally most people guess my age in the late teens early 20’s.

My one doctor said it’d be good for me to write stuff down and it’ll help me work through some things but also it may help timeline if/when I start showing worsening signs of memory loss. I’ve looked at a bunch of those “1 a day” apps where you either take a photo or write something about your day everyday and it’d be a great idea, but I already have the foresight to know that shit might last a week before I forget once or just said to hell with it and it’d make the whole thing a moot point anyway. I’ve still got to get a primary care replacement for my last Doctor that moved to a different city but I’m so not looking forward to the whole ordeal of explaining all the shit wrong with me to yet another person when I wish I could just say, “I’m fucked up, physically, mentally, and emotionally, but here’s the medications I need, I’ll be on my way now.” 

New topic… Navient (formally Sallie Mae) are the biggest bunch of assholes. For the longest time (up until a couple months ago) they kept screwing up my student loans. If you’re a person on SSI and/or Disability, you can request a forbearance or deferment that pretty much means you don’t owe any money now, but they still add the interest to the loan and resume payments usually in a year (or get that extend by another year if you’re still on assistance). The problem I have with these morons is they would call me and say something like “You’re $3000 behind on your payments, we can take a check or credit card over the phone. How will you be paying your bill today?” And first off, the dollar value they tell me is wildly sporadic, sometimes it’d be like $200, other times I’d be closer to $5000. Each time they call I have to explain EVERYTHING all over again about the disability, they’ll say they are checking the account and they apologize and will process my account so I’d be caught up FOR A YEAR. They guarantee me every fucking time, “You’re all set and have no payments for a year” and 2 to 5 months later, they’ll call and do the same dumb shit. That’s sadly not even the worse part of what they are doing. I recently attempted to do some debt consolidation and although all my student loans are pushed, they keep reporting to the credit agency monthly saying my debt went up or more often than not that I’m late on the payments. So, legally I don’t owe them a fucking cent, but because they refuse to report the proper information, the bank sees an extra $57,000 worth of debt that I can’t do anything about which total kills my debt to income ratio. Therefore, I’m in too much debt to have enough credit to pay off my debt. Seems a little ass backwards to me. The bank I went to had a very nice loan officer and she tried her best to get me approved for what I needed, but now I’m stuck in a limbo/hell with no idea who to talk to next to try and fix this. Social Security is a pain to deal with so I can’t ‘borrow’ money from a friend of family member that even though I’d pay them back as if it was a bank loan because for about a day the money would sit in my bank account before going off on it’s merry way to the credit card companies, it’d count all that as income and use it against me. I’ve attempted a bunch of different searches online for the recommended way to do debt consolidation while on assistance and most of the things I could fit into 1 of three categories. Someone else asking similar questions, sites/people giving kind of shady advice or services, and sites that seem like they are trying to up sell you on shit you don’t want or need.

I have a doctor appointment in 6 hours and still haven’t gone to sleep yet. Sometimes I hate my life.

I don’t get how the government expects people to live off the low amount of money they give. If you take a ‘normal’ person that work for 40 hours a week for an average of 50 weeks, that’s 2000 hours of work. Sadly in the area I live in, there’s a good chunk of the working class that doesn’t make 40 hours a week. However, I’ll still use the 2000 hours for my example: at $8 an hour, that’s $16,000 so it’s kind of safe to say that most people in this area make probably $12,000 or more and I make less than that.

If I continue to make this many mistakes while typing I may have to start having someone proof read my posts before I make them public. Speaking of posts, I’m going to be revisiting my protocols posts and not only update those a bit, but add some new stuff, like adding Atom as an alternatives to Sublime and kind of do a tutorial on setting up a basic web development environment.

I may either edit this post or create another post later today/tonight but I think this is good for now.

Category: Uncategorized

What the hell……..??

Posted on by

§ Recent Changes §
I’ve written at least 3 or 4 posts since the Destiny one that I thought I had set to auto post on certain dates, as well as a handful of drafts with ideas, etc. that I wasn’t ready to post and it appears that none of that worked. They obviously didn’t post and the drafts have all disappeared. I know it wasn’t a hacker or someone trolling me… which means I either did something stupid, I don’t remember like deleting the posts or my memory is getting worse. My guess is that latter…

On any note, here’s only a little of what I had written since I can’t for the life of me remember 99% of it. First we’ll start with some of the medical cause it’s always on my mind.

§ Medical §
With the stigma of mental illness, we’ll start by ‘rehashing’ some old posts with new information. I’m too lazy to check the date, but I’ve occasionally talked about another person over the last year or so and have mentioned that they were diagnosed with schizophrenia… I still haven’t asked for permission to talk about ‘them’ specifically, but anyone that knows me personally may be able to venture a guess at who I’m talking about… (please don’t guess publicly). If you haven’t figured it out already, knowing that I’m not only related to him, but we’re close enough for me to be concerned as well since it can be hereditary. Well, the good news so far is that although it took a few months, his doctor’s managed to find the right mixture of medications and doses that not only does he not show many signs of the illness, but he’s actually changed and became more sociable then he had been prior in his life. It’s a struggle every day, not just for him, but for all of us involved, and it’s gotten to the point that most of my medical issues are ‘put on the back burner’ as they say. I don’t mean this is a “Hey, I’m sick too, pay attention to me…” or anything along those lines since I’m sure I could come up with better reasons for people to pay attention to me and trust me, I hate being sick and dealing with all the issues I have.

Keeping that in mind, this is my blog after all, so might as well update you on a bunch of my fucked up problems too… It’s been about 4 or 5 months since I started seeing a psychiatrist (again) and it seems to be helping although we haven’t really talked about anything specific really. For example after I originally got sick my doctor (oncologist) advised to me to go because of the inherent depression and/or denial most Cancer patients initially feel and that doctor (psychiatrist) said in our very first meeting something along the lines with: “Let me start by saying, I don’t have cancer so I can’t pretend to know what you’re going through and if it’s something you want to talk about, we can, however I suggest, at least for now, we focus on non-cancer related issues because it ‘may’ help in the long run.” And for some reason, that statement just clicked and although we didn’t ignore the cancer, instead we started out talking about my experiences in the Military and moved on to some other general topics, giving me a feeling of ‘normalcy’ instead of the typical ‘Why me?’ that a lot of people go through. Fast forward to the current doctor and none of the medical stuff has really come up… (yet). We did the typical start where they ask the basic questions about your past and shit (for paperwork, not really for ‘where do we start?’ kind of thing) so we talked about the military for like 20 minutes total, some other ‘big’ events in my life, yadda yadda yadda… and the main focus most of the time is about a 50/50 split between a girl or about the fact that over the years, I’ve pretty much stopped going out and socializing, never have any friends over… barely have any contact other than the occasional conversation online or going to/from different doctors. There’s been times where I was just like “Fuck it, I’ll just go to a bar and see who’s around” but either something comes up (no money, too much pain) or I get there and the fucking place is empty so there’s no one to talk to anyway and I’m not going to spend $2.50 – $4.00 per beer when I could buy some and drink alone at home drowning my sorrows… which defeats the purpose.

Not that anyone would care, the girl mentioned isn’t a potential girlfriend or anything remotely interesting… and I’m only clarifying that because I slipped up and just mentioned my blog to her so there’s a chance she may read this.

Enough of the ‘head shrink’ type of stuff and we’ll move on to the fact that I’m pretty sure my memory is getting even worse and I’ve started to notice other issues I hadn’t seen before. Thankfully I’m not hearing voices or anything along those lines, but I’ve noticed a few times while talking for example I would either slur my speech or outright screw up a word. I’m not talking about a simple Freudian slip, but saying something like I did on a recent phone call where I asked a friend “Can you come over and help me move a pen” when I meant a fucking couch. But the more common thing I’m noticing is my hand-eye coordination which doesn’t seem to be affected while I’m typing for example, but there’s a game on my iPad that I play a lot when I get bored but I’ve noticed that when I reach to touch a box I swear my eyes see my finger over the correct thing, but when I touch the screen I’ve either hit the box on the right or above the one I want… I’ve tested the sensors on the iPad and confirmed it’s not the device malfunctioning but it’s my sight. I can’t even play the game with my right hand anymore because my hand will shake too much that I can’t keep my finger steady (I’m left-handed) and it makes it so I can’t play while laying on my left side which most of the time is the more comfortable position for my back and leg. Thankfully at this stage it only appears to be an issue when I’ve been awake too long so it might just be as simple as that, but having insomnia for around 15 years now I’m unsure what is ‘sleep deprivation’ or potentially something scarier.

As I stated, thankfully I’m not at the point where I’m hearing voices, but I do hear some noises that I have no real proof if they’re real or not since most of the time when I ‘think’ I heard something, it’s usually something in the distance and never really gives me a ‘that could be someone talking’ type feel, it’s more like a tapping noise or other sound that can usually be explained away.

Enough depressing crap, let’s move on to something new that I’m doing to help keep my mind off the above…
§ Replacement to College §
I finished college years ago at this point, but while working on a new project last week I got stuck trying to deal with some database injection among other things. It turned out that the imports I had written worked fine but due to some PDO limitations I couldn’t do everything required via AJAX and had to rewrite parts of the database to accommodate the changes. While doing research on the problems I decided to check some of the tutorial sites I’ve used in the past like Udemy and although none of the free stuff they had would give me the required knowledge I had some coupon codes that allowed me to purchase over $2,000 worth of courses for a very sizable discount. Udemy isn’t just for programmers, the have all sorts of courses covering Photography, Learning languages, Health & Fitness, Music and more… some are even free. With full disclosure, Udemy has not sponsored or endorsed anything said here, but if you click this link, and sign up you can receive $5 in credit towards your first course.

§ Closing §
There’s a lot more that I had written and amazingly there’s still some that I remember, but it’s almost 5am so I’m going to post what I have so far and create some voice memos to remind me of the other topics and will hopefully remember to write again soon.

Category: Misc. | Tags: , ,

Destiny….

Posted on by

Like every year around E3, people go nuts about new games and this year is no different… There’s a few games that have really peaked my interest. I have to admit the latest from Bungie, original creators of “Halo”, the aptly named “Destiny” which is planned to have content for the next ten (10) years… giving you the potential feeling that your character will have a real destiny, was something that I had mixed feelings on. Don’t get me wrong, it looks fantastic, seems like it has an interesting story but the way my gaming habits have changed I wasn’t sure if I wanted to dive into something knowing it’s supposed to be this expansive, so I haven’t pre-ordered it and actually started to kind of ignore some of the videos and news about it. That is, until tonight when I got my Destiny Alpha code… at least now I’ll have a chance to check it out before doing the typical ‘plop down $65 and hope it’s good enough to keep my attention for more than a few days/weeks’. I was originally going to pre-order the game to get the Beta code and just cancel the order before release (if I decided not to get it).

Destiny

I don’t dare install it until tomorrow or Sunday since I know if I do I wont get any of my other work done and I really got to finish cleaning so I don’t have to listen to any more bitching. Funny thing was, if I didn’t get the Alpha invite, I was going to finish Watch Dogs before doing another run of South Park: The Stick of Truth.


Side note, I have a lot of other stuff on my mind that I was going to write about as well, but I’ve procrastinated enough on some of my ‘required’ work.

Category: Misc.

Random Stuff, plus some updates to the custom protocols…

Posted on by

*What I’m watching or Listening to Now*

Not much of anything since one of my 3TB drives died and took just over 2.5TB of video with it.

*Custom Protocols Update…*

First things first… (Using latest version of browser mentioned)
Firefox:
“Sublime Text” Protocol: Completely working
“Speak” Protocol: Does not encode/decode properly… (fine in Chrome) a.k.a. “This is only a test” whether urldecoded or not gets converted to “This%20is%20only%20a%20test” (since %20 equals a ‘space’) therefore NirCmd will actually say “This percent twenty is percent twenty only percent twenty….” etc.

Here’s the fix for ‘Speak’ in Firefox: (Will only work if you have PHP installed on your development system)

@ECHO OFF
TITLE Archigos NirSpeak
MODE CON COLS=50 LINES=3

ECHO.
ECHO                 Ignore this window

FOR /F "tokens=1,2,3* delims=/" %%a in ("%~1") DO (
  SET Protocol=%%a
  SET String=%%b
)
FOR /F "tokens=1* delims=" %%a in ('php -r "ECHO urldecode('%String%');";') DO SET Talk=%%a
nircmd speak text "%Talk%" && EXIT

Chrome:
I’m not sure when (too lazy to look it up), but with one of the updates to Google Chrome they essentially blocked the use of custom protocols (also called “Handlers”) to a certain extent. The new rules are something akin to your web application “must register the custom URI into Chrome and that it MUST be from the same domain”. This is mainly for security in Chrome Apps, but since we’re doing it for testing, I doubt any of you that are willing to write the C++/C# code required for URI Registration would bother with doing something like this… (however, if you’re interested, you can read about that here.)

Thankfully, getting around this limitation is rather easy for what we want to do, but be warned, make sure you fully trust whatever protocols you use with this method because it essentially turns off all of Chrome’s security for them. Both my Sublime Text and Speak Protocols are safe if you follow the directions, but you could essentially write one that could do harmful actions very easily.

Open up the command prompt and enter the correct location from below based on Operating System:
On Windows 7/8/8.1, the path is: %LOCALAPPDATA%\Google\Chrome\User Data
On Windows Vista: %USERPROFILE%\AppData\Local\Google\Chrome\User Data
On Windows XP: %USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Data

Once the window opens, you have to make sure Chrome is CLOSED because it writes data to the “Local State” which you need to edit (preferably in Sublime Text). If you need to open the “Local State” file in a different editor, make sure that the application doesn’t append a file extension (ex. *.txt)

Inside the “Local State” file, which is in the JSON format, you’re looking for the section called “protocol_handler” which should already have a few entries in it and look similar to the following (line numbers are for demonstration here, the section should be kind of close to the bottom):

  "protocol_handler": {
    "excluded_schemes": {
      "afp": true,
      "data": true,
      "disk": true,
      "disks": true,
      "file": true,
      "hcp": true,
      "javascript": true,
     "mailto": false,
     "ms-help": true,
     "ms-windows-store": false,
     "news": false,
     "nntp": true,
     "shell": true,
     "snews": false,
     "vbscript": true,
     "view-source": true,
     "vnd": {
       "ms": {
         "radio": true
       }
     }
   }
 },

Once you find it, you’re going to want to add two lines to this file (I placed them so they stayed alphabetical like the rest)… setting the value to ‘false’ means that the protocol will be used, and ‘true’ means ignore it for security reasons.

  "protocol_handler": {
    "excluded_schemes": {
      "afp": true,
      "data": true,
      "disk": true,
      "disks": true,
      "file": true,
      "hcp": true,
      "javascript": true,
     "mailto": false,
     "ms-help": true,
     "ms-windows-store": false,
     "news": false,
     "nntp": true,
     "shell": true,
     "snews": false,
     "speak": false,
     "subl": false,
     "vbscript": true,
     "view-source": true,
     "vnd": {
       "ms": {
         "radio": true
       }
     }
   }
 },

As you can see on lines 17 and 18, I added both protocols that I created and made sure to match the names used. If you only created one of them, do NOT create an entry for the opposite one. Save the file, open Chrome, test your page with the protocol examples… if you don’t have one, create a new PHP file accessible from ‘localhost’ and paste the following code for a quick and dirty test:

Sublime Test
"; echo "Speak Test"; ?>

*Testing Environment*

A few people have asked once or twice about possibly doing a full write-up of my main test environments (both Web Design and HTPC related) so if people post a response on Facebook if they are interested in either (or both) I’ll possibly create a new page on this site dedicated to it (because it’ll probably be multiple posts and pretty long).


*In regards to last post*
I left this to the end of the post so those looking for the technical stuff above could skip it.
The person I was talking about still wishes to stay anonymous for as long as possible, mainly due to the stigma I had previously mentioned, but stated that since I mentioned it already I could give a little update. Now, it’s not uncommon for people undergoing the initial changes from mental illness to think “No, I’m normal, if you don’t see/hear/etc. it the way I do, you’re the one that’s wrong” and I think the main problem with the first few sets of doctors were that they did NOT take this into account and observe the behaviors shown and it didn’t help, that he apparently withheld a lot of information for this same reason. I think it was around the third set of doctors we found that started to notice not everything was being said, or that some things being said weren’t necessarily the truth (not that he was intentionally lying, it was based on his ‘distorted’ point of view). This doctor narrowed things down to the point where they debated on if it was some form of extreme bi-polar disorder or (as I suspected) Schizophrenia, the latter ending up being the actual diagnosis.

I think when I was invited to see the doctor with him so the three of us could talk together and I could point out my observations or when details were misinterpreted helped him realize the extent of the paranoia and other symptoms were. The doctor gave him a different type of medication and although most of the symptoms seemed to lessen, you could tell he was still struggling with things. Thankfully, sticking with the current doctor, changing medications and/or dosages a few times, and other forms of support, he seems to have gotten most things under control and for the most part, none of what is going on is noticeable to those that weren’t told at least something prior.

Category: Misc. | Tags:

A lot… of random… well, life happens!

Posted on by

*What I’m Watching or Listening to Now*
Who cares?

*Random Question* OR *Random Quote*
No really, who cares? Actually, the real question is the age-old… “Why do bad things happen to good people?” Don’t get me wrong, the ‘good’ person in question is far from a Saint, but they never really did anything to anyone, in fact, for the most part, they just kept to themselves.

I know a common theme in a chunk of my posts is about wanting to write more often, but this is one of the rare cases where I didn’t ‘forget’ or ‘just didn’t get around to it’ and had a real reason to not write. The person mentioned above hasn’t given me permission to write about them so I’m not going to post many details and try my best not to identify them in any way (other than he’s obviously male). Mental illness is something that a lot of people in today’s society look down upon and sadly way to many people view people with pretty much any form of mental illness as inferior. There’s varying forms of illness and in almost every case the person suffering is in no way at fault for what they must endure. Yes, I’m rambling, and I don’t give a shit… there’s so much going through my head, especially what they are going through, how quickly it seems to be progressing, and the fact that there’s nothing I can do to help them.

I’ve dealt with my share of doctors the last few years since my issues started, some were wonderful, some were complete fucking idiots, but in my case, after the initial scans, the doctors all agreed, “it’s cancer” and after going to a specialist and another set of scans, they figured out what kind… Now the treatment for it was another story altogether, but my point here isn’t trying to lessen the seriousness of Cancer and I know there’s many patients that have it a lot worse than I did, but to say that’s there’s a big difference with doing a body scan, finding a tumor and saying, “here’s where we have to concentrate on” as opposed to admitting that as humans and all the advancements we’ve made, there’s still a shit load about the human brain that we just don’t understand. Case in point, the many doctors that he’s gone to see have all been utterly useless to this point, either saying things that a kid that barely passed high school biology would be like “Um, no, that’s not right.” or essentially just says “Here, take these pills and it’ll fix it” when those pills aren’t even related to anything remotely close. It’s like giving thyroid medication to a guy that accidentally cut off his finger and saying “This should make it grow back.”.

Even my extremely limited knowledge of mental illness, the different kinds, etc. lead me to believe that all the things I’ve witnessed him demonstrate over the (roughly) last two months point towards Schizophrenia and as I said above, certain aspects seem to be progressing. It’s difficult to talk openly about things like this considering the perceived stigmata attached and I’ve been meaning to do research (not just on the disease, but on forms of help, like hotlines, etc.). In fact, after I finish this post, I’m going to start said research and make a few phone calls.


There’s so much on my mind, about this, about my medical issues (which have been causing some more difficulties lately as well), projects I’m working on, etc. The list could go on for pages but I’m sure that’ll just drive away the few readers I have left. But on a two-part closing note, I wanted to thank a good friend of mine that I know reads this blog and I’ve talked with about all of the above stuff and even though he doesn’t even live in the same state anymore, he’s been there and is the only person I trust to talk with about this stuff (at this stage anyway). If and when things become a little more public I may revisit this topic in more detail, describing some of the things I’ve witnessed first hand, outlets for people to find help or anything else that I’ve learned and think may help others in similar situations. The second point is most of the readers that view this (if they’ve stayed around this long) probably came from a link via my Facebook page and if you know of any good resources (other than Wikipedia) about Schizophrenia including hot-lines or whatever (please no links to buy a book on Amazon or things of that nature) please comment on the Facebook post with the information. Lastly, please refrain from negative comments, guesses at the person’s identity, or general assholeishness as this is a sincere request for help and/or information.

Category: Misc.

Quickie Custom ‘Speak’ Protocol

Posted on by

I mentioned on Facebook I was thinking about adding the second protocol I did and also about changing this to a more tech related blog… Well, here’s the “Speak” protocol and I’m still debating on if/when I may do the blog changes.

If you came directly to this post, read the previous one to get an idea about Custom Web Protocols and an idea of what’s going on.

*Required Software*
For starters, this protocol uses some freeware called NirCmd (by NirSoft) which can be downloaded from the bottom of this page. Make sure to download the correct 32bit/64bit version and after you extract it, copy NirCmd.exe to your Windows\System32 directory either manually or by running NirCmd (it offers a button to copy it there automatically).


If you still have the *.reg file from the “Sublime Protocol” you can make a copy of that file and do some simple changes to create this, or if you’re starting from scratch open “Sublime Text” (or your favorite text editor… yes, even Notepad works) and copy/paste the following into your document. Don’t forget to save it with the *.reg extension.

Registry File
Warning:
Modifying the Windows Registry can be hazardous to your computer and cause data corruption, data loss, or just outright kill your system, therefore proceed at your own risk and I will not be held responsible for any damage you may/may not cause. This registry file has been tested and deemed safe on both Windows 7 and Windows 8 but has not been tested on XP or Vista.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\speak]
"URL Protocol"=""
@="URL:SpeakText"

[HKEY_CLASSES_ROOT\speak\DefaultIcon]
@="C:\\Windows\\System32\\shell32.dll,282"

[HKEY_CLASSES_ROOT\speak\shell]

[HKEY_CLASSES_ROOT\speak\shell\open]

[HKEY_CLASSES_ROOT\speak\shell\open\command]
@="C:\\Windows\\System32\\cmd.exe /K nirSpeak.cmd \"%1\""

Notes:

  • If you change the trigger for the protocol (speak) it needs all five references changed.
  • The double \ in the file paths are required.

The last line needs to be altered if you change the name of the Command/Batch file or you get a security error for running the Command Prompt (see previous post for info on this and how to fix it).

Batch File
Taking the name from the registry file, in this case “nirSpeak.cmd”, we create a new empty document with that name and copy the below code into it.

@ECHO OFF
TITLE Archigos NirSpeak
for /F "tokens=1,2* delims=/" %%a in ("%~1") do set protocol=%%a&set str=%%b
nircmd speak text "%str%"
exit

*Using*
There’s one large difference between this and the previous protocol (other than the obvious usage) in which this does NOT encode/decode the information sent which changes a few things with the usage. With the Sublime Protocol for example, if a filename contained a space, that would be converted to %20 and back again where required, but the Speak Protocol would actually say “percent two zero” if you tried to manually encode it. The easiest way to create speech is to create a variable with the entire string you want and than just putting the variable into the URI (which also prevents certain errors due to spaces like speak://multiple words would. It wouldn’t cause a PHP error, but NirCmd would most likely error out or only say the first word).

A great example of how you may want to use this would be to greet your user after they log into your site.

$username = $_POST['username]';
$greeting = "Greetings ".$username;

And then you’d use a JavaScript function or similar to invoke it (in this case: speak://$greeting) on page load or whatever. You could also use buttons or inputs in a similar fashion, like the button I use on one of my sites that reads the stats to the user.

echo "
";

*Final Thoughts*
Obviously both this and the Sublime Protocol could benefit from hiding the Command Window that is spawn but I wanted to write these using as little third party software as I could to make it easier on the reader. Oh and for those that want to play around with the speech function there’s a bunch of information on NirSoft’s website, but for the lazy, open a command prompt and type nircmd speak text "Hello World" and it will say whatever is between the quotation marks.

Development Integration, Custom Web Protocols, and other stuff

Posted on by

*Development Integration*
I’ve been slowly altering my development environments on both my laptop and my main server over the last week so that when I get around to doing the full re-install (which they both need) I can have more of a set game plan on which pieces of software I’ll use, their configurations, etc. mainly because there’s a lot of stray files lingering from apps that I installed and decided they either didn’t fit my style or they just sucked. The point being is that I’ve been using Sublime Text for a long time now and was looking into ways that would integrate it a little more into my flow. On a Mac, you can install a plug in for Sublime (or it might be installed with it by default) where you can open documents directly in Sublime using their custom protocol. Similar to how iTunes will open if you click on a link to an iPhone/iPad app on a webpage.
I did some research to see if it could be done on Windows and let’s just say, my searches didn’t garner promising results. Most of the sites either gave directions of how to activate/use it on a Mac or whatever, with the only reference to Windows is that people claimed it would work or third party apps I have no need for were required. So, I did my usual and got pissed, then decided I would just do it myself, so I’ve managed to get ‘most’ of the same functionality they have on the Mac.

*Custom Web Protocol*
Most people have at least some knowledge of web protocols whether they know it or not. For example, when you type an address into your web browser to visit Google, some users still have a tendency to fully write out http://www.google.com, but even if you don’t, when you click up there, you’ll notice it appended the http:// to it anyway and that’s the part we’re interested in for now. Some other common ones that people have probably heard of would be FTP (ftp://), POP and SMTP for email use, etc.
When I mentioned iTunes above, that’s an example of a custom protocol and is similar to what we’ll be creating for Sublime on Windows (tested on Windows 7 and Windows 8). But some may ask, “What’s the point of all of this?” or “Why would this be useful?” and a great example of this are people that want to implement Custom Error Control into their development so that when something does go wrong, not only do you have some usable information about the problem, but you could just click a link and the source file that contains the error would be opened automatically.


Basic Error in Chrome

Custom Error Control

If you click the second image, you should see near the top middle it says “Open: C:\inetpub\wwwroot\test1\index.php” and that’s the link we’ll be manipulating. Here’s where the platforms are slightly divided, on a Mac, the URI will end up being in the following format: subl://open?url=file://<filename>&line=<number> where ‘<filename>‘ would be the source file with the error and the <number> would take you directly to where the error is located. On the PC side, I haven’t been able to figure out how to utilize the actual line number so I’ve removed it from this, but will make sure to update this post with it if I ever figure it out. Along with the line number, I’ve also removed the starting part of the protocol (open/?url=file://) which leaves you with the following syntax: subl://<filename>. [In both cases, the filename is URLEncoded and has to be decoded for use].

*Now the fun begins*
We have the format of how we’ll set this up, so now we need to create a small Registry file and a single batch file that will handle calling Sublime and passing the required file to it. The actual protocol is subl:// and if you decided to change that, you’ll need to make a few changes to the Registry file (the batch file will stay the same).

Warning:
Modifying the Windows Registry can be hazardous to your computer and cause data corruption, data loss, or just outright kill your system, therefore proceed at your own risk and I will not be held responsible for any damage you may/may not cause. This registry file has been tested and deemed safe on both Windows 7 and Windows 8 but has not been tested on XP or Vista.

Registry File

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\subl]
"URL Protocol"=""
@="URL:SublimeText"

[HKEY_CLASSES_ROOT\subl\DefaultIcon]
@="C:\\Program Files\\Sublime Text 2\\sublime_text.exe"

[HKEY_CLASSES_ROOT\subl\shell]

[HKEY_CLASSES_ROOT\subl\shell\open]

[HKEY_CLASSES_ROOT\subl\shell\open\command]
@="C:\\Windows\\System32\\cmd.exe /K SublimeProtocol.cmd \"%1\""

Notes:

  • If you change the trigger for the protocol (subl) it needs all five references changed.
  • The double \ in the file paths are required.
  • From what I can tell, the icon is not shown anywhere, but still needs to be a valid path.

The command on the last line is going to call a Command/Batch script which we will be doing next, however I wanted to point out, due to security settings on some systems, you may have to make a copy of cmd.exe and call that instead, if that’s the case, just make sure whatever you name the copy is also in your System Path and you change that above as well. The %1 at the end of the command line is what allows us to pass the file through this command, all the \ and ” are just escape characters the Registry needs when writing the “*.reg” file. Copy the above code, and paste it into a new blank document (either in Sublime, or even Notepad) but make sure to save it with the extension “.reg” (for example sublime-protocol.reg) but don’t run it just yet (it wont hurt anything if you do).

Batch File
Taking the name from the registry file, in this case “SublimeProtocol.cmd”, we create a new empty document with that name and copy the below code into it.

@ECHO OFF
TITLE Sublime Protocol Parser
for /F "tokens=1,2,3* delims=/" %%a in ("%~1") do set protocol=%%a&set str=%%b
for /f %%a in ('php -r "echo urldecode('%str%');";') do ( set file=%%a )
START "C:\Program Files\Sublime Text 2\sublime_text.exe" %file%
exit

The protocol sends the entire string (including the protocol itself) to the batch file, so the third line takes that input and strips it down to what we need and the fourth line, with the help of PHP (which I assume you have installed on your development system) takes the URL Encoded Filename and decodes it back into a usable Windows File Path. The entire process would look something like this:
You click a link that looks like this: subl://C%3A%5Cinetpub%5Cwwwroot%5Ctest1%5Cindex.php
The protocol passes that entire string to the batch file, where line three splits it to subl:// and C%3A%5Cinetpub%5Cwwwroot%5Ctest1%5Cindex.php and throws away the first part, now line four takes that and converts it into C:\inetpub\wwwroot\test1\index.php which is now valid to send to Sublime Text (the file replaces %file% dynamically above). Once you have the registry and batch files saved in your Windows Path, double click the registry file in Windows Explorer and it will ask about merging it into the Registry, tell it yes and you should be set.

*Testing*
To test that it works we’ll need to create a simple four line PHP script that creates a subl:// link for us. Open Sublime and create a new file somewhere that is accessible on your server, in my case I’ve been using C:\inetpub\wwwroot\test1\index.php throughout this post. For Microsoft IIS Users, it’d be C:\inetpub\wwwroot\ and for Apache users, the location depends on which package you have installed (Apache, XAMPP, WAMP, etc.) but will normally be inside an htdocs directory.

Sublime Test";
?>

With the above file created, make sure to close the file, than close Sublime. Sadly there’s an issue (at least in Windows 8) where clicking the link will not open the file if Sublime is already running. If I find a fix, I’ll update this post with the information. Open a new tab on your web browser and navigate to where you saved that file (ex. http://localhost/test1/index.php) and you should be presented with a page that looks similar to this:

Clicking that link will spawn a Command Prompt Window with the title “Sublime Protocol Parser” for a brief second, close, and than Sublime should open with the correct file loaded. If it doesn’t, most likely you’re experiencing the security issue I mentioned above. (See the bottom for a more detailed way to correct it.)

*Practical Use*
With my current development environment, I use a modified version of Whoops to handle most of my Error Control and a snippet in Sublime that not only throws the required code into my file as needed, but automatically activates it so I can verify it’s working, at which point I delete a single line than get to coding. The screenshot on the right in the above table gives you a rough idea of how it looks.

Whoops has built-in functionality to allow default code editors and Sublime is already one of them, but if we just set it up to use that, it will give us the links in the wrong format, so this snippet will adjust for that as well. Start by opening Sublime Text and going up to “Tools” => “New Snippet…” and you should be presented with the following code:


  
  
  
  
  

We need to modify the highlighted lines by replacing the code on line 3 with our code and uncommenting lines 6 and 8 to set up the tag trigger and set the scope to PHP:


  
  
  whoops
  
  source.php

Make sure that you leave the <![CDATA[ and ]]> in-tact and you can rename the tab trigger to anything you want, I used ‘whoops’ for the example. Now comes the code to make this snippet worth anything. However, you have to make a small decision (or write two snippets):

  • Are you creating this solely for personal sites or sites that you will run on your system(s) in which you can verify Whoops will be available at all times?
  • Are you creating a site that is meant to be distributed, like an Open Source Web App where you can’t be sure of the environment this will be run on?

If you answered yes to the first question, your snippet can be a lot smaller since you would already know what’s available and what isn’t, however if you answered yes for the second question, you can go about this in two ways:

  • Do the same as you would have answering Yes to question one and remembering to delete or comment out all references before distribution.
  • Write a little extra code so that it only runs on your system and not the end users, leaving it all intact for when you do updates.

The Quickie Version: (From Question 1)

<snippet>
  <content><![CDATA[
  require \$_SERVER['DOCUMENT_ROOT']."/whoops/vendor/autoload.php";
  \$whoops = new Whoops\Run();
  \$errorPg  = new Whoops\Handler\PrettyPageHandler();
  \$errorPg->setEditor(function(\$file) { return "subl://%file"; } );
  \$whoops->pushHandler(\$errorPg);
  \$whoops->pushHandler(\$handler);
  \$whoops->register();

  // Test to verify it works with project, comment out or erase when done
  throw new RuntimeException("Whoops works, you can delete this line now...");

$0
]]></content>
  <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
  <tabTrigger>whoops</tabTrigger>
  <!-- Optional: Set a scope to limit where the snippet will trigger -->
  <scope>source.php</scope>
</snippet>

Extended Version: (From Question 2)

<snippet>
  <content><![CDATA[
  if(\$_SERVER['COMPUTERNAME'] == "YOURSYSTEMNAME") {
    require \$_SERVER['DOCUMENT_ROOT']."/whoops/vendor/autoload.php";
    \$whoops = new Whoops\Run();
    \$errorPg = new Whoops\Handler\PrettyPageHandler();
    \$handler = new Whoops\Handler\JsonResponseHandler();
    \$handler->onlyForAjaxRequests(true);
    \$errorPg->setEditor(function(\$file) { return "subl://%file"; } );
    \$whoops->pushHandler(\$errorPg);
    \$whoops->pushHandler(\$handler);
    \$whoops->register();
  }
  // Test to verify it works with project, comment out or erase when done
  throw new RuntimeException("Whoops works, you can delete this line now...");

$0
]]></content>
  <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
  <tabTrigger>whoops</tabTrigger>
  <!-- Optional: Set a scope to limit where the snippet will trigger -->
  <scope>source.php</scope>
</snippet>

In both cases, you have to verify the ‘require’ path is correct and in the second example change “YOURSYSTEMNAME” to the proper name (you can echo it in the test file if unsure what to use).


*Troubleshooting*
Scenario 1: No Command Prompt flash
If you don’t see the command prompt window pop up for a second than most likely the issue is with the registry not being able to forward the info to the batch file. You can open the registry by running “regedit” from the command prompt or run dialog and drill down in the left menu to HKEY_CLASSES_ROOT\subl\ and you should see two folders inside subl (DefaultIcon and shell) and the file paths from the *.reg file will be converted to single “\”. If this is not the case, you can either edit these directly or delete the ‘subl’ key and edit your *.reg file and re-import it.

Scenario 2: Command Prompt opens but doesn’t work
Open your batch file and add “pause” on line above the first for statement. Close Sublime and try your test again, this time, hopefully you should see the command prompt open with the correct title.
One of two things most likely happened, the title showed which suggests you have a typo somewhere else so double check the code you used (again) in each phase… or the title didn’t match which implies there is probably a security issue similar to the one I experienced on one of my systems.
If this is the case, you’ll have to do a little modification to your *.reg file and a single command from the prompt.
Open a command prompt and type:

cd C:\Windows\System32
copy cmd.exe customCMD.exe

Re-open your *.reg and change the last line to @="C:\\Windows\\System32\\customCMD.exe /K SublimeProtocol.cmd \"%1\"" and re-importing that should resolve the problem.

If you need any more explanation or something still doesn’t work you can feel free to comment below, but please note, comments are moderated and wont automatically appear.

Couple Small Updates…

Posted on by

*What I’m Watching or Listening to Now*

Random Marathon O’ Shit… *rolls eyes*

*Random Question* OR *Random Quote*

I’ve been working on a few projects again recently where the developers are from all over the world, so English comes in a variety of ‘good’, ‘bad’, ‘broken’, and ‘what the fuck did he say?’… Anyway, the ‘question of the day’ has nothing to do with working/dealing with foreign speakers or even about how they view Americans. Instead, the question is why does America have such an endless supply of morons that make us all look bad to the rest of the world? Here’s an example… I was at the McDonald’s drive-thru a few days ago and could hear the woman in the vehicle ahead of me order.

Customer: “Do you have a pen?”
Employee: “Do you need a pen ma’am?”
C: “No, it’s for you, I have a really big order and you better not screw it up.”
E: “Don’t worry about that ma’am, the register takes care of all that when I enter it in.”
C: “Fine, I have a coupon for the Whopper… it’s a buy one get one free, but before you ring that up …”
E: {interrupts} “We don’t serve the Whopper, did you mean a Big Mac?”
C: “I don’t care what you call it, I have a coupon. Now, as I was saying, before you ring up the first one, I want that free one to be my second order
before I have another coupon that’s buy one get one free and so that first one is going to be my free one from the second coupon.”
E: “Ma’am, it doesn’t work that way…”
C: {interrupts} “Don’t tell me how it works, I pay your salary with my taxes you little punk” {Note: the guy sounded like he was in his 30’s}
E: “Ma’am, is there any way you could come into the lobby and we can figure this out?”
C: “I will not come in, I’m in line already because I’m in a hurry.”
E: “Sorry about that ma’am, please pull around to your second window and I’ll have a Manager waiting to speak to you.”

The woman pulled around and I was finally able to order. After pulling around myself I noticed she was still parked in front of the window yelling at the manager because they wouldn’t take her coupons. At one point she just screamed “Give me my g*d damn Whopper” and the employee said “Then go to Burger King where your coupons are for a whopper, we have the Big Mac here… She pulled away from the window towards the road so I moved ahead, got my food, and had to sit there because the stupid bitch still hadn’t pulled out of the parking lot and there wasn’t enough room to leave. 🙁 All in all, I felt bad for the employee and probably wasted about 20-25 minutes of all of our lives because she wasn’t even at the right place.

P.S. I think I got food poisoning that night as well.

*Actual updates*

As I stated above, I’ve been working on some projects lately (directly and some indirectly) that I’m rather excited about. Below are just a few that I can share, in no specific order:

NextGen Portal

This project has changed so much since originally being introduced somewhere around a year ago. It’s changed hands a bit, it’s been fully rewritten from scratch multiple times… pretty much everything is different, except it’s core purpose. As the first part of the name suggests, this project takes the original “HTPC Portal” to the next generation.

History:

Technically it all started with the ‘basics’ (SickBeard, CouchPotato, Headphones, and a few others) which spawned both MediaFrontPage and Maraschino. XBMC Forum user “hernandito” created a ‘wrapper’ for Maraschino that had a slight resemblance to MFP (don’t remember if that was intentional) in purpose. Not long after its initial creation, I took over the lead of “HTPC Portal”, while continuing to work with hernandito I rewrote his version in PHP and started adding a few things here and there. The project kind of fizzled after a few active months, mostly due to my medical issues, but since most of the site worked properly and there weren’t really any ‘death bugs’ I kind of lost interest. Fast forward to the end of the year and I decided to silently start working on it again (haven’t updated anything on GitHub yet). I’ve written the entire thing from scratch adding a whole pile of new features and should be ready for some beta testers soon.

New Features:

  • Entire Framework Built Specifically with HTPC related features
  • Quick Switching between HTPC Apps (SB, CP, Sab, etc.)
  • Image ‘Checker’ (for now, scans your media sources and allows you to monitor for missing ‘folder.jpg’, ‘fanart.jpg’, ‘logo.png’, etc.)
  • Simple Editing/Updating of certain XBMC Database fields (Hopefully more can/will be added) : No MySQL support, internal database only at this time
  • Other stuff I can’t think of right now…

HTML Generator

I’m not attached to this project.
In under a month since the first public release, the author DeadSix has taken a wonderful app for HTPC enthusiasts to show off their media collection to friends and family and made it even better. A few days after initial release DeadSix and I started talking, I mainly was giving bug reports, some feature suggestions, and beta testing. When he introduced the ability to select a theme to the generated output I wrote two themes that are included with the app and plan on updating these as needed for future versions and possibly adding more of them later.

Some Select Features:

List based on latest version at time of writing (6.2)

  • Auto (or Manual) scan of your XBMC Database (MySQL Support coming soon*)
  • View both poster and fanart (optional) image for each show/movie (if available)
    • Click either of these images to bring up fancybox (per video)
  • MediaInfo (Codec) scanning of media details
  • Ability to sort your TV/Movies (by name, date released, last played, XBMC ID, File Size, Resolution)
  • Auto Generation (start program with ‘/auto’ switch)
  • Ability to show/hide pretty much anything
    • Trailers (plays inline from YouTube)
    • Generated On
    • Last Played
    • File Size
    • Release Date
    • Episode Count
    • Studio
    • Rating
    • Info Link (Displays IMDB/TVDB/AniDB link for media)

*Listed as an upcoming feature on first post of thread
More information available about “HTML Generator” on its XBMC Forum Thread.
htmlgen

So Far Unnamed Project

A new C# project I was contracted for in regards to network management… Once I finish it I’ll talk to them about maybe releasing it (in whole or in parts). I’ve always been more akin to the web development side of programming so this is my first C# application, but as DeadSix seems to say, “All programming is the same, you know one, you know them all” and I have to say that I’ve learned a lot so far with this app and Dead’s right in the sense that I’m picking it up quicker than I had originally thought. Granted there are a few things that take some getting used to but if I realized they were this close I probably would have made the jump years ago and been able to make some ‘real’ money on a more regular basis.

The Rest

I have two other projects I’m working on, the first should be done by this weekend and the other one is just one of those “doing it for myself” kind of things that I’ll get done some time… or more likely never. But I’ve been working on this post on and off for hours (TV is distracting) and it’s after 5am so I’m going to bed and I’ll try to start posting more often again. Well, one last thing, speaking of posting more often, part of the reason I haven’t been posting to often for the last six months or so is I got back into using Facebook (mainly to get certain friends to stop hounding me about it) but now I’m back to the “Fuck Facebook” mentality, so I’ll try writing here instead.

Category: Misc.

HTPC Community

Posted on by

About 12 hours ago or so I made a post on the XBMC Forums in regards to my current status in the HTPC Community. So far there have been no replies after my message so I was unsure if anyone bothered to read it (or care) however after doing some things on my laptop that required a restart, when Windows 8 booted back up I noticed above average hits to my blog from yesterday and although I haven’t actually checked where the hits came from yet, I’m going to assume at least a chunk of them were in regards to that post.

For those of you confused about the above, the jist of it is as follows: I’ve been part of the HTPC Community (mainly for XBMC) for a number of years and have always tried to help out where I can… I was one of the co-creators of the original XBMC BlackMarket (back in the days when XBMC was on the original Microsoft Xbox), I’ve hosted numerous forums/wiki’s dedicated to some of the third party applications/services used in conjunction with XBMC and lately I have (with permission from the developer) created a forum dedicated to “XBMC Constellation” (created by Dawid of FSS.cc) and have provided a majority of their tech support via the XBMC and Constellation Forums. All of this… past and present has been done in my spare time with me eating any costs that has incurred for these activities.

Pretty much everyone (regular blog readers and even members that frequent the XBMC Constellation specific threads) knows that I have had a lot of medical issues for the past few years and because of this, I don’t have a job, therefore I’m on a very limited income with disability… Sadly, the main computer I used for my HTPC, as well as the debug/test system for a lot of the tech support I provide decided to die and I have yet to figure out the cause of it. Partly because of the ‘holiday season’ just getting over and mainly because disability doesn’t pay much of anything, I can’t afford to outright replace the computer (as far as I know, all the hard drives did survive, at least I hope they did) and since I don’t have a system to run XBMC, any of the third party apps/services, or to house any of my media I have decided to temporarily leave the HTPC scene and concentrate on my health. I believe this option is best since I wouldn’t feel right about giving out tech support/advice when I’m forced to guess most of what I’m telling the user to do because I can’t check my system to look up the exact procedure they’d need to fix their issue.

A friend and fellow HTPC enthusiast that I talked with briefly before writing the XBMC Post stated I shouldn’t feel bad about asking the community for help, especially with all I’ve given back when I can and he recommended setting up a donation which I will provide the link at the bottom of this post.

Before I post the donation link I wanted to explain exactly where all the money would be going, how it’s determined, etc. so I don’t have users thinking this is some form of scam or “Hey, I didn’t give you money for that…” type of things.

The first important thing I want to point out… Yes, the donations are going to ME personally, not some group, not some company… after PayPal (the ones processing the donations) take any of their applicable fees, 100% of the remaining donations will be going towards me building a new HTPC/Server. If I get enough donations to cover the cost of building the new system, any money left over will be going solely to help cover my medical costs… I will NOT be ‘blowing the money’ on stupid stuff, I wont waste it on random things… it will be going either in my gas tank for my trips to/from doctors, or go towards paying my medical bills. Once the Server is paid (by myself and/or donations) I will update the post with that information and let people know that if they continue to donate via the link it will be going solely to medical at that point and no longer towards hardware (again so I don’t piss people off or make them think they are donating for the wrong thing).

Anyway, it’s 1:34am here and I have to be awake kind of early in the morning so I’ll make another post sometime over the weekend if I can.

Read above for more information on this donate button before clicking:

I also wanted to thank everyone ahead of time that is willing and able enough to donate, I really don’t want to leave the HTPC Community, I just can’t foresee the ability to do this on my own any time soon.

Category: Misc.

First night… Happy Hanukkah

Posted on by

הנרות הללו אנחנו מדליקים על הנסים ועל הנפלאות ועל התשואות ועל המלחמות שעשית לאבותינו בימים ההם, בזמן הזה על ידי כהניך הקדושים.
וכל שמונת ימי חנוכה הנרות הללו קודש הם, ואין לנו רשות להשתמש בהם אלא להאיר אותם בלבד כדי להודות ולהלל לשמך הגדול על נסיך ועל נפלאותיך ועל ישואותיך.

The above is a traditional Hanukkah prayer… and below is the Translation for people.

We light these lights for the miracles and the wonders, for the redemption and the battles that you made for our forefathers, in those days at this season, through your holy priests. During all eight days of Hanukkah these lights are sacred, and we are not permitted to make ordinary use of them except for to look at them in order to express thanks and praise to Your great Name for Your miracles, Your wonders and Your salvation.


Sadly, I broke my dreidel… stepped on it while I was cleaning, but I’m sure if I keep looking later tonight or tomorrow I’ll find another one (I think I had three total)
Oh, last thing… saw an ‘old friend’ today and she gave me some Hanukkah Gelt which I thought was cool… Interestingly I didn’t know she was Jewish.

Category: Misc.