Skip to content

Instantly share code, notes, and snippets.

View skvark's full-sized avatar

Olli-Pekka Heinisuo skvark

View GitHub Profile
@skvark
skvark / sailfishsdkrepos.md
Last active April 4, 2024 04:50
Describes how to add repositories to Sailfish OS SDK (emulator and targets) and how to install them so that they can be used straight from the SDK.

This guide uses my own repos from Mer Obs. I found it very hard to find information about this so hopefully someone sees this useful. This short guide was created as a side product while I was creating these RPM packages (which wasn't so clear to me either).

  1. Add the repositories to the Mer SDK armv7hl and i486 targets (you'll have to ssh to the Mer SDK):

    • sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper ar -f http://repo.merproject.org/obs/home:/skvark/latest_armv7hl tesseract-ocr
    • sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper ar -f http://repo.merproject.org/obs/home:/skvark/latest_armv7hl leptonica
    • sb2 -t SailfishOS-i486 -m sdk-install -R zypper ar -f http://repo.merproject.org/obs/home:/skvark/latest_i486 tesseract-ocr
    • sb2 -t SailfishOS-i486 -m sdk-install -R zypper ar -f http://repo.merproject.org/obs/home:/skvark/latest_i486 leptonica
  2. Refresh sb2 -t SailfishOS-i486 -m sdk-install -R zypper ref and sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper ref

@skvark
skvark / edison_flashing_wifi.md
Last active February 9, 2022 08:48
Flashing Intel Edison using only serial connection and wifi

Do this at your own risk. I take no responsibility for any damage caused to your board.

My Intel Edison was shipped to me with old and buggy version of the Yocto Linux image. I purchased only the console block via Sparkfun (which has only one USB port connected to UART2 (serial connection) of the Edison therefore it's not connected to the actual USB on Edison) so I could not update to a new build the normal way.

I assume you have successfully connected to the Edison via the serial connection and can use the linux console on Edison.

  1. Connect the Edison into a local WiFi network with configure_edison --wifi
  2. Check that you can access to the Edison via SSH or with browser
    • if you can't, vi /etc/systemd/system/basic.target.wants/network-gadget-init.service and change the ip addresses to i.e 192.168.99.15
  3. On Edison, cd /
@skvark
skvark / xmpp_notify.py
Created March 20, 2014 20:17
Sends a message via XMPP. Set your own jid and password and the target jid. Takes in args from command line and sends them as a message. Install xmpppy: pip install xmpppy
import sys
import xmpp
your_jid = ""
password = ""
target_jid = ""
def main():
message = " ".join(sys.argv[1:])
@skvark
skvark / Zip opening hours
Last active August 29, 2015 13:55
Juvenes aukioloajat, tarvis niinku parsia :D
"\"<p style=\\\"font-family: 'trebuchet ms';\\\"><strong>Aukiolo- ja lounasajat<\\/strong><\\/p>\
<p style=\\\"font-family: 'trebuchet ms';\\\">ma - to 10.30 - 15.00<br \\/>\
<span style=\\\"font-size: 14px;\\\">pe 10.30 - 14.30<\\/span><\\/p>\
@skvark
skvark / gist:7973420
Last active December 31, 2015 10:29
How to clean Juvenes API dirty JSON data (Qt5).
// Cleans dirty QByteArray so that it can be read to QJsonDocument
void cleanJSON(QByteArray &dirty) {
// remove "}); from the end
dirty.remove(dirty.length() - 4, 4);
// remove ({"d":" from the beginning
dirty.remove(0, 7);
// replace \ -> empty
const char* remove = "\\";
const char* replace = "";