summary refs log tree commit diff stats
path: root/cmd
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-04-13 13:52:09 +0530
committerAndinus <andinus@nand.sh>2021-04-13 13:52:09 +0530
commit863b5301e2d2c75683086a608ebdf8f497133b94 (patch)
treefc7a07bac513abbd874102fa2e95b9dd0b00d415 /cmd
parent12fdf3632824a3ffea9f8dfc9249cb7a27e6a2c8 (diff)
downloadorion-863b5301e2d2c75683086a608ebdf8f497133b94.tar.gz
Re-initialize project for Raku port
Diffstat (limited to 'cmd')
-rw-r--r--cmd/orion/orion.go55
1 files changed, 0 insertions, 55 deletions
diff --git a/cmd/orion/orion.go b/cmd/orion/orion.go
deleted file mode 100644
index e3ce011..0000000
--- a/cmd/orion/orion.go
+++ /dev/null
@@ -1,55 +0,0 @@
-package main
-
-import (
-	"os"
-	"time"
-
-	"framagit.org/andinus/orion/hibp"
-
-	"github.com/AlecAivazis/survey/v2"
-	"github.com/AlecAivazis/survey/v2/terminal"
-	"github.com/briandowns/spinner"
-	"github.com/fatih/color"
-)
-
-func main() {
-	var pass string
-
-	prompt := &survey.Password{
-		Message: "Password:",
-		Help:    "Enter password to be checked against HIBP's Database",
-	}
-	err := survey.AskOne(prompt, &pass, survey.WithValidator(survey.Required))
-	if err == terminal.InterruptErr {
-		color.Yellow("Interrupt Received")
-		os.Exit(0)
-	} else if err != nil {
-		panic(err)
-	}
-
-	s := spinner.New(spinner.CharSets[12], 32*time.Millisecond)
-	s.Start()
-	s.Color("cyan")
-
-	// get password hash
-	hsh := hibp.GetHsh(pass)
-
-	// get list of pwned passwords
-	list, err := hibp.GetPwned(hsh)
-	if err != nil {
-		color.Yellow(err.Error())
-		os.Exit(1)
-	}
-
-	// check if pass is pwned
-	pwn, fq := hibp.ChkPwn(list, hsh)
-	s.Stop()
-
-	if pwn {
-		color.New(color.FgRed).Add(color.Bold).Println("\nPwned!")
-		color.Yellow("This password has been seen %s times before.", fq)
-		return
-	}
-
-	color.Green("\nPassword wasn't found in Have I Been Pwned's Database")
-}
nd-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/python -O
# ranger - a vim-inspired file manager for the console  (coding: utf-8)
# Copyright (C) 2009, 2010, 2011  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# =====================
# This embedded bash script can be executed by sourcing this file.
# It will cd to ranger's last location after you exit it.
# The first argument specifies the command to run ranger, the
# default is simply "ranger". (Not this file itself!)
# The other arguments are passed to ranger.
"""":
tempfile='/tmp/chosendir'
ranger="${1:-ranger}"
test -z "$1" || shift
"$ranger" --choosedir="$tempfile" "${@:-$(pwd)}"
returnvalue=$?
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
	cd "$(cat "$tempfile")"
	rm -f -- "$tempfile"
fi
return $returnvalue
""" and None

import sys
from os.path import exists, abspath

# Need to find out whether or not the flag --clean was used ASAP,
# because --clean is supposed to disable bytecode compilation
argv = sys.argv[1:sys.argv.index('--')] if '--' in sys.argv else sys.argv[1:]
sys.dont_write_bytecode = '-c' in argv or '--clean' in argv

# Don't import ./ranger when running an installed binary at /usr/.../ranger
if __file__[:4] == '/usr' and exists('ranger') and abspath('.') in sys.path:
	sys.path.remove(abspath('.'))

# Start ranger
import ranger
sys.exit(ranger.main())