Showing posts with label IT. Show all posts
Showing posts with label IT. Show all posts

Monday, September 30, 2013

Wearable Computing, why I don't think Apple is making an iWatch

Here's some barely edited, off the cuff IT speculation for you:


So wearable computing has been getting some press recently and of course people are coming out of the woodwork to say that in a year or two Apple will release their wearable device and the market will take off.  While this is probably valid and it fits Apple's M.O. to wait for smaller companies to setup a space and make some gaffes, most of the speculation has been that Apple will enter the smartwatch space based on patent applications and  acqui-hires by the rounded-corners giant.  Recently some people have been reporting that Apple's interest may have waned due to consumers not buying into smart watches at all.  The space remains pretty stagnant and it's likely that the gaffe right now is to even get into it.

However I can't imagine why a company like Apple would go into smart watches to begin with, even if the market for them was thriving.

Put simply, the other half of Apple's mostly winning strategy the past decade and a half or so is to distill the experience of whatever product down to a few of the most useful and simple features, and them package that up in a way that's tightly integrated with the rest of Apple's offerings.  The key common ground with all their devices has been the iTunes platform, where they've spent massive amounts of money on development and licenses for music, movies, newspapers, books, games, etc.  The iPod started as a music player, and iTunes sold music.  Then they added pictures, and then stepped to video.  And then iTunes sold movies and TV shows.  With the iPhone the iTunes application became a sync hub for that media plus an address book backup and a mobile app store.  I think iTunes got into books a bit before the iPad came out, but it's pretty clear that a major use case for the iPad was as an eBook reader.  This has all made sense, but the idea of them making a watch does not.  Listening to music on your watch is no good.  You'd be running a headphone cable to your wrist, and you use your hands and arms a lot during the day.  It's clumsy.  The screen is too small for movie watching to say anything of reading a book.  You probably couldn't play games on it either.  So why would they abandon everything they've done and make a watch that doesn't play to their strength of an integrated ecosystem?

My theory is that if Apple does enter wearable computing it will be with a Glass-like device.  It makes more sense.  It's something that they can make look good, as a major criticism of Glass has been that you look like a doofus while wearing it.  They could let it bluetooth pair with your iPhone to access its media.  It's a superb platform for listing to music and I bet it'd be a pretty good reader too.  They could integrate it with Apple maps to provide a HUD.  Probably a dozen other things I can't think of.  It'll be the iEyes or i^2 or something.  This is of course providing they're even thinking about it, but they may just see wearables as a fad for now.

That's my story and I'm sticking to it.

--PXA

Saturday, January 19, 2013

A foray into video recording and editing

I'm fully aware it's been a very long while since I discussed anything technical on this site, and that makes me feel a little sad as that was the original point.  I had been somewhat hindered by the fact that there was very little I was doing outside of work that seemed interesting, and a lot of what I was doing in work was too difficult to make generic enough to not get me in trouble.  However, since I had started doing YouTube Let's Play videos (as mentioned previously) I've got something that's pretty interesting and somewhat technical, so here we are.

Let's Drink to Gaming is a Let's Play show with themed cocktails.  I wanted this to be a little more interesting than just playing a game and narrating what's going on, so I decided that I would play with a rotating cast of guest hosts over the internet.  This leads to a somewhat interesting challenge of broadcasting the game video to the other person while simultaneously recording it.  It also raised the question of how to record multiple audio sources, and broadcast multiple sources.  I needed to hear and record their voice, they needed to hear me and the game.

I did some wandering around Google and tried: XSplit, FFSplit, Fraps, Taksi, Bandicam, and I think "GameCam"?  Eventually I settled on Dxtory.  It's paid software but it has a lot of features that were really important in my situation that only really XSplit also mirrored, and since XSplit uses a subscription pay model Dxtory is technically cheaper.  The most important features Dxtory has are:
  • The ability to record an arbitrary number of audio streams.
  • The ability to stream the video it's recording to several DirectShow contexts.
Almost every other program only recorded 2 audio streams, if that.  They're really well setup for traditional commentary recording where you want the game and a microphone, but I was obviously biting off a bit more.  Since starting I've recorded up to 4 tracks at once: Game audio, my friend Tim and his fiancĂ©e over Teamspeak, myself on a headset mic, and my girlfriend on another local mic.  Being able to isolate all these lets me mix everything independently while I'm editing the final video so I can do some EQ and noise removal, basically make a run through and try to clean up the audio as much as possible.

Streaming via DirectShow is the way most webcams work, so since Dxtory can do that, I have a lot of options for video conferencing or streaming software.  I tried Skype first since it's super-easy, but the video quality is awful.  Skype uses 640x480 streams.  We've been trying to get RTSP with VLC working for some time can't quite get it over the internet.  I have a sneaking suspicion Verizon may be blocking RTSP.  I had also briefly toyed with the idea of using a game streaming site like Twitch and maybe making the channel private, if that's possible, but the lag on my stream was unbelievable.  I just recently found out this was because one of the utilities which came with my motherboard, a bandwidth prioritization utility, was devoting almost all my network resources to a Synergy server.  So maybe this is an option again.  I should also revisit the VLC tests in case bandwidth was an issue.

Audio mixing for the live feed was still unanswered.  This market is unfortunately less varied and most of it is paid software.  I tried without success using PulseAudio for windows, Jack for windows.  Eventually I bought Virtual Audio Cable.  VAC lets you create virtual audio devices on your PC and also arbitrarily route real and virtual devices.  This has been really important when we've played non-co-op games and had my girlfriend in the room with me.  I can use VAC to combine both of our microphones, and the game audio into a single device and make Teamspeak use that as its microphone while not affecting my ability to record all 3 of those sources alone.

So once I recorded everything I end up with a few gigs of x264 encoded AVI files with separate audio streams.  All the post-production work is done in Linux.  The software for windows I bought to record and stream was pretty cheap, and they were the only programs I saw with the featuresets I wanted.  Video editing software, however, is really freaking expensive.  I tried some free programs for windows, but they were all terrible.  Nothing could even match the feature set of of Adobe Premier Elements or Windows Movie Maker.  So I went to Linux where there were at least a few programs for me to choose from: Cinelerra, KDEnlive, and OpenShot.

I made my first video in Cinelerra but it was clunky, old looking, unstable, and couldn't export quickly or easily.  I wound up rendering the audio separately, and the video into a ludicrously large MOV, 80 gigs or something, then muxing the two together and reencoding on the command line.  Since then I've been using KDEnlive and it is much much better.  It still crashes and it has some clunkiness around certain tasks or filters.  I'd love some project templates and previewing animated title cards has some problems.  Also, it had this super-strange audio glitch that made creating the clip show utter madness.  I may try OpenShot soon, since it looks really good but I have nothing on it now.

I have a shell script that invokes ffmpeg to extract all the audio streams from the video file so I can work with them in Audacity.  Audacity seems like the go-to cross platform audio program, so I use that to import all the tracks, then run noise removal and run a pre-amp on anyone who seems too quiet.  Then I basically listen to the entire project covering up bits of keyboard noise or other unwanted sounds and if anyone talked over anyone else, bring out whoever said something better.

Anyway, that's the basic setup:
VAC to setup the audio so everyone can hear what they need.
Dxtory to record all the audio to independent data streams and output video in a usable format.
Google Hangouts to stream video to the remote commentators.
Audacity to clean and mix the audio into a single track.
KDEnlive to put everything together into the final video.

Yeah, this is long winded, but at least I'm talking about software again.  Maybe I'll post the bash script next time I boot linux to do some work.

Friday, November 6, 2009

Mojo Rising: AutoFocusing on Dialogs

While I have every confidence the documented controller.setInitialFocusedElement() method will work during scene pushes, the story is somewhat different if you only showDialog(). I'm currently adding the final touches to my first complete Palm Pre application, in preparation for a postmortem blog post on developing with Mojo.
One of those final touches was automatically focusing on the text input widget when the dialog was shown. This simple thing took me over 2 hours to figure out and required reading through the actual framework code provided by Palm.
For whatever reason some methods of the scene controller aren't fired on showDialog() like they are on pushScene(). Might track down more on this later.
For now, to get Mojo to automatically focus on an element when a dialog is shown, do this:

1. When creating your view, add a tabindex="0" to the div which will become the widget. Or use the Mojo.View.makeFocusable() method, which currently does the same thing.
2. In the Assistant object you passed to the showDialog() method as the "assistant" property, add the following line of code to the activate() method:
Mojo.View.advanceFocus(this.controller.sceneElement);

Alternatively you could just call:
this.controller.advanceFocus();
However, the advanceFocus() method of the scene controller object is annotated as private so using it is likely not the best practice. There also might be a better way to get the sceneElement, but at the time of this posting I am far too tired to look it up.

More Mojo Rising coming soon, folks.

--PXA

Wednesday, September 10, 2008

More Cisco Linux VPN problems

I have noticed another issue with Cisco's VPN for linux, this time in the form of a module that inserts fine but won't connect. /etc/init.d/vpnclient_init status reports a good module but the interface can't be found.
When I saw this my first inkling was to see if I could change the name of the interface it's looking for in the initscript, this made status report good but the client still won't connect to anything.
This is because Cisco, in their infinite "wisdom" decided to hard code the name of the interface into the driver itself.

Your best bet is to figure out what udev rule is forcing the rename...it's probably in the file /etc/udev/rules.d/70-persistent-net.rules

Only other option is to rewrite parts of vpn_ioctl_linux.h to change the device name the driver tries to use to the one it's getting anyway, or change the MAC address and hope /etc/udev/rules.d/75-persistent-net-generator doesn't mess with your device when you reload the module.

Matter of fact, it'd be a cool patch to change those on the fly.

Hmm,

--PXA

Tuesday, September 9, 2008

Mini-update: KDE4

I just rebuilt KDE 4.1++ from SVN sources, and frankly, it makes me want to kill small puppies.
This is the list I have compiled after approximately 15 minutes of use.
  1. I tried to use the auto-hide, KDE4 does not like this. To trigger the taskbar's visibility you need to get all the way to the screen side where the panel lives, then back off several pixels. And hope. The panel would sometimes not respond or become visible then immediately fade. But the edge of the screen itself does not respond to input at all.
  2. For me, KDE starts without window decorators, if I try to enable them the panel gains a title bar which doesn't seem to accept input. This causes some problems when trying to open the panel settings. The panel settings are cool when they open since they attach to the panel. But when this titlebar is open you need to quickly cross it to get to the configuration panel, a lot of the time you will lose both panels.
  3. Desktop Folder is the crappiest thing I've seen in a long time, I would LOVE to turn this off and get a real desktop. I can't.
  4. The focus is very strange, to bring a window to front you need to click on its TITLEBAR, not anywhere in the window... I'm hoping that's a settable option but I couldn't battle the interface enough to get to the control panel so no idea here. If this is default, it's just a stupid idea.
Maybe I'll try more later, maybe I'll delete it again and wait for KDE 4.2. Anyone have any GOOD things to say about KDE4?

--PXA

Monday, September 8, 2008

Cisco Linux VPN on kernels 2.6.19+ (And x86_64)

Cisco seems to have been screwing the pooch recently when it comes to releasing good installers for their VPN software. A version of the VPN client for windows released last February had a nasty glitch where it tried to iterate every group in RIT's active directory environment 4 times. And the previous version of the Linux VPN (4.8.00) unceremoniously broke with kernels higher than 2.6.19 and remained officially unpatched (There were only community written patches) for several years. Cisco recently released 4.8.02, which brings with it full compatibility with modern kernels (tested up to 2.6.25)

However, to compile on a 64 bit kernel the module included code which modifies the compiler flags (or CFLAGS) to build correctly on 64 bit kernels. The linux build system for kernel modules (called Kbuild) does not allow makefiles for modules to modify CFLAGS directly, so it accepts a parameter called EXTRA_CFLAGS. The Makefile for Cisco VPN Client for some reason uses EXTRA_CFLAGS fine normally but in the conditional for 64 bits uses CFLAGS directly, causing the build system to throw a hissy fit. So the simple fix is to change line 15 of the Makefile for Cisco VPN 4.8.02 from
CFLAGS += -mcmodel=kernel -mno-red-zone

To
EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone

Then there's a whole slew of other issues with 64 bit kernels which are fixed by this patch.
(patch linked from http://www.lamnk.com/blog/, and written by Steven Frost)

At least there's a positive note with that: A codebase patched for 64 bit will still compile (albeit with warnings) on 32 bit systems.

I see stuff like these issues, and I've gotta wonder...Do they TEST this stuff? At all?

--PXA

Tuesday, September 2, 2008

How To: Break MOLLY!

I have wanted to post this for a long time now, but I had previously been afraid of retaliation by RIT's IT department since this exploit was discovered using their public facing website. However, http://it.rit.edu and http://nssa.rit.edu have both recently switched from Molly, a pseudo in-house solution written mostly by Ronald Vullo. Molly's status as a publicly available CMS from sourceforge opens the possibility that other people outside of RIT will be using it, and these people would probably appreciate being told about a security vulnerability in their software...unlike the IT department which would likely try to expel me or prevent me from graduating on schedule. (Yeah, I have great faith in these people.)

Anyway. Molly stands as a key case example for how you should NOT write PHP. It makes heavy use of BAD-THINGS ®, does not use any sort of legitimate string munging to prevent SQL injection, and has almost no concept of session security.
As for bad things, I mean things like polluting the global namespace, using .html files with PHP in them, the eval() statement, old functions like eregi_*(), and heavy use of $_REQUEST as opposed to $_GET and $_POST. The PHP manual itself states that $_REQUEST cannot be trusted, as you do not know which of Environment, Cookies, Get, Post, Server sources provided the variable you're looking at in $_REQUEST or if one has over-written what you actually want.

The most glaring exploit I've found, however, is related to the rendering engine the the database module (Called forms). Molly controlled pages will often have some string in their URL which tells the Molly engine how to render said page, example: people.maml?id=77&renderAs=output Or renderAs=edit
Yup. I can just see all the tech minded people thinking "What if I change output to input?".
When RIT used Molly, exactly what your worst fears were, is what happened. Each element on the page became HTML Input.


After that point it became trivial to use the Firebug plugin for Firefox to modify the contents of the page on the fly to make Molly bend over for you. To update any record you wanted, it was a simple matter of navigating to that page, changing the URL, using firebug to change the form action from "insert.html" to "replace.html" and adding a value to a hidden input element named something along the lines of "form[0][id]".

Since Molly doesn't understand security, the files which parse the form input and create the SQL queries are wide open for all to access, as long as you can post the right information.

One way these can be protected is through the use of an .htaccess file using the directive and some form of HTTP authentication. And that's probably the simplest way, but I don't know if there's anything resembling security on the rest of the engine that could be expanded to these files.

YOUR CODE IS BAD AND YOU SHOULD FEEL BAD TOO!

--PXA

Monday, August 18, 2008

When lolz turn to sadness

My current employment is as the Co-op student for ITS Desktop Support, the only major project so far has been the rebuilding of the department's internal website in a more interactive, database driven format. The new version of the site is being hosted in RIT's new totally redone better-than-the-old-environment-ever-could-have-been web applications environment. Despite the rather cramped space limitation, and unnecessary staging server, it's been less painful than it could be. Until I got around to porting a few of our backend processes that need to run on a regular basis. This involves command line PHP and UNIX Cron. Which would normally be well and good but this environment is really more than meets the eye.
In short, developing in it is like trying to get from point A to point B in this room:
It took a day to get database connections, because for some reason scripts run by Cron run on a DIFFERENT HOST than scripts run manually from the command line or scripts run by the browser. WHAT?!!!

These people have obviously never heard of the principle of Keep It Simple, Stupid. So when any of these points of failure go down, the whole system dies. I found this out over the weekend. Because it went down.
Every 5 minutes my cron task ran, and every 5 minutes it failed. Which meant that every 5 minutes, I got an e-mail saying that there was a problem running the script, and then another e-mail saying the script failed. I was greeted Saturday morning by well over 100 e-mails.

Remember, don't laugh at the convolution of your development environment, for it might come back and pee in your shoes.

:(


--PXA

Tuesday, July 29, 2008

How-to: Full read/write access to ReiserFS in Windows Server 2008 x64

Yes, I am fully aware of the ReiserFS IFSD project. However due to the somewhat draconic driver signing requirements of 64 Bit Server 2008 this driver doesn't load. I have heard you can convince it to in 32 bit versions of the OS. There's something about the image hash integrity that prevents it from working. I may try to recompile this in 64 bit but that is a project for another week.

However, it's still possible to gain access to your ReiserFS (and any other linux filesystem you'd like) using free tools in Windows Server 2008. All it takes is some time and a rather twisted hack.

You will need:
  • An installation image file (ISO) for your favorite linux distribution. If you don't know linux that well I'd recommend Ubuntu or Fedora. I used Gentoo, since I knew I could make it a very small installation.
  • VMware Server 1.0.6. VMware Server is free, you need to fill out a web form to request pretty much any number of license keys.

At the end of this article I've provided the kernel configuration file I used for Gentoo as well as my smb.conf.

Start VMware Server, before you install you should reboot. Press F8 before windows loads, and make sure to select "Disable driver signature enforcement". Before some recent patches, this could be set permenantly using bcdedit, but no longer works. It is recommended you suspend your windows installation instead of shutting down to avoid having to do this every time you boot your system.

Connect to localhost and create a new VM, use typical settings. Selecting the type of OS you'll be running is only really useful for VMware tools, which I won't discuss here. Feel free to comment on this. Call it whatever you want.
At the networking screen, for security's sake it's advisable to use NAT or host-only networking. I used NAT.
The next screen is for the size of the virtual hard disk. This doesn't really matter, and should only be as large as absolutely needed for your linux of choice, but really shouldn't need to be much bigger than 6 or 7 gigabytes. My Gentoo installation is about 1.3GB, and could probably be made smaller.
For the CD-ROM drive, if you've burned your installation disk use the physical drive, otherwise select the image file you downloaded earlier.
Finish setting up your VM and start it. With no data on the virtual hard drive, it will boot off the CD. For the sake of the length and scope of this article, I will assume you know how to setup the distribution you selected. When you get to a point where you can, make sure to install the most recent version of Samba you can.

Once your linux VM is installed and working, shut it down.
In the VMware console select the VM and click "Edit virtual machine settings", then click "Add" to add hardware. The 3rd option when adding a drive should be to directly access a physical hard disk, for experts only. Click 'ok'.
The names VMware gives the disks in your system are probably not the most descriptive things in the world, but you select to use Invidual Partitions and click next you can see the partitions and their types that are available on the selected disk. Select your Linux partition(s).
Start your VM again.
Once you are up and running, fdisk -l or the system browser should recognize the new disk.

Open the file /etc/fstab as root in your editor of choice and add a line similar to this:
/dev/sdb1 /mnt/reiser reiserfs user,defaults 0 0
Where /dev/sdb1 is the name of the partion as shown in fdisk -l. Also make sure the directory /mnt/reiser actually exists. If it doesn't, create it (you will likely need to be root).

Now mount /mnt/reiser.

The final piece of this convoluted puzzle is samba, the smb.conf file.
[global]
workgroup = WORKGROUP
netbios name = vmlinux
server string = Samba Server %v
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
[reiser]
path = /mnt/reiser/
public = yes
writable = yes
browsable = yes
guest ok = yes

Make sure samba is configured to run on startup...in Gentoo this is
rc-update add samba default
in Ubuntu or Fedora you can configure this in the GUI. If your desktop is GNOME, this will be in System>Administration>Services

Either reboot here or start the service /etc/init.d/samba start

Now back in Windows, open the explorer and go to Network. If you are using Aero you will need to hit the 'Alt' key to see the 'Tools' menu. Select 'Tools' and 'Map Network Drive'.
Select whatever drive letter you want, and as a folder use:
\\vmlinux\reiser
Click 'Finish' and you are done! Yay! You can now open your linux partition under windows and have full access to it.

If you left 'Reconnect on logon' checked when you mapped the drive you should edit the virtual machine. In the options tab of the edit dialog, select the Startup/Shutdown setting and from the dropdown box under "On host startup:" select "Power on virtual machine"


Click here for the Gentoo kernel .config file


As a note I wrote this while incredibly hungry, so it might but hard to understand some things. I might be rewriting sections of it to word things better later...if it looks like anyone's coming here and reading this.

--PXA

Saturday, July 26, 2008

How-to: VLC/Windows Full Screen Video trick.

Once upon a time, nVidia cared about us. The nVidia control panel was hard to use but pretty slick and it had one feature that I thought was absolutely great: There was a video overlay feature that would automatically clone any video output from either screen in full screen on a screen you specify.
In Linux I can simulate this by selecting a screen for full screen output, and VLC will comply without hesitation every time I go to fullscreen mode and every time I add a file to the playlist...it opens in full screen ON THAT SCREEN no matter where the VLC window is.

Windows has befuddled my every attempt to do this. In Direct X output mode video uses the wrong aspect ratio in XP and forces Vista to change from Aero to Vista Basic, and displays on a portion of the video. (Your milage may vary). And OpenGL requires me to move 51% of my window to the other screen, but then if the next video on the playlist starts and I have moved the window to a different screen, it full screens there. Usually on top of my work.

After some experimenation using VLC 0.8.6i on Windows Server 2008 I have managed to get an affect that is close to my Linux experience.

The final result is this: A VLC player with controls, but no video in the main window and video automatically playing in full screen, on the same screen each time (even after the next video in the playlist.)

First enable full screen off the bat so you don't need to force the video into full screen when you start VLC the first time:

1. Go into the settings menu and open preferences, check the box that says "Advanced Options"
2. Select the "Video" section from the box on the left.
3. Check the box that says "Fullscreen Video Output"
4. Scroll the main settings area down to place where you can see "Window Properties"

"Video Height" and "Video Width" should be set to the height and width of the screen you will be viewing your full screen video on. (In this iteration of the technique this is not strictly necessary, but is a leftover from experimentation with the "clone" video filter which would allow video in both the main window and the extra screen)

In my case this is 1024x768 screen.

5. The next 2 options will be Video X and Video Y. In my case, my 1024x768 screen is to the right of a 1280x1024 screen. So I set Video Y to 0, so it's at the top of the screen, and Video X to 1280 so that it will be in the left corner.

6. Further down the window will be another box for "Window decorations". Uncheck it.

7. The very last option on the left should be "Interface", expand this, and then expand "Main interface". Select "wxWidgets" from this list. Unceck the options for "Embed video in interface" and "Size to video"


While this is incredibly involved and rather inflexible, it does get me video the way I'd generally watch it and could hopefully be of use to someone else.

As a note I already tried getting Windows Media Play, MPlayer, and Media Play Classic to behave the way I want them to (like VLC/Linux) but had no luck. MPlayer wouldn't even play ANY video on my other screen.

--PXA