URL and Link repository

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.

    Thursday, November 29, 2018

    Root Asus Zenfone Laser ASUS_Z01BDC

    This is more for my future reference than anything else

    1. First of all, this model is actually a ZC551KL for which there is an unlock tool at Asus. After enabling Developer Mode and USB debugging, plug the Z01BDC aka ZC551KL to your PC. and follow these steps.
    1. Verify that the device is connected to your PC. Typically you'll see it as another drive.
    2. Move the downloaded unlock tool from your PC to the Download folder on your device using Windows File Explorer.
    3. Tap the APK file to install and run. You will see the device factory reset.
    4. Wait for the device to display on-screen set up steps and follow them.
    5. Get developer mode and enable USB debugging. Download USB driver if necessary from Phone USB Drivers.
    6. Under Settings make a note of the Software information, e.g. WW-31.40.13.50-20170807. The model may still show ASUS_Z01BDC, but don't believe the hype. Ignore and continue.
    7. Go to Asus support and download the firmware image that matches step 6. This is precautionary. Hopefully we will not need this download.
    9. Download TWRP image to the ADB/Fastboot directory on your PC.
    10. Download SuperUser to the ADB and Fastboot directory on your PC. 11. Rename the files recovery.img and su.zip to make the next command line instructions easier to type.
    12. Assuming you have ADB and Fastboot installed on your PC, navigate to where you installed Android, ADB and Fastboot for example: C:\Users\SpiFi\AppData\Local\Android\sdk\platform-tools
    13. Move the recovery and su files to the ADB and Fastboot directory.
    14. Open a command line at that directory and type: "adb reboot bootloader". You should see that the device is unlocked.
    15. In same command line window type: fastboot flash recovery recovery.img
    16. Open command line window and navigate to the Fastboot and ADB directory, e.g.,

    Victory Cross Country Motorcycle Not Shifting Gears

    During the weekend before Thanksgiving, I road two up and a load through Twentynine Palms and Joshua Tree. The half hour uphill stop and go at the monument's entrance resulted in the bike not shifting out of 3rd gear and revving with no acceleration. After a brief stop and cool down, the bike seemed to behave normally going down hill, but the next long uphill caused the motor to hesitate while not shifting gears to gain power.
    After checking that all battery connections and ground connections to the chassis were sound, I drove it to Desert Cycle Works in Twentynine Palms.
    The guys there were great and did not just dismiss it as an internal engine problem. After listening to me describe the riding conditions just prior to experiences shiftlessness, they loosened the clutch cable...free of charge. My passenger and I made it back to Los Angeles.