Skip to content

Instantly share code, notes, and snippets.

View Actpohomoc's full-sized avatar

ACTPO HOMOC Actpohomoc

View GitHub Profile
@celly
celly / gist:c4ea2ebc2957059c138e
Created January 11, 2016 22:19
Printrbot Simple Metal start gcode
Found in this post: https://www.reddit.com/r/PrintrBot/comments/3jm8bc/start_gcode_does_not_extrudeandmove_but_the_code/
Use this to reset, center, and auto-extrudea small bit before printing.
G90 ; Explicitly force absolute positioning in case it was not reset previously.
G28 ; Home all axes.
G29 ; Auto-level the bed.
G0 X0 Y0 Z0.15 F9000 ; Move to the front-left part of the bed.
M109 S{print_temperature} ; Set and wait for extruder temperature.
G92 E0 ; Zero the extruder.
#include <ESP8266WiFi.h>
#include <Wire.h>
#include <PubSubClient.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#define wifi_ssid "YOUR_WIFI_SSID"
#define wifi_password "YOUR_WIFI_PASSWORD"
#define mqtt_server "YOUR_MQTT_SERVER_HOST"
# ...
shell_command:
clean_db: python3 /path/to/purge_sensor.py
automation:
- trigger:
platform: time
after: '03:00:00'
action:
@akshaybabloo
akshaybabloo / get_dns_records.py
Last active May 9, 2024 13:22
Printing all DNS records using DNSPython in Python 3
#!/usr/bin/env python
# -*- coding utf-8 -*-
#
# Copyright 2016 Akshay Raj Gollahalli
import dns.resolver
def get_records(domain):
"""
@whiskerz007
whiskerz007 / gist:53c6aa5d624154bacbbc54880e1e3b2a
Last active January 3, 2024 00:08
How to setup a community version of Proxmox VE 5.x-6.x
# Disable Commercial Repo
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list
apt-get update
# Add PVE Community Repo
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list
apt-get update
# Remove nag
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
@PlugFox
PlugFox / Макет.html
Last active January 27, 2021 15:11
Журнал Регистрации ➜ Телеграмм
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Журнал регистрации</title>
<style>.container{margin:0 auto;width:100%}@media only screen and (min-width:601px){.container{width:95%}}@media only screen and (min-width:993px){.container{width:90%}}.deep-orange{background-color:#ff5722!important}table,th,td{border:0}table{width:100%;display:table;border-collapse:collapse;border-spacing:0}table.striped tr{border-bottom:0}table.striped>tbody>tr:nth-child(odd){background-color:rgba(242,242,242,0.5)}table.striped>tbody>tr>td{border-radius:0}table.highlight>tbody>tr{-webkit-transition:background-color .25s ease;transition:background-color .25s ease}table.highlight>tbody>tr:hover{background-color:rgba(255,87,34,0.5)}table.centered thead tr th{text-align:center}tr{border-bottom:1px solid rgba(0,0,0,0.12)}td,th{padding:15px 5px;display:table-cell;text-align:left;vertical-align:middle;border-r
@PlugFox
PlugFox / .proxyauth
Created May 15, 2019 10:29
Установка и настройка прокси-сервера 3proxy на Debian/Ubuntu
## addusers in this format:
#user:CL:password
##see for documentation: http://www.3proxy.ru/howtoe.asp#USERS
#
# Username
MyUser:CL:MyPassword
@basoro
basoro / proxmox-proxy
Created May 25, 2019 20:45
Running Proxmox behind a single IP address
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables.
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding.
Network configuration
Here’s how it’s done:
Create a virtual interface that serves as the gateway for your VMs:
@jeffehobbs
jeffehobbs / vibration_sensor_ESP32_HA_how_to.txt
Last active March 7, 2024 09:59
Vibration Sensor for ESPHome/Home Assistant
GOAL: Send a push notification after the (vibrations from the) dryer cycle has completely stopped.
USING:
* Inexpensive hardware (see below)
* ESPhome (http://esphome.io) for chip firmware
* Home Assistant (http://hass.io) for sensor state machine and push notification.
---
SHOPPING LIST:
@whiskerz007
whiskerz007 / gist:9d146fcb99e6db1cfb9d21bd7287f5ed
Created August 7, 2019 10:12
Create a Windows Scheduled Task to synchronize the clock when the internet is established
C:\WINDOWS\System32\schtasks.exe /CREATE /RU "NT AUTHORITY\LOCAL SERVICE" /SC ONEVENT /EC "Microsoft-Windows-NetworkProfile/Operational" /MO "*[System[Provider[@Name='Microsoft-Windows-NetworkProfile'] and EventID=10000]]" /TN "Update Time When Connected to Internet" /TR "C:\WINDOWS\System32\w32tm.exe /resync /force"