• Stars
    star
    179
  • Rank 212,801 (Top 5 %)
  • Language
    Shell
  • License
    MIT License
  • Created almost 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Add `sudo` command to Git Bash

win-sudo

If we open msysgit as administrator, we can use it as if we were root. However, it is often easier to open without administrator privileges.

Well, Git comes with Bash emulator and you can use *nix commands. "sudo" and "apt-get" are not such - there are tools, programs if you like which obviously you don't have.

Say no to these problems! Install win-sudo and use sudo and su as on Linux.

No more "Why must I open context menu and use a separate window?" questions.

screenshot

(disclaimer: the video is a bit outdated. You should include s/ subdirectory of the repo to PATH instead of repo root. But you better check Installation section)

Installation

curl -s https://raw.githubusercontent.com/imachug/win-sudo/master/install.sh | sh

Usage

sudo

sudo command accepts path to program and then argument list.

$ sudo pip install gevent
Collecting gevent...

You will be prompted for UAC acception (if enabled) and then a new session will be spawned as a sub-shell.

su

su accepts no arguments and runs bash shell. You can exit by typing exit.

$ su
# exit
$

Why win-sudo?

  1. No need for installation: download and use.
  2. Native: no Go, Python, etc.
  3. Open-source: no viruses.
  4. Small: easy to contribute and understand.

Known issues

winpty

Some windows commands (such as cmd) don't work fine. So:

$ sudo cmd
Microsoft Windows [Version 10.0.15036]
(c) Microsoft Corporation, 2017. All right reserved.

C:\Users\Ivanq>echo 1 <--
echo 1 <--
1

C:\Users\Ivanq>

The command is prompted twice. Though the same happens when calling just cmd, not sudo cmd.

To fix this, run sudo winpty cmd instead. (but you will have to run sudo winpty cmd //c "echo 1" instead of sudo cmd /c "echo 1")

Job support

win-sudo doesn't support jobs, so when running su or sudo bash you may get:

bash: cannot set terminal process group (7152): Operation not permitted
bash: no job control in this shell

This is harmless, so you can ignore this warning.

More Repositories

1

docker-boot

Like `execve`, but for userspace
C
116
star
2

gitcenter

An alternative to GitHub in ZeroNet
CSS
74
star
3

PDPy11

Compiler for PDP-11, written in Python
Python
38
star
4

blazingio

Ridiculously fast <iostream> re-implementation
C++
34
star
5

The-Truth-about-ZeroNet

Tutorial for ZeroNet
JavaScript
27
star
6

sslcrypto

Simple ECIES, ECDSA and AES library for Python, supporting OpenSSL and pure-Python environments
Python
26
star
7

problem-xml-specs

Specs of the problem.xml format for competitive programming judge systems
20
star
8

PijulGit

Pijul <-> Git proxy
Python
19
star
9

sunwalker-box

Isolation box developed for sunwalker system
Rust
17
star
10

ZeroMailProxy

SMTP/POP3 protocol for ZeroMail
Python
12
star
11

Kiwipedia

Wikipedia clone for ZeroNet with auto-import
JavaScript
12
star
12

ZeroDevLib

Libraries for ZeroNet
JavaScript
10
star
13

lzsa3

Even more efficient compression algorithm for PDP-11-compatible machines
C
9
star
14

zms

Zero Management System - first CMS for ZeroNet!
JavaScript
8
star
15

crossmist

Efficient and seamless cross-process communication for Rust
Rust
8
star
16

steam

React, minus the bullshit
JavaScript
8
star
17

ZeroNet-cmd-lib

Command-line tools for ZeroNet and some ZeroNet sites
Python
7
star
18

ThunderProxy

A local IRC server supporting ThunderBird to send/receive messages from ThunderWave chat (ZeroNet)
Python
6
star
19

ZeroNet-Instant-Messenger

Messenger for ZeroNet without 30-sec delay, built with P2P-messages plugin!
Vue
6
star
20

sunwalker-invoker

Rust
4
star
21

broadband

Multi-consumer UDP-based deployment
C
4
star
22

gevent-ws

A free MIT-licensed websocket library for gevent
Python
3
star
23

Can-I-Download-The-Internet

ZeroNet backuper
JavaScript
3
star
24

sunwalker-image

A set of self-contained Linux environments for building and running programs written in C++, Rust, Go, Python, and many other languages.
Python
3
star
25

BatchBuilder

Transpiler from Batch to Batch written completely in Batch
Batchfile
2
star
26

disas

A beautiful disassembler
Shell
2
star
27

clirender

CLI rendering engine for Python
Python
2
star
28

zms-themes

Zero Management System - theme & plugin list
Vue
2
star
29

zIRC

Good ol' IRC
JavaScript
2
star
30

ZeroFile

Directory indexing for ZeroNet
JavaScript
2
star
31

btccaserestore

Restore Bitcoin address from lowercase
Rust
2
star
32

ZeroPlay

Game center
Vue
2
star
33

bencode-open

Open-source MIT-licensed library for parsing and converting objects to and from bencode format
Python
2
star
34

rplace

r/place for T-Generation
Rust
2
star
35

taco

Rust
2
star
36

fcpxml-to-srt

Quickly convert .fcpxml files to .srt
JavaScript
2
star
37

Magenta

Python
2
star
38

sunwalker-conductor

Conductor for the sunwalker judge system
Rust
2
star
39

Plugin-Gopher

Gopher plugin for ZeroNet
Python
2
star
40

chronobot

A bot for linking public Telegram channels to private discussion groups
Rust
2
star
41

ZPlace

/r/place for ZeroNet
Vue
2
star
42

workerout

Library that makes any operation async
JavaScript
2
star
43

additional-chapters-of-physics

Rigid but tractable derivations of various facts in thermodynamics and special relativity
TeX
2
star
44

zms-store

Zero Management System - theme&plugin store
JavaScript
1
star
45

shell

My dynamic replacement for the default PS1. Bash.
Shell
1
star
46

lambda-calculus

Introduction to lambda calculus
HTML
1
star
47

gh-riot-widget

HTML
1
star
48

smoljudge

Smol contest management system
C++
1
star
49

pdc

C-like language compiling directly into assembler
1
star
50

obtuse-hashmap

An experimental hash table
C++
1
star
51

sunwalker-deploy

C
1
star
52

downline-0net

JavaScript
1
star
53

xcrypto

C++
1
star
54

GeniousMail

Mail service for ZeroNet
Vue
1
star
55

circuit

Circuit Simulator
JavaScript
1
star
56

talk

Talk.
1
star
57

feijoa

Efficient provably secure hash-like primitive
C++
1
star
58

nginx-blackout

HTML
1
star