Skip to content

Instantly share code, notes, and snippets.

View amateusz's full-sized avatar

Mateusz Grzywacz amateusz

  • AMS NL
View GitHub Profile
@amateusz
amateusz / checksuma do opasek
Last active July 23, 2016 12:26
opaski_suma_kontrolna.py
def checksum(numer):
lista = list(map(int, str(numer))) # słowem kodowanym jest pojedyncza cyfra.
ret = 0
for _ in lista:
ret ^= _
return ret
# niech numer będzie numer plus doklejona cyfra checksumy czyli:
numer*10 + cyfrachecksum
@amateusz
amateusz / RPi_I2C_driver.py
Last active August 6, 2016 22:14 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014-2015 Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
<div class="col-lg-6 col-sm-6 col-12">
<div class="input-group">
<label class="input-group-btn">
<span class="btn btn-primary">
Wybierz&hellip; <input type="file" name="file" style="display: none;">
</span>
</label>
<input type="text" class="form-control" readonly>
</div>
<div class="col-lg-offset-3">
@amateusz
amateusz / T400_big_battery_messed_up.log
Last active December 27, 2017 18:23
after changing 0x60C - 0x60F to 0xFF in eeprom dump of bq8030
mateusz@lukierek:~/smbusb-1.0.1/tools$ sudo smbusb_bq8030flasher --execute
------------------------------------
smbusb_bq8030flasher
------------------------------------
SMBusb Firmware Version: 1.0.1
PEC is ENABLED
Error communicating with the Boot ROM.
Chip is not in the correct mode, has hung or there's an interface issue
//// before setup
const byte FIRST_QUESTION = '?';
const byte FIRST_RESPONSE = 'T';
//// void setup() here
\\\\ end of setup()
//// void loop() here
// put it in the loop
@amateusz
amateusz / Namecheap VPN manual configuration file.md
Last active March 29, 2023 15:16
Configuration file for Namecheap VPN - connect a unsupported device (no need for their proprietary app)

Namecheap VPN OpenVPN configuration file

They have this instructions for routers running dd-wrt, but I found myself unable to setup my desktop (NetworkManager) and iPhone manually. It seems, as those options cannot be set in any GUI/wizard OpenVPN creator, therefore a .ovpn configuration file is needed. I've came up with this file. It works.

Just keep in mind they might roll-out any server without a prior notice, like they'd just done today (9.11.2019) with Rejkjavik node. Strange.

Steps: