Skip to content

Instantly share code, notes, and snippets.

View geekwolverine's full-sized avatar

Blaze geekwolverine

View GitHub Profile
@geekwolverine
geekwolverine / android-adb-pull-apk.md
Created May 12, 2024 09:22 — forked from ctrl-freak/android-adb-pull-apk.md
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

@geekwolverine
geekwolverine / android-adb-pull-apk.md
Created May 12, 2024 09:22 — forked from ctrl-freak/android-adb-pull-apk.md
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

@geekwolverine
geekwolverine / sanitilize_link.py
Created March 8, 2024 19:23 — forked from lepture/sanitilize_link.py
Clean utm parameters on link.
@geekwolverine
geekwolverine / gist:1ab7c0f3ea533381cd02971d861cd3d8
Created November 15, 2023 22:51 — forked from tsjnachos117/gist:8231f9f8ed08968cc5f1a7f4d3e06b0e
Get KDE Connect battery info (from desktop/laptop)

I find the ability to get my android devices' battery info on my desktops via cli to be extremely convenient. I used to be able to this with KDE Connect easily, but things have just changed. Since I can't find any documentation on how to do this, and since I just stumbled on the answer myself, I though I might share what I know here. Please note that in the examples below, I will be using {device-id} as a placeholder for the string that KDE Connect uses to identify to my devices.

That said, I used to be able to get my various devices' battery status through gdbus through the following:

    gdbus call --session --dest org.kde.kdeconnect --object-path /modules/kdeconnect/devices/{device-id} --method org.kde.kdeconnect.device.battery.charge

However on Arch, I now get the following error: Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownInterface: No such interface 'org.kde.kdeconnect.device.battery' at object path '/modules/kdeconnect/devices/b04294f19e8767f5'. I don't get this message on Ubuntu 2

@geekwolverine
geekwolverine / apache_and_php.md
Created October 17, 2023 23:17 — forked from superjojo140/apache_and_php.md
Apache, PHP, MariaDB and PhpMyAdmin on Archlinux

Guide to install Apache, PHP, MariaDB and PhpMyAdmin on your archlinux system and serve php-based database applications

Install Packages

pacman -S apache php php-apache mariadb phpmyadmin

Config PHP

The main PHP configuration file is well-documented and located at /etc/php/php.ini

@geekwolverine
geekwolverine / main.php
Created June 28, 2023 09:58 — forked from lamprosg/main.php
Resize image on the fly in PHP
<?php
//How to use it
//Just call timthumb.php with appropriate arguments, For example:
<img src="/script/timthumb.php?src=/some/path/myimage.png&w=100&h=80" alt="resized image" />
/* http://viralpatel.net/blogs/resize-image-dynamically-php/ */
?>

Problem

In Arch Linux mkinitcpio -p linux

shows

Possibly missing firmware for module: aic94xx
 Possibly missing firmware for module: wd719x
@geekwolverine
geekwolverine / disable-chrome-same-origin.md
Created June 23, 2023 07:01 — forked from n3dst4/disable-chrome-same-origin.md
How to disable same-origin policy (aka CORS checking) in Chrome

You need to run Chrome with two command line flags:

--disable-web-security --user-data-dir

These are kind of documented here: https://peter.sh/experiments/chromium-command-line-switches/

--disable-web-security is the one that turns off the same-origin policy (the name is scarier than the action). Although the docs don't say this, this flag is ignored unless you also specify --user-data-dir. That's because --disable-web-security can be super risky so you shouldn't be surfing in that mode all the time, so Chrome requires you to use an alternative user profile, specified with --user-data-dir. However, you can get away with just giving --user-data-dir and not specifying a dir, and it will use the default one (so you get all your bookmarks, cookies, extension, etc. but --disable-web-security will still feel that honour has been satisfied and tuirn off same-origin policy.

Do not use forEach with async-await

TLDR: Use for...of instead of forEach in asynchronous code.

The problem

Array.prototype.forEach is not designed for asynchronous code. (It was not suitable for promises, and it is not suitable for async-await.)

For example, the following forEach loop might not do what it appears to do:

@geekwolverine
geekwolverine / opendir.md
Created June 1, 2023 07:28 — forked from jermspeaks/opendir.md
Manually Searching OpenDirectories on Google

Manually Searching OpenDirectories on Google

For videos/movies/tvshows :

intext:\"Search Term\" intitle:\"index.of\" +(wmv|mpg|avi|mp4|mkv|mov) -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml)

Images :