Synched gist at Wed May 29 12:43:06 PDT 2024
This commit is contained in:
parent
44eeb59368
commit
f145e15d22
2 changed files with 66 additions and 0 deletions
|
@ -27,12 +27,14 @@ static void() env_particle_emit =
|
|||
if (self.target) {
|
||||
entity targetEnt = find(world, ::targetname, self.target);
|
||||
|
||||
/* TODO: if MOVETYPE_PUSH, get the absmins/maxs center */
|
||||
if (targetEnt) {
|
||||
makevectors(vectoangles(targetEnt.origin - self.origin));
|
||||
self.angles = v_forward;
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: add sound sfx? */
|
||||
pointparticles(self.sounds, self.origin, self.angles * self.speed, self.count);
|
||||
self.nextthink = time + self.wait;
|
||||
};
|
||||
|
|
64
pwm
Executable file
64
pwm
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/bin/bash
|
||||
HOME_DIR="$HOME/Library/Passwords/"
|
||||
|
||||
# gpg only
|
||||
GNUPG=1
|
||||
GNUPG_FILE="$HOME/.pwm-gnupg"
|
||||
|
||||
# help
|
||||
if [ -z "$*" ]; then
|
||||
echo "No arguments supplied. Usage:"
|
||||
echo "pwm list - list all services and accounts"
|
||||
echo "pwm example.com - list all accounts for service"
|
||||
echo "pwm example.com johndoe - decrypt and copy password to clipboard"
|
||||
exit
|
||||
fi
|
||||
|
||||
# we want the gpg type
|
||||
if [ "$GNUPG" == "1" ]; then
|
||||
if [ ! -f "$GNUPG_FILE" ]; then
|
||||
echo "Enter GNUPG Mail: (e.g. johndoe@example.com):"
|
||||
read -s GNUPG_NAME
|
||||
echo "$GNUPG_NAME" >"$GNUPG_FILE"
|
||||
else
|
||||
GNUPG_NAME=$(cat "$GNUPG_FILE")
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create passwords dir if we don't exist
|
||||
if [ ! -d "$HOME_DIR" ]; then
|
||||
mkdir -p "$HOME_DIR"
|
||||
fi
|
||||
|
||||
if [ $# == 1 ]; then
|
||||
# list password contents
|
||||
if [ $1 == "list" ]; then
|
||||
tree "$HOME_DIR"
|
||||
exit
|
||||
else
|
||||
echo "Available logins:"
|
||||
ls "$HOME_DIR/$1"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
# checking if a password exists
|
||||
if [ -f "$HOME_DIR/$1/$2" ]; then
|
||||
# put into the X clipboard
|
||||
if [ "$GNUPG" == "1" ]; then
|
||||
gpg --decrypt "$HOME_DIR/$1/$2" | xclip -selection c
|
||||
else
|
||||
cat "$HOME_DIR/$1/$2" | openssl aes-256-cbc -d -pbkdf2 -a | xclip -selection c
|
||||
fi
|
||||
else
|
||||
# encrypt this shiat
|
||||
printf "Password for $1 doesn't exist. Enter a NEW pass now:\n"
|
||||
read -s PASSPHRASE
|
||||
mkdir -p "$HOME_DIR/$1"
|
||||
|
||||
if [ "$GNUPG" == "1" ]; then
|
||||
echo "$PASSPHRASE" | gpg --encrypt --armor -r "$GNUPG_NAME" > "$HOME_DIR/$1/$2"
|
||||
else
|
||||
echo "$PASSPHRASE" | openssl enc -aes256 -pbkdf2 -base64 > "$HOME_DIR/$1/$2"
|
||||
fi
|
||||
fi
|
Loading…
Reference in a new issue