Merge branch 'master' of git.devuan.org:cyteen/automate
Having commited for another machine we get the merge issues.
This commit is contained in:
commit
473ea7245a
|
|
@ -39,9 +39,10 @@ SALT_VERSION=2016.3
|
||||||
SALT_VERSION=2016.11
|
SALT_VERSION=2016.11
|
||||||
SALT_VERSION=2017.7
|
SALT_VERSION=2017.7
|
||||||
SALT_VERSION=archive/2017.7.3
|
SALT_VERSION=archive/2017.7.3
|
||||||
|
SALT_VERSION=2018.3.0
|
||||||
SALT_VERSION=latest
|
SALT_VERSION=latest
|
||||||
|
|
||||||
REFRESHED_AT=2018-02-20
|
REFRESHED_AT=2018-06-10
|
||||||
|
|
||||||
mkdir -p /etc/apt/sources.list-available
|
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 -"
|
#bash -c "wget -q -O- "http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key" | apt-key add -"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# https://www.kernel.org/doc/Documentation/blockdev/zram.txt
|
||||||
cat > /etc/init.d/zram <<'EOF'
|
cat > /etc/init.d/zram <<'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
|
|
|
||||||
46
020_fish.sh
46
020_fish.sh
|
|
@ -63,6 +63,52 @@ function sr
|
||||||
eval $argv > /dev/null 2>&1 &
|
eval $argv > /dev/null 2>&1 &
|
||||||
end
|
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 subl "subl3"
|
||||||
alias vim "nvim"
|
alias vim "nvim"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ apt-get update
|
||||||
|
|
||||||
apt-get install -y waterfox
|
apt-get install -y waterfox
|
||||||
|
|
||||||
|
update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/waterfox 201
|
||||||
|
|
||||||
# Themes
|
# Themes
|
||||||
## Australis Dark - enabled in Firefox 53
|
## Australis Dark - enabled in Firefox 53
|
||||||
## Has rounded corners on active tab and grey surround
|
## Has rounded corners on active tab and grey surround
|
||||||
|
|
|
||||||
70
020_zsh.sh
70
020_zsh.sh
|
|
@ -274,5 +274,75 @@ alias ipython="_py_version"
|
||||||
alias jupyter="_py_version"
|
alias jupyter="_py_version"
|
||||||
EOF
|
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
|
chown -R root.root /usr/local/share/zsh/site-functions
|
||||||
chmod -R 755 /usr/local/share/zsh/site-functions
|
chmod -R 755 /usr/local/share/zsh/site-functions
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue