Programming, OS's and all things I.T.

A page where I will keep usefull websites,code snippets, or cool things I find and will want to use when switch computers, which has been one of the few things consistant in my life. And my love for technology and gadgets has me taking bits and pieces apart, and trying to make new uses for them, even if its not really that necessary.


Menu

Android 
NetBeans 
Eclipse 
Java Jar
Nokia
Microchip
ASM C
MPLab
Cygwin
VirtualBox
WireShark
Putty SSH
 Tunnel Remote
UBUNTU

Android

Command line functions and emulators 1st Android SDK as path variable emulator-arm.exe @droid
adb connect xxx.xxx.xxx.xxx
to get ip address of android device, Alt F1 to get to command line and type> netcfg. Alt f7 to go back adb disconnect xxx.xxx.xxx.xxx

I have had problems with Android and virtual box where VB wont assign an IP address. Make sure the VirtualBox host only network adapter is disabled on the host. type:

ifconfig eth0 down,
ifconfig eth0 up

netcfg eth0 dhcp

, and up it came. in my virtualbox, there is no menu tab, so I press the button with a cursor on a menu, between space and right ctrl
left click to go back
click and hold for context menu
adb kill-server will kill the application if it gets stuck

For android development, get yourself onto IRC. android-dev channel
register your nick on http://webchat.freenode.net/ before entering the channel.
the following is from this web site http://developer.android.com/resources/community-more.html
/nick /msg nickserv register
/connect irc.freenode.net /nick /msg nickserv identify /join #android-dev


Resolving Errors Resolving erros can be a tedious task in Android. But one sure way to sort out a problem you know isn'tthere is to clean the project. Emulator on a 64bit! change SDK path of adroid in window>preferences>android> at the top. from 

C:\Programe Files(x86)\Android\android-sdk      ----->    C:\Progra~2\Android\android-sdk

 If you see an error about AndroidManifest.xml, or some problems related to an android.zip file, right click on the project and select Android Tools > Fix Project Properties.


Usefull command line commands

adb connect "ip address of virtual machine"
cd C:\Program Files (x86)\Android\andoi-sdk\tools
adb list targets



NetBeans


Netbeans in 64bit Windows7

Getting netbeans started in windows 64bit


http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html download this sdk Download netbeans, or alternativly, and untested by myself, from oracle download netbeans with jdk. I found that at start up the emulator started, and when trying to run a j2me in netbeans I would get an error until I closed the open emulator in the hidden icons. After a while window stops showing these icons in the hidden icons. to stop it from starting in the future customize.

Eclipse

Java

Jar

Nokia

E66

Microchip


http://www.mhennessy.f9.co.uk/pic/time_delays.htm
explains chips very nicely to quote
"First, consider how quickly the processor runs. Depending on what version you buy, a mid-range PIC can run up to 20MHz - check the suffix in the part number for the highest speed applicable. For example, a PIC16F84-04 can run at up to 4MHz, whereas a PIC16F877-10 can work reliably up to 10MHz. As you might expect, the faster versions are more expensive, but not prohibitively so.
Note that these processors can run at any speed you require up to the rated speed. So, there's nothing stopping you running the processor at 1Hz if you want! If you have a variable frequency square-wave generator, you can use it as the clock - from an educational point of view, this is something to try when your PIC is running the 4 bit counter. This is possible because the internal memory of the PICs uses static memory technology (as opposed to dynamic memory, that must be "refreshed" frequently for reliable operation).
 
The clock is divided by 4 (which allows the internal "pipelining" to work), so a 4MHz crystal will result in an internal CPU running at 1MHz. This means that the clock cycle lasts 1 microsecond. Thanks to the highly optimised core, the CPU is able to execute most instructions in just one clock cycle, so each line of your code will execute in just 1 microsecond. This also explains why 4MHz is a popular choice of clock frequency." 
Chips

MPLAB

BTFSS - Bit Test, Skip if set. eg BTFSS ADCON0, 1 ; means check Register ADCON0(bit1), if it is set, skip the next ;No, bit is still clear ;Yes, bit is set
;to make this a do while loop, add goto $-1 ; this repeats the last step till the bit is cleared ; This routine will loop until bit 1, is cleared. when it is cleared, it has finished A2D conversion and the result is in ADRESL/H
andwf andlw iorwf iorlw xorwf xorlw

Simulation

To simulate button presses in MPLAB while using the MPLAB SIM. Open >Debugger, >Stimulus, New Workbook - If button is on RB0, (PortB pin ) add it to Pin/SFR, Action toggle. While simulating, there is a "fire button" to the 1st column of row. An '>' click it to simulate the button.

Assembly


C


Chips


PIC
16f506
16f886
16f887
12f629
12c508a
OP AMP LM741

ASM

C

MPLab

Cygwin

Cygwin Download jdk export PATH=$PATH:"/cygdrive/Program Files/Java/jdk1.6.0_26/bin/" to compile: javac *.java to run: java *

VirtualBox

Moving .vdi's (guest machines) to another partition
Android

Moving .vdi's (guest machines) to another partition

In VirtualBox, I turned off all saved/ running machines. Opened the virtual machine manager, released all machines. and closed VirtualBox. I went the folder that had the virtual machines each had a folder with snapshots and .vdi files. I just cut and pasted in the new partition. In an xml file in the folder .Virtualbox called VirtualBox.xml I edited the src in machine regestry to the new path on the new partition. I now started virtual box, edited the default path to the new one for future. I then went to each virtual machine storage added a harddrive, from a selected destination, i.e the new location of the .vdi. started my machines. They all worked. I did have a problem where one of my machines didn't work. It had "invalid settings detected". I stumbled on the display> remote display> Enable server checked. I unchecked it, and could finally add the harddisk and move on References I worked with are http://www.howtogeek.com/howto/36870/how-to-backup-and-move-virtualbox-machines/

Networking

from http://www.dedoimedo.com/computers/virtualbox-network-sharing.html There are 4 network options, NAT, Bridged, Internal Network, Host-only Adapter NAT - network address translation. This will have an IP address completely different to the host(laptop/workstation) and completely inaccessable. It will have its own virtual private network Bridged means the virtual machine will try obtain an IP address from the same place as the host. Some routers dissallow this, especially if connected directly

Android

Installing Android on Virtual box. If you really want to. set your partition, make it bootable, format in ext3. use fake SD card 1024mb everything should work well.

WireShark

Filters tcp contains facebook on each of facebooks sever address's create a filter by right clicking and filter as selected. change dest to addr as so... ip.addr == 69.63.180.45 || ip.addr == 69.63.180.40 || ip.addr == 69.63.180.47 tcp contains facebook and ssl json contains message

Putty SSH Tunnel Remote

SFTP for windows http://winscp.net/eng/download.php 
 To access my ubuntu machine, I must have ssh installed sudo apt-get install openssh-server and started $sudo /etc/init.d/ssh start 

if firewall is up 
$iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 5900 -j ACCEPT 

Look to see if port is listening 
$netstat -an | grep "LISTEN " //port 22 

On router - set up port forwarding (under NAT on my router) open port 22 for server at servers local ip address on windows I need to run a ssh server to log into my machine in Putty IP address ( external or routers IP if outside the network) SSH Tunneling local - Source port either 5900 or 40000 local ip address:5900 or 3389 then name and password 

UBUNTU Linux 


Shut down command/ Reboot 
$sudo halt 
$sudo shutdown -h 

now sudo reboot Wireless 
$ifconfig eth0 down/up ifconfig 

 For my HP nx6310 (5 years old) Remove the STA driver from Additional Drivers Have you laptop attached to LAN Install b43 (installer package for firmware for b43) restart 
$sudo halt - p 

restart network $sudo /etc/init.d/networking 
restart

Check if its there $nm-tool I see wlan0 
but its unavailable 

$sudo ifconfig wlan0 up 
restart again and wireless networks come to view. 
Networking ping netstat - an | grep "LISTEN" // for ports open 

$sudo apt-get install openssh-server 

$sudo /etc/init.d/ssh start or 
$start ssh sudo /etc/init.d/networking restart 

This really helped when I had my Debian guest sitting on a NAT assigned address i.e. 10.0.2.x And I couldn't get it to budge. I needed it bridged so I could network with it as I am playing with a few guests, I tried 

$ifconfig eth0 down, then up, and still no change. 

I restarted the machine and no change. then with the simple command 
$sudo /etc/init.d/networking restart, and hey presto, I was up and running. 

 rlogin server ssh service ssh -l ssh // puts you in root.

No comments: