How to Install Things off Command Line in Computer we are SSHed to - ssh

so my general problem right now is that I'm SSHing into another computer and would like to download Java, however a lot of what I would need to get things set up can only be accessed, from what I can tell so far, from a download off the web browser. Of course there are likely several solutions to this, such as ways to download the environment and language outside of a web browser, but at the same time I'd like to know the general strategies one would take in downloading new languages and environments on a computer they are SSHed into, or don't have as much utility in its use. Thank you!

Related

How to get data out of citrix

Here's what I want to be able to do:
Run a program on my local computer which logs in to a citrix server (using citrix receiver or doing so in a similar way), on the server in the citrix session open a web browser, load a website, and then bring the html of that site back out of the citrix session and onto my local computer. Bascially I want to get data out of a citrix remote session.
How can I do this programmatically?
I'm fine with whatever programming language/modality you are comfortable in answering the question using.
I've looked a little into the citrix apis but while I find some things about logging in and even sending keystrokes and mouse clicks I found nothing about obtaining data. I could just log in and then use a program like wireshark to get the information, but I'm guessing it's all encrypted (plus then I wouldn't be doing my task all programmatically). I know of at least one open source program which seems to be able to replace a citrix reciever/client (openthinclient.org) but before I got digging through all its source code to try to answer my question I thought I'd ask here in case someone had an easier answer.
If all you want is to automate the task, is having the program act as a citrix client necessary?
I assume you don't have install privileges inside your citrix session, so are unable to install one of the many automation tools available (such as http://docs.seleniumhq.org/)?
Given the above...
If you have/allow java on your local machine, have a look at http://www.sikuli.org/
The main difference between this and other automation tools I've come across is that Sikuli uses the image on screen to navigate the gui, rather than grabbing calls to the widgets (which wont work in a citrix session).
So, assuming you can take a screenshot of your citrix session, it could be useful to you.

How do I go about safely taking a screenshot of a website that I know is infected with malware?

Background:
One of my clients' websites has become a malware infested hotbed.
Disposing of the malware has proven difficult and time consuming, and, in the meantime, we still have had to do work on the site.
For now, we went to some trouble to do our work - creating a disposable VM to just run a web browser, so we can see what the site looks like for the designers' work, for example.
I'm wondering if there's an easier (and faster) way to get an idea what the design of the site looks like. Not everyone on the project is tech savvy enough to be trusted with, for example, properly handling switching VMs.
Question:
Is there a method for safely seeing what a malware infested website looks like (for example, a service which will browse the site for me and send a screenshot), one which ideally is easy and simple enough to use that I can trust our non-tech-savvy designers to user?
You might take at look at Internet Archive: Wayback Machine to see if the site has been archived.
If a screenshot is all you need, there are several online browser simulators, such as Net Renderer (which will run any inputted web URL in a given version of Internet Explorer and then supply a screenshot). You might also try BrowserStack, which requires an account, and is not free, but does have a free trial period, and offers more than Internet Exploder.
You could also try running a browser in Sandboxie, which is simpler to set up and use than a VM (you just install it, and then use the windows right-click menu to launch any program in a sandbox of your choosing). However, it isn't free for commercial use.
I don't know if exist a standalone tool to parse a website for malwares, but I think this can help you, it's a google tool that you can you with a request and they will send you a response.
Follow the link:
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=168328
Hope it helped.

Is there a decent, standalone, cross-platform webserver that will work in concert with Autorun on USB Jump Drives?

I'm trying to find a decent standalone webserver that I can load up on a jump drive.
My wife is a photographer, and I'd like to present the clients with their images on usb. When they plug it in, I'd like a web page to load up, and run some jQuery magic to show them a nice carousel of all there images.
So far, this is all fine since it can all be done client side and doesn't need a server at all.
The problem I'm facing is that I'd like some server-side code to be able to read the images out of the directory so that once the interface is built, I don't need to manually create all of the <img /> tags.
If it was primarily going to be used in a Windows environment, I'd have no problem going with IIS Express, since I'm mainly a .NET MVC developer and this would be perfect for me... However, the fact of the matter is that a large amount of our client base is also OS X users.
I did find this Java one jlHttp, and I also found this thread here on SO, but I don't think I understand enough about either one of them to accomplish what I'm looking for.
Thanks in advance for your suggestions.
I'm looking for the same thing, and the two best options I've found were Flying Ant cd web server and Stunnix. Of the two, Flying Ant is cheaper, and I've tested it with success on my project.
I found Mongoose very convenient for this exact purpose. It's crossplatform, lightweight and requires minimum configuration. You may be interested in this project that uses Mongoose to display pictures in a folder tree or FTP directory.
How about Node.js
It says it runs on Linux, OS X, and Windows.

How would I created a flexible EC2 Windows 2008 boot script?

If you look at the Linux ecosystem (especially the Ubuntu and Alestic EC2 images) there is a common technique where the VMs are pre-configured to look at the EC2 user-data and use it as a boot script. The nice thing about this approach is that you can write a boot script that further provisions your machine, allowing you to avoid making a new image every time your software that runs on the machine changes.
I want to do the same thing for Windows, but given that I'm an Mac and Linux guy, I'm a bit lost on where to start. My requirements are:
This must run on Windows Server 2008
A bootstrap script needs to start when the machine boots up, read the user-data file by pulling down the contents http://169.254.169.254/1.0/user-data
The bootstap script then needs to run the contents of that file as if it were a script
The script embedded in the user-data needs to run in such a way that it has access to the desktop environment (ie: it can launch a browser, etc).
I'm not quite sure how services work in Windows or if I need to enable auto-login, so any advice here would be appreciated. The ultimate goal is to run a Java program that launches some custom software that in turn launches a web browser (IE, Firefox, etc) and is capable of taking screenshots.
The screenshot part is interesting, because in the past when I've tried this the only way I could get something other than a black screen was to have UltraVNC or RealVNC boot up as a service, though I don't know why that helped.
I'm looking for answers to three specific questions, as well as any general advice:
Should I be focussing on a Windows service or auto-login + bat file in the "Startup" folder?
If I use a Windows service, is there anything special that I need to do to make sure desktop access and/or screenshots are available?
Do you recommend any tools for common Linux commands, like curl or wget? Last time I used Windows I used Cygwin a lot, but is there something more appropriate to use here?
I have not tried auto-login on Windows instances in EC2, but here's the support document on how to enable it.
We boot-strap our Windows instances using a custom AMI with a custom Windows 'install' service already installed. The boot-strap installer reads a URL from user-data at startup. The URL points to a ZIP file stored in S3. The installer then downloads, un-zips, and executes the actual application installer -- in our case a simple CMD fie.
This setups allows us to have one base AMI and then be able to easily overlay 15+ different application configurations (without having to rebuild the AMI). If you only have one application configuration this may be overkill for your situation.
The only trouble we ran into was having our installer service start to early -- changing the service startup mode to "Automatic Delayed" fixed that issue.
We wrote our boot-strap installer in Java, launched via YAJSW, because we're comfortable with it. If you just want a few simple Unix tools, most are available pre-compiled for Windows, for example wget.
For something completely different, you could try PsExec to configure the instance after it has booted.
You can try using RightScale's free developer account to create plain Powershell scripts and associate them with your Windows instances to run at boot time. The RightScale dashboard solves exactly the problems you are trying to solve above.
DISCLAIMER: I work for RightScale.
As for screen capture CutyCapt is a simple tool you can point at a URL and generate an image from.
Unxutils is a great solution for those looking for unix tools on Windows. It's got the wget.exe that you're looking for, however, using Powershell to download stuff is not so bad either:
$wc = new-object system.net.webclient
$wc.DownloadFile("http://stackoverflow.com","test.html")
If you can write a batch file to do your setup, then you can run it at startup of the vm by doing this:
1. Run REGEDT32.EXE.
2. Modify the following value within HKEY_CURRENT_USER:
Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ParseAutoexec
1 = autoexec.bat is parsed
0 = autoexec.bat is not parsed
As an answer to #3, I would say that you can do just about anything in a batch file that you need which includes downloading from a ftp server (but not from a http server). I am really interested in this stuff and so if you have questions, try asking me.
If you use Elastic Beanstalks you can use this:
Customizing the Software on EC2 Instances Running Windows
It uses YAML formatting standards, e.g.
packages:
msi:
mysql: http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-6.6.5.msi/from/http://cdn.mysql.com/
or
sources:
"c:/myproject/myapp": http://s3.amazonaws.com/mybucket/myobject.zip
I know this is a little bit late to help out with the original post but for anyone who is still reading this one solution is to use the http://cloudinitnet.codeplex.com/ project. The service is easily installed using a powershell script and will create a local administrator account to use while running.
The goal for this project was to replace the Cloud-Init project used in Amazon Linux and Ubuntu.

For quick testing, portable Linux or portable programming language?

My current role requires me to setup environment which mimics the customer's and perform various checks to replicate and then analyze the problem.
Chances are, I often find working with Windows environments such like XP, Server 2003, Server 2008 is a bit painful without having the handly linux-based shell and some command-line progamming languages such as Perl.
Of course I can just install everything onto the new system and then start working, but it is a bit time-consuming and boring.
So I am wondering which is a better way of working around this?
I can for sure use Qemu to create a portable linux image which doesn't require any host system interference, even without the need of rebooting so to use it. The weakness of this is I have to figure out a way to transfer the files between hosting Windows and embedded Linux. The good part is that I can use all the weapons in Linux's arsenal.
Or I can start looking for a proper portable progamming language such like Movable Python, some variant of Perl or even Lua as a embedded language. Pros: familiar with the language; Cons: have to use scripts to do everything.
My day-to-day activities envolves but not limit to :
Checking the text logs and/or xml.
Grepping important sections from logs for further analysis.
some automate process like application server configuration etc...
automated functional testing - and result comparison
some system admin's job, networking diagnostics, checking process and services, etc...
Any good ideas? Thanks a lot in advance!
While I am a die-hard Linux fan I would recommend in your case to look at Cygwin, preferably on a USB drive or similar. It can live in a single directory, be started with a simple script and end up with (almost) all the Unix goodness, but still being able to access all of the host platform resources.
There are the usual warts related to / vs \ and even worse the case insensitive but case preserving filenames with lot's of spaces in them, but that's equally obnoxious on any other command line.
There is also Mingw but it's scope is more limited I found. It works exceedingly well in a couple of selected target areas, but less so for a GP wide unix-like environment.
I have had a cygwin folder on all my windows machines (and the ones I had to use/repair/maintain) for a very long time now.