Widespread Augmented Reality

Widespread Augmented Reality
Click on the image to get the Android Augmented Reality Heads up Display

Wednesday, May 1, 2019

Fix Scanner Failure Message on HP Officejet 4500 printer

After buying $50 worth of ink, my HP Officejet 4500 printer threw up a "Scanner Failure" error, rendering it useless. I took it out back to "fix it", but then decided to fix it. Basically, I had to remove the cover, the glass and then lift up the scanner bar and plop it back down on the track. Here are the visuals of that process.

Saturday, April 20, 2019

Android FusedLocationProviderClient

In hopes of obtaining GPS location faster, I implemented the FusedLocationProviderClient and removed the old LocationManager.GPS_PROVIDER. Below is a snippet of the new simpler approach that I used in the latest update of Widespread Augmented Reality.
setContentView(R.layout.main);
wargps = (EditText) findViewById(R.id.wargps);
locbtn = (Button) findViewById(R.id.locbtn);
locbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FusedLocationProviderClient fusedLocationProviderClient =
LocationServices.getFusedLocationProviderClient(getApplicationContext());
Task task = fusedLocationProviderClient.getLastLocation();
task.addOnSuccessListener(new OnSuccessListener () {
@Override
public void onSuccess(Location location) {
if(location!=null) {
wargps.setText(location.getLatitude()+" "+location.getLongitude());
locbtn.setText("Got Location");
}}});
}
});

Friday, March 15, 2019

Android Picasso vs s33me code

I spent several hours tweaking my own loading of images into an Android ListView. The problem was that the images would not load until I scrolled the screen and even then the lag was unacceptable.

My program performed the following:

  • Download a non indexed list of geotag data that includes the image URL into ArrayList rowdatalist
  • Loop through the rows in rowdatalist and Async create the bitmap from the image URL in each row
  • The customRowAdapter for the ListView will have a ViewHolder that sets the holder.imageView from the bitmap decoded from the URL.
  • Essentially, this produces statements like the following:
    holder.imageView = (ImageView) convertView.findViewById(R.id.row_image);
    holder.imageView.setImageBitmap(rowdata.getBitmap());
    This is from inside the object rowdata

    public Bitmap getBitmap() {
    if (bitmapurl != null && !bitmapurl.equals("")) {
    new ImageLoadAsync(context).execute(bitmapurl);
    } else {
    // default image if nothing from url
    bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.war4a);
    }
    return bitmap;
    }

    This is the background thread portion of the Async call:
    @Override
    protected Bitmap doInBackground(String... urls) {
    String surl = urls[0];
    Bitmap bm = null;
    try {
    URL imageUrl = new URL(surl);
    bm = BitmapFactory.decodeStream(imageUrl.openStream());
    } catch (IOException e) {
    e.printStackTrace();
    bm = BitmapFactory.decodeResource(context.getResources(), R.drawable.war4a);
    }
    return bm;
    }

    This is just a portion of the cumbersome code. As an experienced programmer, I should have known not to reinvent the wheel, but I just could not help myself

    At the end of the day, this line of code replaced all that nonsense

    Picasso.with(context).load(rowdata.getBitmapUrl()).into(holder.imageView);
    

    Wednesday, February 13, 2019

    HTML / CSS Freeze Page Header

    I want to freeze the title portion of the page so that it is always visible while the main list of images scrolls freely below. See an example at augmented reality geotags.
    Below is my code. The "bottom" and "top" parameters seem to be the key; however, be advised that I have not yet tested this on a variety of screen configurations.
    #titlepane {
    float:left;
    background-color: #ffffff;
    width:100%;
    padding:10px;
    bottom:65%;
    position: fixed;
    box-shadow: 8px 8px 10px #999999;
    z-index:2;
    }
    #scrollbelowtitle {
    position:fixed;
    float: left;
    clear:left;
    top: 35%;
    padding: 10px;
    height: 500px;
    width: 100%;
    overflow-y: scroll;
    z-index:1;
    }

    Sunday, February 3, 2019

    Hydra Command Line Arguments on Lenovo Yoga Book/Debian Linux.

    Example of Hydra command line arguments that seem to be running through the iterations.

    sudo hydra -l myusername -P /usr/share/dict/rockyou.txt -o output.txt thetarget.com http-post-form "/login.cfm RetURL=%2FDefault%2Easp%3F:login_name=^USER^&password=^PASS^:S=logout myusername" -vV -f
  • Replace myusername with your user name
  • Replace target.com with yourwebsite.com
  • Replace login_name with yourwebsite's variable for user name (Hint: View form source code)
  • Replace password with yourwebsite's variable name for password (Hint: View form source code)
  • Do not let this run through completion or to success if target.com is not a website that you own, unless you want to go to jail.

    Sunday, December 30, 2018

    Kali Linux WiFite missing hcxpcaptool and hcxdumptool

    Resolve Warning: Recommended app hcxpcaptool hcxdumptool was not found.

    Go to the hcxdumptool git hub site
    Find the clone of download drop down button.
    Right click on download zip and copy the link address.
    Open and Kali Linux terminal and type: wget [the link address], e.g. wget https://github.com/ZerBea/hcxdumptool/archive/master.zip
    Wait for download then type unzip master.zip
    CD (change directory) to hcxdumptool-master
    Type make
    Type sudo make install

    Follow these same steps for the hcxpcaptool.
    For example: wget https://github.com/ZerBea/hcxtools/archive/master.zip
    You may find it first necessary to run the following:
    sudo apt-get update
    sudo apt-get install libssl-dev
    sudo apt-get install openssl
    sudo apt-get install zlib1g-dev
    sudo apt-get install libpcap-dev
    sudo apt-get install curl
    sudo apt-get install libcurl4 ( or greater )
    wget https://curl.haxx.se/download/curl-7.63.0.tar.gz
     :~/tar -xvzf curl-7.48.0.tar.gz
     :~/rm *.gz
     :~/cd curl-7.48.0
     :~/./configure
     :~/sudo make
     :~/sudo make install

    Monday, December 10, 2018

    Visual Studio C# Run Error

    I am attempting to launch a project that I copied from another machine.

    Unable to launch the IIS Express Web server.
    The start URL specified is not valid. https://localhost/.....
    Need to dropdown [Project] -> [Web Properties] -> Un-check Override Application Root.

    Then get on your motorcycle and reward yourself for a job well done.