Items filtered by date: December 2014

Tuesday, 14 June 2016 16:29

Dehacking a Joomla Website

These are my notes on recovering your hacked Joomla website (de-hack/dehack/dehacking).

The best prevention is to have good reliable backups.

Part 1 - Am I hacked?

If you receive reports from a customer that their website is hacked you need to look at their site from your computer.

Precautions

  • Use a Sacrificial PC (a PC you dont mind wiping if it gets infected)
  • Make sure A-V is running
  • HIPS is on
  • An AD Blocker is running
  • Run your browser in Sandbox mode
  • Malwarebytes Anti-Exploit is running
  • Javascipt is disabled (to start with)
  • Adobe PDF is not installed
  • No Script Plugin is running

What should I do to check?

  • Check the obvious cPanel settings to make sure it is not them causing a website to go off
    • Is the account suspended
    • Over bandwidth quota Account
    • Over disk quota
  • Have a look around with ftp / cPanel before anything else
    • Are there random file names and unusual folders
    • Check the CGI folder and remove anything in there (should I disable CGI)
  • Check the Vulnerability Feed from Joomla
  • Check the homepage to see if it is hacked (optional)
  • Check .htaccess
  • Login to Joomla admin
  • Install RSFirewall and run system check
  • Check Website log files
    • check the raw access logs with ApacheLogViewer (or other log viewer) and check for access to dodgy files and heavy access from 1 IP etc..
    • Also try sorting by request, this will expose dodgy files and their access
    • POST should not be heavily used by remote IP address
    • Add these IPs to the htaccess IP deny rules

Part 2 - First Steps if your site is hacked

  • Disable website by .htaccess (Deny From All)
  • Change cPanel password

Part 3 (opt A) - Recover from backup

This by far is the best way to recover your joomla website.

This will replace all files and your database, so if youor backup is really old or out of date you should consider if this is the best option for you.

  • Back the virus infect website up and store
    • Why do this? This is done just in case you have missed some new content or other thing you have missed. It does not harm and this backup can be deleted later. Download this to your PC before starting.
  • Verify that the Joomla version of the infected website and the backup are the same. If they are not you will need replace the database with that out of the backup and this can lead to content loss if the backup is not new enough. If you do not want to swap the database you cannot use this method.
    • The joomla version number is stored in
      • administrator/manifests/files/joomla.xml
      • /libraries/cms/version/version.php
      • Write down the Joomla version make sure you combine the release+maintenance version to get the correct joomla version?
    • How to find which version of Joomla! I'm using? - Joomla!
  • Delete the files in public_html folder on the server
  • Upload your backup
    • Only the contents of the public_html folder, you should extract these files from the backup and re-zip ready for upload.
    • You can also upload the full backup and after extraction only move the required files into public_html if you know what you are doing
  • Extract backuped files into the public_html folder
  • Replace the database (optional)
    • only do this if the Joomla versions were not the same
  • Empty joomla cache

The site should now be running but it might not be clean, backups can still have issues. Perform the Hack Cleanup to finish.

Part 3 (opt B) - Repair Hacked Site (as is)

If you do not have any backups you will need to repair your Joomla installation using the following procedure. This is not the preferred option.

  • Backup the website
    • Why do this? This is done just in case you have missed some new content or other thing you have missed. It does not harm and this backup can be deleted later. Download this to your PC before starting.
  • Write down the Joomla version
    • The joomla version number is stored in
      • administrator/manifests/files/joomla.xml
      • /libraries/cms/version/version.php
      • Write down the Joomla version make sure you combine the release+maintenance version to get the correct joomla version?
    • How to find which version of Joomla! I'm using? - Joomla!

Full Package Joomla System Files Re-Install

This section should re-enable Joomla but malware might be present in 3rd Party Apps and in random folders all over the place and should not be counted on as fully cleaning your website.

This section will also allow you to get a list of installed extensions and their version numbers. You can get these from your database if you know what you are doing.

  • Download the full installation package for the same Joomla version from github
  • extract the zip file
  • upload all of the extracted Joomla files to the hacked website's public_html folder and replace all files
  • This should allow you to get basic access to your joomla website
  • login into the joomla website and get a list of the installed extensions and their version numbers

You can move to the 'Perfom Hack Cleanup' section if you have time contraints or are happy that the infection is not envasive, this is not recommended. You should carry on with the next section.

Full Fresh Install with 3rd Party Apps brought back in

This is a lot more thourough in cleaning you site but requires a lot more work. This assumes you have followed the section above and have a backup of the infected site and a list of extensions.

  • Delete the files in public_html folder on the server
  • Extract the backup you just made on to your PC (of the infected site)
  • Scan the files in the public_html files for virus and remove them if found.
  • Upload the Full Joomla installation package to the public_html folder on the server
  • carefully check the /images/ folder and once you are happy that it is clean upload this to public_html on the server
  • There might be 3rd party apps that have user files that need uploading (ie in the media folder), unless you know what needs uploading and have check for virus or dogy files DO NOT UPLOAD, you can always do this later. Most user stuff will be in the /images/ folder
  • Download all of the extensions you need and make sure they are the correct version
  • check the  configuration.php from the download infected backup and make sure it is clean from virus or dodgy code and then if all clear upload it to the website server
  • Login to joomla. You migth get some erros but ignore these unless you cannot login (that will need to be dealt seperately)
  • install all of the extensions you have downloaded. this will re-install all of these extensions with fresh files.
  • Check all of the extensions are working correctly (i.e. there are no missing images). If there are missing images check in your infected backup for them, clean the related files and folders and then upload them to the correct location on the server.
  • Check joomla is running normally

The site should now be running but it might not clean yet. Perform the Hack Cleanup to finish.

Part 4 - Post Hack Cleanup

These instructions should be done for all versions of recovery and help prevent getting re-infected and remove any straggling malware or unwanted behaviour.

Users and Passwords

  • Remove any erroneous user accounts. Delete any users that should not be in the Joomla user manager.
  • Change passwords (and prefixes) for the following in order and all of them:
    • cPanel (if not already)
    • MySQL Database
    • MySQL Database Prefix
    • RSFirewall
    • Joomla Users - Reset them all
      • if you have users do a bulk reset once you have changed the admin password
  • Edit configuration.php via cpanel and change MySQL database password
  • Check the administrator folder is protected by .htaccess authentication (Batcode). If it isn't, add this feature
  • Enable 2nd Factor Authentication in Joomla (I have not tried this yet)
  • The potential login procedure would follow
    1. URL with Token
    2. Batcode
    3. RSFirewall
    4. Joomla Login
    5. 2nd Factor Authentication

RSFirewall

If already installed upgrade it if it is not the latest version.

  • Install RSFirewall if not present (with hashes and GeoIP)
    • Upload New Hashes (if not present)
    • Install GeoIP to block by country? (if not present)
  • Configure RSFirewall settings  (as per skeleton notes)
    • Upload Skeleton Config - Which includes:
      • Block all China and Russia
      • Active file scanner
      • Enable admin password protection
      • High and critical emails sent to joomla@example.com
      • Disable Joomla Installer
      • Prevent New Admins from being created
      • convert all emails to images (i have not used this yet)
      • Filter File Uploads
      • Automatic Blacklisting set to 10
      • etc...
  • Scan / System check and follow all recommendations (apart from php.ini)
    • Remove any malware files it finds by keeping the list on screen and then use a ftp browser and remove all infractions
    • Temp Files
      • Empty temp files (except index.html if doing manually)
      • The temp folder should be /home/{account}/tmp-joomla if not already
      • Don’tdelete /home/{account}/publid_html/tmp it will just come back with a system upgrade or get flagged by the RSFirewall as missing.
  • Database Check (PHPMyAdmin and RSFirewall)

Upgrade Joomla and Extensions

Backup again before doing this sections for safety.

  • Re-install/Upgrade all extensions
  • Re-install/Upgrade template (Joomlashine allows you to scan files for modifications)
  • Remove JSecure lite (if present)
  • Install SH404SEF (optional)
  • Upgrade Joomla

Joomla Settings

  • Add captcha to all forms
  • Empty joomla cache
  • Add 5G firewall

Final Operations

  • Empty Temp files again
  • Run RSFirewall System check
  • Create a backup from the live webserver and save it to your PC
  • Extract the public_html (your could do the whole cPanel archive) and scan for virus
  • If the scan(s) come back clear you are done. If any virus is found you need to remove them and upload the cleaned files
  • remove any .htaccess restrictions
  • Delete the root .htaccess and robots.txt files and replace with the Skeleton ones or use the latest Joomla ones from the upgrade
  • Done

Part 5 - cPanel Additional

I use cPanel for hosting so this is what I do but you can easily translate these in to any other hosting platform

  • Set email quotas within the disk quota of the account ie the website + email quota is below the account limit 100mb mail boxes is good.
  • Purge the default mailbox (probably via webmail or ftp)
    • load horde, right click on the inbox and select empty - this will remove all emails
  • Set Default Email address to "Discard the email while your server processes it by SMTP time with an error message."
  • Country restrict the site via .htaccess (in the short term)
  • Enable SPF and DKIM
  • Get the server PHP version upgraded if needed
  • Server AV scan when replacing the .htaccess you must bear in mind multiple domains , if you delte these rewrites this could cause a connection reset error. Restore the htaccess file from the viri website buyt make surte yoou clean it. This might want to be earlier in these instructions

Misc

Password Checklist

When fixing multiple websites you need to record the username and passwords. I use a text file with the following in:

Published in Joomla

This for me is a very important process to know. For my longer articles I mainly create them in office and then copy and then paste them in to my WYSIWYG (JCE Editor). This method allows me to write the articles quicker without fear of time outs and lost content etc.

With putting most of my articles on my website there is no need to keep the word documents as this would get tiresome and could be confusing. There is a downside to this. If you want any of the articles in a word format you no longer have the original and the article has been converted in to a HTML page.

Until now I did not know how to convert the Joomla articles back to Word Documents and i was use to that when I copied the document back from the website and pasted into Word 2010 the results were undesireable and not how I remembered the original word document, the formatting could be loast, the wrong font was being used and the heading references were missing.

I will now show you how to completly restore a Word document from a Joomla article. You should note that this will work with other content such as K2 articles.

 

Different Methods I have tried

  • Pasting into LibreOffice Writer 5.1.3 (Prefered Method)
  • Create HTML file with the HTML from the article WYSIWYG and then open that file with Libre Office
  • Pasting into Word 2010
  • Create a HTM file from the browser and then open with Microsoft Word 2010
  • Conversion Websites

 

Methods and their results:

Pasting into Libre Office Writer 5.1.3 (Prefered Method)

  1. Goto the articles webpage, do not edit the article.
  2. Copy the article's content only, not the menu, statistics, modules etc.... (If you need the title which is not in the content because it is managed by the menu item, type that in later.)
  3. Create a blank LibreOffice Writer document and open it.
  4. Paste (Ctrl+V) the content into LibreOffice Writer
    • Ctrl+V seems to do a paste, 'HTML without comments'.
    • After pasting into LibreOffice Writer there are no weired characters. Layout, lists and headings are maintained but the fonts have been changed to the default LibreOffice style.
  5. Save the file as Word .docx file
  6. Open the file in Word 2010
    • The layout and heading references have been maintained. There are no weired characters but the styling is still the sames as was in LibreOffice.
  7. Select all of the content
  8. Change style to word 2010
  9. Add the main <H1> Title if needed
  10. Save the document
  11. Done

You now have a word version of your HTML article. The headings and formatting is maintained. You can also paste the word document back into a WYSIWYG with no further issues.

Notes

  • I have not tested this method with images but should work.
  • This method seems to remove all weired chracters, possibly has an invisible font substitution for this exact issue.
  • I would guess the results by using the WYSIWYG content (not HTML) will be exactly the same.

 

Create HTML file with the HTML from the article WYSIWYG and then open that file with Libre Office

  1. Edit the article in Joomla
  2. Expose the HTML and copy it
  3. Create a article.html file on your PC's desktop and paste the code into it
  4. Save and close the article.html file
  5. Open the article.html file with LibreOffice Writer
  6. Save the content as a word .docx file (i.e. article.docx)
  7. Open article.docx in Word 2010
  8. Select all of the content
  9. Change style to word 2010
  10. Add the main <H1> Title if needed
  11. Save the document
  12. Done

You now have a word version of your HTML article, there might be a few things you need to sort out but the headings and formatting is maintained. You can also paste the word document back into a WYSIWYG with no further issues.

Notes

  • It is important to only use the HTML of the article.
  • I have not tested this with images, they possibly will fail unless using full http:// paths.
  • When I open up the article.docx file in LibreOffice, some characters appear as weired characters, not a lot. This is due to the characters being non-standard from the original Microsoft Office Word document (i.e look like periods but are not, or those dashes that you get in Word but are the ones Word autocorrect adds). These characters go unnoticed because they render correctly on the webpage (or appear to) but are slightly different characters. When LibreOffice opens the HTML file it substitutes these characters with characters from the ‘SimSun’ font giving rise to what appears to be corruptions but is infact just an unpleasant font substitution. To correct this you can:
    • Makes sure there are no errors in the original word document. It is the auto correct thing that most likely causes this
    • Remove all non standard code in the article (joomla/wysiwyg)
    • Tidy the text up inlibre office before saving
    • Tidy the text up in Microsoft office

 

Pasting into Word 2010

This keeps the formatting from the website but does not correctly attach heading status to the headings even though they are in the nav pane. You can merge the styles which seems to restore the fonts but not the heading.

If you use this method you will have to use the 'Change Style' feature and manually set the headings again. There is also a chance that there will be font settings in the document that will be copied back in to a Joomla rticle should you want to try and use this code back in the joomla article, perhaps after editing it.

 

Create a HTM file from the browser and then open with Microsoft Word 2010

  • Using FireFox I saved the articles webpage as htm and then open with word.
    • This keeps the headings correctly referenced
    • This is messy as it keeps all of the other stuff like the menu and modules.
    • You can then delete the uneeded bits by highlighting and deleting
    • Select all and go to ‘Change Styles’ and select ‘Word 2010’ which makes the headings look normal. The text still stays in the wrong font and size
    • This would cause specified font rules being copied back up to a Joomla article should you want to put the article back into Joomla.

 

Conversion Websites

  • These converters will try and keep the content the same as on the website by setting fonts and sizes rather than maintaining the elements such as converting <h1>, <h2> to a heading elements in Word.
  • So these converters will translate the content fine into the Word equivalent visually but there will be element recognition loss and font substitution.
  • Because of the loss of headings I would have to manually set all the headings again and then use the 'Change Style' feature. Teh results of this will vary from converter to converter.
  • Because I want to create a word document that only uses the default so there is no font settings within the document, this method is not good.

 

General Notes

  • They might be stuff that cannot be translated properly like code highlighting, but these can be sorted out manually as they most likely never existed in a word document anyway

  • Office 2016 - This might be more forgiving for direct pasting of content as it is a lot newer and because HTML and document formats probably have more parity

Published in Joomla
Sunday, 12 June 2016 13:46

Make an Android Microscope

More to come as I do the project.

Viewing Method

  • cast to device
    • screen mirroring (miracast)
    • screen mirroring (chromecast)
    • screen mirroring (TeamViewer/AirDroid/etc..)
  • Other
    • IP webcam (DroidCam)
    • HDMI/MHL output from phone via USB
    • via DLNA (AllCast + AllShare)?
    • TeamViewer
  • Screen share via App
    • AirDroid
    • Windows Phonelink
    • MyPhoneExplorer

Notes

  • Settings --> Connect devices --> Connection preferences --> Cast
    • Still no 3 dots
  • Three-dot menu missing from Cast (#732) · Issues · LineageOS / issues / android · GitLab
    • Google removed "wireless display/Miracast" support in P. This is the method a lot of smartTVs use for direct casting/screen mirroring. Android also fully supports casting via Chromecast/google home type devices and thats why this menu remains in place.
  • Miracast is bi-rectional, where-as Chromecast is one-way i.e. they only do receivers and is a locked down protocol.

Zooming Methods

  • camera zoom
  • adding a lense on
  • using a better phone
  • large TV

my methods makes the phone the microscope, not adding one onto it

Lenses

  • Lense types
    • Macro = for subject close to the lense
    • Micro = microscope stuff (possible Wide + Macro + Fish Eye lens = micro)
    • Telescopic = for subject far away from lense, there is usually a minum distance the subject needs to be (minimum focus distance)
    • Super Macro ?
    • Zoom Lense ?
  • Focusing distance = minimum distance the subject has to be from the lens

Bracket

  • Retort stand (29cm version probably to small)
  • Lazy stand thing (clips onto the desk) – This has the ability to be moved about easily

Software

Different lenses from ebay

Microscope

  • 60x
    • Cheap version (v1)
      • 60 x no adjustable zoom (or possible screm thread) with UV and led light, clips on with a screw thread fitting
  • V2
    • 60 x adjustable zoom with UV and led light, clips on with a screw thread fitting
    • White plastic or one with a smiley face
    • Smiley face one does not have any cushioning on the clamp, this could scratch your phone
    • Bracket version available
  • 100x
    • V1
      • 100x standalone version available (to use with your eye)
      • 100x that fits onto a mobile phone
      • Available with a case for a phone
      • 3 * LR1130 batteries (included)
  • V2
    • Uses 3 x AAA batteries
    • Seems bigger than the other version
    • Maybe heavier
    • Can be used on mobile or standalone

Other notes

Published in Android

Before converting to GPT it is important to know why and if you can convert. This article should help you make that decision.

MBR

MBR is standard method to present partitions to the bios so operating systems can load. The BIOS is hardcoded to read the first part of any hard drive, this is the MBR. In the MBR is stored the locations of the primary partitions. Each physical disk can have up to 4 primary partitions and within this you can create an extended partition which can hold up to a theoretical limit of 25 partitions (I think!).

Only primary partitions can be booted from and to boot from a partition, it must be set to active.

You can only have 1 active partition per physical disk so this limits the bootable partitions on a hard disk using MBR to 1. MBR is now known as a legacy method. MBR is limited to drives under 2.2TiB in size as it cannot address any larger than this.

In the bios there are instructions to load and execute certain files that are found in the root of the active partition and because these instructions are hardcoded in the bios it enables your OS to be loaded even after power down. Operating systems know this and place the appropriate files for the boot procedure in the root. If these files get corrupted or deleted the OS will fail to load.

GPT

GPT is the new way of addressing partitions on a drive. I believe Linux has been using this for a while and it is not limited to 2.2TiB drive sizes amongst other things.

GPT hard disk configurations also put a dummy MBR in place that reports the whole disk as ‘allocated’ (check this) to prevent Non-GPT aware programs corrupting the disk.

GPT Notes

  • UEFI only works on 64-bit systems
  • Secure boot will only work with UEFI enabled
  • Secure boot only allows signed drivers to be loaded for the kernel. I know Microsoft has a certificate and there might be some other company certificates in there aswell.
  • UEFI can be extended on the fly by loading files from a HDD or other boot media. This is how the Microsoft EFI partition works and its purpose.
  • You don’t need the recovery partition to get GPT to work but it is handy.
  • The MSR partition is not currently used but it might be in the future and it is installed in default Windows 10 installations.If It is is not present, your GPT Windows 10 will still load
  • If you convert from a system disk that has always been an MBR, Windows will not boot via UEFI after converting to GPT. You need to add the EFI partition to allow booting.

GPT is not UEFI/EFI

Windows 10 needs a EFI partition to be able to boot windows that is located on a GPT hard disk.

The easiest way to clear this up is to describe the different technologies used by Windows 10 in this new setup.

  • GPT is the new way partitions are addressed on the hard disk
  • UEFI/EFI (User Extensible Framework Interface) is a method of extending a bios by adding drivers on the fly. There are several vectors to add these drivers.
  • EFI Partition - This is where you can place drivers you want to be loaded by the bios. This is done on the fly at every boot up. It is by this mechanism that Windows 10 adds the drivers into its kernel so it can be booted from a GPT partition and also utilise Secure Boot

Questions

  • Can you boot windows of a GPT partition without an EFI partition?

    I don’t think so because Windows uses the EFI partition to add extra driver(s) that sit in between windows and the Hard Disk which allows for the continued support of MBR on the same core code.

  • Can you use a GPT partition for storage if your Windows installation is on a MBR system disk?

    I think the answer to this is yes. You just would not be able to boot of the GPT partition.
Published in Windows 10
Sunday, 12 June 2016 09:44

Embed a Video using HTML5

This article is not finished and is just a holding page for now and to hold collections of code i find:

Video in webpages can make a website look a lot more expensive and professional but you must make sure you have enough bandwidth to cope as it can be quite intensive.

<video class="background-video" aria-role="img" aria-label="PrestaShop" data-mp4-src="//img-cdn.prestashop.com/home/product-video-bg.mp4" data-webm-src="//img-cdn.prestashop.com/home/product-video-bg.webm" data-poster="//img-cdn.prestashop.com/home/bg-video.jpg" autoplay="autoplay" muted="muted" loop="loop" volume="0" canplay="false">
		<source type="video/mp4" src="//img-cdn.prestashop.com/home/product-video-bg.mp4">
		<source type="video/webm" src="//img-cdn.prestashop.com/home/product-video-bg.webm">
</video>

Links

 

Published in HTML
Saturday, 11 June 2016 17:46

Working HTML email with CSS formatting

The following HTML code formed an email I received from Outlook.com and as you can see it has working CSS styles embedded in it.

I have pasted the code exactly as it appeared (ie. non-tabulated). You might be able to use tabluated HTML code but I cannot be 100% sure. The CSS code inside the <script> tags has been remmed out and this might be intentional.

Try adding your own code and extend this example. I would also mess with all the other elements to see what they do.

HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hello</p>
<p><br>
</p>
<p>From QuantumWarp.com<br>
</p>
</div>
</body>
</html>

 

Published in Email

The Problem

This is a weird one. I updated my Samsung S2 to Cyanogenmod 13.0 (cm-13.0-20160528-NIGHTLY-i9100 / Android 6.01) which went well but every time I tried installing the GApps I got the error ’Not enough room on the system partition to install’. At first I check my drives and there was room on the SD card and data partition. These are not the system partition which was my first mistake. The system partition on an S2 is on 500mb in size so it is only just enough room for CM13.0 but not GAPPS as well.

The Fix/Theory

In simple terms we need to alter the partition sizes. The S2 comes with a 16GB flash chip but for some reason Samsung on gave 500mb to the system partition and 2.0GB to the data partition.

We will make the system partition larger and while we are at it, make the data partition bigger. System partition will go to 1GB and the data partition will go to 6GB. The Internal SD will take the remainder and ends up about 7.5GB

What Are We Going To Do?

Now I have given you the idea of what we are going to achieve, here come the tricky bit. I have learnt this information from many different places to put together simple instructions especially for those who are not experienced at flashing but I do encourage you to read my instructions and then have a look at the links and research I have put together just in case I have got anything wrong.

To repartition the phone we will use the REPIT from Lanchon but that needs to have an IsoRec compatible Bootloader/Recovery in place otherwise issues will occur and could possibly brick your phone.

The ROM being loaded also needs to be IsoRec compatible I believe otherwise it might not load correctly. I am not 100% about this.

Because of how things are you most likely cannot just install the latest version of TWRP which is IsoRec compatible because it is only available in an img format. To get around this we will install an older version of TWRP which is available in zip format that can be installed from most Custom Recoveries. Once this old version of TWRP is installed we can then use it to install the newer version in the img package format. There are other ways to install the img package:

  • HeimDall - I tried this and it doesn’t work. The software just give me errors and I don’t think the software has been updated in ages
  • Side load – not 100% what this is
  • ADB – via the command line
  • Other Custom Recoveries

NB: I don’t think you can install the img packages via ODIN. ODIN is file system aware and I think img are binary files

Make sure your battery is charged and perform these actions whilst the phone is plugged into the mains.

Instructions

These instructions are geared for my Samsung Galaxy S2 i9100 Int

Overview

  1. Backup phone
  2. Install CM13 (IsoRec compatible ROM)
  3. Install old version of TWRP via a custom recovery to add img support
  4. Install TWRP 3 which is an IsoRec compatible recovery
  5. Run the REPIT software to repartition the Samsung S2 Flash Drive
  6. Install GAPPS
  7. Wipe cache and data
  8. Reboot
  9. Done

Full Instructions

Preparation

1. Download the following files to your PC

  1. recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-(by-arnab).zip - This is an IsoRec compatible version of TWRP v2.8.7.0 by arnab in a zip format that you can install via most Recoveries. This is specific to a Samsung S2
    or
    twrp-3.0.2-0-i9100.zip (latest version in zip format)
  2. twrp-3.0.2-1-i9100.img - This is a new official version of TWRP in img format for a Samsung S2
  3. lanchon-repit-20160415-system=1.0-data=same-sdcard=max-preload=min+wipe-i9100.zip
    • This is REPIT by Lanchon for the Samsung S2
    • The files are specific to your phone, if there is no file then you cannot use this method.
    • You can request a file for the process
  4. SAMSUNG_USB_Driver_for_Mobile_Phones.zip - needed to connect to your phone, if not already installed
  5. cm-13.0-20160528-NIGHTLY-i9100.zip - Latest version of Cyanogen mod Android for the Samsung S2
  6. open_GApps-arm-6.0-micro-20160529.zip - CM13 / Android 6 compatible GAPPS

2. Rename the REPIT file

lanchon-repit-20160415-system=1.0-data=same-sdcard=max-preload=min+wipe-i9100.zip
-->
lanchon-repit-20160415-system=1.0-data=6-sdcard=max-preload=min+wipe-i9100.zip
  1. I changed -data=same to -data=6
  2. This files will set 1GB system partition and a 6GB data partition
  3. The file name controls the repartitioning options
  4. The file is specific to the model of the phone

3. Copy the following files to your phones Internal SD Card

  1. recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-(by-arnab).zip
  2. twrp-3.0.2-1-i9100.img
  3. lanchon-repit-20160415-system=1.0-data=6-sdcard=max-preload=min+wipe-i9100.zip (note it is the one with the larger data partition)
  4. cm-13.0-20160528-NIGHTLY-i9100.zip
  5. open_GApps-arm-6.0-micro-20160529.zip

4. Backup all that is important to you, pick whatever method you prefer. A nandroid and a files backup is the best. Copy the backup of the phone on to your PC

Install Cyanogen mod 13

  1. Install cm-13.0-20160528-NIGHTLY-i9100.zip via recovery as normal
    • Can be done later just before installing GAPPS, I found I had to do it this way because TWRP would not replace Clockworkmod. (or appeared so)
    • It did install but when Clockworkmod rebooted to bootloader, Clockworkmod just re-loaded
    • after I installed CM13 and booted to Recovery, TWRP loaded without re-installing it again meaning it must of installed previously but Clockwordmod did not properly unload from memory
    • NB as ever, it is better to wipe your cache and do a factory reset to prevent incompatibilities

Upgrade the Recovery with IsoRec compatible TWRP

  1. Install an old version of TWRP via recovery (recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-(by-arnab).zip)
    • SD Card might of got wiped here
    • We have to install an old version of the TWRP so we can install the latest version of TWRP which is in img format.
    • If your custom recovery supports the install of img files you can probably skip this step
    • Reboot to recovery - This loads TWRP v2.8.7.0
  2. Upgrade to the latest vcersion of TWRP (twrp-3.0.2-1-i9100.img)
    1. Flash twrp-3.0.2-1-i9100.img via TWRP - When prompted which partitions to flash, select Recovery
    2. Reboot to Recovery - this loads the new TWRP v3.0.2.1

Repartition the Flash Drive

We now are going to repartition the drive which is very simple, when you know how. This will give a 1gb system partition and a 5.91GB data partition, the internal SD Card will take the rest of the space which is about 7.49GB

  1. Plug your phone into the mains if not already.
  2. Assuming you are still in TWRP v3.0.2.1 , Browse to and flash the REPIT file:
    lanchon-repit-20160415-system=1.0-data=6-sdcard=max-preload=min+wipe-i9100.zip
  3. It most likely will fail first time and say it has copied itself to the /tmp/ directory. This is fine. If it actually processes your phone skip flashing from the /tmp/ directory steps.
  4. Browse to /tmp/ in TWRP by going up one level in the folder tree
  5. Flash the REPIT file in the /tmp/ directory:
    /tmp/lanchon-repit-20160415-system=1.0-data=6-sdcard=max-preload=min+wipe-i9100.zip
  6. The partitions will now get resized. Mine took about 15 minutes and kept the /system/ files, possibly the /data/ files and the Internal SD Card files. I did not have that much on my phone, possibly a 200mb – 300mb, so you time might vary.
  7. Perform a System Reboot to make sure Android loads and runs ok and the partitions are the correct size etc... (optional)

Install GAPPS

  1. Reboot back in to recovery and install GAPPS
  2. Flash this file via the recovery partition open_GApps-arm-6.0-micro-20160529.zip
  3. Clear /Cache/ and /data/ partitions
    1. A Factory Reset as might remove GAPPS (check this)
  4. Perform a System Reboot

Final Settings

  1. CM13 will now load and you should setup as normal.
  2. Once you have setup the phone, make sure that Cyanogen mod is not configured to replace the bootloader as I am not 100% sure if this will stop things working or if it was just whilst repartitioning the drive. This option is found in the Developer Options.
  3. Finished

Done, What Now?

You now should have a Samsung S2 with a much larger system and data drive. Dont forget you can always re-run this process and make the drives larger, but for now you can just use your phone for flashing ROMs as you have in the past. The only exceptions I can see is do not flash stuff by ODIN as I do not know if it will break anything.

Notes

These are my notes I made whilst I figured all of this out, which would of not been possible without the guys who did the all of the programming.

Flashing Compatible TWRP

  • TWRP for Samsung Galaxy S2 i9100 – Official Home Page for the Samsung S2
  • Installing TWRP 3 the Easy Way – This shows you how you can load TWRP img file via ADB. (it is also the IsoRec homepage)
  • [RECOVERY] [ISOREC] [TWRP 3.0.2-1] [OFFICIAL] [26/04/2016] (Official thread by arnab)
    • Flash via Recovery
    • Flash via Heimdall Suite (Windows only)
    • Update via Recovery
    • Side Load
    • Can you get a new compatible recovery via the play store?
  • Two things I found:
    • adb side load isn't actually exposing any adb, but instead creates a "USB storage" device
    • when files are copy-pasted via MTP, last modified date is changed

IsoRec

  • IsoRec is a new feature which I believe allows for the use of a combined recovery/bootloader partition. Either way bootloader either support it or they don’t.
  • [MOD] IsoRec: Isolated Recovery for the Galaxy S2 – XDA Developers thread explaining what this technology is
  • [RECOVERY] [ISOREC] [TWRP 3.0.2-1] [OFFICIAL] [26/04/2016]
    • XDA Developer thread for TWRP 3.0.2-1
    • Maintained by arnab
    • This has various installation instructions
      • Flash via Recovery
      • Flash via Heimdall Suite (Windows only)
      • Update via Recovery
  • Download links for:
    • HeimdallSuite_v1.4.0.zip
    • SAMSUNG_USB_Driver_for_Mobile_Phones.zip
  • The i9100 does not support a separately bootable recovery partition. To install and use TWRP, you will need to install a custom kernel or boot image that supports IsoRec
  • CM12.1 and CM13 has IsoRec support

REPIT

  • GitHub Homepage
    • This site has some very good instructions on how it works
    • The example instructions and filenames are for the i9100
  • Original XDA Developers thread (no longer updated)
  • The Software
    • A Device-Only Data-Sparing Repartitioning Tool For Android (keeps your data)
    • The REPIT files are Phone specific
    • The operations are controlled by the filename
    • Use of this requires an IsoRec compatible Recovery to be installed

PIT Files

Cyanogen mod

  • You need to make sure that you install GAPPS and CM13 at the same time otherwise it might go mental (check this)
  • I have not seemed to of had any problem but if you install GAPPS before 1st use, the Google wizard runs on first boot. This might also happen when you install GAPPS later but I am not sure.
  • CM 13.0 Release 1 – Official blog post. It outlines some issues.
    • CM13.0 is funny about installing GApps apparently. You must install both packages at the same time (CM and GApps) with no reboot otherwise it might go mad. I have not seen this.
  • Samsung Galaxy S2 by CNBLACK ROM set which Contains
    • cm-12.1-20160406-UNOFFICIAL-i9100.zip
    • cm-12.1-20160406-UNOFFICIAL-i9100.zip.md5sum
    • Cyanogen Recovery - i9100.tar - An ODIN Flashable Recovery

Heimdall

 

Published in Android
Thursday, 26 May 2016 18:12

Embed an image directly into HTML

It is possibly to directly embed an image in to the HTML rather than linking it as you normally would. This is very useful when you want to write contained articles, some apps or where you are not able to link to external assets.

The following technique embed a binary image directly within an <img> tag

  1. Get your image and convert it in to bas64 format
  2. Create the <img> reference as layed out below
  3. Done

NB: Dont use this method for large images.

Example

dell docking station

HTML

This code is not complete because it is sending my search funny.

<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCAGQAZADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL" alt="">

 

Published in HTML

This is the most efficient way of doing eBay and is especially useful when you are doing many items

Setup the equipment

  • Photo area with with paper
  • Camera tripod
  • Android phone on WIFI (connect to phone via airdroid, can be done later) or other method of WiFi camera. I set he res to 1280 x 1024 as this is not to large but you can have personal preference.
  • Have your pc on with Turbo Lister open and a web browser
  • All your pack materials in 1 area
  • The ebay html code for gallery open in notepad++ on your laptop
  • I use the free program Easy Thumbnails for creating the thumbnails.

Basic work flow

  1. Get all of you items for sale in 1 pile
  2. Box and semi pack all items so you know you have a suitable box for them
  3. Take all the items you have boxed and then photograph them on your android phone/wifi setup
  4. Do a couple of test images to make sure the equipment is working properly. Do this by downloading them on your pc and checking
  5. No go ahead and photo graph all of your items. The more expensive the more photos you should take more
  6. Process the images (see below)
  7. Write and build the item/auction in Turbo Lister. Do this for all items you have just taken photos for

eBay HTML Gallery for images on your own server

Image processing

  1. Get the images on your PC
  2. Remove any bad images
  3. Resize images to 1280px (optional, but better for loading on mobiles)
  4. Sort them in to folders for each product with a suitable web-safe folder name
    Those that you just took 1 photo on purpose, create a folder called misc and put them in there

    The following can actually be done just as easy when you create the individual Item/auction

  5. For each product's images rename them to: (and put them into a specific order if required.)
    1.jpg, 2.jpg, 3.jpg  etc......
  6. Create thumbnails for each item using Easy Thumbnails (default settings are perfect) this creates thumbnails called and should be in the products folder where the original images are. If not move them there.
    tn_1.jpg, tn_2.jpg, tn_3.jpg  etc......
  7. Upload these product images and thumbnails, in their folders, to you website holding folder and it should end up being in the format below.
     {Website eBay Folder}/{Item Name}/
  8. Image processing stuff done

HTML Gallery

We now have the images uploaded on our webserver but need to create a HTML gallery to use them.

This code is a nicely layed out basic gallery that you can use for your eBay listings but hosting the images on your own server saving you money and allowing you to add as many images as you want. I use the free program Easy Thumbnails for creating the thumbnails.

HTML

<p>Click on the images for a larger version</p>
<p>
	<a href="https://quantumwarp.com/ebay/items/bottle/1.jpg" style="padding: 5px;"><img alt="" src="http://quantumwarp.com/ebay/items/bottle/tn_1.jpg" /></a>
	<a href="https://quantumwarp.com/ebay/items/bottle/2.jpg" style="padding: 5px;"><img alt="" src="http://quantumwarp.com/ebay/items/bottle/tn_2.jpg" /></a>
	<a href="https://quantumwarp.com/ebay/items/bottle/3.jpg" style="padding: 5px;"><img alt="" src="http://quantumwarp.com/ebay/items/bottle/tn_3.jpg" /></a>
	<a href="https://quantumwarp.com/ebay/items/bottle/4.jpg" style="padding: 5px;"><img alt="" src="http://quantumwarp.com/ebay/items/bottle/tn_4.jpg" /></a>
	<a href="https://quantumwarp.com/ebay/items/bottle/5.jpg" style="padding: 5px;"><img alt="" src="http://quantumwarp.com/ebay/items/bottle/tn_5.jpg" /></a>
	<a href="https://quantumwarp.com/ebay/items/bottle/6.jpg" style="padding: 5px;"><img alt="" src="http://quantumwarp.com/ebay/items/bottle/tn_6.jpg" /></a>
	<a href="https://quantumwarp.com/ebay/items/bottle/7.jpg" style="padding: 5px;"><img alt="" src="http://quantumwarp.com/ebay/items/bottle/tn_7.jpg" /></a>
</p>

Build the product specific gallery HTML code

  • Copy the HTML code above into your favourite text editor, mine in Notepad++
  • Adjust the number of image references to match how many you need. Either delete lines or use copy and paste and add more not forgetting to change the image numbers.
  • Using text replace
    • change the domain to match yours. Dont forget to change https for http if needed
    • change the file path to mathc yours
    • change the product name to match the product image folder name
  • Save this gallery or keep it to hand.

Turbo Lister – Building an item

The process is fairly easy and straight forward but I will write it down anyway. You only need to do this if you are doing multiple images for you item and is to bypass eBay costs for extra images.

  1. Open Turbo Lister
  2. Create new item
  3. Select a product you have just photographed and have the images for
  4. Search eBay to see if there are any of these items on eBay so you can gauge a price. If you take a lower price you might find your ssales increase. Don’t be greedy if you want to sell quick
  5. Create a suitable title – use the search results for inspiration
  6. Select a category - – use the search results for inspiration
  7. Set an auction time
    1. 7 or 10 days for an auction. Start 7 days on Sunday 8.00pm to 9.00pm and 10 days start these on Thursday at 8.00pm to 9.00pm. 8.15pm is probably the best
    2. If you are doing a fixed you either start at the times above or whenever you want. Only do 30 days for the real specialty stuff as most people don’t do anything until the last week if not on the last day. You would only need 30days to advertise something people don’t look for often
  8. Now fill in your description. It is ok to nick stuff of other people’s listing because they have done all the hard work for you but do not 100% rip their work as they could find you out and report you to eBay. Be honest in your description
  9. Select an auction image via Turbo Lister, you should navigate to image 1 (or your selection) select the image for your auction
  10. Product Image HTML Gallery (optional)
    1. Go back to your description and select the HTML view in Turbo Lister
    2. Open the HTML Code you created earlier for your HTML Gallery in Notepad++
    3. Copy the HTML Code to the bottom of your Turbo Lister description (or wherever you want)
    4. Preview the images and make sure they open.

Done

That should be it, you have made one complete eBay product and listed it using TurboLister.

Other Notes

  • You can diretly embed images into HTML using the following code. See my article about this.
    <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABACiiigD//Z" alt="">

 

Published in eBay
Tuesday, 17 May 2016 14:41

Locations Page

This is a page to display various client locations utilising BT Google Map Plugin. this layout is fully responsive via the Joomlashine template grid layout.


Locations

Manchester

Rocky Lane
Skerton
Manchester
Cumbria
MA1 1QW

Tel: 01772 123456

Mobile: 07747 123456

Google Map

 

Manchester

Rocky Lane
Skerton
Manchester
Cumbria
MA1 1QW

Tel: 01772 123456

Mobile: 07747 123456

Google Map

 

Manchester

Rocky Lane
Skerton
Manchester
Cumbria
MA1 1QW

Tel: 01772 123456

Mobile: 07747 123456

Google Map

 

Manchester

Rocky Lane
Skerton
Manchester
Cumbria
MA1 1QW

Tel: 01772 123456

Mobile: 07747 123456

Google Map

 


HTML

<h1>Locations</h1>

<div class="grid-layout">
	<div>
		<h2>Manchester</h2>
		<address>Rocky Lane<br />Skerton<br />Manchester<br />Cumbria<br />MA1 1QW</address>
		<p>Tel: 01772 123456</p>
		<p>Mobile: 07747 123456</p>		
	</div>
	<div>
		{lo admodule mod_bt_googlemaps,Locations - Manchester}
	</div>
</div>

<p>&nbsp;</p>

<div class="grid-layout">
	<div>
		<h2>Manchester</h2>
		<address>Rocky Lane<br />Skerton<br />Manchester<br />Cumbria<br />MA1 1QW</address>
		<p>Tel: 01772 123456</p>
		<p>Mobile: 07747 123456</p>		
	</div>
	<div>
		{lo admodule mod_bt_googlemaps,Locations - Manchester}
	</div>
</div>

<p>&nbsp;</p>
		
<div class="grid-layout">
	<div>
		<h2>Manchester</h2>
		<address>Rocky Lane<br />Skerton<br />Manchester<br />Cumbria<br />MA1 1QW</address>
		<p>Tel: 01772 123456</p>
		<p>Mobile: 07747 123456</p>		
	</div>
	<div>
		{lo admodule mod_bt_googlemaps,Locations - Manchester}
	</div>
</div>

<p>&nbsp;</p>	
		
<div class="grid-layout">
	<div>
		<h2>Manchester</h2>
		<address>Rocky Lane<br />Skerton<br />Manchester<br />Cumbria<br />MA1 1QW</address>
		<p>Tel: 01772 123456</p>
		<p>Mobile: 07747 123456</p>		
	</div>
	<div>
		{lo admodule mod_bt_googlemaps,Locations - Manchester}
	</div>
</div>

<p>&nbsp;</p>

 

Published in Joomlashine
Page 24 of 96