Skip to content

Instantly share code, notes, and snippets.

@realmahdi
realmahdi / eapk.txt
Last active June 4, 2019 10:57
get an apk file from an Android device
adb shell 'cat `pm path [your_package_name] | cut -d':' -f2`' > [your_destination_path]
@realmahdi
realmahdi / high_quality_media_recorder.kt
Created October 28, 2018 19:31 — forked from abbasnaqdi/high_quality_media_recorder.kt
The MediaRecorder formula is compatible with various Android versions and high-quality audio recorder, Tested on Android 21 to 28
// The MediaRecorder formula is compatible with various Android versions and high-quality audio recorder,
// Tested on Android 21 to 28
mediaRecorder = MediaRecorder().apply {
setAudioSource(MediaRecorder.AudioSource.MIC)
setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
setAudioEncoder(MediaRecorder.AudioEncoder.HE_AAC)
setOutputFile(filePath)
setAudioEncodingBitRate(320000)
@realmahdi
realmahdi / aria.sh
Created October 16, 2018 14:37 — forked from amrza/aria.sh
Download List of files with aria2
#!/bin/sh
aria2c --dir=./ --input-file=urls.txt --max-concurrent-downloads=1 --connect-timeout=60 --max-connection-per-server=16 --split=16 --min-split-size=1M --human-readable=true --download-result=full --file-allocation=none
date
# Now create this file in the same directory and paste all urls in it: urls.txt
@realmahdi
realmahdi / update all PIP package
Created May 13, 2018 08:40
simple script for update all pip package
import os
os.system("pip freeze > /tmp/list.txt")
file = open('/tmp/list.txt')
os.system("pip install --upgrade pip")
for i in file:
x = i.split('==')[0]
cmd = "pip install --upgrade "+x
os.system(cmd)
os.system("pip freeze > /tmp/Nlist.txt")
print("Done")
@realmahdi
realmahdi / pm_install.sh
Last active May 13, 2018 08:37 — forked from punkdata/pm_install.sh
Postman Install Ubuntu 18.04 LTS
#!/bin/sh
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman