I manage our MAC OS X server on a Windows XP machine from a command shell from ssh.com. I can do 98% of my task from the command line, however sometimes I need to use the MAC GUI. I have OSXVNC running on the OS X and Real VNC running on my Windows box.
For our staging server, there is no real security concerns running VNC because the box is inside of our network and can not receive outside traffic. However for our production Web Server, I don’t think it’s a good idea to have VNC running even if you change the default port. For one reason OSXVNC only does 1 part authentication, I.E. you are only challenged with a password, not a user name. Instead of running down to the server room everytime I have to use the MAC GUI, I instead have came up with this nice little tip.
I start VNC server from the command line in my shell client specifing an encrypted password file, log on to VNC, do my buisness, and then kill the VNC server thread. In security theory it goes like this: - I create a locked door on the fly, open it up (keeping it locked behind me), then destroy the door when I am done. This is how to do it.
- OSCVnc creates a directory when installed named: /OSXvnc.app/
- Inside /OSXvnc.app/ there is a utility named: storepassword
- Run this command to create your encrypted file with your password in it:
#./storepassword yourpassword yourfilename
To start OSXVnc by command line:
- Go inside the Application directory(OSXvnc.app) and launch the OSXvnc-server process.
- To change parameters you will need to give it arguments (-rfbport to set port, -rfbauth to specify a password file, etc). For usage run the command with -help. For example:
# ./OSXvnc-server -rfbauth yourfilename
This starts the OSXvnc server with your encrypted password file
Now, start your RealVNC client on your windows machine. You will be asked to autheticate. Once you are done with the MAC GUI, close RealVNC, go back to your command shell and hit: “Ctrl + X” to kill the VNC thread. This is a nice way to not worry about running VNC all the time on your production boxes exposed to the world.
I’ve gotten an email or two about how I managed to make my search box look like an Apple MAC OS X Finder. You could view source on my site and see or how about I share it with you
Basically it is contructed by using the method: Left Round Image -> Input Text Box with special Styles <- Right Round Image
However some older web browsers do not support this entirely. In my case I was losing the attibute tags across post back in asp.net. Anyway, I came across a different way of doing this using Javascript. I have no idea why I hadn’t thought of this earlier, it kinda makes me feel dumb
I know that some people will frown on this because Javascript must be turned on. But in my case, Javascript is required to be turned on to run the application because of the AJAX stuff I am doing.
NOTE:Someone at work pointed out another way that you can do this that I never used before, by using the “disabled” attribute.
I think this is a case where you do something one way for so long (like I did the readyonly attribute) and you can miss out on other ways that have their individual advantages.
One thing I was looking forward with asp.net 2.0 release was improved viewstate optimization. The truth is it has improved, but for me there is still something desirable to be had.
Where I have run into the problems is a web application I am working on the must allow the user to add an infinate amount of web controls dynamically. The results below are pretty amazing. I ended up using SharpZipLib for the compressing algorithm.
Test Scenerio: One web page with that ended up with 116 asp.net web controls add to it.
Result of ViewState Size: Before Compression: 43.3 KB After Compression using SharpZipLib: 3.50 KB
Below is the code to get you started
Imports System.IO
Imports Zip = ICSharpCode.SharpZipLib.Zip.Compression
One asp.net custom control that I am loving right now is Denis Baur’s Dynamic PlaceHolder. I’m having to do an web application that must allow for an infinite number of standard web controls and maintain state as these are entered. I went down the AJAX.NET Professional route for a minute but ran into some issues. Instead of recreating the controls on Page_INIT on every request to add a control, I’m able to add to the the new controls to the placeholder list.
Example:
Function AddProduct(Byval strPN as String)
Dim Count As Int32 = CType(ViewState(strPN & "Count_v"), Int32)
Count += 1 'increase viewstate count
Dim ddlProduct as New DropDownList
with ddlproduct
.id = "ddl" & strPN "Product" & Count.ToString()
dphP.Controls.Add(ddlproduct) 'add to dynamic placeholder
end with
ViewState(pn & "Count_v") = Count 'add back to viewstate count