From 08bb89b9ace88818e13c61d17f1de53a51938a32 Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Mon, 25 Jul 2022 01:55:07 -0400 Subject: [PATCH 1/2] [F] Fix git switch --- scripts/python/git-switch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/python/git-switch.py b/scripts/python/git-switch.py index 7bd4477..53c444e 100755 --- a/scripts/python/git-switch.py +++ b/scripts/python/git-switch.py @@ -10,6 +10,8 @@ print(f'Current url: {url}') if url.startswith('http'): print('> HTTP git remote detected, switching to SSH') repo = url.split('github.com/')[-1] + if repo.endswith('.git'): + repo = repo[:-4] print(f'> Repo detected: {repo}') new_url = f'git@github.com:{repo}.git' From 2548fa8ec45407c519325c2f46b62496c140a5b5 Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Mon, 1 Aug 2022 12:26:39 -0400 Subject: [PATCH 2/2] [U] Scripts --- config-sync/ssh-config | 4 ++++ scripts/bin/deploy-npm | 10 ++++++++++ scripts/bin/deploy-pypi | 20 +++++++++++++++++++ .../{python/git-switch.py => bin/git-switch} | 0 scripts/zshrc.sh | 5 ++--- 5 files changed, 36 insertions(+), 3 deletions(-) create mode 100755 scripts/bin/deploy-npm create mode 100755 scripts/bin/deploy-pypi rename scripts/{python/git-switch.py => bin/git-switch} (100%) diff --git a/config-sync/ssh-config b/config-sync/ssh-config index 6dce605..e8acf86 100644 --- a/config-sync/ssh-config +++ b/config-sync/ssh-config @@ -1,3 +1,7 @@ +Host localhost + HostName localhost + User root + Host home HostName home.hydev.org Port 10022 diff --git a/scripts/bin/deploy-npm b/scripts/bin/deploy-npm new file mode 100755 index 0000000..12eda6f --- /dev/null +++ b/scripts/bin/deploy-npm @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Stop on error +set -e + +# Check if package.json is present +[[ ! -f "package.json" ]] && echo "package.json not found, please make sure you're in the correct path" && exit -1 + +# Deploy npm +npm publish \ No newline at end of file diff --git a/scripts/bin/deploy-pypi b/scripts/bin/deploy-pypi new file mode 100755 index 0000000..b62bb6c --- /dev/null +++ b/scripts/bin/deploy-pypi @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# Stop on error +set -e + +# Check if setup.py is present +[[ ! -f "setup.py" ]] && echo "Setup.py not found, please make sure you're in the correct path" && exit -1 + +# Remove old build +rm -rf dist +rm -rf build + +# Build +python setup.py sdist bdist_wheel + +# Check built files +twine check dist/* + +# Upload +twine upload dist/* \ No newline at end of file diff --git a/scripts/python/git-switch.py b/scripts/bin/git-switch similarity index 100% rename from scripts/python/git-switch.py rename to scripts/bin/git-switch diff --git a/scripts/zshrc.sh b/scripts/zshrc.sh index 65fcd74..b067a1e 100755 --- a/scripts/zshrc.sh +++ b/scripts/zshrc.sh @@ -36,9 +36,8 @@ alias dc='docker-compose' alias vsucode='sudo code --user-data-dir /root/.config/vscode --no-sandbox' alias gpu-temp='while sleep 1; do clear; gpustat; done' alias cpu-temp='s-tui' -# alias mine='nuxhashd --show-mining' alias mine='sudo lolminer --algo ETHASH --pool stratum+ssl://daggerhashimoto.auto.nicehash.com:443 --user=3AcCeSHHwWJRf945iKCbxZ8cjUvy7Tmg3g.Daisy-lol' -# alias mine-zel='sudo lolminer --algo ZEL --pers BgoldPoW --pool stratum+tcp://zelhash.auto.nicehash.com:9200 --user=3AcCeSHHwWJRf945iKCbxZ8cjUvy7Tmg3g.Daisy-lol' +alias mine-zel='sudo lolminer --algo ZEL --pers BgoldPoW --pool stratum+tcp://zelhash.auto.nicehash.com:9200 --user=3AcCeSHHwWJRf945iKCbxZ8cjUvy7Tmg3g.Daisy-lol' alias mount-external='sudo mount -t cifs //192.168.2.1/external /smb/external -o rw,user=azalea,uid=1000,gid=1000,pass=' alias ds-clean="sudo find ./ -name \".DS_Store\" -depth -exec rm {} \;" @@ -46,7 +45,7 @@ alias ds-clean="sudo find ./ -name \".DS_Store\" -depth -exec rm {} \;" alias catt="echo 🐱" alias update-ssh-keys="curl -L https://github.com/Hykilpikonna.keys > ~/.ssh/authorized_keys" -export PATH="$SCR/python:$PATH" +export PATH="$SCR/bin:$PATH" # Lisp wrapper lisp() {