Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
Play a file continously, and exit gracefully on signal
Based on https://github.com/steveway/papagayo-ng/blob/working_vol/SoundPlayer.py
@author Guy Sheffer (GuySoft) <guysoft at gmail dot com>
"""
import signal
import time
@guysoft
guysoft / reminders.py
Created December 31, 2018 10:05
Get google calendar reminder api
#!/usr/bin/env python3
## How to use
##
## 1. enter http://calendar.google.com/
## 2. press ctrl+alt+J in chrome to ender the developer tools and select the "network" tab. In firefox ctrl+shift+elif
## 3. refresh and make sure "reminders" is checked.
## 4. search for "reminder" in url filters and look for a url of the form: https://reminders-pa.clients6.google.com/v1internalOP/reminders/list?key=
## 5. Copy the key and the followind headers and cookies below:
## For mor info see: https://issuetracker.google.com/issues/36760283
@guysoft
guysoft / timezone_bot.y
Created August 10, 2017 14:51
A telegram bot that lets you pick a timezone
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A telegram bot that lets you pick and a timezone
@author Guy Sheffer (GuySoft) <guysoft at gmail dot com>
"""
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import ConversationHandler, RegexHandler
'''
MicroPython pH sensor Eduponics mini - demo
https://github.com/STEMinds/micropython-eduponics
MIT License
Copyright (c) 2020 STEMinds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
SteamVR System Report created Mon Aug 23 14:59:08 2021
<Report>
SteamVR Version: 1.19.7 (1629236071)
SteamVR Date: 2021-08-18
Steam: Public
Steam Branch: beta
Steam AppID: 250820
Tracking: lighthouse
OS: Linux version 5.13.5-051305-generic (kernel@kathleen) (gcc (Ubuntu 10.3.0-6ubuntu1) 10.3.0, GNU ld (GNU Binutils for Ubuntu) 2.37) #202107251335 SMP Sun Jul 25 13:38:50 UTC 2021
@guysoft
guysoft / scrape.py
Created August 10, 2020 21:36
Scrape all electronics recycle places in Israel
#!/usr/bin/env python3
import json
from urllib.request import urlopen
link = "https://mai.org.il/weee_map_israel/"
f = urlopen(link)
data = f.read().decode()
# If you want to try a cache, uncomment this
@guysoft
guysoft / rootsystem_backup.lst
Created October 20, 2019 13:06
Nightly snapshot script, needs an email script at /home/guy/stuff/scripts/email
# Include
+ /dev/console
+ /dev/initctl
+ /dev/null
+ /dev/zero
# Exclude
- /dev/*
- /run/*
- /proc/*
@guysoft
guysoft / kivyconsole.py
Last active September 20, 2019 12:29 — forked from aron-bordin/kivyconsole.py
Initial Python/Kivy Terminal Emulator (It's just a performance test. You can use this sample to write your own terminal emulator)
from kivy.base import runTouchApp
from kivy.event import EventDispatcher
from kivy.lang import Builder
from kivy.properties import ObjectProperty, ListProperty, StringProperty, \
NumericProperty, Clock, partial
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.textinput import TextInput
import os
import subprocess
#!/bin/bash
sudo sed -i '/^CONF_SWAPSIZE.*/s//CONF_SWAPSIZE=1000/' /etc/dphys-swapfile
SLIC3R_REPO="https://github.com/alexrj/Slic3r.git"
SLIC3R_VERSION="master"
SLIC3R_DIR=/home/pi/Slic3r
sudo apt-get update
sudo apt-get install -y git libboost-all-dev libboost-geometry-utils-perl libboost-system-dev libboost-thread-dev git-core build-essential libgtk2.0-dev libwxgtk2.8-dev libwx-perl libmodule-build-perl libnet-dbus-perl cpanminus libextutils-cbuilder-perl gcc-4.7 g++-4.7 libwx-perl libperl-dev libextutils-cppguess-perl libeigen3-dev libglew-dev libglewmx-dev cpanminus
sudo apt install -y git libboost-all-dev libboost-geometry-utils-perl libboost-system-dev libboost-thread-dev git-core build-essential libwxgtk3.0-dev libgtk-3-dev libwx-perl libmodule-build-perl libnet-dbus-perl cpanminus gcc-4.7 g++-4.7 libwx-perl libperl-dev libextutils-cppguess-perl libeigen3-dev libglew-dev cpanminus libcurl4-openssl-dev
sudo cpan ExtUtils::CBuilder ExtUtils::CppGuess Alien::wxWidgets CPAN::Mini ExtUtils::XSpp::Cmd Ex
# Example configuration file for HAProxy 1.3, refer to the url below for
# a full documentation and examples for configuration:
# http://haproxy.1wt.eu/download/1.3/doc/configuration.txt
# Global parameters
global
# Log events to a remote syslog server at given address using the
# specified facility and verbosity level. Multiple log options
# are allowed.