Security

Token

There is no security token.

Firewall

main Name
Security enabled
Stateless

Configuration

Key Value
provider security.user.provider.concrete.app_user_provider
context main
entry_point App\Security\KbinAuthenticator
user_checker App\Security\UserChecker
access_denied_handler (none)
access_denied_url (none)
authenticators
[
  "two_factor"
  "remember_me"
  "App\Security\KbinAuthenticator"
  "App\Security\FacebookAuthenticator"
  "App\Security\GoogleAuthenticator"
  "App\Security\GithubAuthenticator"
  "App\Security\KeycloakAuthenticator"
]

Listeners

Listener Duration Response
Symfony\Component\Security\Http\Firewall\ChannelListener {#723
  -map: Symfony\Component\Security\Http\AccessMap {#722 …}
  -logger: Monolog\Logger {#783 …}
  -httpPort: 80
  -httpsPort: 443
}
0.00 ms (none)
Symfony\Component\Security\Http\Firewall\ContextListener {#706
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage {#1017 …}
  -sessionKey: "_security_main"
  -logger: Monolog\Logger {#783 …}
  -userProviders: Symfony\Component\DependencyInjection\Argument\RewindableGenerator {#705 …}
  -dispatcher: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher {#747 …}
  -registered: false
  -trustResolver: Scheb\TwoFactorBundle\Security\Authentication\AuthenticationTrustResolver {#780 …}
  -sessionTrackerEnabler: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage::enableUsageTracking(): void {#703 …}
}
2.68 ms (none)
Symfony\Component\Security\Http\Firewall\AuthenticatorManagerListener {#584
  -authenticatorManager: Symfony\Component\Security\Http\Authentication\AuthenticatorManager {#595 …}
}
0.00 ms (none)
Scheb\TwoFactorBundle\Security\Http\Firewall\TwoFactorAccessListener {#582
  -twoFactorFirewallConfig: Scheb\TwoFactorBundle\Security\TwoFactor\TwoFactorFirewallConfig {#842 …}
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -twoFactorAccessDecider: Scheb\TwoFactorBundle\Security\Authorization\TwoFactorAccessDecider {#581 …}
}
0.06 ms (none)
Symfony\Component\Security\Http\Firewall\AccessListener {#579
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -accessDecisionManager: Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager {#937 …}
  -map: Symfony\Component\Security\Http\AccessMap {#722 …}
}
0.00 ms (none)
Symfony\Component\Security\Http\Firewall\LogoutListener {#786
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -options: [
    "csrf_parameter" => "_csrf_token"
    "csrf_token_id" => "logout"
    "logout_path" => "app_logout"
  ]
  -httpUtils: Symfony\Component\Security\Http\HttpUtils {#841 …}
  -csrfTokenManager: Symfony\Component\Security\Csrf\CsrfTokenManager {#1015 …}
  -eventDispatcher: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher {#747 …}
}
0.00 ms (none)

Authenticators

No authenticators have been recorded. Check previous profiles on your authentication endpoint.

Access Decision

affirmative Strategy
# Voter class
1
"Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter"
2
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
3
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
4
"Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter"
5
"App\Security\Voter\EntryCommentVoter"
6
"App\Security\Voter\EntryVoter"
7
"App\Security\Voter\MagazineVoter"
8
"App\Security\Voter\MessageThreadVoter"
9
"App\Security\Voter\MessageVoter"
10
"App\Security\Voter\NotificationVoter"
11
"App\Security\Voter\OAuth2UserConsentVoter"
12
"App\Security\Voter\PostCommentVoter"
13
"App\Security\Voter\PostVoter"
14
"App\Security\Voter\UserVoter"

Access decision log

# Result Attributes Object
1 DENIED ROLE_USER
null
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
ACCESS DENIED
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
2 DENIED moderate
App\Entity\EntryComment {#1396
  +user: Proxies\__CG__\App\Entity\User {#1365 …}
  +entry: App\Entity\Entry {#1790 …}
  +magazine: App\Entity\Magazine {#314
    +icon: Proxies\__CG__\App\Entity\Image {#295 …}
    +name: "linux@lemmy.ml"
    +title: "linux"
    +description: """
      From Wikipedia, the free encyclopedia\n
      \n
      Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).\n
      \n
      Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.\n
      \n
      ### Rules\n
      \n
      - Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.\n
      - No misinformation\n
      - No NSFW content\n
      - No hate speech, bigotry, etc\n
      \n
      ### Related Communities\n
      \n
      - [!opensource@lemmy.ml](https://lemmy.ml/c/opensource)\n
      - [!libre_culture@lemmy.ml](https://lemmy.ml/c/libre_culture)\n
      - [!technology@lemmy.ml](https://lemmy.ml/c/technology)\n
      - [!libre_hardware@lemmy.ml](https://lemmy.ml/c/libre_hardware)\n
      \n
      Community icon by [Alpár-Etele Méder](https://www.iconfinder.com/pocike), licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 1406
    +entryCommentCount: 28632
    +postCount: 6
    +postCommentCount: 214
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729583542 {#322
      date: 2024-10-22 09:52:22.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#286 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#282 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#271 …}
    +entries: Doctrine\ORM\PersistentCollection {#229 …}
    +posts: Doctrine\ORM\PersistentCollection {#187 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#249 …}
    +bans: Doctrine\ORM\PersistentCollection {#166 …}
    +reports: Doctrine\ORM\PersistentCollection {#152 …}
    +badges: Doctrine\ORM\PersistentCollection {#130 …}
    +logs: Doctrine\ORM\PersistentCollection {#120 …}
    +awards: Doctrine\ORM\PersistentCollection {#109 …}
    +categories: Doctrine\ORM\PersistentCollection {#96 …}
    -id: 73
    +apId: "linux@lemmy.ml"
    +apProfileId: "https://lemmy.ml/c/linux"
    +apPublicUrl: "https://lemmy.ml/c/linux"
    +apFollowersUrl: "https://lemmy.ml/c/linux/followers"
    +apInboxUrl: "https://lemmy.ml/inbox"
    +apDomain: "lemmy.ml"
    +apPreferredUsername: "linux"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729583596 {#323
      date: 2024-10-22 09:53:16.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1698929468 {#317
      date: 2023-11-02 13:51:08.0 +01:00
    }
  }
  +image: null
  +parent: null
  +root: null
  +body: """
    A person in this thread already recommended having different colors for different conditions like ssh and running as root, I havent seen anyone mention this specifically but you can determine if the current working directory is writable with something like `[ -w “$(pwd)” ]` and set the color to red or print a symbol if it doesnt return true.\n
    \n
    Also I recommend putting all the code and logic for your shell prompt in a shell function, and using a substitution shell to put it into the PS1 variable like this:\n
    \n
    ```\n
    \n
    <span style="color:#323232;">__shellprompt ()\n
    </span><span style="color:#323232;">{\n
    </span><span style="color:#323232;">\tif [ "$(id -u)" = 0 ]; then\n
    </span><span style="color:#323232;">\t\tlocal PROMPT_EMBLEM='#'\n
    </span><span style="color:#323232;">\telse\n
    </span><span style="color:#323232;">\t\tlocal PROMPT_EMBLEM='$'\n
    </span><span style="color:#323232;">\tfi\n
    </span><span style="color:#323232;">\tprintf "%s" "$(whoami)@$(uname -n):$(pwd)"\n
    </span><span style="color:#323232;">\tprintf "n%c " "$PROMPT_EMBLEM"\n
    </span><span style="color:#323232;">}\n
    </span><span style="color:#323232;">PS1='$(__shellprompt)'\n
    </span>\n
    ```\n
    \n
    Now this is just a really barebones example, there is a whole lot more you can do like passing in the last exit code through the argv of your shellprompt function like this `PS1=‘$(__shellprompt $?)’` and like print it out if its non-zero so you wont have to like `echo $?` to see if the last command failed, but you should be able to still do this. In my testing, running the shell prompt function in the subsitiution shell didnt effect the $? variable.\n
    \n
    In my first comment on another thread about shell prompts, I posted my full shellprompt, it is slightly outdated (I just changed `hostname` to `uname -n`), if you cant find it feel free to send a message or just ask, and I will send you the code.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 1
  +score: 0
  +lastActive: DateTime @1699929949 {#1768
    date: 2023-11-14 03:45:49.0 +01:00
  }
  +ip: null
  +tags: [
    "323232"
  ]
  +mentions: [
    "@wolf@lemmy.zip"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1369 …}
  +nested: Doctrine\ORM\PersistentCollection {#1370 …}
  +votes: Doctrine\ORM\PersistentCollection {#2429 …}
  +reports: Doctrine\ORM\PersistentCollection {#1367 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2487 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2477 …}
  -id: 107768
  -bodyTs: "'0':93 'abl':179 'alreadi':6 'also':58 'anoth':205 'anyon':23 'argv':142 'ask':239 'barebon':122 'c':111 'cant':228 'chang':221 'code':64,139,246 'color':10,46 'command':173 'comment':203 'condit':13 'current':33 'determin':30 'didnt':196 'differ':9,12 'directori':35 'doesnt':55 'echo':167 'effect':197 'els':98 'emblem':97,101,113 'exampl':123 'exit':138 'fail':174 'feel':231 'fi':102 'find':229 'first':202 'free':232 'full':213 'function':74,146,191 'havent':21 'hostnam':222 'id':91 'last':137,172 'like':14,40,87,133,147,152,166 'local':95,99 'logic':66 'lot':128 'mention':24 'messag':236 'n':107,110,225 'non':159 'non-zero':158 'outdat':218 'pass':134 'person':2 'post':211 'print':50,153 'printf':103,109 'prompt':70,96,100,112,190,209 'ps1':85,114,149 'put':61,81 'pwd':42,108 'realli':121 'recommend':7,60 'red':48 'return':56 'root':19 'run':17,187 'see':169 'seen':22 'send':234,243 'set':44 'shell':69,73,79,189,195,208 'shellprompt':89,115,145,150,214 'slight':217 'someth':39 'specif':26 'ssh':15 'still':181 'subsitiut':194 'substitut':78 'symbol':52 'test':186 'thread':5,206 'true':57 'u':92 'unam':106,224 'use':76 'variabl':86,199 'w':41 'whoami':105 'whole':127 'wont':163 'work':34 'writabl':37 'zero':160"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://lemmy.blahaj.zone/comment/4253531"
  +editedAt: null
  +createdAt: DateTimeImmutable @1699627856 {#1938
    date: 2023-11-10 15:50:56.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
3 DENIED edit
App\Entity\EntryComment {#1396
  +user: Proxies\__CG__\App\Entity\User {#1365 …}
  +entry: App\Entity\Entry {#1790 …}
  +magazine: App\Entity\Magazine {#314
    +icon: Proxies\__CG__\App\Entity\Image {#295 …}
    +name: "linux@lemmy.ml"
    +title: "linux"
    +description: """
      From Wikipedia, the free encyclopedia\n
      \n
      Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).\n
      \n
      Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.\n
      \n
      ### Rules\n
      \n
      - Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.\n
      - No misinformation\n
      - No NSFW content\n
      - No hate speech, bigotry, etc\n
      \n
      ### Related Communities\n
      \n
      - [!opensource@lemmy.ml](https://lemmy.ml/c/opensource)\n
      - [!libre_culture@lemmy.ml](https://lemmy.ml/c/libre_culture)\n
      - [!technology@lemmy.ml](https://lemmy.ml/c/technology)\n
      - [!libre_hardware@lemmy.ml](https://lemmy.ml/c/libre_hardware)\n
      \n
      Community icon by [Alpár-Etele Méder](https://www.iconfinder.com/pocike), licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 1406
    +entryCommentCount: 28632
    +postCount: 6
    +postCommentCount: 214
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729583542 {#322
      date: 2024-10-22 09:52:22.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#286 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#282 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#271 …}
    +entries: Doctrine\ORM\PersistentCollection {#229 …}
    +posts: Doctrine\ORM\PersistentCollection {#187 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#249 …}
    +bans: Doctrine\ORM\PersistentCollection {#166 …}
    +reports: Doctrine\ORM\PersistentCollection {#152 …}
    +badges: Doctrine\ORM\PersistentCollection {#130 …}
    +logs: Doctrine\ORM\PersistentCollection {#120 …}
    +awards: Doctrine\ORM\PersistentCollection {#109 …}
    +categories: Doctrine\ORM\PersistentCollection {#96 …}
    -id: 73
    +apId: "linux@lemmy.ml"
    +apProfileId: "https://lemmy.ml/c/linux"
    +apPublicUrl: "https://lemmy.ml/c/linux"
    +apFollowersUrl: "https://lemmy.ml/c/linux/followers"
    +apInboxUrl: "https://lemmy.ml/inbox"
    +apDomain: "lemmy.ml"
    +apPreferredUsername: "linux"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729583596 {#323
      date: 2024-10-22 09:53:16.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1698929468 {#317
      date: 2023-11-02 13:51:08.0 +01:00
    }
  }
  +image: null
  +parent: null
  +root: null
  +body: """
    A person in this thread already recommended having different colors for different conditions like ssh and running as root, I havent seen anyone mention this specifically but you can determine if the current working directory is writable with something like `[ -w “$(pwd)” ]` and set the color to red or print a symbol if it doesnt return true.\n
    \n
    Also I recommend putting all the code and logic for your shell prompt in a shell function, and using a substitution shell to put it into the PS1 variable like this:\n
    \n
    ```\n
    \n
    <span style="color:#323232;">__shellprompt ()\n
    </span><span style="color:#323232;">{\n
    </span><span style="color:#323232;">\tif [ "$(id -u)" = 0 ]; then\n
    </span><span style="color:#323232;">\t\tlocal PROMPT_EMBLEM='#'\n
    </span><span style="color:#323232;">\telse\n
    </span><span style="color:#323232;">\t\tlocal PROMPT_EMBLEM='$'\n
    </span><span style="color:#323232;">\tfi\n
    </span><span style="color:#323232;">\tprintf "%s" "$(whoami)@$(uname -n):$(pwd)"\n
    </span><span style="color:#323232;">\tprintf "n%c " "$PROMPT_EMBLEM"\n
    </span><span style="color:#323232;">}\n
    </span><span style="color:#323232;">PS1='$(__shellprompt)'\n
    </span>\n
    ```\n
    \n
    Now this is just a really barebones example, there is a whole lot more you can do like passing in the last exit code through the argv of your shellprompt function like this `PS1=‘$(__shellprompt $?)’` and like print it out if its non-zero so you wont have to like `echo $?` to see if the last command failed, but you should be able to still do this. In my testing, running the shell prompt function in the subsitiution shell didnt effect the $? variable.\n
    \n
    In my first comment on another thread about shell prompts, I posted my full shellprompt, it is slightly outdated (I just changed `hostname` to `uname -n`), if you cant find it feel free to send a message or just ask, and I will send you the code.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 1
  +score: 0
  +lastActive: DateTime @1699929949 {#1768
    date: 2023-11-14 03:45:49.0 +01:00
  }
  +ip: null
  +tags: [
    "323232"
  ]
  +mentions: [
    "@wolf@lemmy.zip"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1369 …}
  +nested: Doctrine\ORM\PersistentCollection {#1370 …}
  +votes: Doctrine\ORM\PersistentCollection {#2429 …}
  +reports: Doctrine\ORM\PersistentCollection {#1367 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2487 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2477 …}
  -id: 107768
  -bodyTs: "'0':93 'abl':179 'alreadi':6 'also':58 'anoth':205 'anyon':23 'argv':142 'ask':239 'barebon':122 'c':111 'cant':228 'chang':221 'code':64,139,246 'color':10,46 'command':173 'comment':203 'condit':13 'current':33 'determin':30 'didnt':196 'differ':9,12 'directori':35 'doesnt':55 'echo':167 'effect':197 'els':98 'emblem':97,101,113 'exampl':123 'exit':138 'fail':174 'feel':231 'fi':102 'find':229 'first':202 'free':232 'full':213 'function':74,146,191 'havent':21 'hostnam':222 'id':91 'last':137,172 'like':14,40,87,133,147,152,166 'local':95,99 'logic':66 'lot':128 'mention':24 'messag':236 'n':107,110,225 'non':159 'non-zero':158 'outdat':218 'pass':134 'person':2 'post':211 'print':50,153 'printf':103,109 'prompt':70,96,100,112,190,209 'ps1':85,114,149 'put':61,81 'pwd':42,108 'realli':121 'recommend':7,60 'red':48 'return':56 'root':19 'run':17,187 'see':169 'seen':22 'send':234,243 'set':44 'shell':69,73,79,189,195,208 'shellprompt':89,115,145,150,214 'slight':217 'someth':39 'specif':26 'ssh':15 'still':181 'subsitiut':194 'substitut':78 'symbol':52 'test':186 'thread':5,206 'true':57 'u':92 'unam':106,224 'use':76 'variabl':86,199 'w':41 'whoami':105 'whole':127 'wont':163 'work':34 'writabl':37 'zero':160"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://lemmy.blahaj.zone/comment/4253531"
  +editedAt: null
  +createdAt: DateTimeImmutable @1699627856 {#1938
    date: 2023-11-10 15:50:56.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
4 DENIED moderate
App\Entity\EntryComment {#1396
  +user: Proxies\__CG__\App\Entity\User {#1365 …}
  +entry: App\Entity\Entry {#1790 …}
  +magazine: App\Entity\Magazine {#314
    +icon: Proxies\__CG__\App\Entity\Image {#295 …}
    +name: "linux@lemmy.ml"
    +title: "linux"
    +description: """
      From Wikipedia, the free encyclopedia\n
      \n
      Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).\n
      \n
      Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.\n
      \n
      ### Rules\n
      \n
      - Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.\n
      - No misinformation\n
      - No NSFW content\n
      - No hate speech, bigotry, etc\n
      \n
      ### Related Communities\n
      \n
      - [!opensource@lemmy.ml](https://lemmy.ml/c/opensource)\n
      - [!libre_culture@lemmy.ml](https://lemmy.ml/c/libre_culture)\n
      - [!technology@lemmy.ml](https://lemmy.ml/c/technology)\n
      - [!libre_hardware@lemmy.ml](https://lemmy.ml/c/libre_hardware)\n
      \n
      Community icon by [Alpár-Etele Méder](https://www.iconfinder.com/pocike), licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 1406
    +entryCommentCount: 28632
    +postCount: 6
    +postCommentCount: 214
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729583542 {#322
      date: 2024-10-22 09:52:22.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#286 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#282 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#271 …}
    +entries: Doctrine\ORM\PersistentCollection {#229 …}
    +posts: Doctrine\ORM\PersistentCollection {#187 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#249 …}
    +bans: Doctrine\ORM\PersistentCollection {#166 …}
    +reports: Doctrine\ORM\PersistentCollection {#152 …}
    +badges: Doctrine\ORM\PersistentCollection {#130 …}
    +logs: Doctrine\ORM\PersistentCollection {#120 …}
    +awards: Doctrine\ORM\PersistentCollection {#109 …}
    +categories: Doctrine\ORM\PersistentCollection {#96 …}
    -id: 73
    +apId: "linux@lemmy.ml"
    +apProfileId: "https://lemmy.ml/c/linux"
    +apPublicUrl: "https://lemmy.ml/c/linux"
    +apFollowersUrl: "https://lemmy.ml/c/linux/followers"
    +apInboxUrl: "https://lemmy.ml/inbox"
    +apDomain: "lemmy.ml"
    +apPreferredUsername: "linux"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729583596 {#323
      date: 2024-10-22 09:53:16.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1698929468 {#317
      date: 2023-11-02 13:51:08.0 +01:00
    }
  }
  +image: null
  +parent: null
  +root: null
  +body: """
    A person in this thread already recommended having different colors for different conditions like ssh and running as root, I havent seen anyone mention this specifically but you can determine if the current working directory is writable with something like `[ -w “$(pwd)” ]` and set the color to red or print a symbol if it doesnt return true.\n
    \n
    Also I recommend putting all the code and logic for your shell prompt in a shell function, and using a substitution shell to put it into the PS1 variable like this:\n
    \n
    ```\n
    \n
    <span style="color:#323232;">__shellprompt ()\n
    </span><span style="color:#323232;">{\n
    </span><span style="color:#323232;">\tif [ "$(id -u)" = 0 ]; then\n
    </span><span style="color:#323232;">\t\tlocal PROMPT_EMBLEM='#'\n
    </span><span style="color:#323232;">\telse\n
    </span><span style="color:#323232;">\t\tlocal PROMPT_EMBLEM='$'\n
    </span><span style="color:#323232;">\tfi\n
    </span><span style="color:#323232;">\tprintf "%s" "$(whoami)@$(uname -n):$(pwd)"\n
    </span><span style="color:#323232;">\tprintf "n%c " "$PROMPT_EMBLEM"\n
    </span><span style="color:#323232;">}\n
    </span><span style="color:#323232;">PS1='$(__shellprompt)'\n
    </span>\n
    ```\n
    \n
    Now this is just a really barebones example, there is a whole lot more you can do like passing in the last exit code through the argv of your shellprompt function like this `PS1=‘$(__shellprompt $?)’` and like print it out if its non-zero so you wont have to like `echo $?` to see if the last command failed, but you should be able to still do this. In my testing, running the shell prompt function in the subsitiution shell didnt effect the $? variable.\n
    \n
    In my first comment on another thread about shell prompts, I posted my full shellprompt, it is slightly outdated (I just changed `hostname` to `uname -n`), if you cant find it feel free to send a message or just ask, and I will send you the code.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 1
  +score: 0
  +lastActive: DateTime @1699929949 {#1768
    date: 2023-11-14 03:45:49.0 +01:00
  }
  +ip: null
  +tags: [
    "323232"
  ]
  +mentions: [
    "@wolf@lemmy.zip"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1369 …}
  +nested: Doctrine\ORM\PersistentCollection {#1370 …}
  +votes: Doctrine\ORM\PersistentCollection {#2429 …}
  +reports: Doctrine\ORM\PersistentCollection {#1367 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2487 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2477 …}
  -id: 107768
  -bodyTs: "'0':93 'abl':179 'alreadi':6 'also':58 'anoth':205 'anyon':23 'argv':142 'ask':239 'barebon':122 'c':111 'cant':228 'chang':221 'code':64,139,246 'color':10,46 'command':173 'comment':203 'condit':13 'current':33 'determin':30 'didnt':196 'differ':9,12 'directori':35 'doesnt':55 'echo':167 'effect':197 'els':98 'emblem':97,101,113 'exampl':123 'exit':138 'fail':174 'feel':231 'fi':102 'find':229 'first':202 'free':232 'full':213 'function':74,146,191 'havent':21 'hostnam':222 'id':91 'last':137,172 'like':14,40,87,133,147,152,166 'local':95,99 'logic':66 'lot':128 'mention':24 'messag':236 'n':107,110,225 'non':159 'non-zero':158 'outdat':218 'pass':134 'person':2 'post':211 'print':50,153 'printf':103,109 'prompt':70,96,100,112,190,209 'ps1':85,114,149 'put':61,81 'pwd':42,108 'realli':121 'recommend':7,60 'red':48 'return':56 'root':19 'run':17,187 'see':169 'seen':22 'send':234,243 'set':44 'shell':69,73,79,189,195,208 'shellprompt':89,115,145,150,214 'slight':217 'someth':39 'specif':26 'ssh':15 'still':181 'subsitiut':194 'substitut':78 'symbol':52 'test':186 'thread':5,206 'true':57 'u':92 'unam':106,224 'use':76 'variabl':86,199 'w':41 'whoami':105 'whole':127 'wont':163 'work':34 'writabl':37 'zero':160"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://lemmy.blahaj.zone/comment/4253531"
  +editedAt: null
  +createdAt: DateTimeImmutable @1699627856 {#1938
    date: 2023-11-10 15:50:56.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
5 DENIED edit
App\Entity\Magazine {#314
  +icon: Proxies\__CG__\App\Entity\Image {#295 …}
  +name: "linux@lemmy.ml"
  +title: "linux"
  +description: """
    From Wikipedia, the free encyclopedia\n
    \n
    Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).\n
    \n
    Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.\n
    \n
    ### Rules\n
    \n
    - Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.\n
    - No misinformation\n
    - No NSFW content\n
    - No hate speech, bigotry, etc\n
    \n
    ### Related Communities\n
    \n
    - [!opensource@lemmy.ml](https://lemmy.ml/c/opensource)\n
    - [!libre_culture@lemmy.ml](https://lemmy.ml/c/libre_culture)\n
    - [!technology@lemmy.ml](https://lemmy.ml/c/technology)\n
    - [!libre_hardware@lemmy.ml](https://lemmy.ml/c/libre_hardware)\n
    \n
    Community icon by [Alpár-Etele Méder](https://www.iconfinder.com/pocike), licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
    """
  +rules: null
  +subscriptionsCount: 1
  +entryCount: 1406
  +entryCommentCount: 28632
  +postCount: 6
  +postCommentCount: 214
  +isAdult: false
  +customCss: null
  +lastActive: DateTime @1729583542 {#322
    date: 2024-10-22 09:52:22.0 +02:00
  }
  +markedForDeletionAt: null
  +tags: null
  +moderators: Doctrine\ORM\PersistentCollection {#286 …}
  +ownershipRequests: Doctrine\ORM\PersistentCollection {#282 …}
  +moderatorRequests: Doctrine\ORM\PersistentCollection {#271 …}
  +entries: Doctrine\ORM\PersistentCollection {#229 …}
  +posts: Doctrine\ORM\PersistentCollection {#187 …}
  +subscriptions: Doctrine\ORM\PersistentCollection {#249 …}
  +bans: Doctrine\ORM\PersistentCollection {#166 …}
  +reports: Doctrine\ORM\PersistentCollection {#152 …}
  +badges: Doctrine\ORM\PersistentCollection {#130 …}
  +logs: Doctrine\ORM\PersistentCollection {#120 …}
  +awards: Doctrine\ORM\PersistentCollection {#109 …}
  +categories: Doctrine\ORM\PersistentCollection {#96 …}
  -id: 73
  +apId: "linux@lemmy.ml"
  +apProfileId: "https://lemmy.ml/c/linux"
  +apPublicUrl: "https://lemmy.ml/c/linux"
  +apFollowersUrl: "https://lemmy.ml/c/linux/followers"
  +apInboxUrl: "https://lemmy.ml/inbox"
  +apDomain: "lemmy.ml"
  +apPreferredUsername: "linux"
  +apDiscoverable: true
  +apManuallyApprovesFollowers: null
  +privateKey: null
  +publicKey: null
  +apFetchedAt: DateTime @1729583596 {#323
    date: 2024-10-22 09:53:16.0 +02:00
  }
  +apDeletedAt: null
  +apTimeoutAt: null
  +visibility: "visible             "
  +createdAt: DateTimeImmutable @1698929468 {#317
    date: 2023-11-02 13:51:08.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS DENIED
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details