Skip to content

Instantly share code, notes, and snippets.

Avatar

Gregor Schram gregor160300

View GitHub Profile
@gregor160300
gregor160300 / 00-i2c_hid-mods.sh
Last active Sep 15, 2019
HP ZBook X360 FIxes Arch Linux
View 00-i2c_hid-mods.sh
#!/bin/sh
case $1/$2 in
pre/*)
echo "Removing i2c_hid kernel module"
rmmod i2c_hid
;;
post/*)
echo "Adding i2c_hid kernel module"
modprobe i2c_hid
;;
@gregor160300
gregor160300 / polaris.xml
Last active May 26, 2019
Local Manifest PE
View polaris.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="gregor160300/device_xiaomi_polaris" path="device/xiaomi/polaris" remote="github" revision="pie-caf" />
<project name="LineageOS/android_kernel_xiaomi_sdm845" path="kernel/xiaomi/sdm845" remote="github" revision="lineage-16.0" />
<project name="vendor_xiaomi" path="vendor/xiaomi/" remote="pixel-devices" revision="pie-caf" />
<project name="LineageOS/android_packages_resources_devicesettings" path="packages/resources/devicesettings" remote="github" revision="lineage-16.0" />
<project name="device_xiaomi_sdm845-common" path="device/xiaomi/sdm845-common" remote="pixel-devices" revision="pie-caf" />
<project name="packages_apps_Playground" path="packages/apps/Playground" remote="pixel-gitlab" revision="pie" />
<project name="packages_apps_GoogleCameraMod" path="packages/apps/GoogleCameraMod" remote="pixel-gitlab" revision="pie-beryllium" />
<project name="packages_apps_WallpapersBReel2018" path="packages/apps/WallpapersBReel2018" remo
@gregor160300
gregor160300 / duo.py
Created May 23, 2019
Duolingo cron job to buy streak freeze
View duo.py
#######Start of script
##redir in cron job
## 0 2,8,14,20 * * * python /home/osmc/MyScript/DuolingoVacation.py >> /home/osmc/MyScript/log/DuoVac_$(date +\%Y\%m\%d).log
import logging
import sys
import duolingo
ScriptName = 'Duolingo Vacation'
USER='MyUserName here'
View gist:834aec0937405a0e68550be8c11af00d
#=====================================#
# ~/.bash_aliases | Personnal aliases #
#=====================================#
## System tools
alias update='sudo apt-get update && sudo apt-get dist-upgrade && apm update'
#alias update='sudo apt-get update && sudo apt-get dist-upgrade && apm-beta update'
alias install='sudo apt-get install '
alias bye='sudo /sbin/shutdown'
alias remove='sudo apt-get remove '
@gregor160300
gregor160300 / default.prop
Last active Jun 20, 2021
HOW TO: Modify boot.img to allow usb debugging from recovery adb
View default.prop
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
persist.sys.usb.config=adb
ro.adb.secure=0
View picks (temp)
# Load envsetup.sh
source ./build/envsetup.sh;
# Libraries SHIM
repopick 185640;
# TWRP workaround
repopick 186687;
# OTA signature
@gregor160300
gregor160300 / LAMPSetup
Created Sep 13, 2017
Instructions to setup LAMP for local development with php and user write permissions (DO NOT USE IN PRODUCTION)
View LAMPSetup
1. Install lamp server + phpMyAdmin
2. Find out under which group the web server is running:
ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1
3. Correct the chown of the www folder
sudo chown GROUP_OF_STEP2:GROUP_OF_STEP2 -R /var/www
4. Add user to group:
sudo usermod -a -G GROUP_OF_STEP2 USER
5. Fix permissions:
sudo find /var/www -type d -exec chmod 775 {} \;
sudo find /var/www -type f -exec chmod 664 {} \;
@gregor160300
gregor160300 / picks.sh
Last active Aug 27, 2018
LineageOS 15 repopicks
View picks.sh
#!/bin/bash
source build/envsetup.sh;
# https://review.lineageos.org/#/q/status:open+branch:%255Elineage-15.0.*+-project:%255ELineageOS/android_device_.*+-project:%255ELineageOS/android_kernel_.*
# repopick updates
repopick 188834;
# bionic
repopick 185636 185640;
repopick -f 185639;
@gregor160300
gregor160300 / buildInstructions
Last active Aug 28, 2017
Some command to make building PA (for potter) on Ubuntu simpler
View buildInstructions
cd Android/AOSPA
PATH=~/.bin:$PATH
export USE_CCACHE=1
export CCACHE_DIR=/home/gregor/.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G
export USE_NINJA=false
rm -rf ~/.jack*
export ANDROID_JACK_VM_ARGS="-Xmx4g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server
@gregor160300
gregor160300 / Docker
Created Aug 28, 2017
Setup Docker on Ubuntu 16.04+
View Docker
Docker setup:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sudo usermod -aG docker ${USER}
su - ${USER}
Docker LAMP ( + phpMyAdmin):
docker pull mattrayner/lamp:latest