zsh: alias update

This commit is contained in:
Mathieu Maret 2022-05-31 16:09:54 +02:00
parent d6e7105017
commit e302ae266e

View File

@ -232,6 +232,16 @@ croot ()
fi fi
} }
syswrite ()
{
adb wait-for-device && adb root || return 1;
if [[ -n $(adb disable-verity | grep "reboot") ]]; then
echo "rebooting";
adb reboot && adb wait-for-device && adb root || return 1;
fi;
adb wait-for-device && adb remount || return 1
}
function zsh_stats() { function zsh_stats() {
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
} }
@ -275,10 +285,10 @@ sdocker (){
AOSP_ARGS=${AOSP_ARGS:--it} AOSP_ARGS=${AOSP_ARGS:--it}
img=$(docker ps | grep $1 | awk '{print $1}'); img=$(docker ps | grep $1 | awk '{print $1}');
if [ -z $img ]; then if [ -z $img ]; then
img=$(docker ps -a | grep $1 | awk '{print $1}' | head -1); img=$(docker ps -a | grep -w $1 | awk '{print $1}' | head -1);
if [ -z $img ]; then if [ -z $img ]; then
echo "Running a new container" echo "Running a new container"
docker run ${AOSP_ARGS} ${=SSH_AUTH_ARGS} -h $(hostname) -e DISPLAY=${DISPLAY} --privileged -v /dev/bus/usb:/dev/bus/usb -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v ${AOSP_IMAGE}:/aosp/Project -v $HOME/Sources/:/aosp/Sources/ -v /local/:/local/ --user="$(id -u):$(id -g)" $1 docker run ${AOSP_ARGS} ${=SSH_AUTH_ARGS} -h $(hostname) -e DISPLAY=${DISPLAY} --privileged -v /dev/bus/usb:/dev/bus/usb -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v ${AOSP_IMAGE}:/aosp/Project -v $HOME/Sources/:/aosp/Sources/ -v /local/:/local/ --user="$(id -u):$(id -g)" $1
else else
echo "Starting $img" echo "Starting $img"
docker start -i -a $img docker start -i -a $img