Skip to content

Instantly share code, notes, and snippets.

View marvin-marvin's full-sized avatar
⌨️
https://gist.github.com/marvin-marvin

Marvin marvin-marvin

⌨️
https://gist.github.com/marvin-marvin
  • Braunschweig, Germany
View GitHub Profile
# find zombie process ; look for STAT Z
ps aux | grep 'Z'
pstree -p -s 93572
# 0 for SSD, 1 for HDD
lsblk -d -o name,rota
@marvin-marvin
marvin-marvin / rsync_ssh_key.sh
Created October 8, 2019 16:05
rsync with ssh key
# rsync with ssh key
rsync -avx -e "ssh -i /root/key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /root/* TARGET:/root/
@marvin-marvin
marvin-marvin / curl_put_speedtest.sh
Created October 8, 2019 16:00
curl put speedtest
# curl put speedtest
dd if=/dev/urandom of=testfile bs=200M count=1
curl -OLvkX PUT -T testfile https://s3-host/testfile | tee /dev/null
@marvin-marvin
marvin-marvin / put_logfile.sh
Created October 8, 2019 15:58
curl public put file
# curl public put file
curl -s -X PUT -T logfile.log https://s3-host/logfile.log
@marvin-marvin
marvin-marvin / check_ssh_login.sh
Last active October 8, 2019 15:55
check ssh on multiple servers from file
#check ssh login on multiple servers from file
for i in `awk '{print $3}' <STAGING>/FILE.txt`; do echo $i ; ssh -i <STAGING>/KEY -n root@$i "echo OK" ; done
@marvin-marvin
marvin-marvin / cloudflared_setup.sh
Last active September 18, 2019 11:19
cloudflared setup
# RP3
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
#RP1
wget https://hobin.ca/cloudflared/releases/2019.9.0/cloudflared_2019.9.0_arm.tar.gz
mv cloudflared_2019.9.0_arm.tar.gz cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz
sudo cp ./cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
@marvin-marvin
marvin-marvin / 50unattended-upgrades
Last active January 22, 2021 19:44
unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
„${distro_id}:${distro_codename}“;
„${distro_id}:${distro_codename}-security“;
„${distro_id}ESMApps:${distro_codename}-apps-security“;
„${distro_id}ESM:${distro_codename}-infra-security“;
};
Unattended-Upgrade::DevRelease „auto“;
Unattended-Upgrade::Remove-Unused-Kernel-Packages „true“;
Unattended-Upgrade::Remove-Unused-Dependencies „true“;
Unattended-Upgrade::SyslogEnable „true“;
@marvin-marvin
marvin-marvin / pi_setup.sh
Last active December 27, 2020 13:50
pi setup
#Setup Pi1/3 @ Raspbian Buster
# SSH
vi .ssh/authorized_keys (insert pub key)
# Packages
sudo apt-get update ; sudo apt-get upgrade ; sudo apt-get install dnsutils nmap iftop ncdu wget htop atop zip unzip slurm p7zip deltarpm unattended-upgrades python python3
sudo apt purge libreoffice*
sudo apt clean
sudo apt autoremove
@marvin-marvin
marvin-marvin / multiarch_docker_images.txt
Created June 24, 2019 15:45
multiarch docker images
### multi-arch docker images
- create Dockerfile.amd64
- create Dockerfile.arm32v7
- push to dockerhub (see previous dockerfiles projects/hooks folder)
- on dockerhub set tags to amd64 and arm32v7
- let both build finish and delete :latest tag
or local (docker login before):
docker build -t marvinmarvin/project:amd64 .