pantz.org banner
Finding Google photos original files and SimpleSSHD
Posted on 10-13-2019 04:37:25 UTC | Updated on 10-13-2019 04:43:40 UTC
Section: /software/android/ | Permanent Link

I fired up SSHDroid using Android 10 for the first time, and quickly noticed a warning that the app was not made for Android 10, and might not work correctly. I was happy to see that it did work as the daemon fired right up and I ssh'ed in without issue. I tried getting to my pictures area on my phone so I could back up some of the original raw files. I was greeted with an "Access Denied" to /storage/emulated/0/DCIM/Camera area. Unfortunately SSHDroid is not allowed access to the /storage area anymore in Android 10. Now to find a way to get to my raw picture files.

Finding Google original quality photos

My pictures are uploaded to Google in "Original Quality" not Google's "High Quality" mode. Basically original quality is the exact picture the camera took. High quality is a more compressed version of the same picture which takes up less space. Looking at the info area of a photo in the Google Photos app you can see the original quality picture size. If you go to Google photos on the web and you look at the same info on the same file, you see that the file size is smaller. Which made me wonder how would I get my original quality photo back if Google is showing me the high quality version of my photo. After trying a few things, I found out that if you select the photos in Google photos in the web, and then select "Download", you get a zip file of the original quality photos. It seems that on the web they show you the high quality version of the file, but when you download it you get the quality that it was originally uploaded in. This allows me to get the original files if I want now. Wheew!

SimpleSSHD

It seems that SimpleSSHD is not being updated any time soon, and for that matter does not even show up in the Google Play store anymore, I wanted to see if any other sshd programs for Android allowed access to the photos area of the phone. The one that seems to allow this that I found is SimpleSSHD. Upon first startup it asks for access to media which includes photos and videos. I proceed to start up the sshd server and ssh in. I was able to access the /storage/emulated/0/DCIM/ area with my photos. SimpleSSHD works great. I don't see any way to give the dev some money by buying the app, or in app purchases, so I guess I'll just say thanks for making a great sshd app that works on Android 10.

Del.icio.us! | Digg Me! | Reddit!

Related stories

Skip commercials on Hulu in a web browser
Posted on 12-06-2018 00:15:38 UTC | Updated on 12-30-2018 07:12:53 UTC
Section: /software/chrome/ | Permanent Link

I signed up for Hulu on Cyber Monday at an unbelievable deal of $12/yr. This of course is their commercial tier, but it was worth it to give Hulu a shot. Currently, Hulu runs commercials in 2 ways. The first is one big commercial before the show, or multiple commercial breaks during the show. You can of course pay for a no commercial tier if you like Hulu, and I suggest you do that, if you don't like the commercials. But during your trial period you might want to help speed up a few of those commercial breaks,before you decide to pay for that higher tier. Here is how I do that when watching content through the Chrome web browser.

How this works

What I'm basically doing is using a browser extension that can skip through HTML5 video streams. Since all of Hulu uses HTML5 video (even the commercials), you can use hotkeys to skip however many seconds you want of video. This works during the playback of the show, and during the commercials as well. I'm telling you this because if you can find a browser plugin/add-on that can skip through HTML5 video, then you can do this same thing on other browsers.

Video Speed Controller

Go over to the Chrome store or the Firefox Add-ons site, and download and install the extension called "Video Speed Controller". After installing it click on the red icon and select "Settings" button. In the "Other" section you will see "Rewind Time (s)" and "Advanced Time (s)". Set Advance Time to 14 and Rewind to 10. Feel free to play with these values as needed. These values are set to hotkeys "z" (rewind) and "x" (forward). The hotkeys are of course changeable. Also, if your going to watch your videos at regular speed, set your "Preferred Speed (x)" to something like 4. Then you can hit the "g" hotkey and speed up the commercials that way. The g hotkey is a toggle so it will go back and forth from regular speed to whatever speed you set it to. Jump out of the settings back to your browser.

Testing it

Go over to Hulu's site and pull up a show and start to watch it. You will see the video speed controller on your screen in the top left (there is a setting that removes this). After starting the show wait for your first commercial. You will see the commercial countdown timer come on the screen from Hulu. This is where you can start hitting the "x" key on the keyboard which will start the skip forward. They can cram up to 4 commercials into one slot, each with a different lengths of time. Usually the shortest commercial time I have seen is 15 seconds, hence the 14 second skip setting. If you try to hit the skip button to fast you will not allow the next commercial to start playing, and it seems to skip back to the beginning of the commercial. This seems that this work best if you let each commercial finish cleanly, and transition to the next commercial, before starting to skip through the next commercial in the slot.

After skipping through the commercials, you will notice that your show is about 1 or 2 mins ahead of the commercial skip point. You can use the "z" key on the keyboard to skip back to where the commercial started, or just use your mouse and place the cursor at the beginning of the commercial break point (the break points have lines you can clearly see).

Another way to get through these commercials is using that "g" hotkey we setup which will speed the video up the instead of trying to skip through it. If you use this approach, just hit the g key when the commercial starts and it will start playing very quickly. Watch the countdown timer on the screen. When it gets close to 0 hit the "g" key again and it will go back to regular speed. You still have to watch the commercials, but you can watch them at 4x or whatever speed you set this to. A hell of a lot faster than 1x speed.

Conclusion

I just started using this method to get through these commercials, and it is not perfect, but it does get through the commercials a whole lot faster than any other method I've seen. Other methods try to block the commercials, or skip through them with difficult to configure software, but they seem like to much trouble than this one. Of course the easiest way to not have to deal with Hulu commercials is just to pay for them to go away, which I hope you do. Until then, this should help you decide if you want to pay for that tier, and get you through those pesky commercials with the least aggravation.

Bonus

I've been told this commercial skipping method also works with the inline YouTube commercials as well.

Del.icio.us! | Digg Me! | Reddit!

Related stories

OpenVPN with Private Internet Access and port forwarding
Posted on 11-11-2017 03:50:03 UTC | Updated on 11-25-2018 22:58:57 UTC
Section: /software/openvpn/ | Permanent Link

Intro

This post will show my setup using PIA (Private Internet Access) with OpenVPN on a Linux machine. Specifically, where only certain applications will utilize the VPN and the rest of the traffic will go out the normal ISP's default route. It will also show how to access the PIA API via a shell script, to open a forwarding port for inbound traffic. Lastly, I will show how to take all of the OpenVPN and PIA information and feed it to programs like aria2c or curl. The examples below were done on Ubuntu 16.04.

Packages and PIA Setup

Go signup for a PIA account.

# Install the packages you need, example uses apt-get
sudo apt-get install openvpn curl unzip

# make dir for PIA files and scripts
sudo mkdir -p /etc/openvpn/pia
cd /etc/openvpn/pia

# grab PIA openvpn files and unzip
url='https://www.privateinternetaccess.com/openvpn/openvpn.zip'
sudo curl -o openvpn.zip $url && sudo unzip openvpn.zip

OpenVPN password file

Now that we have PIA login info lets make password file so we don't have to put in a password every time we start OpenVPN. We just need to make a file with the PIA username on one line and the PIA password on the second line. So just use you favorite text editor and do this. The file should be called "pass" and put in the "/etc/openvpn/pia" directory. The scripts that are used later depend on this file being called "pass" and put in this specific directory. An example of what the file looks like is below.

piausername
piapassword123

Change permission on this file so only root can read it

sudo chmod 600 /etc/openvpn/pia/pass

OpenVPN config file

This is the OpenVPN config file that works with PIA, and that also utilizes the scripts that will be talked about further down in the page. Use your favorite editor and copy and paste this text to a file called "pia.conf" and put in the "/etc/openvpn/pia" directory.

# PIA OpenVPN client config file 
client
dev tun

# make sure the correct protocol is used
proto udp

# use the vpn server of your choice
# only use one server at a time
# the ip addresses can change, so use dns names not ip's
# find more server names in .ovpn files
# only certain gateways support port forwarding
#remote us-east.privateinternetaccess.com 1198
#remote us-newyorkcity.privateinternetaccess.com 1198
#remote aus.privateinternetaccess.com 1198
#remote us-west.privateinternetaccess.com 1198
remote ca-toronto.privateinternetaccess.com 1198

resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-128-cbc
auth sha1

# ca.crt and pem files from openvpn.zip downloaded from pia
ca /etc/openvpn/pia/ca.rsa.2048.crt
crl-verify /etc/openvpn/pia/crl.rsa.2048.pem

tls-client
remote-cert-tls server

# path to password file so you don't have to input pass on startup
# file format is username on one line password on second line
# make it only readable by root with: chmod 600 pass
auth-user-pass /etc/openvpn/pia/pass

# this suppresses the caching of the password and user name
auth-nocache

comp-lzo
verb 1
reneg-sec 0
disable-occ

# allows the ability to run user-defined script
script-security 2

# Don't add or remove routes automatically, pass env vars to route-up
route-noexec

# run our script to make routes
route-up "/etc/openvpn/pia/openvpn-route.sh up"

OpenVPN route script

This is the script that the OpenVPN client will run at the end of startup. The magic happens in this script. Without this script OpenVPN will start the client and make the default route for the box the vpn connection. If you want that then go into the pia.conf file and comment out the "script-security 2", "route-noexec", and "route up ..." lines, and just fire up the client "sudo openvpn --config /etc/openvpn/pia/pia.conf" and your done.

If you don't want the vpn to take over your default route then let's keep going. Now that you have left those lines in the pia.conf file, the following script will be run when the client starts, and it will set up a route that does not take over the default gateway, but just adds secondary vpn gateway for programs to use. Open your favorite text editor and copy in the script below into the file "/etc/openvpn/pia/openvpn-route.sh".

#!/bin/sh
# script used by OpenVPN to setup a route on Linux.
# used in conjunction with OpenVPN config file options
# script-security 2, route-noexec, route-up 
# script also requires route table rt2
# sudo bash -c 'echo "1 rt2" >> /etc/iproute2/rt_tables

# openvpn variables passed in via env vars
rtname="rt2"
ovpnpia="/etc/openvpn/pia"
int=$dev
iplocal=$ifconfig_local
ipremote=$ifconfig_remote
gw=$route_vpn_gateway

if [ -z $int ] || [ -z $iplocal ] || [ -z $ipremote ] || [ -z $gw ]; then
  echo "No env vars found. Use this script with an OpenVPN config file "
  exit 1
fi

help() {
  echo "For setting OpenVPN routes on Linux."
  echo "Usage: $0 up or down"
}

down() {
  # delete vpn route if found
  ip route flush table $rtname
  if [ $? -eq 0 ]; then
    echo "Successfully flushed route table $rtname"
  else
    echo "Failed to flush route table $rtname"
  fi    
}

up() {
  # using OpenVPN env vars that get set when it starts, see man page
  echo "Tunnel on interface $int. File /tmp/vpnint"
  echo $int > /tmp/vpnint
  echo "Local IP is         $iplocal. File /tmp/vpnip"
  echo $iplocal > /tmp/vpnip
  echo "Remote IP is        $ipremote"
  echo "Gateway is          $gw"

  down # remove any old routes

  ip route add default via $gw dev $int table $rtname
  if [ $? -eq 0 ]; then
    echo "Successfully added default route $gw"
  else
    echo "Failed to add default route for gateway $gw"
  fi
  ip rule add from $iplocal/32 table $rtname
  if [ $? -eq 0 ]; then
    echo "Successfully added local interface 'from' rule for $iplocal"
  else
    echo "Failed to add local interface 'from' rule for $iplocal"
  fi
  ip rule add to $gw/32 table $rtname
  if [ $? -eq 0 ]; then
    echo "Successfully added local interface 'to' rule for $gw"
  else
    echo "Failed to add local interface 'to' rule for $gw"
  fi

  # PIA port forwarding, only works with certain gateways
  # No US locations, closest US is Toronto and Montreal
  # no network traffic works during exec of this script
  # things like curl hang if not backgrounded
  $ovpnpia/pia_port_fw.sh &
}

case $1 in
  "up") up;;
  "down") down;;
  *) help;;
esac

# always flush route cache 
ip route flush cache

Now run some final commands to get the script ready to work

# make the new script executable
sudo chmod 755 /etc/openvpn/pia/openvpn-route.sh

# make a new route table rt2 in linux for the script to use
# this only has to be run once before you connect the first time
sudo bash -c 'echo "1 rt2" >> /etc/iproute2/rt_tables'

PIA port forward script

The following script is run by the openvpn-route.sh script. It will contact a PIA server and tell it to open a port for incoming traffic on your vpn connection. This is so people on the internet can contact your machine through the vpn connection. Just a important note that currently only a certain list of PIA gateways support port forwarding. See the PIA support article on this for more info. Now, open your favorite text editor and copy in the script below into the file "/etc/openvpn/pia/pia_port_fw.sh".

#!/bin/bash
# Get forward port info from PIA server

client_id=$(head -n 100 /dev/urandom | sha256sum | tr -d " -")
url="http://209.222.18.222:2000/?client_id=$client_id"

echo "Making port forward request..."
sleep 1
curl --interface $(cat /tmp/vpnint) $url 2>/dev/null > /tmp/vpnportfwhttp

if [ $? -eq 0 ]; then
  port_fw=$(grep -o '[0-9]\+' /tmp/vpnportfwhttp)
  [ -f /tmp/vpnportfw ] && rm /tmp/vpnportfw
  echo $port_fw > /tmp/vpnportfw
  echo "Forwarded port is $port_fw"
  echo "Forwarded port is in file /tmp/vpnportfw"
else
  echo "Curl failed to get forwarded PIA port in some way"
fi
# make the new script executable
sudo chmod 755 /etc/openvpn/pia/pia_port_fw.sh

Starting OpenVPN

Finally we can start OpenVPN to connect with PIA. To do this run the the following command. It will keep the connection in the foreground so you can watch the output.

sudo openvpn --config /etc/openvpn/pia/pia.conf

During startup the OpenVPN client and both of the scripts we made will report on the screen data about the connection and if there were any errors. The output will look like the following example.

Fri Nov 10 19:40:50 2017 OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 22 2017
Fri Nov 10 19:40:50 2017 library versions: OpenSSL 1.0.2g  1 Mar 2016, LZO 2.08
Fri Nov 10 19:40:50 2017 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Fri Nov 10 19:40:50 2017 UDPv4 link local: [undef]
Fri Nov 10 19:40:50 2017 UDPv4 link remote: [AF_INET]172.98.67.111:1198
Fri Nov 10 19:40:50 2017 [dbacd7b38d135021a698ed95e8fec612] Peer Connection Initiated with [AF_INET]172.98.67.111:1198
Fri Nov 10 19:40:53 2017 TUN/TAP device tun0 opened
Fri Nov 10 19:40:53 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Nov 10 19:40:53 2017 /sbin/ip link set dev tun0 up mtu 1500
Fri Nov 10 19:40:53 2017 /sbin/ip addr add dev tun0 local 10.24.10.10 peer 10.24.10.9
Tunnel on interface tun0. File /tmp/vpnint
Local IP is         10.24.10.10. File /tmp/vpnip
Remote IP is        10.24.10.9
Gateway is          10.24.10.9
Successfully flushed route table rt2
Successfully added default route 10.24.10.9
Successfully added local interface 'from' rule for 10.24.10.10
Successfully added local interface 'to' rule for 10.24.10.9
Fri Nov 10 19:40:53 2017 Initialization Sequence Completed
Making port forward request...
Forwarded port is 40074
Forwarded port is in file /tmp/vpnportfw

Using the vpn connection

When the vpn started it dropped some files in /tmp. These files have the ip and port info we need to give to different programs when the startup. The scripts created the following files.

Now you can use this info when you start certain programs. Here are some examples.

# get vpn incomming port
pt=$(cat /tmp/vpnportfw)

# get vpn ip
ip=$(cat /tmp/vpnip)

# get vpn interface
int=$(cat /tmp/vpnint)

# wget a file via vpn
wget --bind-address=$ip https://ipchicken.com

# curl a file via vpn
curl --interface $int https://ipchicken.com

# ssh to server via vpn
ssh -b $ip 

# rtorrent 
/usr/bin/rtorrent -b $ip -p $pt-$pt -d /tmp

# start aria2c and background. use aria2 WebUI to connect download files
aria2c --interface=$ip --listen-port=$pt --dht-listen-port=$pt > /dev/null 2>&1 &

Final notes and warnings

If you start any programs and don't specifically bind them to the vpn interface or its ip address their connection will go out the default interface for the machine. Please remember this setup only sends specific traffic through the vpn so things like DNS requests still go through the non-vpn default gateway.

Remember only certain PIA gateways support port forwarding so if it is not working, try another PIA gateway. As of this writing, it seems that gateways that support port forwarding are ones not in the USA, like Toronto.

PIA has a Linux vpn client that you can download and use if you are into GUI's.

Del.icio.us! | Digg Me! | Reddit!

Related stories


RSS Feed RSS feed logo
About


3com
3ware
alsa
alsactl
alsamixer
amd
android
apache
areca
arm
ati
auditd
awk
badblocks
bash
bind
bios
bonnie
cable
carp
cat5
cdrom
cellphone
centos
chart
chrome
cifs
cisco
cloudera
comcast
commands
comodo
compiz-fusion
corsair
cpufreq
cpufrequtils
cpuspeed
cron
crontab
crossover
cu
cups
cvs
database
dbus
dd
dd_rescue
ddclient
debian
decimal
dhclient
dhcp
diagnostic
diskexplorer
disks
dkim
dns
dos
dovecot
drac
dsniff
dvdauthor
e-mail
echo
editor
emerald
ethernet
expect
ext3
ext4
fat32
fedora
fetchmail
fiber
filesystems
firefox
firewall
flac
flexlm
floppy
flowtools
fonts
format
freebsd
ftp
gdm
gmail
gnome
google
greasemonkey
greylisting
growisofs
grub
hacking
hadoop
harddrive
hba
hex
hfsc
html
html5
http
https
hulu
idl
ie
ilo
intel
ios
iperf
ipmi
iptables
ipv6
irix
javascript
kde
kernel
kickstart
kmail
kprinter
krecord
kubuntu
kvm
lame
ldap
linux
logfile
lp
lpq
lpr
maradns
matlab
memory
mencoder
mhdd
mkinitrd
mkisofs
moinmoin
motherboard
mouse
movemail
mplayer
multitail
mutt
myodbc
mysql
mythtv
nagios
nameserver
netflix
netflow
nginx
nic
ntfs
ntp
nvidia
odbc
openbsd
openntpd
openoffice
openssh
openssl
openvpn
opteron
parted
partimage
patch
perl
pf
pfflowd
pfsync
photorec
php
pop3
pop3s
ports
postfix
power
procmail
proftpd
proxy
pulseaudio
putty
pxe
python
qemu
r-studio
raid
recovery
redhat
router
rpc
rsync
ruby
saltstack
samba
schedule
screen
scsi
seagate
seatools
sed
sendmail
sgi
shell
siw
smtp
snort
solaris
soundcard
sox
spam
spamd
spf
sql
sqlite
squid
srs
ssh
ssh.com
ssl
su
subnet
subversion
sudo
sun
supermicro
switches
symbols
syslinux
syslog
systemrescuecd
t1
tcpip
tcpwrappers
telnet
terminal
testdisk
tftp
thttpd
thunderbird
timezone
ting
tls
tools
tr
trac
tuning
tunnel
ubuntu
unbound
vi
vpn
wget
wiki
windows
windowsxp
wireless
wpa_supplicant
x
xauth
xfree86
xfs
xinearama
xmms
youtube
zdump
zeromq
zic
zlib