• SimCityWok

    Using youtube-dl to download videos and sometimes instead of MP4 it downloads WEBM.

    @jonb suggested using webview, and if that's the case, how do I do so?

    posted in Pythonista read more
  • SimCityWok

    I am on Wifi swapping to 4G when it fails (in pasted log)

    As I said in Slack, updating dulwich as per your recommendation, seems to have done the trick.

    There was an error saying something about an error renaming to dulwich.old but restarting worked

    posted in Pythonista read more
  • SimCityWok

    @JonB said:

    sounds like you already set up ssh keys. so you should be able to set up the remote url using ssh.

    Ok, I appreciate it.
    Happy to work ssh on stash out myself, but can you tell me where to start?
    I appreciate all your help

    EDIT: Dulwich error on SSH

    [alphabear-solver]$ git remote origin ssh://git@github.com/wizardofozzie/alphabear-solver.git
    [alphabear-solver]$ git push
    Attempting to push to: ssh://git@github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/master
    
    [alphabear-solver]$ git push
    Attempting to push to: ssh://git@github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/master
    stash: <class 'dulwich.errors.HangupException'>: The remote server unexpectedly closed the connection.
    
    [alphabear-solver]$ ```

    posted in Pythonista read more
  • SimCityWok

    Dulwich version (0,12,2)

    Keychain checks out.

    gh create_key stash

    [alphabear-solver]$ gh create_key stash
    stash: <class 'github.GithubException.GithubException'>: 422 {u'documentation_url': u'https://developer.github.com/v3/users/keys/#create-a-public-key', u'message': u'Validation Failed', u'errors': [{u'field': u'key', u'message': u'key is already in use', u'code': u'custom', u'resource': u'PublicKey'}]}
    

    posted in Pythonista read more
  • SimCityWok

    [~/Documents]$ cd alphabear-solver/
    [alphabear-solver]$ git init .
    stash: <type 'exceptions.OSError'>: [Errno 17] File exists: './.git'
    
    [alphabear-solver]$ ls -h
    usage: ls.py [-h] [-1] [-a] [-l] [files [files ...]]
    
    positional arguments:
      files           files to be listed
    
    optional arguments:
      -h, --help      show this help message and exit
      -1, --one-line  List one file per line
      -a, --all       do not ignore entries starting with .
      -l, --long      use a long listing format
    [alphabear-solver]$ ls -1a
    .git
    README.md
    ab.py
    dictionary.txt
    hashdict.py
    map.json
    solver.py
    [alphabear-solver]$ rm .git
    .git: is a directory
    [alphabear-solver]$ rm -r .git
    [alphabear-solver]$ git init .
    [alphabear-solver]$ git add *
    Adding README.md
    Adding ab.py
    Adding dictionary.txt
    Adding hashdict.py
    Adding map.json
    Adding solver.py
    [alphabear-solver]$ git commit
    Commit Message: bare Pythonista commit
    Author Name: wizardofozzie
    Save this setting? [y/n]y
    Author Email: djsim4242@gmail.com
    Save this setting? [y/n]y
    628238a51a09ccbff9d389e2a27cd340d4ffe640
    [alphabear-solver]$ gh create alphabear-solver -i
    Created https://github.com/wizardofozzie/alphabear-solver
    [alphabear-solver]$ git remote origin https://github.com/wizardofozzie/alphabear-solver.git
    [alphabear-solver]$ git push
    Attempting to push to: https://github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/master
    stash: <class 'urllib2.URLError'>: <urlopen error [Errno 32] Broken pipe>
    
    [alphabear-solver]$ 
    

    Same issue

    posted in Pythonista read more
  • SimCityWok

    The fastkml library tries to import pkg_resources in the __init__.py file (CODE).

    from pkg_resources import get_distribution, DistributionNotFound
    

    Is there a workaround for this?

    posted in Pythonista read more
  • SimCityWok

    So, 1 & 2 don't work as I posted above, @JonB
    I really appreciate the help.

    Let me rephrase the problem: if I delete the GitHub repo, how can I push my folder to GitHub?

    posted in Pythonista read more
  • SimCityWok

    StaSh v0.6.13
    Tip: Send a running command to background by pressing the CZ button (Ctrl-Z on external keyboard)
    [~/Documents]$ cd alphabear-solver/
    [alphabear-solver]$ git fetch http://github.com/wizardofozzie/alphabear-solver.git
    Starting fetch, this could take a while
    stash: <class 'dulwich.errors.HangupException'>: The remote server unexpectedly closed the connection.
    
    [alphabear-solver]$ git fetch http://github.com/wizardofozzie/alphabear-solver.git
    Starting fetch, this could take a while
    stash: <class 'dulwich.errors.HangupException'>: The remote server unexpectedly closed the connection.
    
    [alphabear-solver]$ git fetch http://github.com/wizardofozzie/alphabear-solver.git
    Starting fetch, this could take a while
    stash: <class 'dulwich.errors.HangupException'>: The remote server unexpectedly closed the connection.
    
    [alphabear-solver]$ git fetch https://github.com/wizardofozzie/alphabear-solver.git
    Starting fetch, this could take a while
    Counting objects: 3, done.
    Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
    Fetch successful.  Importing refs
    imported refs/remotes/origin/master a650a1a9b804dde858f74928fc8e615a97e2f5a4
    Checking for deleted remote refs
    Fetch complete
    [alphabear-solver]$ git merge
    ______________________________
    stash: <type 'exceptions.TypeError'>: object of type 'NoneType' has no len()
    
    [alphabear-solver]$ git merge -h
    ______________________________
    usage: git merge' [--msg <msg>] [<commit>]
        git merge --abort
    
        
        merges <commit> into HEAD, or remote tracking branch if commit not specified.
        <commit> can be a local or remote ref, or an existing commit sha.
    
        merge will handle unambiguous conflicts between head and other 
        merge head, and will insert conflict markers if conflicts cannot be resolved.  
        note that the strategy used will prefer changes in the local head.  
        for instance, if HEAD deleted a section, while MERGE_HEAD modified the same 
        action, the section will be deleted from the final without indicating a conflict.
          
        be sure to commit any local changes before running merge, as files in working tree (i.e on disk) are changed, and checked in, which will probably overwrite any local uncomitted changes.
        
        note merge will not actually commit anything.  run git commit to commit a successful merge.
    
        
        --abort will remove the MERGE_HEAD and MERGE_MSG files, and will reset staging area, but wont affect files on disk.  use git reset --hard or git checkout if this is desired.
        
    
    positional arguments:
      commit      commit sha, local branch, or remote branch name to merge from
    
    optional arguments:
      -h, --help  show this help message and exit
      --msg MSG   commit message to store
      --abort     abort in progress merge attempt
    [alphabear-solver]$ git merge HEAD
    ______________________________
    Fast forwarding master to ecb4a1958ef8b1e288151822ff087f3f64894745
    [alphabear-solver]$ git commit
    Commit Message: 1
    46c9d246c69a3506ec3336357e6f9baea52caf2f
    [alphabear-solver]$ git push 
    Attempting to push to: https://github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/master
    stash: <class 'urllib2.URLError'>: <urlopen error [Errno 32] Broken pipe>
    
    [alphabear-solver]$ git fetch https://github.com/wizardofozzie/alphabear-solver.git
    Starting fetch, this could take a while
    Fetch successful.  Importing refs
    imported refs/remotes/origin/master a650a1a9b804dde858f74928fc8e615a97e2f5a4
    Checking for deleted remote refs
    Fetch complete
    [alphabear-solver]$ git branch newb origin/master
    [alphabear-solver]$ git reset newb --soft
    updating HEAD to newb
    [alphabear-solver]$ git commit
    Commit Message: 2
    71e91a769320587655bae120454d7fce88ee367b
    [alphabear-solver]$ git push
    Attempting to push to: https://github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/newb
    stash: <class 'urllib2.URLError'>: <urlopen error [Errno 32] Broken pipe>
    
    [alphabear-solver]$ git remote sshorigin ssh://git@github.com/wizardofozzie/alphabear-solver.git
    [alphabear-solver]$ ssh_keygen
    stash: ssh_keygen: command not found
    
    [alphabear-solver]$ 
    

    posted in Pythonista read more
  • SimCityWok

    [alphabear-solver]$ git push https://github.com/wizardofozzie/alphabear-solver.git
    Attempting to push to: https://github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/master
    stash: <class 'urllib2.URLError'>: <urlopen error [Errno 32] Broken pipe>
    

    I'm getting the same error trying to push the commit to GitHub irrespective of whether I use http or https.

    The weird thing is, another repo worked perfectly fine just prior to trying to push this repo (using https, http threw an error).

    Can anyone enlighten me as to what the issue here is? (Pythonista 3, latest Stash version)

    posted in Pythonista read more
  • SimCityWok

    One final query....
    If I wanted to implement this, how would I change the class code?

    def make(bits=256):
        assert bits in (256, 512)
        hashes = []
        for hsh in range(int(bits//256)):
            myhash = TouchHash()
            hashes.append(myhash)
        return "".join(hashes)
    

    posted in Pythonista read more
  • SimCityWok

    1. Seems @omz added pyscrypt for me! Thx!
    2. I'm trying to get SHA3 (KECCAK) 256bit cryptography working without luck, anyone know how I'd go about this (I'm hopeless re C wrappers)
    3. I was under the impression from Python 2.7.10 included PBKDF2 as part of hashlib but it's not available in Pythonista 3?

    posted in Pythonista read more
  • SimCityWok

    I'm curious to know this too.

    I have lost my 2FA device for my Dropbox account and the only way I can see gaining access is using the Pythonista Dropbox API. I have 2 sets of secret/keys and also the longer tokens. ±However as OP says, with the secret/key, one still needs to authenticate using login (and 2fa).

    Am I wasting my time trying to access Dropbox using Pythonista even with the long token string? I am 99% certain the API keys were activated at the time

    posted in Pythonista read more
  • SimCityWok

    @omz said:

    There should be a "Modules" section at the top that contains the site-packages folder. Is that not there?

    Indeed it is. I've been in hospital so that iOS device was running the non beta Pythonista 2.0.
    Tangentially, have you got a signup link for the Pythonista 3 beta, @omz ? I've got a lot more spare time to test it now :)
    Keep up the good work

    posted in Pythonista read more
  • SimCityWok

    site-packages exists (ie it's not .site-packages), but the sidebar shows nothing: Screenshots

    Beta 201009

    posted in Pythonista read more
  • SimCityWok

    Is there a way to have a horizontal bar fill up as the percentage rises?

    posted in Pythonista read more
  • SimCityWok

    @ccc said:

    https://forum.omz-software.com/topic/2988/dragging-finger-around-screen-to-build-entropy

    I'd forgotten I'd asked that.

    The answers this time are great though

    posted in Pythonista read more
  • SimCityWok

    How would one implement an entropy builder with a UI where you drag your finger (like Magic Text.py) until enough x,y coordinates are recorded to build a 256bit hash?
    www.bitaddress.com does so with JavaScript but it's over my head.

    Thanks!

    posted in Pythonista read more
  • SimCityWok

    How is the best way to go about using an interactive (eg dragging one's finger on the screen) method to build entropy?

    posted in Pythonista read more
  • SimCityWok

    @AtomBombed said:

    Okay, so I am not new to cryptography, but why would a hashing algorythm be insecure? Isn't it just an algorythm that changes text into a text that is always the same thing when hashed?
    I don't understand how a random piece of text can be insecure of there is no way to decrypt it other than just running through all possible pieces of text, hashing them, and seeing if they match. It just doesn't make sense to me.

    Maybe somebody could enlighten me?

    basically, there can be shortcuts, like the NSA's backdoor in the NIST curve

    AFAIK, bcrypt is old-school and has stood the test if time. Scrypt, not so much.

    posted in Pythonista read more
  • SimCityWok

    @omz

    @omz said:

    @AtomBombed I'm not an expert, but from my understanding, it's mostly about how fast the hashing algorithm is – the slower, the better. If you get your hands on a database of usernames and hashed passwords, a weak (i.e. fast) hash (like MD5) makes it a lot easier to translate a large number of these hashes back to the original passwords, simply by trying all words in a very long list. You can compute millions of MD5 hashes in seconds. But if it takes a modern computer minutes to check just a couple hundred words or so, a brute-force attack is much less feasible.

    @omz said:

    @AtomBombed I'm not an expert, but from my understanding, it's mostly about how fast the hashing algorithm is – the slower, the better.

    This is exactly why scrypt is so slow. It's designed to be RAM intensive to slow ASICs. The context which I'm familiar using scrypt is in crypto-currency, namely Litecoin, and for Bitcoin's password protected private keys (aka BIP39)

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!