Skip to content

Instantly share code, notes, and snippets.

View theundefined's full-sized avatar

Andrzej Dopierała theundefined

View GitHub Profile
@theundefined
theundefined / ssl
Last active December 4, 2016 16:26
command-fu
nmap --script ssl-enum-ciphers -p 443 onet.pl -Pn
@theundefined
theundefined / sourceforge.to.github.impor.markdown
Created May 7, 2017 21:48 — forked from binarytemple/sourceforge.to.github.impor.markdown
import a sourceforge project (with full history) to github

In order to clone the TVN application from sourceforge to github I performed the following steps.

rsync -av rsync://tnv.cvs.sourceforge.net/cvsroot/tnv/* .
svn export --username=guest http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
cp ./cvs2svn-trunk/cvs2git-example.options ./cvs2git.options
vim cvs2git.options
cvs2svn-trunk/cvs2git --options=cvs2git.options --fallback-encoding utf-8
git@github.com:binarytemple/tnv.git tnv-github
git clone git@github.com:binarytemple/tnv.git tnv-github
@theundefined
theundefined / HAProxy_and_K8s.md
Created June 14, 2017 06:45 — forked from suside/HAProxy_and_K8s.md
Kubernetes + HAProxy sticky session affinity

Kubernetes + HAProxy sticky session affinity

  1. Make sure you have balance source in haproxy.
  2. Backend server section in haproxy config should have all your k8s nodes.
  3. sessionAffinity in k8s is irrelevant.
  4. Exposed k8s service need to have nodePort set and this annotation:

kubectl annotate service myService service.beta.kubernetes.io/external-traffic=OnlyLocal

This will cause internal k8s loadbalancer on nodeⁿ to route traffic only to pod on nodeⁿ. From Haproxy point of view it will look like nodeⁿ:nodePort === pod on nodeⁿ:port thus disabling k8s LB completly.

@theundefined
theundefined / gist:8ef8239a93ae51f7927b7b9052d7d3ff
Last active December 29, 2019 15:09
smogomierz home assistant configuration
- platform: mqtt
state_topic: "Smogomierz-5917206/sensor/PM10"
name: "Smogomierz PM10"
unit_of_measurement: "µg/m³"
- platform: mqtt
state_topic: "Smogomierz-5917206/sensor/PM2.5"
name: "Smogomierz PM2.5"
unit_of_measurement: "µg/m³"
- platform: mqtt
state_topic: "Smogomierz-5917206/sensor/humidity"
@theundefined
theundefined / syngeos-ha.yaml
Created December 30, 2019 17:38
configuration of syngeos for home assistant
- platform: rest
scan_interval: 900
name: syngeos 605
resource: https://api.syngeos.pl/api/public/data/device/605
value_template: " {{ address }}"
json_attributes:
- sensors
- platform: template
sensors:
syngeos_605_temperature:
wifi:
networks:
- ssid: !secret wifi_SSID
password: !secret wifi_password
priority: 2
- ssid: !secret wifi_SSID2
password: !secret wifi_password2
priority: 5
ap:
ssid: "XXX Fallback"
[23:40:11][I][wifi:193]: WiFi Connecting to 'XXX'...
[23:40:17][W][wifi_esp8266:334]: Event: Disconnected ssid='XXX' reason='Probe Request Unsuccessful'
[23:40:17][W][wifi:451]: Error while connecting to network.
[23:40:17][W][wifi:488]: Restarting WiFi adapter...
[23:40:17][I][wifi:193]: WiFi Connecting to 'XXX'...
- platform: template
sensors:
gios_944_pm25:
friendly_name: "GIOS Dąbrowskiego PM2.5"
value_template: "{{ state_attr('air_quality.gios_dabrowskiego', 'particulate_matter_2_5') |float }}"
unit_of_measurement: 'µg/m³'
gios_944_pm10:
friendly_name: "GIOS Dąbrowskiego PM10"
value_template: "{{ state_attr('air_quality.gios_dabrowskiego', 'particulate_matter_10') |float }}"
unit_of_measurement: 'µg/m³'
2020-02-11 22:21:50 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 826, in _read_ready__data_received
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 406, in data_received
self._spawn_event(xml)
File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 970, in _spawn_event
stanza = self._build_stanza(xml)
File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 951, in _build_stanza
stanza = stanza_type(self, xml)
notify:
- platform: xmpp
name: andrzejdopierala_hangouts
sender: !secret xmpp_username
password: !secret xmpp_password
recipient: !secret adopierala_jid