
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Keeping lines (alphabetically) sorted is always a pain. Say we have a long list that we want to maintain alphabetical sorting on (for the sake of readability and maintenance).
animals = [
"alligator",
"monkey",
"zebra",
]
Now We want to add “cat” to this list...
Either:
We add macros (directives) and a tool that can parse the files for this and to sort
animals = [
# alphasort: on
"apple",
"monkey",
"zebra",
# alphasort: off
]
And yes, it works on most other files too, including comment deliminators like //
and more.
It even works with json if you do "_comment": "alphasort: on"
pip install alphasort
alphasort "./path/**/*.py"
Also recommend adding it
This project is equiped with argcomplete which you can enable via running this:
eval "$(register-python-argcomplete alphasort)"
This is inspired by other such macros like:
# fmt: off
mylist = [3, 2, 1] # Black will not touch this line.
# fmt: on
I’m honestly surprised something like this doesn’t exist. But here it is now. So, you're welcome 😁
FAQs
Sort lines within regions of a file.
We found that alphasort demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.