Do yourself a favor and login as root to save yourself some time and headaches:
$ sudo su -Install unattended-upgrades:
| # Get latest version from https://bitbucket.org/iBotPeaches/apktool/downloads | |
| export apktool_version=2.4.0 | |
| sudo -E sh -c 'wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_$apktool_version.jar -O /usr/local/bin/apktool.jar' | |
| sudo chmod +r /usr/local/bin/apktool.jar | |
| sudo sh -c 'wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -O /usr/local/bin/apktool' | |
| sudo chmod +x /usr/local/bin/apktool | |
| # To use: | |
| # apktool d TelephonyProvider.apk -o TelephonyProvider |
| ``` | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| sudo apt-get autoremove | |
| sudo apt-get autoclean | |
| ``` | |
| ------------ auto update | |
| ``` |
| # setup repo tool | |
| mkdir -p ~/bin | |
| wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin | |
| r | |
| # install dependencies | |
| sudo add-apt-repository ppa:openjdk-r/ppa | |
| sudo apt-get update | |
| sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev | |
| mkdir -p ~/aosp/pie |
| <input id=username type="text" placeholder="github username or repo link"> | |
| <button onclick="fetch(`https://api.github.com/users/${username.value.replace(/^.*com[/]([^/]*).*$/,'$1')}/events/public`).then(e=> e.json()).then(e => [...new Set([].concat.apply([],e.filter(x => x.type==='PushEvent').map(x => x.payload.commits.map(c => c.author.email)))).values()]).then(x => results.innerText = x)">GO</button> | |
| <div id=results></div> |
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o pipefail | |
| set -o nounset | |
| curl -sSL "http://s3.amazonaws.com/alexa-static/top-1m.csv.zip" | tar xvfz - -C . | |
| python - <<EOF | |
| import json |
| from itertools import chain | |
| def get_behind_chars(c, pool): | |
| behind = [] | |
| for item in pool: | |
| if c in item: | |
| chars = item[item.index(c):] | |
| [behind.append(_) for _ in chars if _ != c] | |
| return list(set(behind)) |
E: Unable to locate package [xxx]
apt-get update
apt-get install apt-file
apt-file updateInstall the CLI
sudo apt-get install python-pip
sudo pip install awscli
# upgrade
sudo pip install --upgrade awscli| zip myfiles d0 | |
| (cd f1; zip -u ../myfiles.zip d1) | |
| (cd f2/f3; zip -u ../../myfiles.zip d4) | |
| # example | |
| # zip project3.zip -j a/*.hdl | |
| # (cd b; zip -u ../project3.zip *.hdl) | |
| # The parentheses create subshells, and the effect of the cd only lasts in the subshell, | |
| # so you don't have to cd back to the original directory. |