- Download latest Raspbian
- Use Etcher to flash SD-card
touch ssh
in/boot
before putting the SD-card in the Raspberry Pi- find out the IP of Raspberry and ssh into it
ssh-copy-id
and change password- Setup auto mounting of disk
ls -l /dev/disk/by-uuid/
and copy the UUID- Create the folder to mount to
sudo mkdir /media/usb && sudo chown -R pi:pi /media/usb
- Permanent mounting with
sudo nano /etc/fstab
and add this line at bottom:UUID=PUT_THE_UUID_HERE /media/usb ext4 defaults,noatime 0 1
- Install
syncthing
with:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(1, 101): | |
if i%15 == 0: | |
print('FizzBuzz') | |
elif i%3 == 0: | |
print('Fizz') | |
elif i%5 == 0: | |
print('Buzz') | |
else: | |
print(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache | |
@lru_cache() | |
def fib(n): | |
if n in [0, 1]: | |
return 1 | |
else: | |
return fib(n-1) + fib(n-2) | |
fib(10) |
- download the image here
- put the rasbian stretch image on an SD-card with Etcher
- put a
ssh
file in the/boot
folder by doing:cd /Volumes/boot/
andtouch ssh
- connect the Raspberry Pi to your router and ssh into it
- run
ssh-copy-id pi@<ip here>
- change password with
passwd
- Expand file system, change hostname, set timezone, change Wi-Fi country, and set locale in
sudo raspi-config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# run this script with: | |
# nohup ~/Work/install_conda.sh > /dev/null 2>&1 & | |
export CONDA_DIR="${HOME}/miniconda3" | |
# Create a temporary folder | |
mkdir -p ~/tmp && cd ~/tmp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table border="0" width="300" cellspacing="0" cellpadding="0"> | |
<tbody> | |
<tr> | |
<td> | |
<table border="0" cellspacing="0" cellpadding="0"> | |
<tbody> | |
<tr> | |
<td style="padding: 0 8px 0 0" valign="top" width="100"><img style="width: 100px; border-radius: 10%" src="http://nijholt.biz/stuff/me.png" alt="" width="100" /></td> | |
<td style="font-size: 1em; padding: 0 15px 0 8px" valign="top"> | |
<table style="line-height: 1.4; font-family: Verdana, Geneva, sans-serif; font-size: 70%; color: #000001" border="0" cellspacing="0" cellpadding="0"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nbviewer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho nbviewer /tmp/test.ipynb\ncat /tmp/test.ipynb | nbviewer test.ipynb"; return 1; fi | |
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; (cat $tmpfile | sed s@https://@https://nbviewer.jupyter.org/urls/@g); rm -f $tmpfile; echo ""; } |
Create slurm_jupyter.sbatch
#!/bin/bash
#SBATCH --nodes 1
#SBATCH --ntasks-per-node 20
#SBATCH --exclusive
#SBATCH --time 4:00:00
#SBATCH --mem-per-cpu 4000
#SBATCH --job-name jupyter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Common functions for doing stuff.""" | |
from copy import copy | |
from datetime import timedelta | |
import functools | |
from glob import glob | |
from itertools import product | |
import os | |
import time | |
import subprocess |