Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
echp Add a new mounted volue and mset it up to be mounted on boot
echo "instructions from https://devopscube.com/mount-extra-disks-on-google-cloud/"
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
@camme
camme / aws-create-mount.sh
Last active September 6, 2019 08:12
Mount AWS external drive
#!/bin/bash
echp Add a new mounted volue and mset it up to be mounted on boot
echo "instructions from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html"
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
@camme
camme / take-screenshots.sh
Last active May 29, 2019 06:47
Take screenshots on your mac from all your monitors and save them datewise. Use it together with cron.
#!/bin/bash
set -e
EXEC_PATH=/usr/sbin/screencapture
FOLDER=~/Pictures/journal/$(date +"%Y")-w$(date +%V)/$(date +'%Y-%m-%d')
mkdir -p $FOLDER
FILES=""
for screen in screen1 screen2
# to expand /dev/xvdb check out https://github.com/hackoregon/civic-devops/blob/master/docs/HOWTO-extend-EBS-Volume-size.md
# we have used it and it works
# Expand it
sudo growpart /dev/xvda 1
# Check if the the volume had the correct size
lsblk
# Use it
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
file -s /dev/xvdb
mkfs -t ext4 /dev/xvdb
mkdir /data
@camme
camme / raspberry init
Last active October 24, 2018 21:03
First installs for a new raspberry pi
sudo apt-get update
sudo apt-get install vim tmux -y
# DOCKER
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
# Change the size of the tty instance, so we in a docker instace docker (example) can have longer rows
stty rows 50 cols 180
# Remove dangling images
docker rmi $(docker images --quiet --filter "dangling=true")
# Remove images and more from docker (https://docs.docker.com/engine/reference/commandline/system_prune/#description)
docker system prune --all
@camme
camme / super-co-op-game.js
Last active November 10, 2017 07:58
NodeConf EU 2017 - Super Co-Op Game
/*
* Game created for the awesome badges at NodeConf EU 2017
* One player will see what the other player should press and tell them that
* And the other player will see what the first player needs to press
* For every successfull level, the combination of buttons gets harder
* and you have less and less time to complete. You win or loose together!
*
* It doesnt work perfect though.
*
* To use it, you need to get the addresses of each of the two badges and put them
@camme
camme / docker-installx2.sh
Last active March 8, 2021 07:22
install docker and docker-compose
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get update
apt-get install -y \
~