Archive for November, 2003
LCOD – 11.21.03 – How to run Power E*Trade Pro on Linux, without WINE
Posted by Jon Zobrist in Linux, Linux Command of the Day on November 21, 2003
Get Java Web Start, and install it for Linux from http://java.sun.com/products/javawebstart/download-linux.html
I installed it in /opt/blackdown-jdk-1.4.1/javaws
because that’s where gentoo put blackdown-jdk which is the jdk I use.
Now add it to your path statement in your ~/.bashrc
and add
JAVAWS_HOME=”/opt/blackdown-jdk-1.4.1/javaws”
export JAVAWS_HOME
to your ~/.bashrc also
Install Power E*Trade pro on a windows box…unfortunately..
Now copy the C:\Program Files\Java Web Start\.javaws\cache folder to temp directory in your home directory. I shared the folder in windows as cache, then did this smbclient //192.168.0.5/cache -U administrator
to smb copy the whole thing type turn prompt off and recurse on by typing
prompt
recurse
now get the whole directory with
mget *
once you have it cd to http/Dimg.etrade.com/P80/DMetprocli
run javawsbin AMetrader.jnlp
This will install & update your Power E*Trade Pro software, next delete the directory you put your Windows version in, and find that same file in your ~/.javaws/cache…/../ dirs
mine is in ~/.javaws/cache/http/Dimg.etrade.com/P80/DMetprocli/AMetrader.jnlp
and run javawsbin AMetrader.jnlp
you may want to make a script to start it like this
#!/bin/sh
javawsbin ~/.javaws/cache/http/Dimg.etrade.com/P80/DMetprocli/AMetrader.jnlp
and put that in your start menu, for me when I run javawsbin I get Power E*Trade pro as an option, but it doesn’t do anything to click on it
So I made ~/bin/poweretrade, put the above 2 lines in it, chmod u+x ~/bin/poweretrade
and off I go. You’ll have to logout/login to get your ~/.bashrc read by your window manager, and if it’s not reading it try linking it to ~/.bash_profile
Here are some screen shots of my desktop with Power E*Trade Pro running.
http://www.submarinefund.com/etrade1.jpg
http://www.submarinefund.com/etrade2.jpg
http://www.submarinefund.com/etrade3.jpg
http://www.submarinefund.com/etrade4.jpg
Questions/Problems?
Email me jon@zobristfamily.com
LCOD – 11.3.03 – command line network setup
Posted by Jon Zobrist in Linux, Linux Command of the Day on November 3, 2003
If you’ve installed a major distribution of Linux then most likely you’ve configured your Networking via the install GUI. Now, what if you want to change your network options, but don’t want to mess with the GUI’s available to you, or say you want to script something network related. Here are some commands you can use to change your network settings. Note, these will be reset when you reboot, if you need to change them permenantly you’ll need to find your config files, or use the provided GUI.
First, the clincher, ifconfig. Type it alone at the command line, you’ll see all your network interfaces listed with the accompanying settings. You should see eth0 and lo at a minimum. Eth0 is your Ethernet interface 0. Ethernet is the most common local area network type (LAN). Lo is your loopback device, it is always 127.0.0.1 and is used for internal network communication. This is a way Unix uses to make programs easily translatable from local use to network use. So, your ethernet interface is the one we’ll be concerned about. To see just it’s configuration type
ifconfig eth0
If you get a message like error fetching device info, then you’re driver for your network card isn’t installed. The quickest way to get it working, if you’re on one of the main distros, is to find which card it is, then which driver it uses ,then load the driver/module manually into the kernel with modprobe modulename. So, if you’ve got an Intel EtherExpress pro100/B, then modprobe pro100. lsmod will tell you what modules you’ve currently got loaded in your kernel, and rmmod modulename will remove an unused module from a running kernel.
So, what can we do with ifconfig. Well, the simplest thing is setup your IP address. For this example, let’s say 192.168.0.50 is what you want your IP address to be, and 192.168.0.0/24 is your network, 192.168.0.254 is your gateway, and 192.168.0.1 is your domain name server (DNS server).
Let’s bring up that interface with those configs, we do that like this, (all on one line):
ifconfig eth0 192.168.0.50 netmask 255.255.255.0 broadcast 192.168.0.255
Now ifconfig eth0 should show us having an inet address of 192.168.0.50. It should also say the keyword UP in there, this tells you the interface is up and working.
Now you should be able to ping it, ping 192.168.0.50.
Remember, in Unix/Linux/*BSD the ping command doesn’t stop after 4 pings, it keeps going forever, until you hit CTRL+C.
This will work even if your network isn’t plugged in, since it’s just talking locally to the computer.
You should also be able to ping your default gateway, ping 192.168.0.254. Remember the CTRL+C to stop the pings.
Now, your interface is up, but you can’t go anywhere. This is becuase you don’t have a default gateway set. Let’s jump on over to the route command. Start with
route -n
This will display your routes, you really only need 3 routes, your local loopback (127.0.0.1), your local area network (192.168.0.0), and your default gateway. If you just added an interface manually, or changed the existing one, then it’s likely all associated routes, such as your old default gateway, were dropped. To add a new default gateway type
route add -net default gw 192.168.0.254
This will setup 192.168.0.254 as your default gateway. What this does is basically tell your computer that if it doesn’t see the computer on the network locally, to forward the packets to the default gateway and let it handle it. This is how 90% of Internet routing works. Any site that has 1 connection to the Internet, only needs 1 default gateway.
Now, back to ipconfig for something very useful. Say you want to have 2 IP addresses, but only have 1 physical network interface. Maybe you want to run a web server and not use Name based virtual hosting. You can add and remove interfaces to your eth0 by just using a colon and a number, and then configuring just like we did eth0.
So, if we want to add 192.168.0.51 to eth0, without losing 192.168.0.50, we type (all on one line)
ifconfig eth0:0 192.168.0.51 netmask 255.255.255.0 broadcast 192.168.0.255
Now ifconfig eth0:0 will tell us information about our new sub-interface, and ping 192.168.0.51 will ping ourselves and we’ll get replies.
This can be added as many times as you want. I’m sure there is some limit, maybe 65535 or 256. I’ve used it in production with 250 addresses on 1 interface without any problems.