• 0 Posts
  • 9 Comments
Joined 1 year ago
cake
Cake day: July 5th, 2023

help-circle



  • I made this userscript to put the vote count in comments back beside the vote button because the new one is kind of hard to see, its not the prettiest script (idk much about javascript), but I’ve tested it in Librewolf with Violentmonkey and it does work, hope it helps someone else!

    // ==UserScript==
    // @name        New script blahaj.zone
    // @namespace   Violentmonkey Scripts
    // @match       https://lemmy.blahaj.zone/post/*
    // @grant       none
    // @version     1.0
    // @author      -
    // @description 8/24/2024, 3:32:47 PM
    // @run-at      document-idle
    // ==/UserScript==
    
    function main ()
    {
    	var parent_comments = document.getElementsByClassName("comment list-unstyled"); 
    	for (var i = 0; i < parent_comments.length; /*i++*/)
    	{
    		/*console.log(i);*/
    		var comments = parent_comments[i].getElementsByTagName("article");
    		for (var j = 0; j < comments.length; j++)
    		{
    			var upvote_button = comments[j].getElementsByTagName("button")[1];
    			
    			if (upvote_button.attributes["vote_count_patched"] != null)
    			{
    				i++;
    				continue;
    			}
    			
    			var post_votes = upvote_button.attributes[2].textContent.split(' ')[0];
    			upvote_button.append(' ' + String(post_votes));
    			upvote_button.attributes["vote_count_patched"] = true;
    			i++;
    		}
    	}
    }
    /*var mutation = null;
    var mutation_observer = new MutationObserver(function(m) { mutation = m; console.log("new mutation logged yo");} );
    mutation_observer.observe(document, { childList: true, subtree: true }); */
    
    var mutation_observer = new MutationObserver(main);
    mutation_observer.observe(document, { childList: true, subtree: true});
    
    main();
    




  • I did a internet search on “AAAD” and I found this github repository. I’m not sure if it is the same, but they seem to serve the same purpose and share the same name. I took a look into the code and I saw something about Settings.Secure.ANDROID_ID in AboutPaymentActivity.kt, so I did some searching on that, and according to a person on stackoverflow, Settings.Secure.ANDROID_ID is a ID unique to every app on your phone, this ID will persist across uninstalls and reinstalls. The only reason it should change is if the package name or signing key changes. Also it should be different for different users on the phone, but im guessing it might not be possible to add more users on android auto, im not sure, I’ve never really used one.

    Now, about circumventing it, you could modify the source code and remove the license verification checks and rebuild, but this might not be legal, I’m not to good with legal stuff, but the license had a few words that suggest it might be non-free, but if software licenses arent an issue, feel free! There is also the option of just resigning the apk with your own key, which should change the ID, I believe you can do this in luckypatcher with one click, but lucky patcher is kind of sketchy and might not be able to work on android auto, I dont know much about them.

    I hope this helps, im sorry I couldnt find any like anything that could just reset it and be done with it, maybe someone else might chime in with a more helpful answer.



  • I designed this prompt shortly after I switched to Linux, I’ve been using it for a while, it has a few features like putting the exit code if it isn’t 0, changing the hostname color if its detected that you are over ssh, changing the directory color to red if it isn’t writeable, changing the prompt color to red if your euid is 0, and instead of printing I have no name! when your user does not have an entry in the passwd file, it will just print your uid in red. I also have a version that I wrote in C that works the same way with a subsitution shell, but it was harder to sync across all my devices when I made a change, so I rewrote it in posix shell that could be synced with just my .bashrc and work almost anywhere.

    I don’t know how to post a screenshot, sorry for the long paragraph, but here is the source code, feel free to share or do whatever with it!

    #-----PS1-----#
    BOLDRED="\001\033[1;31m\002"
    BOLDBLUE="\001\033[1;34m\002"
    BOLDPURPLE="\001\033[1;35m\002"
    BOLDCYAN="\001\033[1;36m\002"
    BOLDGREEN="\001\033[1;32m\002"
    COLORRESET="\001\033[0m\002"
    CURSOR_BLINK="\001\033[5 q\002"
    INFO_COLOR=$BOLDGREEN
    SUPERUSER_COLOR=$BOLDRED
    NORMALUSER_COLOR=$BOLDCYAN
    SSH_COLOR=$BOLDPURPLE
    __shellprompt ()
    {
            if [ "$(id -u)" = 0 ]; then
                    PROMPT_COLOR=$SUPERUSER_COLOR
                    PROMPT_EMBLEM='#'
            else
                    PROMPT_COLOR=$NORMALUSER_COLOR
                    PROMPT_EMBLEM='$'
            fi
            # [user@hostname]
            printf "%b%s%b" "${PROMPT_COLOR}[${INFO_COLOR}" "$(whoami 2>/dev/null || (printf "%b%s" "${BOLDRED}" "UID:$(id -u)"))" "${PROMPT_COLOR}@"
            if [ -n "${SSH_TTY}" ] || [ -n "${SSH_CLIENT}" ]; then
                    printf "%b" "$SSH_COLOR"
            else
                    printf "%b" "$INFO_COLOR"
            fi
            printf "%s%b" "$(hostname)" "${PROMPT_COLOR}]"
            # :
            printf "%b" "${COLORRESET}:"
            # (/pwd)
            printf "%b" "${PROMPT_COLOR}("
            if [ -w "$PWD" ]; then
                    printf "%b" "${INFO_COLOR}"
            else
                    printf "%b" "${BOLDRED}"
            fi
            if [ -n "$HOME" ] &amp;&amp; [ "$HOME" != "/" ] &amp;&amp; { [ "$PWD" = "$HOME" ] || [ "$PWD" != "${PWD#"$HOME/"}" ]; }; then
                    printf "%s" "~${PWD#"$HOME"}"
            else
                    printf "%s" "${PWD}"
            fi
            printf "%b" "${PROMPT_COLOR})${COLORRESET}"
            # :(EXITCODE)
            if [ "$1" != 0 ]; then
                    printf "%b" "${COLORRESET}:"
                    printf "%b%s%b" "${PROMPT_COLOR}(${BOLDRED}" "${1}" "${PROMPT_COLOR})${COLORRESET}"
            fi
            # ->$
            # ->#
            printf "%b" "\n${PROMPT_COLOR}->${PROMPT_EMBLEM} ${COLORRESET}${CURSOR_BLINK}"
    }
    export PS1='$(__shellprompt $?)'
    #-----PS1-----#