Skip to content

Instantly share code, notes, and snippets.

@malefs
malefs / git_info.txt
Last active May 2, 2023 17:27
git howtos
Repo anlegen auf gitserver
mkdir name.git
cd name.git
git --bare init
git init
chown -R git:git name.git/
---------------------------------------------
lokales vorhandenes repo diesem zuweisen
@malefs
malefs / message.hpp
Created April 18, 2019 10:26 — forked from mashiro/message.hpp
zeromq + msgpack
#include <string>
#include <ctime>
#include <msgpack.hpp>
struct message
{
std::string tag;
std::time_t time;
std::string text;
MSGPACK_DEFINE(tag, time, text);
@malefs
malefs / ffmpeg-mjpeg.sh
Last active March 28, 2019 07:59 — forked from indiejoseph/ffmpeg-mjpeg.sh
ffmpeg record mjpg-streamer
# capture mjpegstream -r Framerate
ffmpeg -f mjpeg -r 2 -i "http://127.0.0.1/rpicam/cam_pic_new.php?" -r 2 ./video.avi
@malefs
malefs / freetz.info
Last active September 10, 2022 11:26
freetz 7412 install
Quelle:https://www.ip-forum.eu/howto-fritz-box-firmware-images-auch-unsignierte-ueber-den-bootloader-installieren-577#p3861
freetz-trunk/tools/yf/eva_tools$ ./image2ram < ~/programming/freetz-trunk/images/7412_06.85-freetz-devel-15014.de_20181209-120438.image > ~/programming/freetz-trunk/images/7412firmware.image.in-memory
eval $(sudo ./eva_discover INTERFACE=eth0 FROM=192.168.178.20 TO=192.168.178.1 BLIP=1 HOLD=0); echo "EVA_FOUND=$EVA_FOUND"; echo "EVA_IP=$EVA_IP"; [ "$EVA_FOUND" = "1" ] && ./eva_to_memory ~/programming/freetz-trunk/images/7412firmware.image.in-memory $EVA_IP
http://fritz.box:81/cgi-bin/passwd.cgi
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHEdWhOZo8ZgGXnWxol8EtJ4LfMdqozm3PAd85Lx0tMbYdJqF1wJnsSyEmG11EtSiwDDcRmRYNukmuJDKHOLKpVd5YqCA/rGrDw9EBExkg1Hk7Q+9m2TX1HnfTNu5PF4464E7BktADmnmFJWFmbC1jI9BNtyabocmioyugKm1m9w5vSfQP1ttyxwYux/WveZGHmFfKbor9F2WmrdusLq23Hj5rhsokQcySXTYlfQaq9oxxFeW0TDpiEuREx0DzwhEkGrfYMGS2O44xKmsG/+WhuX963NtNJsOg/kHEI37qQswol2dGHFi4NiA9+J3lSJkRWaleYGrDf7HaI2kK2EF1X0CdgMsLWhJRIeAQ4U
@malefs
malefs / micropython_ESP8266_32
Last active November 2, 2018 23:19
micropython circuitpython esp8266 esp32
pip install esptool
esptool.py --port com14 erase_flash
esptool.py --port com14 --baud 460800 write_flash --flash_size=detect 0 adafruit-circuitpython-feather_huzzah-3.0.1.bin
esptool.py --port com14 --baud 115200 write_flash --verify --flash_mode=qio --flash_size=detect 0 adafruit-circuitpython-feather_huzzah-3.0.1.bin
Firmware:
http://micropython.org/download#esp8266
https://github.com/adafruit/circuitpython/releases
@malefs
malefs / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Created October 15, 2018 15:31 — forked from IamAdiSri/Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H python ./get-pip.py
Installing pip also installs Python3
To run Python3
$ python3
Install pip3 by just executing the same file as in the step above, but this time using Python3
$ sudo -H python3 ./get-pip.py
@malefs
malefs / mongo_test_restaurants.py
Created October 4, 2018 05:54 — forked from vinovator/mongo_test_restaurants.py
Script to interact with MongoDB using pymongo driver
# mongo_test_restaurants.py
# Python 2.7.6
"""
Test script to connect to MongoDB collections using pymongo library
Connects to an already imported connection named "restaurants"
source - https://docs.mongodb.org/getting-started/python/
"""
from pymongo import MongoClient, ASCENDING, DESCENDING
@malefs
malefs / gist:a37cc9744ddd97305f3cd2579c25aa10
Created October 4, 2018 05:52 — forked from ealogar/gist:6698348
tutorial of pymongo: - Recommendations of use - Examples - Useful readings
#-*- coding: utf-8 -*-
u"""
MOD: pymongo
"""
import pymongo
#===============================================================================
# -*- coding: utf-8 -*-
import paho.mqtt.client as mqtt
import time
import json
import base64
def on_connect(client, userdata, flags, rc):
print("Connected with result code " + str(rc))
dev_eui = 'ZZZZZ'