adb devices
adb shell
pm list packages -f
pm uninstall -k --user 0 com.oneplus.opbugreport
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import SimpleHTTPServer | |
import SocketServer | |
PORT = 8000 | |
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
self.send_head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def download_file_from_google_drive(id, destination): | |
def get_confirm_token(response): | |
for key, value in response.cookies.items(): | |
if key.startswith('download_warning'): | |
return value | |
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
from email.mime.text import MIMEText | |
msg = MIMEText('Loved your locker room talk!') | |
msg['Subject'] = 'Not so confidential stuff here' | |
msg['From'] = 'pladimir.vutin@russia.com' | |
msg['To'] = 'tonald.dump@us.com' | |
s = smtplib.SMTP('smtp.sendgrid.net', 465) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net/http" | |
import "net/url" | |
import "io" | |
import "os" | |
import "mime" | |
import "path" | |
import "fmt" | |
import "flag" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
import BaseHTTPServer | |
def test(HandlerClass=SimpleHTTPRequestHandler, | |
ServerClass=BaseHTTPServer.HTTPServer): | |
protocol = "HTTP/1.0" | |
host = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Add this function to cronjob | |
# This will it every 2 minutes: "2 * * * * /path/to/script" | |
# Define a function to show the notification on MacOS | |
function notify() { | |
if [ $# -eq 3 ]; then | |
osascript -e "display notification \"$2\" with title \"$1\" sound name \"$3\"" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################ | |
# I did something terribly wrong, please tell me git has a magic time machine! | |
git reflog | |
# You will see a list of every thing you've done in git, across all branches! | |
# Each one has an index HEAD@{index} | |
# Find the one before you broke everything | |
git reset HEAD@{index} | |
# Magic time machine | |
################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SEDMAGIC='s;/[^/]*;|____;g;s;____|; |;g' | |
for f in $(find . -name "*.go" -print); do | |
line=$(head -n 1 "$f"); | |
[[ ! -z "$line" ]] && [[ "$line" =~ ^package[\ ][a-z_]+$ ]] && is_package=true | |
if [ "$is_package" = true ]; then | |
tree=$(echo "$f" | sed -e "$SEDMAGIC"); | |
package_name=$(echo $line | cut -d' ' -f 2); | |
echo "$tree $package_name" | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check current bash version | |
bash --version | |
# Install unofficial version of bash | |
brew install bash | |
# List bash binaries | |
which -a bash | |
# Whitelist new bash shell |
OlderNewer