• Stars
    star
    183
  • Rank 210,154 (Top 5 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 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
137
star
2

gitcenter

An alternative to GitHub in ZeroNet
CSS
77
star
3

blazingio

Ridiculously fast <iostream> re-implementation
C++
42
star
4

PDPy11

Compiler for PDP-11, written in Python
Python
37
star
5

The-Truth-about-ZeroNet

Tutorial for ZeroNet
JavaScript
29
star
6

sslcrypto

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

crossmist

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

site

My website
HTML
22
star
9

sunwalker-box

Isolation box developed for sunwalker system
Rust
22
star
10

problem-xml-specs

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

PijulGit

Pijul <-> Git proxy
Python
19
star
12

ZeroMailProxy

SMTP/POP3 protocol for ZeroMail
Python
12
star
13

Kiwipedia

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

lzsa3

Even more efficient compression algorithm for PDP-11-compatible machines
C
10
star
15

ZeroDevLib

Libraries for ZeroNet
JavaScript
10
star
16

steam

React, minus the bullshit
JavaScript
10
star
17

minecraft-badapple

Bad Apple!! in Minecraft
Rust
8
star
18

disas

A beautiful disassembler
Shell
8
star
19

zms

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

ZeroNet-cmd-lib

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

ThunderProxy

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

broadband

Multi-consumer UDP-based deployment
C
6
star
23

ZeroNet-Instant-Messenger

Messenger for ZeroNet without 30-sec delay, built with P2P-messages plugin!
Vue
6
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
5
star
25

sunwalker-invoker

Rust
4
star
26

additional-chapters-of-physics

Rigid but tractable derivations of various facts in thermodynamics and special relativity
TeX
4
star
27

btccaserestore

Restore Bitcoin address from lowercase
Rust
3
star
28

gevent-ws

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

Can-I-Download-The-Internet

ZeroNet backuper
JavaScript
3
star
30

BatchBuilder

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

clirender

CLI rendering engine for Python
Python
2
star
32

zms-themes

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

zIRC

Good ol' IRC
JavaScript
2
star
34

ZeroFile

Directory indexing for ZeroNet
JavaScript
2
star
35

ZeroPlay

Game center
Vue
2
star
36

bencode-open

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

rplace

r/place for T-Generation
Rust
2
star
38

taco

Rust
2
star
39

fcpxml-to-srt

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

Magenta

Python
2
star
41

Plugin-Gopher

Gopher plugin for ZeroNet
Python
2
star
42

sunwalker-conductor

Conductor for the sunwalker judge system
Rust
2
star
43

chronobot

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

ZPlace

/r/place for ZeroNet
Vue
2
star
45

workerout

Library that makes any operation async
JavaScript
2
star
46

feijoa

Efficient provably secure hash-like primitive
C++
2
star
47

zms-store

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

shell

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

lambda-calculus

Introduction to lambda calculus
HTML
1
star
50

gh-riot-widget

HTML
1
star
51

smoljudge

Smol contest management system
C++
1
star
52

pdc

C-like language compiling directly into assembler
1
star
53

obtuse-hashmap

An experimental hash table
C++
1
star
54

sunwalker-deploy

C
1
star
55

downline-0net

JavaScript
1
star
56

xcrypto

C++
1
star
57

GeniousMail

Mail service for ZeroNet
Vue
1
star
58

circuit

Circuit Simulator
JavaScript
1
star
59

talk

Talk.
1
star
60

nginx-blackout

HTML
1
star