Tag Archive for 'terminal'

Offline math program for iPhone

Hi, I have got an iPod Touch and I’ve always wanted a good math program for my iPod. I wanted one with all the things that I needed to calculate: integrals, diffs, limits, matrices, … but there was nothing for the iPhone. I looked up and in the AppStore and I found Wolfram Alpha, but it has two things I don’t like: it’s online and it has no memory.

So I looked up in Cydia an over the Internet and I didn’t find anything. I decided to try to compile GNU Octave, but it was very difficult, then I found that I could install python from Cydia. I did it and I found a module called sympy that does everything I wanted, it’s like a small matlab for your iPhone. You can see all the things this module does here. It’s really easy to get it working, here there are the requirements:

- Jailbroken iPhone
- Python (you can download it form Cydia)

And the steps:

Installation

1. In your iPhone, you need the Telesphoreo Tangelo source, that comes by default, anyway, it’s: http://apt.saurik.com and if you don’t have it a package called Terminal.

2. Now, in Cydia click into search and type python and download “Python” (not “iPhone/Python”).
3. From your computer download the .tar.gz file of Sympy from here. You should download the latest one, in this case it’s sympy-0.6.6.tar.gz
4. You’ll find a folder called sympy-version where version is the version, i.e.: sympy-0.6.6. To avoid problems extract the folder in your desktop and rename it to sympy.

5. From your computer copy the folder sympy directly inside your Media folder inside your iPhone. To copy files in your iPhone use iFuse if you are not on Lucid (if you’re on Lucid you don’t need anything!), and iPhone Explorer if you’re on Windows or on a Mac. The media folder is the default folder when you browse your iPhone with this programs. Some folders inside of Media are DCIM, iTunes_Control, or Photos.

(Note: The next steps: 6-8 may not be needed, if you want, try the manual without them and tell me if it worked.)

6. It’s almost done, now open your iPhone Terminal and type su. Type your root password, if you don’t have changed it, it should be alpine, if you have problems look up in google, I also don’t know if this step is needed or not, if you have problems try to avoid this part.

7. Now put this code in your Terminal:

cd /var/mobile/Media/sympy

And this one:

chmod +x setup.py

8. Now type this in your Terminal:

python setup.py

Running Sympy (after installation)

Even if you get errors executing setup.py don’t worry, as I don’t know if steps 6-8 are needed, I’ve done them but I doubt if they were needed. Ok, the point is that you have sympy installed. Now let’s see how you can open it. Close your terminal and open it again. Then put this code:

cd /var/mobile/Media/sympy

And then this one:

python

And… finally this one:

from sympy import *

You’re done, everything is fine. You can use the program, let’s do an example:

x=symbol('x')
pprint(integrate(1/(x**3+1),x))

Enjoy!

How to open Sympy faster

If you want to open Sympy faster, download this bash file I’ve created. Put it in /bin and give it executing permissions. To do this, just copy the file to Media in your iPhone and then, in your iPhone Terminal:

cd Media
su
cp 'sympy' '/bin'
cd /bin
chmod +x sympy

Then, to run Sympy, open your Terminal, type sympy and then inside the Python prompt type:

from sympy import *

Internet Terminal

This is a project that I think I started about 2 months ago, but now I’ve been improving it. Internet Terminal is a program made with PHP & MySql that lets you use some functions (commands) like in a computer terminal. There are a lot, and when I need I add new functions as it’s very fast and simple, for example today I installed wordpress and I wanted to unzip the package so I made a function called unzip. Right now IT has this functions installed:

login [password] -> get full access / it’s not used after you are logged in
o [site] -> open [site] (it works with abreviatures)
d [name] -> open a stored text file
new ‘[Ref]‘ ‘[Name]‘ ‘[Result]‘ -> create a new value for a function or replace it. Note: use %pre% to include previous value
delete ‘[Ref]‘ ‘[Name]‘ -> it deletes one stored value
show [Ref] -> it shows you all the stored values for a Ref / Note: If [Ref] is sessions it will show you the number of sessions
session [Number] (time) (ip) -> it shows you the [Number] session, and if you write time or/and ip it will include dates and ips
logout -> it deletes your login cookie
calc -> it shows a calc, to disable it type anything, it works up to you text something new on the terminal
echo [string] -> it shows the HTML you put, its only needed if you are going to use one of the function words
exit -> it put the screen white
help -> list of most common commands
mkdir ‘[dir]‘ -> it makes a dir in [dir]
rmdir ‘[dir]‘ -> it deletes [dir] if it’s a directory
rm ‘[file]‘ -> it deletes [file]
cp ‘[file1]‘ ‘[file2]‘ -> it copyes [file1] to [file2]
rename ‘[file1]‘ ‘[file2]‘ -> it renames [file1] to [file2]
ls ‘[dir]‘ -> it lists [dir]
upload -> a upload program appears (default folder is ../files/uploads as it’s meant to be to upload files to File Browser Alpha)
unzip ‘[file]‘ ‘[folder]‘ -> it unzips [file] in [folder]

First, I made Internet Terminal because I was used to Linux Terminal and I wanted something similar to store information on Internet, the first functions let you save HTML texts and links. If you use opera, Internet Terminal is really incredible as you can insert the commands directly from the browser bar!

The program is password protected as it has got some functions that only me should use as rm (remove) or upload. I’ll release a beta of this program soon.