Index
home
-
directory tree
-
search
Adrian Eichelbaum
Progressbar for scripts
- just end the string with
\r
- this returns the cursor back to the beginning of line, so next print
starts there
- might have to clear the whole line, too, otherwise artefacts
remain
Python
for i in range(0, 100):
print("Processing " + str(i), end='\r')
Bash
for i in ${0..100}; do
echo -n -e "Processing $i\r"
done
Mount Virtualbox-Image on
Linux host
- mount create device nodes
vboximg-mount --image <UUID> -o allow_root <folder>
allow_root
has to be enabled in
/etc/fuse.conf
- mount node to filesystem
sudo mount <mount> <mountpoint>
Enable GPG commit signing for
Git
- create gpg key
- set username and email
git config (--global) user.email <email>
git config (--global) user.name <name>
- set the key to use
gpg -K --keyid-format SHORT
- the string on the
ssb
line, after the key type is the
keyID
git config (--global) user.signingKey <keyID>
git config (--global) commit.gpgsign 1
Add key automatically to
ssh-agent
- you can add this to your
.bashrc
- automatically add key to ssh-agent:
# $EDITOR ~/.ssh/config
Host *
AddKeysToAgent yes
Start ssh-agent
automatically
- add following to your
/etc/profile
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
- this starts the ssh-agent only once, otherwise just updates the
env