log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h
1            Power adapter disconnected
3            Dirty Shutdown/Sleep resulting from forced restart or shutdown
5 Clean Shutdown/Sleep initiated by the user
| require 'jwt' | |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| KEY_ID = "" | |
| PRIVATE_KEY_PATH = ".p8" | |
| API_URL = "https://api.appstoreconnect.apple.com/v1/apps" | |
| private_key = OpenSSL::PKey::EC.new(File.read(PRIVATE_KEY_PATH)) | 
| -- Tesla Transport Protocol (TTPoE) Wireshark Dissector | |
| -- Based on Tesla's Implementation | |
| -- https://github.com/teslamotors/ttpoe | |
| -- Dissector author: github.com/@ferbass | |
| local ttpoe = Proto("ttpoe", "Tesla Transport Protocol over Ethernet") | |
| -- Extension Types | |
| local TTP_EXTENSION_TYPES = { | |
| [0x00] = "TTP_ET__BASE/PROTOCOL/DATA_VC/REQUEST_VC", | 
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o nounset | |
| set -o pipefail | |
| if [[ "${TRACE-0}" == "1" ]]; then | |
| set -o xtrace | |
| fi | |
| # Check for upgradable packages | 
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o nounset | |
| set -o pipefail | |
| if [[ "${TRACE-0}" == "1" ]]; then | |
| set -o xtrace | |
| fi | |
| # Function to send a message to Slack | 
| # convert any kB lines to MB: | |
| awk '$3=="kB"{$2=$2/1024;$3="MB"} 1' /proc/meminfo | |
| # converts to gigabytes: | |
| awk '$3=="kB"{$2=$2/1024^2;$3="GB";} 1' /proc/meminfo | |
| # convert to MB or GB as appropriate: | |
| awk '$3=="kB"{if ($2>1024^2){$2=$2/1024^2;$3="GB";} else if ($2>1024){$2=$2/1024;$3="MB";}} 1' /proc/meminfo | 
| sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig | |
| sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target | |
| exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME | |
| snap version | 
| class Solution { | |
| public: | |
| vector<vector<string>> partition(string s) { | |
| vector<vector<string>> result; | |
| vector<string> part; | |
| dfs(0, s, part, result); | |
| return result; | |
| } | |
| void dfs(int i, string& s, vector<string>& part, vector<vector<string>>& result){ | |
| if(i>=s.size()){ | 
1 - access https://www.linkedin.com/feed/following
2 - Scroll a little
3 - Open developer console;
4 - place the code in this gist
credits/ref: https://mighil.com/mass-unfollow-people-on-linkedin/
| # Copy your updated FrequentWords function (along with all required subroutines) below this line | |
| def FrequentWords(Text, k): | |
| FrequentPatterns = [] # output variable | |
| # your code here | |
| Count = CountDict(Text, k) | |
| m = max(Count.values()) | |
| for i in Count: | |
| if Count[i] == m: | |
| FrequentPatterns.append(Text[i:i+k]) |