Merge branch 'master' of git.devuan.org:cyteen/automate

Having commited for another machine we get the merge issues.
This commit is contained in:
Cyteen 2018-07-28 11:28:16 +01:00
commit 473ea7245a
5 changed files with 121 additions and 1 deletions

View File

@ -39,9 +39,10 @@ SALT_VERSION=2016.3
SALT_VERSION=2016.11
SALT_VERSION=2017.7
SALT_VERSION=archive/2017.7.3
SALT_VERSION=2018.3.0
SALT_VERSION=latest
REFRESHED_AT=2018-02-20
REFRESHED_AT=2018-06-10
mkdir -p /etc/apt/sources.list-available
#bash -c "wget -q -O- "http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key" | apt-key add -"

View File

@ -1,4 +1,5 @@
#!/bin/sh
# https://www.kernel.org/doc/Documentation/blockdev/zram.txt
cat > /etc/init.d/zram <<'EOF'
#!/bin/sh
### BEGIN INIT INFO

View File

@ -63,6 +63,52 @@ function sr
eval $argv > /dev/null 2>&1 &
end
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
set file $argv[1]
#if tty -s;
#then
set basefile (basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
# if [ ! -e $file ];
# then
# echo "File $file doesn't exists."
# return 1
# fi
if test -d $file
# zip directory and transfer
set zipfile ( mktemp -t transferXXX.zip )
# echo (dirname $file)
#cd (dirname $file) and echo (pwd)
zip -r -q - $file >> $zipfile
curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile
rm -f $zipfile
else
# transfer file
curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile
end
#else
# # transfer pipe
# curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile
#fi
## cat output link
cat $tmpfile
## cleanup
rm -f $tmpfile
end
alias subl "subl3"
alias vim "nvim"

View File

@ -17,6 +17,8 @@ apt-get update
apt-get install -y waterfox
update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/waterfox 201
# Themes
## Australis Dark - enabled in Firefox 53
## Has rounded corners on active tab and grey surround

View File

@ -274,5 +274,75 @@ alias ipython="_py_version"
alias jupyter="_py_version"
EOF
cat > .zsh_aliases.d/003-transfer.zsh <<'EOF'
#
# Defines transfer alias and provides easy command line file and folder sharing.
#
# Authors:
# Remco Verhoef <remco@dutchcoders.io>
#
curl --version 2>&1 > /dev/null
if [ $? -ne 0 ]; then
echo "Could not find curl."
return 1
fi
transfer() {
# check arguments
if [ $# -eq 0 ];
then
echo -e "No arguments specified.\n\nUsage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
fi
# get temporarily filename, output is written to this file show progress can be showed
tmpfile=$( mktemp -t transferXXX )
# upload stdin or file
file=$1
if tty -s;
then
basefile=$(basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
if [ ! -e $file ];
then
echo "File $file doesn't exists."
return 1
fi
if [ -d $file ];
then
# zip directory and transfer
zipfile=$( mktemp -t transferXXX.zip )
cd $(dirname $file) && zip -r -q - $(basename $file) >> $zipfile
curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile
rm -f $zipfile
else
# transfer file
curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile
fi
else
# transfer pipe
curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile
fi
# cat output link
cat $tmpfile
# log file link
APPLICATION="${0##*/}"
RIGHTNOW="$(date)"
EXPIRES="$(date -d "+14 days")"
echo -e "$(cat "$tmpfile") - uploaded $RIGHTNOW - expires $EXPIRES\n" >> ~/$APPLICATION.log
echo "\n\nSee ~/$APPLICATION.log for all transfers.\n"
# cleanup
rm -f $tmpfile
}
EOF
chown -R root.root /usr/local/share/zsh/site-functions
chmod -R 755 /usr/local/share/zsh/site-functions