Skip to content

Instantly share code, notes, and snippets.

View Lucchetto's full-sized avatar

Lucchetto

View GitHub Profile
#!/bin/bash
USER_DISK_PATH=/home/user-disks
USER_DISK_SIZE_IN_BYTES=1099511627776
USER_PASSWORD_LENGTH=24
USER_DEFAULT_SHELL=/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="lenovo-sm8150/android_device_lenovo_zippo" path="device/lenovo/zippo" remote="github" revision="r12.0" />
<project name="lenovo-sm8150/android_device_lenovo_sm8150-common" path="device/lenovo/sm8150-common" remote="github" revision="r12.0" />
<project name="lenovo-sm8150/android_kernel_lenovo_sm8150" path="kernel/lenovo/sm8150" remote="github" revision="r12.0" />
<project name="lenovo-sm8150/proprietary_vendor_lenovo" path="vendor/lenovo" remote="github" revision="r12.0" />
</manifest>
@Lucchetto
Lucchetto / gist:8c2955c40c04882681295071d8bd8bda
Last active November 12, 2021 18:11
flamegapps permissions error
11-12 19:05:33.520 2688 2688 E Zygote : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981)
11-12 19:05:33.520 2688 2688 D AndroidRuntime: Shutting down VM
11-12 19:05:33.520 2688 2688 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
11-12 19:05:33.520 2688 2688 E AndroidRuntime: java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions allowlist: {com.android.packageinstaller (/system/system_ext/priv-app/GooglePackageInstaller): android.permission.INSTALL_PACKAGES, com.android.settings (/system/system_ext/priv-app/Settings): android.permission.RESET_BATTERY_STATS, com.android.packageinstaller (/system/system_ext/priv-app/GooglePackageInstaller): android.permission.PACKAGE_USAGE_STATS, com.android.packageinstaller (/system/system_ext/priv-app/GooglePackageInstaller): android.permission.MANAGE_USERS, com.android.packageinstaller (/system/system_ext/priv-app/GooglePackageInstaller): android.permission.DELETE_PACKAGES, com.android.packagei
import os
video_path = input("Insert full path of videos: ")
subs_path = input("Insert full puth of subtitles: ")
# Assume both lists have the same length
video_files = os.listdir(video_path)
subs_files = os.listdir(subs_path)
output_path = input("Insert full path of output: ")
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllowPairing</key>
<true/>
<key>AutoAdvanceSetup</key>
<false/>
<key>AwaitDeviceConfigured</key>
<false/>
@Lucchetto
Lucchetto / apache-supysonic.conf
Last active June 19, 2020 06:50
Supysonic setup
<VirtualHost *:5000>
WSGIDaemonProcess supysonic home=/var/lib/supysonic user=supysonic group=supysonic
WSGIProcessGroup supysonic
WSGIApplicationGroup %{GLOBAL}
ErrorLog /var/lib/supysonic/error_log
WSGIScriptAlias / /var/www/supysonic/cgi-bin/supysonic.wsgi
<Directory /var/www/supysonic/cgi-bin>
WSGIApplicationGroup %{GLOBAL}
@Lucchetto
Lucchetto / ampache
Created June 13, 2020 10:27
Ampache and phpmyadmin with nginx server
server {
# listen to
listen [::]:701; #ssl; ipv6 optional with ssl enabled
listen 701; #ssl; ipv4 optional with ssl enabled
server_name ampcache;
charset utf-8;
# Logging, error_log mode [notice] is necessary for rewrite_log on,
#include <iostream>
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
using namespace std;
// Imposto scritto a false per mettere il thread controllo_ingressi in attesa
// e imposto letto a true per procedere alla lettura degli ingressi
bool scritto, letto = true;
export INSTALL_MOD_PATH=$my_top_dir/modules
mv_modules () {
mdpath=`find $INSTALL_MOD_PATH -type f -name modules.dep`
if [ "$mdpath" != "" ]; then
mpath=`dirname $mdpath`
ko=`find $mpath/kernel -type f -name *.ko`
for i in $ko; do mv $i $INSTALL_MOD_PATH/; done
mv $mpath/modules.dep $INSTALL_MOD_PATH
mv $mpath/modules.alias $INSTALL_MOD_PATH