Remote Desktop into a Raspberry PI (using XRDP)

A Raspberry Pi makes for a great home server, platform for development, electronics host, and a variety of other things.

 

Raspberry Pi Model B

Raspberry Pi Model B

 

If you have a Windows desktop/laptop you are likely familiar with Remote Desktop, the usual tool used to view the desktop of a remote machine. With the right software, this is a great tool for view Linux desktops as well, such as the Raspberry Pi.

If you want to use Remote Desktop with the Raspberry Pi, the XRDP package needs to be installed. Before installing a new package, if it has not been done recently, is to update your repositories with the terminal command:

 

pi@raspberrypi ~ $ sudo apt-get update

 

This will make sure you’ve got the latest view of the package repositories. You can then follow it with the command to install XRDP.

 

pi@raspberrypi ~ $ sudo apt-get install xrdp

 

It will read the repository, ask you to confirm with the [Enter] key, then install the package. Once it complete, try to start XRDP to confirm it is running. You should see text like this:

 

pi@raspberrypi ~ $ sudo /etc/init.d/xrdp start
[ ok ] Starting Remote Desktop Protocol server : xrdp apparently already running.

 

Once installed and running, it may take a minute or two, then you should be able to connect with Remote Desktop with the default username and password of ‘pi’ and ‘raspberry’ respectively.

 

RemoteDesktopDownArrow

Login

Posted in Electronics | Comments Off on Remote Desktop into a Raspberry PI (using XRDP)

Enhancing “Smart” Comic Naming

This article is obsolete with version 2.21 or newer. The algorithm is no longer user-visible.

Comic Seer sorts, organizes, and displays comics based on their file name. It tries to make a ‘best guess’ on what that name should be, but it is not always perfect. Starting with Comic Seer version 2.00, how this “smart” naming works is configurable if you are familiar with perl-style regular expressions.

Regular Expressions are a tool used for reading and parsing text. In this case, they are used to parse a comic file name and put it into four components: base name, volume, part, and issue. These components are then taken separately and put back together to make a pretty name. For example, “ComicABC Volume01 023.cbz” will be shown in Comic Seer as “ComicABC V1 #23.”

In the v2.00 release of Comic Seer, there was a problem such that “Mind the Gap 001” was being shown incorrectly.

 

NameProblem

 

Luckily, this can now be fixed without a new version of Comic Seer. (Although, a fixed regular expression will be provided in the next release)

When you run Comic Seer on your computer, a file by the name of “ComicSeer.ini” is created in your user preferences directory (ie on Windows 7: this is C:Users<user>AppDataLocalXylasoftComicSeer”). This is where all of your preferences are stored and this is where the regular expression is stored for parsing comic file names.

 

RegexLocationInFile

 

The “ComicNameRegex” string can be edited and replaced as you desire, where the most current “recommended” can always be found in the forums.

 

By replacing this text (after the equal ‘=’ sign) and opening Comic Seer again, it will use the updated regular expression and you will now see the updated naming. (Note: if there is a problem with your regular expression and the comic name is not being recognized, your comic names will default to the original file name)

 

NameFixed

Posted in Comic Seer (desktop), Software | Comments Off on Enhancing “Smart” Comic Naming

How to rip files (and images) from Chrome and Firefox web browser cache

Disclaimer: Please observe licenses when using this information.

Whether you are developing a website or would like to access hard-to-get information in a web browser, it may be useful to retrieve files from a web browser cache. All browsers provide a way of accessing the cache and you can access the files yourself, but sometimes that is not enough. In addition, in many cases, the web browsers only provide you a report on a file, not the actual file.

For instance, if you type “about:cache” in Firefox, you will be able to get a list of entries, where each generates a report like this:

FirefoxBrowserCacheReportWhile there is good information here like the size of the file, the raw content of the file in hexadecimal, and the type of the file; it’s not real useful in this format. (For informational purposes, you can type “chrome://cache” in Google Chrome to access a very similar view of the cache files)

While there are extensions available for these browsers that makes it easier to get at the original files, those extensions are susceptible to the day-to-day whim of the browser developers and are often broken in my experience. Some of them can also be rather buggy. I decided it would be easier to write a tool that would provide a means to get back to the original file outside the scope of the browser.

I am providing a Perl script that will read the above HTML file and produce the original file, originally developed for reproducing images. Given this is an external script, it is cross-platform (Windows, Mac, Linux, Unix) and cross-browser (Firefox, Chrome, others?). You can download the script at the bottom of the post.

In order to use the script to retrieve cache files, you must first save the report file from the web browser. This can be done by right-clicking on the page and selecting “Save As”, “Save Page”, etc. This will save the HTML file to a local directory.

You must then make sure you have Perl installed. If you are running Mac, Linux, or Unix, you probably already have it installed. You can check by opening a command prompt (or terminal) and typing “perl –version,” which would produce version information like this:

 

PerlVersion

 

If you don’t have it, you can get it from here (www.perl.org). Once installed, download the script at the bottom of the page. You can then recreate the original file by executing the script with the cache report file as a parameter:

 

perl webcachefile.pl mycachefile.html

 

PerlWebcacheRun

When you run it, you will see that it tries to identify the file first, finds the hex data block, and recreates the file- and that’s it!

Now, in my case, I often have a bunch of files I want to convert at once. If I download these cache files and put them in the same directory. I can run this shell script in Linux (and probably works on Mac and Unix too).

 

for f in *.html ; do perl webcachefile.pl “$f” ; done

 

PerlWebcacheRunMulti

Currently, there are only a few content types (images, icons, text files, etc) that the script identifies and adds the correct file extension for. If the script does not recognize the file, it will give the extension “.raw,” which can then be changed back to the original file’s extension. You can also add this information directly to the script if you’d like.

Feel free to leave comments below.

 

Current Version of Web Cache File Download script:

  • Version 1.0, March 29, 2013
  • Validated on Firefox 19.0.2 and Chrome 26.0 cache files
  • If you make changes to the script and think I might find it useful, please send the changes over to me and I may add them to the released script here.
Posted in Software | Comments Off on How to rip files (and images) from Chrome and Firefox web browser cache
« Older
Newer »