Skip to content

Commit

Permalink
chore: implement tools cheat (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
luismayta committed May 24, 2021
1 parent c4a12d7 commit 74031a0
Show file tree
Hide file tree
Showing 1,345 changed files with 31,896 additions and 2 deletions.
28 changes: 28 additions & 0 deletions 2to3
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 2to3

> Automated Python 2 to 3 code translation.
> More information: <https://docs.python.org/3/library/2to3.html>.

- Display changes that would be performed:

2to3 {{path/to/file.py}}

- Convert a Python 2 file to Python 3:

2to3 --write {{path/to/file.py}}

- Convert a specified Python 2 feature to Python 3:

2to3 --write {{file.py}} --fix={{raw_input}} --fix={{print}}

- Convert all features except *raw_input* the specified ones to Python 3:

2to3 --nofix={{raw_input}} --fix={{print}} example.py

- Display the list of available transformation features:

2to3 --list-fixes

- Convert an entire directory:

2to3 --output-dir={{path/to/code_python3_version}} --write-unchanged-files --nobackups {{path/to/code_python2_version}}
36 changes: 36 additions & 0 deletions 7z
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 7z

> A file archiver with high compression ratio.
> More information: <https://www.7-zip.org/>.

- Archive a file or directory:

7z a {{archived.7z}} {{path/to/file_or_directory}}

- Encrypt an existing archive (including headers):

7z a {{encrypted.7z}} -p{{password}} -mhe=on {{archived.7z}}

- Extract an existing 7z file with original directory structure:

7z x {{archived.7z}}

- Extract an archive with user-defined output path:

7z x {{archived.7z}} -o{{path/to/output}}

- Extract an archive to stdout:

7z x {{archived.7z}} -so

- Archive using a specific archive type:

7z a -t{{zip|gzip|bzip2|tar}} {{archived.7z}} {{path/to/file_or_directory}}

- List available archive types:

7z i

- List the contents of an archive file:

7z l {{archived.7z}}
25 changes: 25 additions & 0 deletions 7za
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 7za

> A file archiver with high compression ratio.
> A standalone version of 7z with support for fewer archive types.
> More information: <https://www.7-zip.org/>.

- Archive a file or directory:

7za a {{archived.7z}} {{path/to/file_or_directory}}

- Extract an existing 7z file with original directory structure:

7za x {{archived}}

- Archive using a specific archive type:

7za a -t{{zip|gzip|bzip2|tar}} {{archived}} {{path/to/file_or_directory}}

- List available archive types:

7za i

- List the contents of an archive file:

7za l {{archived}}
17 changes: 17 additions & 0 deletions 7zr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 7zr

> A file archiver with high compression ratio.
> A standalone version of 7z that only supports .7z files.
> More information: <https://www.7-zip.org/>.

- Archive a file or directory:

7zr a {{archived.7z}} {{path/to/file_or_directory}}

- Extract an existing 7z file with original directory structure:

7zr x {{archived.7z}}

- List the contents of an archive file:

7zr l {{archived.7z}}
32 changes: 32 additions & 0 deletions R
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# R

> R language interpreter.
> More information: <https://www.r-project.org>.

- Start an R interactive shell (REPL):

R

- Check R version:

R --version

- Start R in vanilla mode (i.e. a blank session that doesn't save the workspace at the end):

R --vanilla

- Execute a file:

R -f {{path/to/file.R}}

- Execute an R expression and then exit:

R -e {{expr}}

- Run R with a debugger:

R -d {{debugger}}

- Check R packages from package sources:

R CMD check {{path/to/package_source}}
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

16 changes: 16 additions & 0 deletions aapt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# aapt

> Android Asset Packaging Tool.
> Compile and package an Android app's resources.

- List files contained in an APK archive:

aapt list {{path/to/app.apk}}

- Display an app's metadata (version, permissions, etc.):

aapt dump badging {{path/to/app.apk}}

- Create a new APK archive with files from the specified directory:

aapt package -F {{path/to/app.apk}} {{path/to/directory}}
24 changes: 24 additions & 0 deletions ab
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ab

> Apache Benchmarking tool. The simplest tool to perform a load testing.
> More information: <https://httpd.apache.org/docs/2.4/programs/ab.html>.

- Execute 100 HTTP GET requests to a given URL:

ab -n {{100}} {{url}}

- Execute 100 HTTP GET requests, processing up to 10 requests concurrently, to given URL:

ab -n {{100}} -c {{10}} {{url}}

- Use keep alive:

ab -k {{url}}

- Set the maximum number of seconds to spend for benchmarking:

ab -t {{60}} {{url}}

- Execute 100 HTTP POST requests to a given URL, using a JSON payload from a file:

ab -n {{100}} -T {{application/json}} -p {{data.json}} {{url}}
24 changes: 24 additions & 0 deletions abduco
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# abduco

> Terminal session manager.
> More information: <http://www.brain-dump.org/projects/abduco/>.

- List sessions:

abduco

- Attach to a session, creating it if it doesn't exist:

abduco -A {{name}} {{bash}}

- Attach to a session with dvtm, creating it if it doesn't exist:

abduco -A {{name}}

- Detach from a session:

Ctrl + \

- Attach to a session in read-only mode:

abduco -Ar {{name}}
32 changes: 32 additions & 0 deletions ack
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ack

> A search tool like grep, optimized for programmers.
> More information: <https://beyondgrep.com/documentation/>.

- Find files containing "foo":

ack {{foo}}

- Find files of a specific type:

ack --ruby {{foo}}

- Count the total number of matches for the term "foo":

ack -ch {{foo}}

- Show the file names containing "foo" and number of matches in each file:

ack -cl {{foo}}

- Search a file for a specified string:

ack bar "{{foo bar}}" {{path/to/file}}

- Search a file for the specified regex pattern:

ack bar "{{[bB]ar \d+}}" {{path/to/file}}

- List all valid types:

ack --help-types
28 changes: 28 additions & 0 deletions act
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# act

> Execute GitHub Actions locally using Docker.
> More information: <https://github.com/nektos/act>.

- List the available actions:

act -l

- Run the default event:

act

- Run a specific event:

act {{event_type}}

- Run a specific action:

act -a {{action_id}}

- Do not actually run the actions (i.e. a dry run):

act -n

- Show verbose logs:

act -v
32 changes: 32 additions & 0 deletions adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# adb

> Android Debug Bridge: communicate with an Android emulator instance or connected Android devices.
> More information: <https://developer.android.com/studio/command-line/adb>.

- Check whether the adb server process is running and start it:

adb start-server

- Terminate the adb server process:

adb kill-server

- Start a remote shell in the target emulator/device instance:

adb shell

- Push an Android application to an emulator/device:

adb install -r {{path/to/file.apk}}

- Copy a file/directory from the target device:

adb pull {{path/to/device_file_or_directory}} {{path/to/local_destination_directory}}

- Copy a file/directory to the target device:

adb push {{path/to/local_file_or_directory}} {{path/to/device_destination_directory}}

- Get a list of connected devices:

adb devices
20 changes: 20 additions & 0 deletions adb-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# adb install

> Android Debug Bridge Install: Push packages to an Android emulator instance or connected Android devices.
> More information: <https://developer.android.com/studio/command-line/adb>.

- Push an Android application to an emulator/device:

adb install {{path/to/file.apk}}

- Reinstall an existing app, keeping its data:

adb install -r {{path/to/file.apk}}

- Grant all permissions listed in the app manifest:

adb install -g {{path/to/file.apk}}

- Quickly update an installed package by only updating the parts of the APK that changed:

adb install --fastdeploy {{path/to/file.apk}}
20 changes: 20 additions & 0 deletions adb-reverse
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# adb reverse

> Android Debug Bridge Reverse: reverse socket connections from an Android emulator instance or connected Android devices.
> More information: <https://developer.android.com/studio/command-line/adb>.

- List all reverse socket connections from emulators and devices:

adb reverse --list

- Reverse a TCP port from an emulator or device to localhost:

adb reverse tcp:{{remote_port}} tcp:{{local_port}}

- Remove a reverse socket connections from an emulator or device:

adb reverse --remove tcp:{{remote_port}}

- Remove all reverse socket connections from all emulators and devices:

adb reverse --remove-all
36 changes: 36 additions & 0 deletions adb-shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# adb shell

> Android Debug Bridge Shell: Run remote shell commands on an Android emulator instance or connected Android devices.
> More information: <https://developer.android.com/studio/command-line/adb>.

- Start a remote interactive shell on the emulator/device:

adb shell

- Get all the properties from emulator or device:

adb shell getprop

- Revert all runtime permissions to their default:

adb shell pm reset-permissions

- Revoke a dangerous permission for an application:

adb shell pm revoke {{package}} {{permission}}

- Trigger a key event:

adb shell input keyevent {{keycode}}

- Clear the data of an application on an emulator or device:

adb shell pm clear {{package}}

- Start an activity on emulator/device:

adb shell am start -n {{package}}/{{activity}}

- Start the home activity on an emulator or device:

adb shell am start -W -c android.intent.category.HOME -a android.intent.action.MAIN
Loading

0 comments on commit 74031a0

Please sign in to comment.