FINALLY! SOME UPDATES! This website is being reconstructed. Some content will go away soon. If you want to see my new stuff, visit my github: https://github.com/jrcharney/.

December 26, 2012

Saigo.fm and other project ideas for 2013

There was a lot to say that I wanted to say in this post, but I'm just going to keep it short and sweet if I can.

Saigo.fm will be the big project I want to get done in early 2013. Spotify just released a Roku channel. However, in general Spotify programming mannerisms, the channel/program/app they built took a while to download to my Roku, meaning if I could hack into my Roku just to see the files put on it to support the Spotify app, there is a good chance that it will be much bigger than it should be. Saigo.fm won't be like that. In fact, I am to make Saigo.fm the best music player app/channel for Roku combining features from the Roku, Last.fm and WinAmp APIs to create a visually pleasing Last.FM app, without calling it "Last.FM for Roku" which is the real reason why there is no Last.FM app for Roku anymore. If VideoBuzz can make YouTube accessable to the Roku without calling itself "YouTube for Roku" like the last guy who did and got the channel delisted, then Saigo.FM can be as successful as VideoBuzz without infringing upon the rights of the owners.

Next up, getting my desktop computer back up and running. I'm pleased to announce that this will happen next month. Which means, developing Saigo.FM as well as a few Java Applications and trying out Steam for Linux (Beta) is in the cards.

Also anticipated, Mathematica for Linux, something I should have got into a few years ago but didn't because of hardware constraints. Despite my graphics card being a few years old (and hopefully not obsolete), I would really like to use this to develop some visuals for charts and math-based projects. It is my hope that with this new hardware, a decision can finally be made for which LaTeX software to use on this site.

I still need to get a new Uninterruptable Power Supply (UPS), a must have for any desktop computer. The one I have needs replacing or at very least a new battery.

I know I can't afford a Makerbot, but that doesn't mean I can't play around with the software.

Another decision to make with the new hardware is what operating system to use. Clearly, it will be Linux. The Distribution will likely be Linux Mint. Ubuntu showed that a Debian-based Linux is ideal, but at the same time letting outside sources track my information was wrong. Add to this the inconvenience of the interfaces provided by Ubuntu including Unity, Ubuntu won't be making an appearance on the desktop. The future of Gnome 3 also seems doubtful. Whose idea was it to remove the Minimize and Maximize buttons and to remove where I can put widgets on the dashboard? Like convincing my to use Evolution will make me want to use it even more? In a world where web-based email and calendars exists, explain why anyone still needs to use Evolution or Microsoft Outlook.

I'm not sure if I want to use KDE as my desktop environment. Perhaps I should look for alternatives, preferably ones that won't make using Steam, Mathematica, as well as some three dimensional scripting. Which in Linux means learning how to use Python on programs like FreeCAD and Blender.

But what kills me the most is the fact that Compy, the netbook, had to do far more work than what it was intended to do. To serve as my primary computer the past couple of years was hell, especially with all the waiting for things to get processed that a normal sized computer should have been doing. But Compy is not doomed to a life to being left to collect dust somewhere in the basement like the other computers I previously owned. Unlike those machines, this one still functions and is operational enough to handle smaller tasks, which is what will happen to it once the desktop is fixed up. I need a device to act as a media server for Plex on my Roku. One of the pitfalls with creating a local area network with a spare router, is that your ISP may give you a router which doesn't like routing for another router, which is probably why when I tried plugging an older Linksys Router into an Ethernet cable plugged into a different router to act as a repeater, things didn't work out like I wanted them too. Regardless, that just means I need to read up more on how to do that.

Also, in case you are wondering where Part 3 of my "One Giant Leap Forward" series is, it's still in the works. Compy needs to understand what programs http_proxy should not be used on like Plex or SSH for VNC.

I just look forward to using better equipment again to make great projects.

December 16, 2012

One Giant Leap Forward (Part 2)

Welcome back to our short series on remote computing. It took me a while to get back to this post as there were a few things more required that I needed before I could elaborate on how to establish a remote connection.

For years, I've accessed my webserver that hosts this website and its predicessors using Secure Shell or SSH. Being a Linux geek, and having downloaded software for many years prior to using Linux using FTP, I wanted to immerse myself in the experience of being a computer programmer. To train myself not to focus on using Graphical User Interfaces (GUIs) but the Command-Line Interfaces (CLIs) that traditionally are the signature methods of a computer programmer, web developer, database adminstrator, or data entry clerk. To free myself of the mouse and the touch screen and keep both hands on the keyboard where my hands belong.

Imagine you are a line cook at a restaurant who makes an exquist meal. One day you have a customer come in demanding the chef cook this mean in front of him.

Because you have to make something outside of your post in the kitchen (CLI) and have to make it in the dining room (GUI) where the customer wants you to cook their food (demonstrate a program or writing a program) in front of them. But the tools you make to be that great chef are at the kitchen's grill, not at the dining room grill where the sushi chef works most of the time. In this case, you have to use his grill to get to your grill. (Hopefully this metaphor is clear enough to understand.)

Because you can not leave the dining room grill to get the items from your grill without the rist of a customer trying to reach over and take something that doesn't belong to them (consider this the metaphor for just using VNC with an insecure connection), you need to use a couple of sous chefs (an SSH client and an SSH server) to connect with your commis to handle message off to the souses including the information to the recipie that you use to make that meal without the customer (who could be a spy from a rival restaurant) gaining access to it.

To further make this metaphorical example sound more relevant to a computer setting, let say that the two souses are divided by a wall with a small window in it (firewall) such that the souses can transfer items (encrypted packets) beetween you and your commis. Without the souses items that should be kept private might be easy to see by unauthorized eyes. Remeber, a direct VNC connection is not encrypted and thusly not secure.

Now there are products on the market that have been advertised quite promenantly the past few years like the ones that are advertised by Citrix (i.e. GoToMyPC and GoToMeeting). Today's post (and last weeks) uses non-prorprietary software. This also means, wel will not be using any method that uses the Remote Desktop Protocol (RDP) as that is a proprietary product as well unlike the Remote Framebuffer Protocol (RFB) which was designed to work with VNC. As much as I have stated that VNC does not come with its own encryption, using VNC through an SSH tunnel using port forwarding is more secure than using straight RDP.

So why didn't I show using the SSH Tunnel for VNC in the previous post? Well for starter, I hadn't really need to use this stuff. Secondly, my forte is in programming not IT and network communications, although I am learning as I go along, in fact there may be more posts like this in the future. And lastly, Compy (my netbook) is on its last legs. There is an urgency to rebuild my desktop computer but not the funding meaning there is an urgen push to move toward using my Touchpad as the interface for computer work. In fact, I wish I had learn about his back when the desktop was operational. Compy probably would have lasted much longer.

So until we can afford to fix EVERYTHING, these efforts are critical toward keeping myself in the business of programming. A chef can't work without a stove and a computer programmer can't work without a computer.

Right, now down to the meat and potatoes of this post, the how to part.

The computer that you will want to connect two will need to have Vino installed. Last post shows you how. But for the security part, you will need to install the OpenSSH server package, openssh-server, as well as a couple of other things that look helpful like openssh-blacklist and openssh-blacklist-extra. If you are wondering "Hey, I can access SSH using the ssh command, why do I need this?" It's because ssh is the client program which is part of the openssh-client package you probably installed before. The server package now installs the daemon, that is the background process much like we saw when we enabled Vino to work. I'll post some figures later in this article.

Keep in mind, that these instructions are designed for Debian-based Linux distros like Ubuntu, Linux Mint, or Debian. YMMV.

sudo http_proxy= apt-get install openssh-server openssh-blacklist openssh-blacklist-extra
Installing the three packages.

Initially when I did this, I installed just the openssh-server package and noticed these five lines that were output during the installation.

Setting up openssh-server (1:5.9p1-5ubuntu1) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
ssh start/running, process 13031
Security keys set up.

There is a good chance that this installation will not be completely set up until you restart the machine, but for now here's what I get when I call up the process list of for SSH.

$ ps -AHF | grep ssh
jrcharney   2132  2087  0  1020    24   0 Dec14 ?        00:00:01         /usr/bin/ssh-agent /usr/bin/dbus-launch 
                                                                            --exit-with-session gnome-session --session=gnome
jrcharney  16611 17249  0  1097   836   0 14:53 pts/4    00:00:00       grep --color=auto ssh
jrcharney  13536 13310  0  1580  2504   0 12:58 pts/5    00:00:08       ssh [REDACTED]
jrcharney  16462 16228  0  1257  1568   0 14:45 pts/6    00:00:00       man ssh
root     13031     1  0  1671  2432   1 12:51 ?        00:00:00   /usr/sbin/sshd -D
As usual sanitized for your protection.

The process list says there is an SSH Daemon (sshd) running, but is it active?

$ netstat -an | less
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 :::5900                 :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
Remember: This is just a truncated list. In real life there is other stuff.

Apparently so. As usually, use ipconfig like in the previous post to see where your IP Address is.

OK, we have our machine set up. As I stated previously, the computer I want to connect to will be my tablet. And as I stated previously, there are two apps that I recommend to use on Android for SSH. One is Connectbot and the other is AirTerm. I want to use AirTerm first so that I can demonstrate what the output would look like if I was using another computer.

AirTerm uses Dropbear as its SSH client and the output should be similar to that if I wanted to use another computer with OpenSSH to access my computer. ConnectBot seems to do this with a GUI set up, which we already discussed how I feel about using GUIs when programming is involved. On the other hand, ConnectBot does save your connection settings. For now, we'll use Dropbear SSH in AirTerm to understand how this works then we can fill out the form in ConnectBot to automatically do that for us.

So here's what happens when I try to access Compy through my tablet via AirTerm/Dropbear.

$ ssh jrcharney@192.168.x.y
ssh: exited: Error connecting No route to host
Remember to substitute x.y with numbers from running ipconfig

So what happend? It wouldn't even ask for a password or ask us to establish a RSA passkey so that the devices get to know each other. Why can we get in? Probably because we didn't configure the SSH Server (which hence force we'll call the server 'sshd' and the client 'ssh').

Back at Compy, we need to got to /etc/ssh/sshd_config to get sshd set up. this page on the Community Ubuntu Documentation website seems to go over the set up, but I will make the following suggestion in the next figure.

Firstly, make a backup copy of the sshd_config file then use vim to edit it.

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults
sudo chmod a-w /etc/ssh/sshd_config.factory-defaults
sudo vim /etc/ssh/sshd_config
Make a back up and use VIM not gedit to edit!
  • Keep password authentication enabled. Leave the #PasswordAuthentication yes line as is and use a VERY STRONG password that uses a long password that use letters, numbers, and other characters. Keep in mind, when we use ConnectBot later, remembering the password will be no problem.
  • Keep port forwarding enabled. That is the entire point of this blog post. So leave the lines that say AllowTcpForwarding yes and X11Forwarding yes as they are. If they aren't like that, set them like that. Hopefully you remembered to set up a password when setting up VNC last time. If neither lines exist, add the ones that done to the end of the file.
  • Add which users should be allowed to access the computer at the bottom of the file. At the end of the file include a (space separated) list of people allowed to access your computer with AllowUsers loginName at the bottom. You can deny users as well using DenyUsers loginName1 logninName2.
  • Log all logins! To keep the baddies out, track who attemps to log in. Change LogLevel from INFO to VERBOSE. Check the /var/log/auth.log file regularly. If anything doesn't look right, add them to the blacklist. (I'll probably go over how to use that in the future.)
  • Add a banner...because its fun! Sure that page will say "Add it for security", but you just want to play with figlet like they do on the IRC servers. At any rate change #Banner /etc/issue.net to Banner /etc/issue.net and make a copy of /etc/issue.net, twice. Once for the default, and secondly to back up your thing incase it gets replaced upon a system upgrade.
$ figlet jrcharney
   _          _                                 
  (_)_ __ ___| |__   __ _ _ __ _ __   ___ _   _ 
  | | '__/ __| '_ \ / _` | '__| '_ \ / _ \ | | |
  | | | | (__| | | | (_| | |  | | | |  __/ |_| |
 _/ |_|  \___|_| |_|\__,_|_|  |_| |_|\___|\__, |
|__/                                      |___/ 

sudo figlet jrcharney >> /etc/issues.net
See, fun with figlet. We should have more fun with this in the future! See if we can add some color.

OK, with our config file set up (and possibly banner too), let's save it (:w) and restart sshd.

$ sudo restart ssh
$ sudo restart ssh
[sudo] password for jrcharney: 
ssh start/running, process 19133

OK, let's try this again...1...2..3...

$ ssh jrcharney@192.168.x.y
ssh: exited: Error connecting No route to host
Wah...wha...whaaaaaaa.

Nothing? What if we tried adding a port number to the end.

$ ssh jrcharney@192.168.x.y:22
ssh: exited: Error resolving '192.168.x.y:22' port '22'. No address associated with hostname
No. But nice try though. (Port 22 is the ssh port, BTW.)

We could check our iptables to see if that helps. Remember the firewall.

Something tells me I should work on a part 3 of this article. Yeah. Next time we talk about firewalls and iptables.

December 8, 2012

One Giant Leap Forward (Part 1)

I've been struggling with myself to set up Virtual Network Computing (VNC) for years. Firstly, when you use something like VNC, you kind a need a second computer to do that. Secondly, if you do establish a VNC connection between two devices, it is completely insecure.

The tipping point for me to get on the VNC bandwagon after much hesitation came when I realized, I still want to access my netbook directly, but up until a few months ago, the keyboard and mouse were still screwed into the chase where the cooling fan once made such a loud unbearable noise, it was louder than most conversations.

However, since the fan-dectamy, things have become much quieter but I can't take my netbook with me anymore. This is a problem for a guy with no money looking for work. So what am I to do?

I think of what I've learned so far that I can do with my HP Touchpad, ported with Cyanogenmod with access to Android applications like Connectbot and AirTerm for Secure Shell (SSH) and RealVNC and Vino for VNC.

Let's start with the simple part even though it is insecure. Let's assume that we have two devices. An Android tablet and a Linux Netbook using the GNOME desktop. On the Linux notebook where either GNOME or--heaven forbid--Ubuntu Unity, type into the applications menu search bar Desktop Sharing and click on the icon for the "Desktop Sharing" application. What this is really setting up Vino. As software changes or if you have different preference, you might use other VNC programs. But you don't have to worry about installing such program if you are using GNOME as your desktop as it should be built-in. If it isn't, in the terminal sudo apt-get install vino.

Set your settings up to look like this.

Desktop Sharing Settings
Don't forget a password!

After setting things up line in the image, and setting a password, click "Close". Whenever you are connected to your computer, an icon should show up on the lower status bar indicating that another computer is connected to this device.

Next part you will need to look for is your computer's IP Address so that you can input that information into the RealVNC application on Android or Windows or another Linux machine that has Vino.

$ netstat -an | less
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN
tcp6       0      0 :::5900                 :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN

Finding your computer's IP address with netstat. This is just a truncated list. In real life there is other stuff.

In the above figure, just made a copy of part of the output the netstat -an command does. As an extra measure, I piped it to less (though you could use more.) The above examples show active internet connections. The first column on the left shows what protocol is being used. tcp means the computer is using the TCP/IP version 4 (IPv4) protocol on some connections, while tcp6 means the computer is using the TCP/IP version 6 (IPv6) protocol. The last column on the right indicates the state of the connection. In this case, all the Local Addresses are LISTENING for activity on the Foreign Addresses. Often these addresses will only listen to a certain port such as port 80 (web server) or port 5900 (VNC server). There is other stuff involving how Internet protocols and Internet connections work, but let's focus on the issue at a hand.

So we checked the state of the services and know that they are running and waiting for something to happen. Let's find our IP address to tell the other device where to connect.

$ ifconfig | sed -n '/inet/p'
	inet addr:192.168.x.y  Bcast:192.168.x.z  Mask:255.255.255.0
	inet6 addr: [REDACTED] Scope:Link
	inet addr:127.0.0.1  Mask:255.0.0.0
	inet6 addr: ::1/128 Scope:Host
Finding the IP address with ifconfig. Note, some data has been redacted for my privacy.

I decided to add a sed command to reduce the number of lines outputted. In all honesty, most of the other lines without using sed are irrelevant to what we are looking for. Although, we can't see what devices use what connections.

At any rate, this is all being done on a local home network. I'm rather new to this so patching into the Netbook from outside of the home network is something I'm not familiar with as of yet, but I'm sure to learn it very soon.

The address for just connecting to the netbook starts with 192.168-something. If your home computers don't keep the same IP address either due to the set up of the router's firmware (such as the local IP address changes if the router is reset or unplugged), your going to need to do this step again the next time it happens.

The next four figures will show how to set up RealVNC for Android. This app is free on most other platforms but not Android. Generally, this app is about $9.99 in the Google Play store, but as of this writing, the app is $4.99. But I think that deal is only good through December 2012. Anyway, here's the sequence for setting up RealVNC.

2012.12.08-20.44.16.jpeg
Step 1: Press the plus icon in the upper right to create a new connection profile. Enter the IP address from earlier. 192.168.x.y should be replaced with the appropriate value. Don't forget to name the device. Picture quality can be left as "Automatic" because the image quality is generally high quality.
2012.12.08-20.48.07.jpeg
Step 2: Review the settings you want. You can edit them with the pencil icon on top or delete it with the trash icon. Otherwise, press "Connect".
2012.12.08-20.48.30.jpeg
Step 3: The first time you create a profile and have the profile save the password, you will see this prompt. Fill in the Password then press OK.
2012.12.08-20.49.51.jpeg
And you're connected! If you touch the top part of the screen, you will see icons for keyboard, mouse, connection information, help , and to close the screen. (BTW, Sinfest © Tatsuya Ishida.)

Back at your computer, you will move the mouse or do whatever else you are doing and the netbook will show those actions to in real time. On the other hand, if you touch the screen or use Reverend Kyle's USB Hosting Hack (which lets you use a Keyboard and a Mouse for Input), you can manipulate what happens on the computer remotely as we have it set up that way.

So does this mean, that we are done? NOOOOOOOOOOOO!!!!! In fact, if you haven't already, log out of the VNC session.

What's wrong with it then? There is no security between the Tablet and the Netbook, but there is a way to fix that using SSH. To do this on Android, you will have to tune in tomorrow for part 2.

November 27, 2012

Leser has a Project Page

I spent most of the day working on Leser, and boy am I tired from a good long day of work.

Perhaps it's me still getting used to jQuery, but it's kind of weird how you can load a file using jQuery onto your page, but you can't process it with any other JavaScript project. The data MUST be in the file.

PHP is just as bad. The file you want to load MUST be a PHP type unless you upload your data from a database. And since I have no time to fiddle around with databases at the moment, they only thing that makes sense at the present time is to just insert the data directly into the page. I had really hoped to use one page to act as a template for many others but for now, it's better this way.

So what does all this mean? It means that in the near future, and with more improvment to Leser, Tutorials and Cheat Sheets will be able to be uploaded on this site without the repetitveness of table tags and the like. I can write pages like I could with editing a Wikipedia page and not have wear myself out deciding how I should organizes these things or the tedious task of using tags properly as Leser will take care of that for me.

I think that last sentence didn't sound right. I'm too burnted out to fix it at the moment. I think I'll go outside for a brisk walk and some fresh air.

It is my hope to integrate Leser on this site especially when this site starts using LaTeX in the near future. But for now, I'm taking the rest of the evening off. More later.

One more thing, I made some style chages to tables on the project pages that might also effect the rest of the site. But like I said, I'll take care of it later.

November 26, 2012

Ich bin ein Leser

Ich bin mit deutschen Wörtern um de Klassen in meinem neuesten JavaScript-Projekt beschreiben. Es ist gut, ja.

And that is all the German I know. Yo entiendo español mucho mejor que alemán. Especially since I didn't need to use Google Translate to compose that last sentence.

For your convenience, I put the English translations in the title tag.

It's been really difficult to put into words the projects I want to do more than it was to find the words to describe this post. Perhaps it's because I work more efficiently in the summertime with the warm air or my brain is tuned into a better ambient frequency during the middle part of the year. I haven't quite figured it out since I proposed writing three different blog entries between now and just before the last one and all of them needed their backup files (because Vim is so awesome) moved to a draft folder somewhere offline until I can compose a constructive argument for writing them.

So what about now? Today is a good day. I'm motivated. If I had things set up to view the timestamp this post was written, you would see I got up bright and early this morning. (6:30 AM! Oh how I longed to wake up at that time again!) But enough of that, lets get back to today's subject.

As I may have mentioned in deutscher Sprache, I am working on a project in JavaScript where the class names are in German. Mainly because, in programming language that uses English keywords, where words like "class", "Object", "Array", and "String" are reserved keywords, but "Klasse", "Objekt", "Feld", and "Zeichenkette" are not.

So what is Leser? Leser (German for "reader") is a JavaScript program that acts as a document translator. Only instead of translating words from English to German or Spanish (though that is theoretically possible), it translates a set of strings from a set of Wiki notation to HTML only instead of using PHP, like MediaWiki does, this program uses JavaScript and jQuery to process strings into HTML.

This was an important project as I am composing another project for listing all the Vim commands in an accessible, fast-to-write format where I won't be so distracted worrying about tag attributes.

So what makes Leser so much more Wunderbar than using MediaWiki syntax? Leser is a more rigid form of Wiki syntax, but at the same time will have more features and be more fluent than Wiki. Just as jQuery made JavaScript more dynamic, Leser aims to do a similar task for HTML notetaking. Although, I haven't though of how to process templates like Wiki yet, the basic structures of headers, lists, tables, anchors, paragraphs, blockquotes, and preformatted text will be uses. However, using single quotes for boldface and emphasis will not be used. I really don't like use single quotes especially if you need to describe code or commands, and these HTML shortcuts have problem with uneven pairs. There are still a few HTML tags that will be honored. Namely the <code>, <samp>, <kbd>, and <var> will be honored, in addition to <span>, <b>, <i>, and whatever tag I plan on using when I get whatever LaTeX software up and running for this site.

Keep in mind, Leser will not be used on this blog immediately (I have a good system already for blogging) but will be used on other pages on this site. Hence my interest in developing a Vim cheatsheet that will explain how to use Vim as a Java IDE with minimal resources used. (If someone can get Minecraft PE to run on a Raspberry Pi microcomputer, Vim can be used as IDE.)

At this point, I'm just going to write my Vim (and maybe Java, C/C++, and SQL) notes in Leser format then work on getting Leser to work. That seems to be the most efficient and effective way of doing this project. Getting these notes written then making them look pretty later.

The only pit fall with this is that JavaScript, on it's own, will only process one line at a time. The challenge is to get JavaScript to recognized line breaks. Again, content first then style. I just need to remind myself of that.

More about this project later. I still need to get project pages set up for it anyway. Auf Wiedersehen!

Tags

Under Construction