Skip to content

Instantly share code, notes, and snippets.

@Logic-gate
Logic-gate / GalleryStartPage.qml
Created May 8, 2023 06:35
Whisperfish Gallery Patch
// /usr/share/jolla-gallery/pages/GalleryStartPage.qml
import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Silica.private 1.0
import Sailfish.Gallery 1.0
import Sailfish.Gallery.private 1.0
import com.jolla.gallery 1.0
import QtDocGallery 5.0
import Nemo.FileManager 1.0
@Logic-gate
Logic-gate / fontconfig-helper.sh
Created February 12, 2023 13:25
fontconfig helper script SailfishOS
#!/bin/bash
#Fontconfig helper script
#Use absolute path
common_aliases_dir=/home/defaultuser/.local/share/fonts/common-aliases
#common_extra_dir=/home/defaultuser/.local/share/fonts/common-extra
#lowdpi_aliases_dir=/home/defaultuser/.local/share/fonts/lowdpi-aliases
#lowdpi_extra_dir=/home/defaultuser/.local/share/fonts/lowdpi-extra
#USE AT YOUR OWN RISK
#MAKE A COPY OF YOUR OLD CONF BEFORE APPLYING THIS
# XTRA_SERVER_QUERY (1=on, 0=off)
# If XTRA_SERVER_QUERY is on, the XTRA_SERVERs listed
# below will be ignored, and instead the servers will
# be queried from the modem.
XTRA_SERVER_QUERY=1
# XTRA_SERVERs below are used only if XTRA_SERVER_QUERY
# is off. THESE ARE DISABLED
@Logic-gate
Logic-gate / FXTEC PRO 1 Keyboard Orientation
Last active May 29, 2020 11:10
Fxtec Pro 1 Orientation Lock + Keyboard Shortcuts
This is not a recommended way to achieve landscape lock...but it works...
Start..
touch $HOME/.Xdbus
chmod 600 $HOME/.Xdbus
env | grep DBUS_SESSION_BUS_ADDRESS > $HOME/.Xdbus
echo 'export DBUS_SESSION_BUS_ADDRESS' >> $HOME/.Xdbus
touch $HOME/.keyboard-state
@Logic-gate
Logic-gate / gspreadHelper.py
Created July 17, 2019 12:33
A helper script for gspread
import gspread
from oauth2client.service_account import ServiceAccountCredentials
class gHelper:
def __init__(self, json_creds):
self.scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive']
self.cred = ServiceAccountCredentials.from_json_keyfile_name(
@Logic-gate
Logic-gate / megaSync_Installation.txt
Last active August 28, 2022 04:54
MegaSync Client Installation | Solus
https://dev.solus-project.com/T163
Clone it -- https://github.com/meganz/MEGAsync
> git clone https://github.com/meganz/MEGAsync.git
> cd MEGAsync
> git submodule update --init --recursive
Get crypto++ | I think it's already in the repo (cryptopp-devel) if not:
> wget https://www.cryptopp.com/cryptopp563.zip #Tested on version 5.6.3
> mkdir ~/crypto && cd ~/crypto && unzip ~/Downloads/cryptopp563.zip
### Keybase proof
I hereby claim:
* I am Logic-gate on github.
* I am mad_dev (https://keybase.io/mad_dev) on keybase.
* I have a public key whose fingerprint is AE12 3A22 7CB2 35E3 7AB8 34C2 A6C5 335A C529 9679
To claim this, I am signing this object:
@Logic-gate
Logic-gate / RPI_START_STOP_FAN.py
Last active November 22, 2015 17:57
RPI-PiFace start/stop fan according to temperature(vcgencmd) - Fan Control If the temperature(vcgencmd measure_temp) is =(greater than or equals) 43.0 C', start the fan If the temperature is = 42.9 C', Stop the fan This assumes a 5V or less fan is present.
#! /usr/bin/env python3
import re
import subprocess
import pifacedigitalio as pio
import time
import datetime
def get_temp_from_system():
temp = subprocess.check_output(['vcgencmd', 'measure_temp'])
#!/usr/bin/env python3
import pifacedigitalio as pf
import time
import subprocess
import urllib
from xml.dom import minidom
def get_temp(cc):
##Thanks to http://stackoverflow.com/questions/16070885/python-yahoo-weather-xml-parse-works-with-2-7-1-but-not-2-6-1
@Logic-gate
Logic-gate / ServReport.py
Created November 22, 2015 17:54
I needed a simple way to manually report suspicious actions on or to my server.
#! /usr/bin/env python
import datetime
import urllib
import os
class REPORT():
def cons(self):
date_now = datetime.datetime.now()
date = date_now.strftime("%Y_%m_%d")
time = date_now.strftime("%H:%M")