Sunday, October 29, 2017

LG G3 Lineage OS install

- This is just a pointers thread, as most any google'd "install TWRP/Lineage OS" finding will give you a great tutorial- but specific to my goals and the LG G3 there were some key lessons.

- LG G3 official 3.0.2-0 and even the un-official 3.0.3.2 does not support updating via OS GUI (must download from website, manually update via TWRP) nor decryption (if you encrypted the phone) to update when updating manually.  3.0.3.2 does at least prompt you for the swipe/pin to decrypt, but it just doesn't work.

- If you have already encrypted and now stuck in a loop where you can't format the internal storage to start over (as you can't mount it to start with), in TWRP go to command line and:

"recovery --wipe_data --set_filesystem_encryption=off"

- Don't encrypt the phone, you will not be able to update the OS and the LG G3's snapdragon 801 does not have hardware optimization for encryption, you take a huge read/write speed hit.

- I did not choose the superuser/root option, I actually wanted to run un-rooted this time to use android pay.

- Android pay works!  Its great going to a store and not caring if their network or POS device is compromised, my info and CC is still safe!  And its convenient (and much faster than chip and pin).

- My LG G3 isn't super fast/snappy, but Lineage has breathed new life into my old phone- saving me from having to ditch it and buy a new phone.

- Part of that 'new breath' is SUPER fast security updates- faster than Nexus/Pixel!  I got the WPA2 Krack patch the first Monday after the announcement of the hack!

Friday, October 27, 2017

Enable trim on PFsense

I started to bookmark or save URLs of helpful tutorials, but started to find sometimes the sites/blogs etc would be taken down and the info lost.  So I found a great tutorial on how to enable trim for SSD in PFSense and want to save it for the long run, as it was a pain sifting through google results for a tutorial of this quality.

URL:   https://gist.github.com/mdouchement/853fbd4185743689f58c

Thank you mdouchement for the below:

nstallation

Use memstick-licecd to install pfsense on your SSD.

Enable TRIM

  • Initialize fstab:
[2.2.4-RELEASE][root@pfSense.localdomain]/root: /usr/local/sbin/ufslabels.sh
It may do nothing because all is already initialize but it's only in a case of
  • Enable AHCI by adding ahci_load="YES" in th following file:
[2.2.4-RELEASE][root@pfSense.localdomain]/root: vi /boot/loader.conf.local
  • Get your device ID by showing the fstab file:
[2.2.4-RELEASE][root@pfSense.localdomain]/root: cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ufsid/563dee910aa6a80a             /               ufs     rw              1       1
/dev/label/swap0                none            swap    sw              0       0
Check the Device ID that is mounted on /, in this example it's /dev/ufsid/563dee910aa6a80a
  • Before enabling TRIM, the partition/device must be unmounted so you have to reboot pfsense in Single User mode.
[2.2.4-RELEASE][root@pfSense.localdomain]/root: reboot
  • Add your USB memstick-livecd and boot on it and select 2 then use tunefs to enable TRIM:
          __ ____
   _ __  / _/ ___|  ___ _ __  ___  ___
  | '_ \| |_\___ \ / _ \ '_ \/ __|/ _ \
  | |_) |  _|___) |  __/ | | \__ \  __/
  | .__/|_| |____/ \___|_| |_|___/\___|
  |_|


 +------------Welcome to pfSense-----------+
 |                                         |                 ______
 |  1. Boot Multi User [Enter]             |                /      \
 |  2. Boot [S]ingle User                  |          _____/    f   \
 |  3. [Esc]ape to loader prompt           |         /     \        /
 |  4. Reboot                              |        /   p   \______/  Sense
 |                                         |        \       /      \
 |  Options:                               |         \_____/        \
 |  5. [K]ernel: kernel (1 of 2)           |               \        /
 |  6. Configure Boot [O]ptions...         |                \______/
 |                                         |
 |                                         |
 |                                         |
 +-----------------------------------------+


...


Enter full pathname of shell or RETURN for /bin/sh:
# /sbin/tunefs -t enable /dev/ufsid/563dee910aa6a80a
tunefs: issue TRIM to the disk set
# /sbin/reboot
  • Boot pfsense in normal mode then go in shell and you can check that TRIM is now activated:
[2.2.4-RELEASE][root@pfSense.localdomain]/root: tunefs -p /
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         enabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            6408
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)
[2.2.4-RELEASE][root@pfSense.localdomain]/root: tunefs -p /var
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         enabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            6408
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)

Links that help me to write this tutorial