Skip to content

Instantly share code, notes, and snippets.

View annttu's full-sized avatar

Antti Jaakkola annttu

View GitHub Profile
@annttu
annttu / .vimrc
Created July 14, 2021 06:41
vimrc
syntax on
set nomodeline
set cursorline
set list listchars=tab:»·,trail:¤,nbsp:␣
" Show always at least 4 lines below/above
set scrolloff=4
"set cursorcolumn
hi CursorLine cterm=underline ctermbg=NONE
" use spaces instead of tabs
autocmd FileType python set ts=4 sw=4 expandtab
@annttu
annttu / logpinger.sh
Created July 11, 2019 10:40
Logpinger
#!/bin/bash
test -z "$1" && exit 1
ping -OW 1 "$1" 2>&1 | while read line; do echo `date` - $line; done |tee -a "$1".log
@annttu
annttu / vammassh
Last active October 11, 2021 12:28
Vammassh
#!/bin/bash
OPTS=""
OPTS="$OPTS -o HostKeyAlgorithms=+ssh-rsa,ssh-dss "
OPTS="$OPTS -o Ciphers=+aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc "
OPTS="$OPTS -o Macs=+hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 "
OPTS="$OPTS -o KexAlgorithms=+diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 "
OPTS="$OPTS -o PubkeyAcceptedKeyTypes=+ssh-rsa,ssh-dss "
# OPTS="$OPTS -o IdentityFile=none -o IdentityAgent=none " # Enable if you don't want to pass ssh keys or agent
unset SSH_AUTH_SOCK
@annttu
annttu / setup.sh
Last active March 29, 2024 13:02
Debian PXE install
#!/bin/bash
# Setup Debian PXEinstall environment
export MYIP=10.66.6.1 # TODO: Setup this
export MYINTERFACE=$(netstat -ie | grep -B1 "$MYIP" | head -n1 | awk '{print $1}')
if [ -z "$MYINTERFACE" ]
then
echo "Setup ip $MYIP first"
@annttu
annttu / mysql_backup.sh
Created September 22, 2015 15:35
mysql backup script
#!/bin/bash
# Path to directory where backups should be stored.
DIR="path/to/mysql_backup"
mysqldump -A |gzip -c - > ${DIR}/`date +%Y-%m-%d`.sql.gz
if [ "`date +%d`" == "01" ]
then
cp ${DIR}/`date +%Y-%m-%d`.sql.gz ${DIR}/month_`date +%Y-%m`.sql.gz
touch ${DIR}/month_*.sql.gz
@annttu
annttu / gist:10542940
Created April 12, 2014 15:59
Keybase proof
### Keybase proof
I hereby claim:
* I am annttu on github.
* I am annttu (https://keybase.io/annttu) on keybase.
* I have a public key whose fingerprint is 2123 BD0A F25D 8B6D 923D 9C95 36BA CE45 C579 CB50
To claim this, I am signing this object: