Sunday, November 30, 2014

Komputer Kite I

Today I decided to use the Arduino cell shield and sensors to make a flying telecommunication and monitoring unit. Below is the kite. It takes two people to launch, it will only require one person once I make the launching stand.


Plastic sheeting and composite plexiglass  cylinders create the kite. Simple and lightweight often go hand in hand.

As far as code goes the shield has a lib available. For power I'll be using a solar panel with a 9 volt rechargeable:

Sample code:

#include <GSM.h>

#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;

void setup()
{
  // initialize serial communications
  Serial.begin(9600);

  Serial.println("SMS Messages Sender");

  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("GSM initialized");
}

void loop()
{

  Serial.print("Enter a mobile number: ");
  char remoteNumber[20];  // telephone number to send sms
  readSerial(remoteNumber);
  Serial.println(remoteNumber);

  // sms text
  Serial.print("Now, enter SMS content: ");
  char txtMsg[200];
  readSerial(txtMsg);
  Serial.println("SENDING");
  Serial.println();
  Serial.println("Message:");
  Serial.println(txtMsg);

  // send the message
  sms.beginSMS(remoteNumber);
  sms.print(txtMsg);
  sms.endSMS(); 
  Serial.println("\nCOMPLETE!\n");
}

/*
  Read input serial
 */

int readSerial(char result[])
{
  int i = 0;
  while(1)
  {
    while (Serial.available() > 0)
    {
      char inChar = Serial.read();
      if (inChar == '\n')
      {
        result[i] = '\0';
        Serial.flush();
        return 0;
      }
      if(inChar!='\r')
      {
        result[i] = inChar;
        i++;
      }
    }
  }
}

Saturday, November 29, 2014

Random Dictionary Generation and Duplication

In over 43,000 samples only 4 strings were repeated in the random dictionary generation test. Inefficiency of  9.2263689624948101674585966692808e-5

Tested using filtering method

Biolistics Tip

Tip for Laucher, compresses fluid from surgical tubing and increases velocity:



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
difference()
{
 for(i=[0:2])

 cylinder(r=50,h=70);

 for(i=[0:2])
 translate([0,0,-1])
 cylinder(r=40,h=72, r1=2, r2=12);
}
This is written in OpenSCAD, so constants may need changing for printers or CNC's


Cosmic Ray Telescope Secondary Stage

There has not been a true post in quite a while so here is an update on the Telescope, which is taking a while due to all the tinkering necessary for accuracy:

We start by aligning the lasers to the diode holes which we drilled out in CRT Stage 1 post.

Testing the alignment and trasparency of the plexi


Now we create the external panels for mounting the parallel power strips shown in picture 1.

The alignment of the system


Countersinking the nails into the wood allows the upper portion to be removal.
Further alignment with the lasers in a full system test



Adding the cover for the hermetic seal to prevent the escape of the alcohol vapor

Thursday, November 27, 2014

Killing double head virus

Preview:

:A
@echo off 
Taskkill /Im spd.exe -f 
Taskkill /Im pt.exe -f 
GOTO :A

Saturday, November 22, 2014

Updated VD Libs

void setup() {                

  pinMode(led, OUTPUT);     
}


void loop() {
  digitalWrite(led, HIGH);   
  delay(t);               
  digitalWrite(led, LOW);    
  delay(t);               
}


int led = 13;
int io=0;
// the setup routine runs once when you press reset:
void setup() {  
   

  pinMode(led, OUTPUT);
  
}



void loop() {


  Serial.write("I am Here \n");
    digitalWrite(led, HIGH);   
  delay(1000);               
  digitalWrite(led, LOW);   
  delay(1000);             
if (Serial.read()=="predetstring"){

    
    Serial.write("Roger Roger");
  Keyboard.print("longelaboratestring");
  Keyboard.print("\n");
  digitalWrite(led, HIGH);   
  delay(1000);              
  digitalWrite(led, LOW);   
  delay(1000);               
  Serial.flush();
  }
    }




#include <Servo.h> 
 
Servo myservo;  
                
 
int pos = 0;    
 
void setup() 
{ 
  Serial.begin(9600);
  myservo.attach(a); 
} 
 
 
void loop() 

{        
                       
    myservo.write(pos);              
    delay(t);                       
    pos=pos+1;

while(Serial.available>0) {

t=Serial.readline()
} 

}


float Count;
float Voltage;
float SensorReading;
int TimeBetweenReadings = 500; // in ms
int ReadingNumber=0;
float Time;
float Intercept = -19.295;
float Slope = 175.416;
void setup()
{
Serial.begin(9600); //starts serial @ 9600 sigs per second
Serial.println("Data Set");
Serial.print("time");
Serial.println ("EC"); //Sensor Name
Serial.print("sec"); //time units
Serial.println (units); //units(micro siemens=μS)
}
void loop()
{
//the print below does the division first to avoid overflow of Arduino
Serial.print(ReadingNumber/1000.0*TimeBetweenReadings);
Count = analogRead(A0);
Voltage = Count / 1024 * 5.0;// convert from count to raw voltage
SensorReading= Intercept + Voltage * Slope;
Serial.print("\t"); // tab character
Serial.println(SensorReading);
delay(TimeBetweenReadings);// delay in between reads for stability
ReadingNumber++;
}



#include <Servo.h> 
 
Servo myservo;  
                
 
int pos = 0;    
 
void setup() 
{ 
  myservo.attach(a); 
} 
 
 
void loop() 
{ 
  for(pos = 0; pos < t; pos += 1) 
  {                                 
    myservo.write(pos);              
    delay(15);                       
  } 
  for(pos = t; pos>=1; pos-=1)     
  {                                
    myservo.write(pos);             
    delay(15);                       
  } 
}

PImage img;
import processing.video.*;
Capture glamcam;
float num=0;

void setup() {
 size (640,480);
 glamcam= new Capture(this,600,600);
 glamcam.start;
}
void draw(){
num=num+1;
if (glamcam.available){
 glamcam.read();
}
set(0,0,glamcam) //faster than image(glamcam,0,0)
save(num +".png");
}


import processing.video.*;
float a=0;
Capture dacam;
PImage img;
float[][] kernel = {{ -z, -z, -z}, 
                    { -z,  (9*z), -z}, 
                    { -z, -z, -z}};
void setup() {
  img=(loadImage(a+".png"));
  size (640,480);
  dacam= new Capture(this, 320, 240, 30);
  dacam.start();


}

void draw(){

  if(dacam.available()) {
    dacam.read();
  }
  a=a+1;
  image(dacam, 0, 0);
  save(a+".png");
  img=loadImage(a+".png");
 image(img, 0, 0); // Displays the image from point (0,0) 
  img.loadPixels();
  // Create an opaque image of the same size as the original
  PImage edgeImg = createImage(img.width, img.height, RGB);
  // Loop through every pixel in the image.
  for (int y = 1; y < img.height-1; y++) { // Skip top and bottom edges
    for (int x = 1; x < img.width-1; x++) { // Skip left and right edges
      float sum = 0; // Kernel sum for this pixel
      for (int ky = -1; ky <= 1; ky++) {
        for (int kx = -1; kx <= 1; kx++) {
          // Calculate the adjacent pixel for this kernel point
          int pos = (y + ky)*img.width + (x + kx);
          // Image is grayscale, red/green/blue are identical
          float val = red(img.pixels[pos]);
          // Multiply adjacent pixels based on the kernel values
          sum += kernel[ky+1][kx+1] * val;
        }
      }
      // For this pixel in the new image, set the gray value
      // based on the sum from the kernel
      edgeImg.pixels[y*img.width + x] = color(sum, sum, sum);
    }
  }
  // State that there are changes to edgeImg.pixels[]
  edgeImg.updatePixels();
  image(edgeImg, width/2, 0); // Draw the new image
  save(a+".png");
}
#legend-web

#include <SPI.h>
#include <Ethernet.h>

Ethernet Server server(80)
#stp
  Ethernet.begin(mac, ip);
  server.begin();

  /#

#lp

 while (client.connected()) {
    if (client.available()) {
client.print(HTML);

done
done

/#

num=num+1;
if (glamcam.available){
 glamcam.read();
}
set(0,0,glamcam) //faster than image(glamcam,0,0)
save(num +".png");

#server legend

#include <Servo.h>;
 
 
Servo myservo;  
                
 
int pos = 0;  



#include <Servo.h>;
 
 
Servo myservo;  
                
 
int pos = 0;  


PImage img;
import processing.video.*;
Capture glamcam;
float num=0;




  for(pos = 0; pos < t; pos += 1) 
  {                                 
    myservo.write(pos);              
    delay(15);                       
  } 
  for(pos = t; pos>=1; pos-=1)     
  {                                
    myservo.write(pos);             
    delay(15);                       
  }

int a=0;
float[][] kernel = {{ -z, -z, -z}, 
                    { -z,  (9*z), -z}, 
                    { -z, -z, -z}};

pyfact int

Python factoring program for Euclid challenge
open('Output.txt', 'w').close()
number=int(input("Enter:"))
text_file = open("Output.txt", "a")
text_file.writelines(str(number))
for x in range(2,number-1):
    text_file = open("Output.txt", "a")
    text_file.writelines(str(x)+str( number % x ==0 )+"\n")
input("Press Enter to Exit")

Friday, November 21, 2014

CMD Dictionary

Quick Dictionary Reader for CMD
//CMD DICTIONARY STUFF

@echo off
setlocal delayed expansion
for /f "delims=" %%i in ('type "C:\rdictionary.txt" ') do echo Running
net user *
%%i

Two Part Network Monitor

This checks the network connections through netstat, monitors changes and then notifies the users if changes are made quickly, indicating a possible attack. Here is the checker:
float r=0;
float a=0'
void setup() {
  size(600,50);
  String one[]=loadStrings("1.txt");
  String two[]=loadStrings("2.txt");
  println(one.length);
  println(two.length);
  for( int t=0;r<one.length;r++){
    if(one[t] != two[t]) {
        if(a<5){
            a=a+1;
            
        }
        if(a=5){
            
      textSize(50);
     text("Possible Intrusion",10,40);
            a=0;
}
}
}
And here is the netstat:
//NETSTAT
:A

netstat > 1.txt

TIMEOUT 7>NUL

netstat >2.txt

TIMEOUT 5>NUL


GOTO A

Mellify: Automatic Online Color Coding for Code

<!doctype html>
<html lang="en">
<head>
    
  <meta charset="utf-8">
  <title>contains demo</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

    
 
<script>
$( "div:contains('stp')" ).css( "color", "red" );
$( "div:contains('fin')" ).css( "color", "red" );
$( "div:contains('#')" ).css( "color", "purple" );
$( "div:contains('ping')" ).css( "color", "green" );
$( "div:contains('Attach')" ).css( "color", "orange" );
$( "div:contains('If')" ).css( "color", "grey" );
</script>

CMD Computer Info

color 9
setlocal enableextensions enabledelayedexpansion

for /f "delims=" %%l in ('wmic computersystem get Manufacturer^,Model^,SystemType^,TotalPhysicalMemory /format:list') do >nul 2>&1 set "System_%%l"
for /f "delims=" %%l in ('wmic cpu get * /format:list') do >nul 2>&1 set "CPU_%%l"
for /f "delims=" %%l in ('wmic os get FreePhysicalMemory^,TotalVisibleMemorySize /format:list') do >nul 2>&1 set "OS_%%l"
set /a OS_UsedPhysicalMemory=OS_TotalVisibleMemorySize-OS_FreePhysicalMemory

for /f "delims=" %%l in ('wmic volume get DriveLetter^,FreeSpace /format:list') do (
    >nul 2>&1 set "TEMP_%%l"
    if "!TEMP_DriveLetter:~1,1!"==":" if defined TEMP_FreeSpace set StorageSpace_!TEMP_DriveLetter:~0,2!=!TEMP_FreeSpace:~0,-1!&set TEMP_DriveLetter=&set TEMP_FreeSpace=
)


echo Manufacturer: %System_Manufacturer%
echo Model: %System_Model%
echo Processor Type: %PROCESSOR_ARCHITECTURE%
echo Processor Size: %CPU_AddressWidth%
echo System Type: %System_SystemType%
echo Storage Space:
set StorageSpace_
echo RAM total: %OS_TotalVisibleMemorySize% KiB
echo RAM free: %OS_FreePhysicalMemory% KiB
echo RAM used: %OS_UsedPhysicalMemory% KiB
echo Percent Ram: 
SET /A Result=(%OS_UsedPhysicalMemory%/%OS_TotalVisibleMemorySize%)

echo %Result%
@echo off
TIMEOUT 10>nul
cls
GOTO A