Skip to content

Instantly share code, notes, and snippets.

View pertoft's full-sized avatar

Per Abildgaard Toft pertoft

View GitHub Profile
@pertoft
pertoft / gist:2669cc4787e81bbf691fae58c8ee1671
Created January 27, 2022 16:08
Raspberry PI 4 PWM example
import RPi.GPIO as GPIO
from time import sleep
ledpin = 12 # PWM pin connected to LED
GPIO.setwarnings(False) #disable warnings
GPIO.setmode(GPIO.BOARD) #set pin numbering system
GPIO.setup(ledpin,GPIO.OUT)
pi_pwm = GPIO.PWM(ledpin,1000) #create PWM instance with frequency
pi_pwm.start(0) #start PWM of required Duty Cycle
@pertoft
pertoft / gist:333defaa728896b073bd22a51a7ab344
Last active June 18, 2024 01:07
Klipper Raspberry PI4 PWM Fan and DS18B20 sensor
[temperature_fan enclosure]
pin: !rpi:gpio12
#pin: rpi:pwmchip0/pwm0
control: pid
sensor_type: DS18B20
serial_no: 28-3c01e07653c6
sensor_mcu: rpi
ds18_report_time: 1.5
min_temp: 0
max_temp: 60
1) Get ANSIBLE_MODULE_ARGS:
ANSIBLE_KEEP_REMOTE_FILES=1 ansible-playbook playbooks/jira-cmdb-get.yml --vault-password-file=~/.vault_pass -vvv
2) cd /Users/pto/.ansible/tmp/ansible-tmp-1584606942.395108-45581463648279/
3)
python AnsiballZ_jira.py explode
Module expanded into:
/Users/pto/.ansible/tmp/ansible-tmp-1584606942.395108-45581463648279/debug_dir
pto:ansible-tmp-1584606942.395108-45581463648279 pto$
@pertoft
pertoft / ceph-commands.txt
Last active April 25, 2024 10:37
Ceph command cheatsheet
ceph -w
ceph health detail
ceph osd df
ceph osd find
ceph osd blocked-by
ceph osd pool ls detail
ceph osd pool get rbd all
ceph pg dump | grep pgid
ceph pg pgid
@pertoft
pertoft / .vimrc
Created June 25, 2019 13:16
.vimrc YAML support
autocmd FileType yaml setlocal ai ts=2 sw=2 et
Website with keys: http://releases.ubuntu.com/xenial/
# wget http://releases.ubuntu.com/xenial/SHA256SUMS.gpg
# wget http://releases.ubuntu.com/xenial/SHA256SUMS
[root@pto-centos pto]# gpg --keyid-format long --verify SHA256SUMS.gpg SHA256SUMS
gpg: Signature made Thu 28 Feb 2019 05:54:26 PM CET
gpg: using DSA key 46181433FBB75451
gpg: Can't check signature: No public key
gpg: Signature made Thu 28 Feb 2019 05:54:26 PM CET
Ionic server with Cordova/ Ionic native plugins support in browser
ionic serve --cordova --platform=browser
@pertoft
pertoft / gist:2efac86c5a21b93e5d77ec4ee431acca
Created January 11, 2019 13:37
Openstack Ansible interfaces configuration example
#/etc/network/interfaces
auto lo
iface lo inet loopback
dns-nameservers 212.242.40.3
dns-search cloudlab.telenor.dk
### Physical interfaces
auto enp27s0f0
iface enp27s0f0 inet manual