Skip to content

Instantly share code, notes, and snippets.

@enthusiasmus
Last active June 11, 2020 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enthusiasmus/d08b64e11391b90a7d8dfcccd4ec1ce0 to your computer and use it in GitHub Desktop.
Save enthusiasmus/d08b64e11391b90a7d8dfcccd4ec1ce0 to your computer and use it in GitHub Desktop.
Stuff I solved during me hacking journeys

Cocktail DB-Draft

Zutaten-Tabelle ID Name

Cocktail-Tabelle ID Name Art Zubereitung Glas

Cocktail-hat-Garnitur-Tabelle ID Zutaten-ID Cocktail-ID Menge

Cocktail-hat-Zutat-Tabelle ID Zutaten-ID Cocktail-ID Menge

MySQL 8.0.11 with Wordpress 4.8.6

I got following error when trying to open the blog in the browser.

Warning: mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client in /var/www/danceteam-salzburg.at/wp-includes/wp-db.php on line 1603

So I created a new user with the authentification handler mysql_native_password (instead of the default caching_sha2_password) and granted permissions.

CREATE USER '<user>'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';
GRANT ALL PRIVILEGES ON <database> . * TO '<user>'@'localhost';
FLUSH PRIVILEGES;

Normally that should work, but it didn't. So I added following line to the config file of mysql:

default_authentication_plugin=mysql_native_password

If this does not work you can choose the retain old authentification method option during the installation.

Restarted MySQL and imported the dump via

mysql -u <user> -p <database> < dump.sql

Datenbank liegt dann unter /var/lib/mysql Konfigurationsdatei ist diese Datei hier: /etc/mysql/mysql.conf.d/mysqld.cnf

Update Wordpress database after relocation

UPDATE wp_options SET option_value="<url>" WHERE option_id=2;
UPDATE wp_options SET option_value="<url>" WHERE option_id=1;

Fix wordpress permissions

cd /var/www/
sudo chown www-data:www-data * -R
cd blog
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;
# wp-content only should be writeable by everyone eql. www-data
sudo chown -R <user>:<user> *
sudo chown -R www-data:www-data wp-content

Set upload max body size for wordpress themes

sudo vi /etc/nginx/nginx.conf

http {
    ...
    client_max_body_size 200M;
}    

sudo vi /etc/php/7.0/fpm/php.ini

upload_max_filesize = 200M
sudo service nginx restart
sudo service php7.0-fpm restart

Dump MySQL table

mysqldump -u root -p <database> > <database>.sql

Import MySQL dump

mysql -u username -p new_database < data-dump.sql

Linux Inodes

ls -i listet die Inode-Nummer auf find . -inum NUM findet die Files die die gleiche Inode Nummer haben

Linux-Permissions

Files werden immer mit 666 und Directories mit 777 erstellt. umask wird danach allerdings noch angewendet und subtrahiert, z.B. 022.

1777 = Sticky-Bit wird gesetzt, geteiler Ordner, allerdings darf nur der Ersteller die Files löschen. 2777 = GUID wird gesetzt, File wird als Gruppenbesitzer ausgeführt (s anstatt x, s wenn x gesetzt ist, S wenn x nicht gesetzt) 4777 = SUID wird gesetzt, File wird als User/Besitzer ausgeführt (s anstatt x, s wenn x gesetzt ist, S wenn x nicht gesetzt)

Graphene OS

adb, fastboot, signify installieren

oem unlock

ausschalten, power + volume down ODER USB-Debugging aktivieren, adb reboot bootloader

image und signature runterladen

public-key runterladen und mit website, reddit, github vergleichen!

signify-openbsd -Cqp factory.pub -x sargo-factory-2020.05.23.12.zip.sig && echo verified

unzip sargo-factory-2020.05.23.12.zip

cd sargo-factory-2020.05.23.12

./flash-all.sh

Reboot into Bootloader

fastboot flashing lock + Volume down + Bestätigen

einrichten

USB-Debugging aktivieren für adb restore ~/backup.ab

oem lock neustart

Für die Validierung via Auditor bräuchte man zwei Handys die die App unterstützen

Signal

keytool -printcert -jarfile Signal-website-universal-release-4.59.11.apk

Zertifikatsfingerprints vergleichen

F-Droid

gpg --verify FDroid.apk.asc keytool -printcert -jarfile FDroid.apk

Vergleichen mit https://f-droid.org/docs/Release_Channels_and_Signing_Keys/?title=Release_Channels_and_Signing_Keys

Perfect WM neapolitan pizza

250g - 280g teigling max. 140g tomatensoße (salzen erst auf der pizza) 80-100g mozarella knoblauch, basilikum, oregano

Install Google Pixel 3a Factory-Image, when having Graphene OS

Make a backup of your Signal, K9 and Contacts.

(Screenshots)

adb, fastboot, signify installieren

oem unlock

ausschalten, power + volume down ODER USB-Debugging aktivieren, adb reboot bootloader

image runterladen und signature kopieren:

https://developers.google.com/android/images#sargo https://dl.google.com/dl/android/aosp/sargo-qq3a.200605.002-factory-62d57330.zip

Check Checksum:

➜ Downloads echo "62d573305daa3ade73816b62766f4aa5d5f622446f7515d630718898a06b9d85 sargo-qq3a.200605.002-factory-62d57330.zip" | shasum --algorithm 256 --check sargo-qq3a.200605.002-factory-62d57330.zip: OK

➜  Downloads fastboot flashing unlock
                                                   OKAY [  0.107s]
Finished. Total time: 0.110s

unzip zip

./flash-all.sh

fastboot erase avb_custom_key fastboot flashing lock

unlocking bootloader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment