Skip to content

Instantly share code, notes, and snippets.

View minlexx's full-sized avatar
🐧
Working

Alexey Min minlexx

🐧
Working
View GitHub Profile
@minlexx
minlexx / README.md
Created November 8, 2018 22:49 — forked from e7d/README.md
[Debian] Setup a Squid anonymous proxy
@minlexx
minlexx / CMakeLists.txt
Last active December 4, 2018 22:42
hacky cmake script to build wine explorer.exe separately from whole wine (project to open in any C++ IDE)
cmake_minimum_required(VERSION 2.8)
project(wine_explorer)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_C_FLAGS
"-m32 -fPIC -Wall -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -gdwarf-2 -gstrict-dwarf -fno-omit-frame-pointer"
)
# Tweak this to your wine buld path
#!/usr/bin/python3
# First, find what real compiler is called, symlink destination: ls -l /usr/bin/armv7hl-unknown-linux-gnueabi-gcc
# /usr/bin/armv7hl-unknown-linux-gnueabi-gcc: symbolic link to \
# /usr/x86_64-pc-linux-gnu/armv7hl-unknown-linux-gnueabi/gcc-bin/7.3.0/armv7hl-unknown-linux-gnueabi-gcc
# So, we go and replace "/usr/bin/armv7hl-unknown-linux-gnueabi-gcc" with this script and make it executable.
# Then when this script is called instead of a real compiler, it would replace all parameters '-L/usr/lib64'
# to correct ones: '-L/usr/armv7hl-unknown-linux-gnueabi-gcc/lib' to prevent linking to wrong libs from host.
@minlexx
minlexx / Gentoo_chroot_script.sh
Created January 7, 2019 16:39
Gentoo_chroot_script.sh
#/bin/bash
# Before chroot
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
#!/bin/bash
@minlexx
minlexx / ck-unlock-session.sh
Created January 20, 2019 20:34
Unlock user session using ConsoleKit
#!/bin/bash
#SESSION=$1
SESSION=Session1
dbus-send --system --dest=org.freedesktop.ConsoleKit \
--print-reply \
/org/freedesktop/ConsoleKit/$SESSION \
org.freedesktop.ConsoleKit.Session.Unlock
@minlexx
minlexx / RelinkQt.sh
Created January 25, 2019 11:47
Binary patcher for linux Qt builds to relocate hard-coded paths to library install location
#!/bin/sh
if [ x"$VERBOSE" = x"1" ]; then
set -x
fi
SCRIPT=$(readlink -f $0)
SCRIPTPATH=$(dirname $SCRIPT)
cd $SCRIPTPATH/..
@minlexx
minlexx / startplasmamobile snip
Last active July 15, 2019 13:20
modify /usr/bin/startplasmamobile like this
if [ -d "/dev/dri" ]; then
kwin_wayland --drm --xwayland plasma-phone 2>&1 | logger -t "$(whoami):plasma-mobile"
elif [ -d "/usr/lib/libhybris-egl" ]; then
# export EGL_PLATFORM=hwcomposer
# export QT_LOGGING_RULES="kwin*.debug=true;qt*.debug=true"
export QT_LOGGING_RULES="kwin*.debug=true"
export LD_PRELOAD=/usr/lib/libhybris-egl/libEGL.so.1
kwin_wayland --hwcomposer /usr/bin/plasma-phone 2>&1 | logger -t "$(whoami):plasma-mobile"
else
@minlexx
minlexx / sdm660-mtp_f7a.dts
Last active December 11, 2019 20:35
Xiaomi Redmi Note 7 (lavender) Device Tree Sources (preprocessed and included files list)
/dts-v1/;
/ {
#address-cells = <0x2>;
#size-cells = <0x2>;
model = "Qualcomm Technologies, Inc. SDM 660 PM660 + PM660L MTP F7A overlay";
compatible = "qcom,sdm660-mtp", "qcom,sdm660", "qcom,mtp";
qcom,msm-id = <0x13d 0x0>;
interrupt-parent = <0x1>;
qcom,board-id = <0x20008 0x0>;
@minlexx
minlexx / create-bootimg.sh
Last active September 15, 2023 19:15
Script to create boot.img for xiaomi-lavender from inside kernel build tree, using initramfs file built by pmbootstrap
#!/bin/bash
set -x
KERNEL=./arch/arm64/boot/Image.gz
KERNEL_DTB=${KERNEL}-dtb
DTB=./arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dtb
INITRD=initramfs-postmarketos-qcom-sdm660
# Optional:
@minlexx
minlexx / example_output.txt
Last active February 14, 2020 16:11
test_threaded_socketnotifier
Thread: started!
Thread: writing: Write 0
ready to read!
read: Write 0
Thread: writing: Write 1
ready to read!
read: Write 1
Thread: writing: Write 2
ready to read!
read: Write 2