{"id":42926654,"url":"https://github.com/coderefinery/clean-shell","last_synced_at":"2026-01-30T18:10:29.268Z","repository":{"id":75413599,"uuid":"217737706","full_name":"coderefinery/clean-shell","owner":"coderefinery","description":"Clean shell rc files for interactive demos using Linux namespaces","archived":false,"fork":false,"pushed_at":"2019-10-27T22:14:14.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-09-10T04:46:46.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderefinery.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-26T16:33:41.000Z","updated_at":"2019-10-27T22:14:15.000Z","dependencies_parsed_at":"2023-06-06T10:31:44.210Z","dependency_job_id":null,"html_url":"https://github.com/coderefinery/clean-shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coderefinery/clean-shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fclean-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fclean-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fclean-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fclean-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderefinery","download_url":"https://codeload.github.com/coderefinery/clean-shell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderefinery%2Fclean-shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-30T18:10:28.789Z","updated_at":"2026-01-30T18:10:29.262Z","avatar_url":"https://github.com/coderefinery.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Clean shell environment for demos\n=================================\n\nYou are giving demos on your computer, but you have heavily customized\n``.bashrc``, ``.gitconfig``, etc.  You don't want to have to move\nthese out of the way every time.  Linux namespaces to the rescue!\n``clean-shell`` creates a new mount namespace, which can replace the\nvalues of these config files with empty (or minimal) defaults.  That\nshell, and any subprocesses, will experience this clean environment.\n\nFiles cleaned by default: ``.bashrc``, ``~/.ssh/``, and\n``~/.gitconfig``, ``~/.gitignore``.  Furthermore, anything in\n``~/.clean-shell/`` will be replaced (the basename there will have\n``~/`` appended to it) also.  Non-existing original files will be\nignored (thus, you might make them in the subshell).\n\nCurrently only supports Linux, because ``unshare`` only works there.\nBut perhaps other operating systems have they own way of doing\nnamespaces?  Contributions welcome.\n\n\n\nInstallation\n------------\n``clean-shell.py`` is a single-file Python, no installation needed.\nRequires Python\u003e=3.4.\n\nDependencies: ``unshare`` (``pip install --user unshare``).  This is a\nthin wrapper around the ``unshare`` Linux system call.\n\nUnprivileged users need to be able to use namespaces.  You can make\nthis so with ``sudo bash -c 'echo 1 \u003e\n/proc/sys/kernel/unprivileged_userns_clone'``.  I'm currently unclear\nif this is only disabled in Debian-like Linuxes, or if this is always\ndisabled by default for normal users.  If it is disabled by default,\nthis really is much less useful.  Expert advice would be welcome here.\n\n\n\nInvocation\n----------\n\n* ``-v`` runs in verbose mode (print all files being altered)\n* ``--persist`` will bind-mount the original template files, so that\n  any modifications are persisted across sessions.  Perhaps useful for\n  recurring demos where you are defining your own aliases and so on.\n  May have currently-unknown interactions with the different\n  directories.\n\n\n\n\"Default\" files\n---------------\nThe first of these values is taken as the replacement value for each\nfile:\n\n- ``~/.clean-shell/BASENAME``\n- ``DIRNAME/defaults/BASENAME``, where ``DIRNAME`` is the directory\n  containing ``clean-shell.py``.\n- A empty file, or an empty directory if the path to be replaced ends\n  in ``/``.\n\n\n\nPersistent replacement files\n----------------------------\n\nSometimes, you don't want to completely reset your ``.bashrc``\netc. each time you run clean-shell.  You can handle that, too.\n\nYou can ::\n   mkdir ~/.csdefaults\n   touch ~/.csdefaults/.bashrc\n   touch ~/.csdefaults/.gitconfig\n\nThe files in ``~/.csdefault/`` are bind-mounted in, and if you use\n``--persist`` then any changes inside get persisted to this location.\n\n\n\nDevelopment and maintenance\n---------------------------\nStatus: Alpha; improvements, including breaking improvements, are\nwelcome.\n\nEditor: Richard Darst, Aalto University.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderefinery%2Fclean-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderefinery%2Fclean-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderefinery%2Fclean-shell/lists"}