Code without "messing up everything"? - php

I'm a coder (I'm on a mac) and I'm using a computer that is a computer that "shouldn't be messed with". I'd like to install some command-line programs but I want to somehow be able to erase everything I did.
I know, I shouldn't be doing any of that just-in-case something does happen.
But, I'd like to do all of my work and then have it automatically completely clean everything up when I'm finished.
I'm planning to code in php, java and maybe objective-c (Apple developer toolkit). I installed another OS (dual boot) and yeah. That didn't go over very well with the manager....

If it's fairly modern machine with decent amount of RAM, you could run a virtual machine with another OS in it. This way you're for all purposes sandboxed.

You can get a virtual machine and install the OS you want to code in in it. When you're down you can delete the OS first, then uninstall the virtual machine, then you can probably do a system restore to clean it off completely. I personally use VMWare. Its pretty easy to install a new OS in it and it has good networking features.
VMWare Link http://downloads.vmware.com/
You can check out some here
http://en.wikipedia.org/wiki/Comparison_of_platform_virtual_machines

Has anyone just said "Live OS"?
Many applications can be installed on a USB stick, see portableapps.com. (Windows only.)
If that doesn't suit your needs, download a Ubuntu image, burn that on a CD and tell your target computer to boot from this CD. E voila, now you have a complete OS at your hand, that doesn't leave any trace on the target computer. (Make sure to save your data on a real hard drive or USB stick before shutting down the computer.)
On a Mac, since it's a Unix, you could install another OS X inside a chroot environment. However, I doubt, that it will suit your needs as to leave the original system untouched, since you seem to have to install lots of other stuff to get this running: http://www.algonet.se/~afb/mac/chroot.html (Google for OS X and chroot, perhaps there is a cleaner solution).
Finally you can use a virtual machine. Download VirtualBox, create a machine, use it, and the remove it and uninstall VirtualBox.

My best recommendation would be to use a Linux live CD and save your data onto a USB flash drive. Boot the live CD (if you can select the machine's boot device), do what you need to do, save your data, and shut down.
Some examples -- many more are out there...
Fedora
Knoppix (the "classic" liveCD distribution)
Ubuntu

What's the purpose of this machine? Is it in a state that SHOULD NEVER BE CHANGED? Or does it get changed on a regular basis, just not by you?
If it doesn't get changed, and only provides services you could look at software like DeepFreeze. It's a program that my school used to use, it basically sets up an "Image" of the disc, and everytime the computer is reboot it restores that image.
http://www.faronics.com/ <-- I think this it the site, I can't visit it because my company's firewall blocks it... hmmm

I have a flash drive with utilities, including pathman.exe and a batch file that adds the utilities to the path. Unplug the flash, log out, and they're all gone. Note that this could leave traces, e.g. in the event log or antivirus logs, or be logged by any software that's monitoring activity.
Edit:
Mac, huh? You could apply the same idea, utilities on a flash, script to put them in your path.

Related

how do you run a php file on a chromebook?

I've been looking on YouTube and other places, i'm not sure how, this place is filled with smart people so i thought i would ask you guys!
This blog post lists some options:
Termux lets you install a Linux environment and has a PHP distribution (but it is highly restricted and you will probably run into plenty of frustrating limits)
You can enable Developer Mode and then press Ctrl-Alt-T to open a crosh shell, from which you get type shell to get a regular shell and from there either:
Install Linux and dual-boot
Create a chroot environment to develop in
Meanwhile OS 69 introduces Linux for Chromebook which should be an easier way to get a Linux environment.
… but that said, Chromebooks are generally low-powered machines that aren't ideal hardware for doing development work. I'd look at setting up a remote server and doing my dev work over SSH.
You need to install MAMP or XAMPP on your Chromebook. MAMP or XAMPP will turn your Chromebook into a web server capable of reading PHP.
EDITED:
Since you can't run MAMP or XAMPP on your Chromebook, then you should look into using a Cloud solution such as AWS or Google Cloud.

Running PHP/MySQL website from USB drive

PROBLEM:
I've got a client who needs to run their website(uses PHP/MySQL/Apache) from a USB thumb drive on both Windows and Mac, even Linux if possible. So they could plug the USB thumb into a Windows machine and the sites index would load, alternatively plug the thumb into a Mac or Linux machine and voilà the site index loads.
To clarify further, my client essentially wants to distribute these USB thumb drives to his own clients so they can browse a sample group of products uniquely catered too them. This would mean the launching of the site from the USB thumb drive would need to be as simple as possible since no assumptions can be made about the clients technical know how! A a double click and go type solution would be ideal if auto load isn't an option. Is this achievable with a Virtual Machine solution as suggested below in the comments? Or would some software such as VMware Player need to be installed on the clients machine first in order for a Virtual Machine on the USB to be launched?
FINDINGS:
I've managed to get XAMPP Portable Lite installed and running from a USB thumb via Windows 7, however I obviously cannot start XAMPP Portable Lite when connecting the USB to a Mac / Linux system. I've tried installing and running XAMPP for Mac from the USB also, however it can't seem to run outside of the Mac's /Applications directory.
If anyone could please shed some light on a possible way to achieve what my client is wanting using XAMPP or anything else, or whether it's even possible, I would be grateful!!
PS: I noticed there is a solution which would achieve what my client is wanting offered by a company called Stunnix, however they charge a fairly hefty fee, so I'm holding off in the hope a freeware solution to my clients problem exists somewhere.
Fortunately, PHP, MySQL, and Apache all run just fine on all three platforms. Just include statically compiled x86 copies for both platforms, and you're good to go.
Now, as far as the autorun problem goes, there is nothing you can do about that. Almost no system these days will automatically run executables upon inserting removable media.
In general - no, you can't get all-in-one solution. There's too big differences incl. approach to security on these platforms. It's simpler on Windows, while you face more problems on Linux due to security models (like protecting bind to ports <1024). In general, you may need to end with virtualization, if that would suffice for your needs.

Developing on both Windows & Linux machines simultaneously

Sorry for the bad title (couldn't think of a better way to describe it)
I have a windows machine which I do development on. However, I have a new project which needs to interact with a linux system (executing linux commands etc.).
So, obviously I can't do development on my windows machine..and I don't wish to code on the dev machine, svn commit and then svn update it on the linux machine.
Is there a way where any changes I make on my dev machine will be quickly mirrored to the linux machine? SVN is not a very quick alternative and of course some changes will be very minor.
Any ideas? A network share I guess....but that's not very pretty (bit slow too).
As fellow developers I would like to know if you've been in a similar situation and how you've resolved it.
On a furthernote, I can't just install Ubuntu as my development machine and mirror the commands, applications etc. from the linux machine because it's a cluster 'master' machine and so therefore it has quite a special configuration.
Thanks guys!
EDIT: I've also thought about having web services on the linux machine and then just calling them from code thus seperating platform development dependency. What do you think about that too? thanks
Edit your files on the Linux machine, using Samba to expose them to Windows file-sharing.
(Alternatively via SFTP, but Windows software to mount SFTP as a filesystem isn't free.)
Have you considered using an XServer on your Windows box? You should be able to fire up a desktop session on the Linux box and have it display on your Windows machine.
Depending on how Linux-savvy you are, you may be able to get away with simply using SSH to get a terminal window, then editing files with vi or emacs. If you're working with PHP, I assume that you'll be able to see the results with your regular browser. I've done this a lot, and while it's not a full-on IDE, it's certainly workable.
You can developp your app in Windows and test it throug cygwin ;)

Can I setup a WAMP Virtual Machine on my guest OS that uses files from my Windows host?

I'm on a desktop PC, so I dont need Apache, MYSQL, PHP to run all the time on my main PC. Also I have all the good tools (adobe cs4, etc) on my XP box and they wont run on my Win2000 VM Guest, plus they would require another license even if they did. I'm not sure if its worth the trouble but figured I'd ask before I try to figure out how to attempt it.
Share the folders from the host OS on the network.
Map them to drive letters on the guest OS.
Configure WAMP to use those drives.
Yes, you can set up shared directories which should fit for this scenario.
There's probably a better way, but at work we have network shares and I can access the files on the network shares when I map to them. That may be a last resort.
Probably what you need is to install XAMPP: http://www.apachefriends.org/es/xampp.html
In this way you can run it whenever you really need to.

PHP Deployment to windows/unix servers

We have various php projects developed on windows (xampp) that need to be deployed to a mix of linux/windows servers.
We've used capistrano in the past to deploy from windows to the linux servers, but recent changes in architecture and windows servers left the old config not working. The recipe works fine for the linux deployment, but setting up the windows servers has required more time than we have right now. Ideas for the Capistrano recipe are valid answers. obviously the windows/linux servers don't share users, so this complicates it a tad (for the capistrano assumption of same username/password everywhere).
Currently we're using svn-update for the windows servers, which i dislike, since it leaves all the svn files hanging on the production servers. (and we still have to manually svn-update them on windows) And manual updating of files using winscp and syncing the directories with their linux counterparts.
My question is, what tools/setup do you suggest to automatize this deployment scenario:
"Various php windows/linux developers deploying to 2+ mixed windows/linux machines"
(ps: we have no problems using linux tools or anything working through cygwin, we simply need to make deployment a simple one-step operation)
edit: Currently we can't work on a all-linux enviroment, we have to deploy to both linux and windows server. We can start the deploy from anywhere, but we'd prefer to be able to do it from either enviroment.
I use 4 different approaches depending on the client environment:
Capistrano and similar tools (effective, but complex)
rsync from + to Windows, Linux, Mac (simple, doesn't enforce discipline)
svn from + to Windows, Linux, Mac (simple, doesn't enforce discipline)
On-server scripts (run through the browser, complex)
There are some requirements that drive what you need:
How much discipline you want to enforce
If you need database (or configuration) migrations (up and/or down)
If you want a static "we're down" page
Who can do the update
Configuration differences between servers
I strongly suggest enforcing enough discipline to save you from yourself: deploy to a development server, allow for upward migrations and simple database restore, and limit who can update the live server to a small number of responsible admins (where the dev server is open to more developers). Also consider pushing via a cron job (to the development server), so there's a daily snapshot of your incremental changes.
Most of the time, I find that either svn or rsync setups are enough, with a few server-side scripts, especially when the admin set is limited to a few developers.
This will probably sound silly but... I used to have this kind of problem all the time until I decided in the end that if I'm always deploying on Linux, I ought really to at least try developing on Linux also. I did. It was pain free. I never went back.
Now. I am not suggesting this is for everyone. But, if you install VirtualBox you could run a Linux install as a local server on your windows box. Share a folder in the virtual machine and you can use all your known and trusted Windows software and techniques and have the piece of mind of knowing that everything is working well on its target platform.
Plus you'll be able to go back to Capistrano (a fine choice) for deployment.
Best of all, if you thought you knew Linux / Unix wait until you use it everyday on your desktop! Who knows you may even like it :)
Capistrano is the nicest deployment tool I've seen. Do the architecture changes make it impossible to fix the configs so it works again?
Why you can't use capistrano anymore?
Why you dislike svn-update?
What things in your app requires an special deployment ?
You can setup svn:ignore property on configuration files, so that svn update doesn't erase them, and then use svn export /target/path/ to get rid of .svn files in your Subversion repository.

Categories