This file contains 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
.PHONY: today list | |
objects = $(wildcard *.in) | |
outputs := $(objects:.in=.txt) | |
setup: | |
@pip install -r requirements.txt --no-cache-dir | |
@echo 'Installed all requirements to (virtual) environment' | |
install: add compile update check |
This file contains 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
def week_num2dayname(i: int) -> str: | |
switcher = { | |
1: 'Monday', | |
2: 'Tuesday', | |
3: 'Wednesday', | |
4: 'Thursday', | |
5: 'Friday', | |
6: 'Saturday, | |
7: 'Sunday | |
} |
This file contains 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
# dictionary comprehension | |
dict_original = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5} | |
my_new_dict = {k:v for (k,v) in dict_original.items()} | |
# list comprehension | |
list_original = ['h', 'u', 'm', 'a', 'n'] | |
my_new_list = [letter+letter for letter in list_original] #[expression for item in list] | |
print(my_new_list) # ['hh', 'uu', 'mm', 'aa', 'nn'] |
This file contains 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
#! /usr/bin/env zsh | |
for f in *.wav; do sox --ignore-length $f ../$1/$f ; done |
This file contains 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 | |
echo "Assign static ip to raspberry pi:" | |
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" | |
echo "Choose unused IP adress not appear in following list:" | |
sudo arp-scan --interface=wlp4s0 --localnet | |
read -p "192.168.1." freeIP | |
rm eth0 | |
touch eth0 |
This file contains 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 | |
echo "Setup ssh:" | |
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" | |
rm ssh | |
touch ssh | |
echo "some text to enable ssh on raspbian jessie" > ssh | |
df -h | |
read -p "path to boot from sd card:" bootpath |
This file contains 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 | |
echo "Set up raspbian image on sd card:" | |
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" | |
#use df -h to discover all partitions of the sd card | |
#umount all partitions first before keep going | |
df -h | |
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" | |
echo "unmount all partitions of the sd card first" |
This file contains 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
#!/usr/bin/env bash | |
ssh_wifi() { | |
touch /Volumes/boot/ssh | |
touch wpa_supplicant.conf | |
echo "country=DE" >> wpa_supplicant.conf | |
echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev" >> wpa_supplicant.conf | |
echo "update_config=1" >> wpa_supplicant.conf | |
echo "network={" >> wpa_supplicant.conf |
This file contains 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
#!/usr/bin/env bash | |
# download and write image to sd card | |
image() { | |
read -p "Enter raspbian image download link: " link | |
if [ -n "$link" ]; then | |
echo "Download latest raspbian image from:" $link | |
else | |
link=https://downloads.raspberrypi.org/raspbian_lite_latest | |
echo "No link provided. Using default link:" $link |
This file contains 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
country=DE | |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
network={ | |
ssid="NETWORK-NAME" | |
psk="NETWORK-PASSWORD" | |
} |
NewerOlder