Skip to content

Instantly share code, notes, and snippets.

View Self-Perfection's full-sized avatar

Alexander Meshcheryakov Self-Perfection

View GitHub Profile
@Self-Perfection
Self-Perfection / compressed_journald_logs.yaml
Last active June 22, 2023 14:16
Ansible playbook to move persistent journald logs to loopback mounted Btrfs filesystem with compression. Makes sure that journal files are kept decently compressed
# FIXME: override /usr/lib/tmpfiles.d/journal-nocow.conf to avoid applying noCOW flag?
# systemd-tmpfiles --create?
#
# FIXME: systemd 250 reenables COW for archived journal. so we can skip parts of configuration.
- name: Store journald logs on compressed volume
hosts: all
gather_facts: yes
become: yes
@Self-Perfection
Self-Perfection / No_WhatsApp.svg
Last active March 17, 2022 09:54
No WhatsApp avatar
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Self-Perfection
Self-Perfection / skip_yandex_music_ads.py
Last active June 15, 2020 12:04
Couple of scripts to skip yandex music ads while listening in browser with enabled plasma-browser-integration
#!/usr/bin/python
from pydbus import SessionBus
from gi.repository import GLib
import subprocess
bus = SessionBus()
def event_handler(a_str, b_dict, c_list):
if 'Metadata' not in b_dict:
@Self-Perfection
Self-Perfection / MTS_reconnector.py
Last active October 26, 2021 08:39
Lame script to toggle airplane mode on/off on SailfishOS if network connection breaks (see https://4pda.ru/forum/index.php?s=&showtopic=501263&view=findpost&p=64055550 )
#!/usr/bin/python
import calendar
import dbus
import signal
import subprocess
import time
tool_name = 'MTS_reconnector'
start_time = calendar.timegm(time.gmtime())
@Self-Perfection
Self-Perfection / check_mapsme_webreleases.py
Created February 9, 2016 10:51
Check if new web release of MAPS.ME has been published
#!/usr/bin/python2
# Checker for new releases of MAPS.ME apk
# Author: Alexander Meshcheryakov
# Distributed under WTFPL
url = 'http://maps.me/apk/'
import os
cache_file_path = os.path.expanduser('~/.cache/mapsme_webreleases')
@Self-Perfection
Self-Perfection / developer-profile.sh.patch
Last active August 29, 2015 14:19
Patch: faster shell launch in developer mode on SailfishOS
--- /etc/profile.d/developer-profile.sh 2015-02-11 03:14:12.000000000 +0300
+++ script_versions/developer-profile.sh_v1 2015-04-26 14:42:19.212224189 +0300
@@ -98,13 +98,12 @@
ENV_SET=$(cat /proc/$SESSION_PID/environ | sed -e 's/\x00/\n/g' | grep -wvF "$BLACK_LIST_VALUES")
while read ENV_PAIR
do
- echo $ENV_PAIR | grep -qwF "$WHITE_LIST_VALUES"
- if [ $? -ne 0 ]; then
- echo "NOTICE: Env value ignored $ENV_PAIR"
- else
@Self-Perfection
Self-Perfection / zram_swap_stats.lua
Created February 4, 2015 16:16
This script calculates aggregate statistics for all currently enabled zram swap devices.
#!/usr/bin/lua
-- /proc/swaps lists as used mem_used_total + zero_pages
for line in io.lines('/proc/meminfo') do
SwapCached = line:match('SwapCached.* (%d+)') or SwapCached
end
zram_devices = {}
for line in io.lines('/proc/swaps') do
table.insert(zram_devices, line:match('^/dev/(zram%d+)'))
Running Steam on arch rolling 32-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1361807486_client)
Sun Mar 3 21:58:41 MSK 2013
Installing breakpad exception handler for appid(steam)/version(1361807486_client)
[2013-03-03 21:58:41] Verifying installation...
unlinked 0 orphaned pipes
Sun Mar 3 21:58:42 MSK 2013
Installing breakpad exception handler for appid(steam)/version(1361807486_client)
[0303/215842:ERROR:object_proxy.cc(239)] Failed to call method: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files
Processor Information:
Vendor: AuthenticAMD
Speed: 2600 Mhz
2 logical processors
2 physical processors
HyperThreading: Unsupported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported