{"id":20021316,"url":"https://github.com/spitfire-666/raspberry-pi","last_synced_at":"2025-05-05T01:30:54.814Z","repository":{"id":38533987,"uuid":"388012853","full_name":"SpitFire-666/raspberry-pi","owner":"SpitFire-666","description":"Quickly setup a raspberry pi without having to search google 400 times","archived":false,"fork":false,"pushed_at":"2025-02-21T00:00:17.000Z","size":55,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T14:45:37.766Z","etag":null,"topics":["camera","motion-detection","pi-hole","pihole","raspberry-pi","raspberrypi","rpi"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpitFire-666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-21T06:09:54.000Z","updated_at":"2025-02-21T00:00:20.000Z","dependencies_parsed_at":"2024-01-12T07:55:04.937Z","dependency_job_id":null,"html_url":"https://github.com/SpitFire-666/raspberry-pi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpitFire-666%2Fraspberry-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpitFire-666%2Fraspberry-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpitFire-666%2Fraspberry-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpitFire-666%2Fraspberry-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpitFire-666","download_url":"https://codeload.github.com/SpitFire-666/raspberry-pi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252422989,"owners_count":21745526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera","motion-detection","pi-hole","pihole","raspberry-pi","raspberrypi","rpi"],"created_at":"2024-11-13T08:36:17.591Z","updated_at":"2025-05-05T01:30:54.808Z","avatar_url":"https://github.com/SpitFire-666.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](https://user-images.githubusercontent.com/38451588/126574688-051a6b6a-df2e-494d-9aef-51e4c6470857.png)\n\n\n# Installation/OS Install (Windows)\n\nDownload an OS from https://www.raspberrypi.org/software/operating-systems/#raspberry-pi-os-32-bit\n\n```\n2018-06-27-raspbian-stretch-lite.zip\n```\n\nNOTE: No need to extract the .img - Etcher will read the .zip just fine\n\nFlash using Etcher, use a USB-\u003emicroSD Card reader:\n\nhttps://github.com/balena-io/etcher\n\n### Enable SSH (assumes BOOT volume is E:\\ drive)\n```powershell\nnew-item -ItemType File -Name ssh -Path e:\\ \n```\n\n### Auto-join WiFi (update ssid and psk) (assumes BOOT volume is E:\\ drive\n```powershell\n$config = @\"\ncountry=AU\nctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev\nupdate_config=1\nnetwork={\n\tssid=\"GlobalEliteHackingCrew\"\n\tpsk=\"password\"\n\tkey_mgmt=WPA-PSK\n}\n\"@\n$config | out-file E:\\wpa_supplicant.conf\n```\nOS install done\n\n---\n\nFire up the pi 🚀\n\nFind the pi on the network - use Fing for Android/iOS\n\n---\n\n```\nssh pi@ipaddress\n```\npassword: raspberry\n        \n        \n### Set WiFi locale\n````\nsudo raspi-config nonint do_wifi_country AU\n````\n\t\n\n### Set hostname\n\t\n````bash\nsudo hostnamectl set-hostname my-raspberry-pi\t\n````\n### Set timezone\n\n````bash\nSudo raspi-config \n```` \n\n# 📷 Camera\n        \n### Enable camera\n\n3, interface options\n```bash\nsudo raspi-config\n```\n\t\n### 📸 Test camera\n\n```bash\nraspistill -o  image.jpg \n```\t\n\n### Update and upgrade\n\n```bash\nsudo apt-get update -y \u0026\u0026 sudo apt-get dist-upgrade -y\n```\n\t\n### Install Git, clone the RPi_Cam_Web_interface\n\t\n```bash\nsudo apt-get install git -y\ngit clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git \nsudo ./RPi_Cam_Web_Interface/install.sh\nsudo reboot\n```\n\n### Documentation\n\nhttp://elinux.org/RPi-Cam-Web-Interface\n\n- WEB INTERFACE \n\nCamera \u003e Motion Detection: internal\n\nCamera \u003e Buffer: 4000\n\nCamera \u003e Preview Quality: 15 \n\nQuality is the jpeg compression factor (0-100). Lower numbers give better compression at the expense of quality. It is set to 25 by default which gives pretty good compression and not too much degradation. You can try lowering it to say 15 which will significantly lower sizes further but you will start to see some degradation. Lower than this it will start to get bad.\n\nDivider is the rate at which new data is fetched. It is the video fps (default 25) divided by 'Divider'. Nominally that would mean it is trying to update at 25fps but in practice other delays lower this a bit. Increasing the divider lowers the fetch frame rate so 3 would give a nominal rate of 8fps. This will also have a dramatic effect on bandwidth. \n\n- Custom annotation \n\n![image](https://user-images.githubusercontent.com/38451588/126848389-ea5cd216-89a9-4d28-815e-20a0fa21dafa.png)\n\n```\n%h:%m:%s %a \n```\n \nUse ````%a````, this references ````/dev/shm/mjpeg/user_annotate.txt````\n\nUse a cron job to update this file automatically (eg for day of week): \n\n````sudo crontab -e````\n\n````\n  * * * * * date +\"\\%a \\%d \\%b \\%Y\"  \u003e /dev/shm/mjpeg/user_annotate.txt \n````\n \n### Change site name/page title\n\n![image](https://user-images.githubusercontent.com/38451588/126848437-fd06864b-52dd-419b-8ab5-27a60972fd2a.png)\n\n\n```bash\nsudo nano /var/www/html/config.php \n```\n\n```\ndefine('CAM_STRING',\"pi-camera\");\n```\n\n### Motion detection/Notifications \n\n \n````\nsudo nano /var/www/html/macros/motion_event.sh \n````\n \n````\nsudo \"#!/bin/bash\" \u003e\u003e  /var/www/html/macros/motion_event.sh \n````\n \nReplace Xs with your pushbullet API key\n\t\n````\n#!/bin/bash \ncurl -u XXXXXXXXXXXXXXXXXXXXXXXXX: https://api.pushbullet.com/v2/pushes -d type=note -d title=\"ALERT\" -d body='Motion detected!' \n`````\n\n````\nsudo chown www-data:www-data /var/www/html/macros/motion_event.sh \n\nsudo chmod 764 /var/www/html/macros/motion_event.sh \n````\n \n### Add buffer\nvideo_buffer in ms \n```\nsudo nano /etc/raspimjpeg \n```\n \n### Add FAVICON \n\n- Upload a favicon.ico to HOME\n\n```\nsudo cp ~/favicon.ico /var/www/\n```\n\n### Disable camera LED\nNote: need to do this interactively unless you're root\nAdd:\n```\ndisable_camera_led=1\n```\nto:\n```\n/boot/config.txt\n```\n\n### Dark/night mode GUI\n\nSystem \u003e Style \u003e Night \u003e OK\n\n## Night Vision/IR camera ##\n\n\t\n# 🍓🚫 Pi-Hole \n\n### Install Pi-Hole\n```bash\ncurl -sSL https://install.pi-hole.net | bash\n```\n\n### Disable PTR records showing up\n```bash\nsudo nano /etc/pihole/pihole-FTL.conf \nANALYZE_ONLY_A_AND_AAAA=true\n```\n\n### Add multiple domains to blacklist\n\n![image](https://user-images.githubusercontent.com/38451588/149241259-e91e49be-581c-4f35-9a1c-cc9d2e50b083.png)\n\n\n### Adlist location \n\n```bash\n/etc/pihole/adlists.list \n```\n\n### Remove password from web console (press enter for blank)\n\n```bash\npihole setpassword\n```\n\n```bash\npihole -a -p\n```\n\n### Install pihole \n````\ncurl -sSL https://install.pi-hole.net | bash\n````\n \n### Tail pihole log \n```bash\ntail -f /var/log/pihole.log\n```\n\n### Tail pihole log (show only blocked requests) \n```bash\ntail -f /var/log/pihole.log | grep 0.0.0.0\n```\n\n*improved version: \n````\ntail -f /var/log/pihole.log | cut -c 31-100 | grep 0.0.0.0 \n````\n- Show last entries added to blocklist \n````\ntail /etc/pihole/black.list \n````\n\n### Remove background image \n```bash\nsudo mv /var/www/html/admin/img/boxed-bg-dark.png /var/www/html/admin/img/boxed-bg-dark.png2\n```\n\n### Adjust HOSTS/DNS names \n````\nsudo nano /etc/hosts \n````\n### Top 50 domains (past day)\n```sh\nsqlite3 /etc/pihole/pihole-FTL.db \"SELECT domain FROM queries WHERE timestamp\u003e='$(($(date +%s) - 86400))'\" | sort | uniq -c | sort -n -r | head -50\n```\n### Blocked domains for specific client\n```sh\nsqlite3 /etc/pihole/pihole-FTL.db \"SELECT domain FROM queries WHERE client='192.168.1.1' AND (STATUS == 1 OR STATUS == 4 OR STATUS == 5 OR STATUS == 9 OR STATUS == 10 OR STATUS == 11) AND timestamp\u003e='$(($(date +%s) - 80000))'\"  | sort | uniq\n```\n\n\nsqlite3 \"/etc/pihole/pihole-FTL.db\" \"SELECT domain,count(domain) FROM queries WHERE (STATUS == 2 OR STATUS == 3) GROUP BY domain ORDER BY count(domain) DESC LIMIT 3\"\n\n### Show clients per IP\n```bash\nsqlite3 /etc/pihole/pihole-FTL.db \"SELECT domain FROM queries WHERE client='192.168.1.12' AND timestamp\u003e='$(($(date +%s) - 86400))'\" | sort | uniq -c | sort -n -r | head -10\n```\n\n### Modify default recent queries (instead of just 10 by default) \n````sudo nano /var/www/html/admin/scripts/pi-hole/js/queries.js ````\n\nFirst value is the default the page loads with.  Modify both the first and the 2nd array (eg 60):\n\n![image](https://user-images.githubusercontent.com/38451588/127440901-5a2f37d0-3b60-41c0-87ea-9a72e03d451c.png)\n \n### Setup exclusions for specific devices\nHappy wife, happy life\n\n\n# 🕹Retro-Pi #\n````\nsudo update-locale LC_ALL=\"en_GB.UTF8\" \nsudo update-locale LANGUAGE=\"en_GB:en\" \nsudo apt-get install git lsb-release -y \nsudo apt-get update \nsudo apt-get -f install \nsudo apt-get dist-upgrade \ngit clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git \n\ncd RetroPie-Setup \nchmod +x retropie_setup.sh \nsudo ./retropie_setup.sh \n````\nDownload the img \n\n\nStretch the aspect ratio \n\n \n\n# 🔌Pinout/GPIO 🔌\n\n### Zero\n![image](https://user-images.githubusercontent.com/38451588/128586000-983690dc-aba4-41ef-a676-669e12613928.png)\n\n### 2B\n![image](https://user-images.githubusercontent.com/38451588/128586020-bae1d6be-99b6-427c-a07b-d72a80d02570.png)\n\n\n# 💡 LEDs 💡\n\n\n\n# 🌡 Temperature Sensor 🌡\n\n\n### DSB18B20\n- comes in transistor or waterproof probe form\n- is a digital probe\n- -55°C to 125°C range\n- 3.0V to 5.0V operating voltage\n\n## Enable 1-Wire sensor\n\n````\nsudo raspi-config\n````\n\n\n#### Wiring\n\n![image](https://user-images.githubusercontent.com/38451588/127440391-a07df571-a7e8-408d-b965-bd270ae9b1a0.png)\n\n\n![image](https://user-images.githubusercontent.com/38451588/128584637-6f2e95ba-4ad6-4130-a032-451c5bb3ce11.png)\n\n\nDS18B20 Wiring: Red = VCC, Yellow = Data, Black = GND\n\n#### Temp readout\n````\ncat /sys/bus/w1/devices/28*/w1_slave | grep t | cut -d= -f2\n````\n\n## Stepper motor\n\n\nhttps://www.rototron.info/raspberry-pi-stepper-motor-tutorial/\n\nhttps://thinkingofpi.com/getting-started/raspberry-pi-stepper-motor/\n\n\n## Servo\n\n![image](https://user-images.githubusercontent.com/38451588/145665441-4514152d-7f88-43de-b93b-58b291b3a66d.png)\n\n\n![image](https://user-images.githubusercontent.com/38451588/145664477-f506e719-35d2-4a39-9622-b8cdead1684e.png)\n\n\n![image](https://user-images.githubusercontent.com/38451588/145664624-7e92ec48-ce2f-42b3-9ac7-af17bef66fa6.png)\n\n\n\n### Anti-Clockwise\n````python\nimport RPi.GPIO as GPIO\nimport time\n\n#print(\"doing stuff\")\n\nservoPIN = 17\nGPIO.setmode(GPIO.BCM)\nGPIO.setup(servoPIN, GPIO.OUT)\n\np = GPIO.PWM(servoPIN, 50) # GPIO 17 for PWM with 50Hz\n\np.start(2.5) # clockwise\ntime.sleep(1) # run for x seconds\np.stop()\n````\n\n\nsudo apt install python3-gpiozero -y\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspitfire-666%2Fraspberry-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspitfire-666%2Fraspberry-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspitfire-666%2Fraspberry-pi/lists"}