Skip to content

Instantly share code, notes, and snippets.

View carlohcs's full-sized avatar
:octocat:
Focusing on AI!

Carlos Santana carlohcs

:octocat:
Focusing on AI!
View GitHub Profile
@paulmwatson
paulmwatson / cypress_test_404_spec.js
Created January 14, 2021 08:33
Testing a 404 page with Cypress
cy.visit('/404')
//=> Test fails
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes but does not test the HTTP code was 404
cy.request({url: '/404', failOnStatusCode: false}).its('status').should('equal', 404)
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes, tests that the HTTP code was 404, and tests page was visited
@leo-aa88
leo-aa88 / vulnerability_check.sh
Created April 2, 2024 10:21
Check for liblzma vulnerability in sshd
#!/bin/bash
set -u
set -x # Print commands and their arguments as they are executed.
# find path to liblzma used by sshd
path="$(ldd $(which sshd) | grep liblzma | grep -o '/[^ ]*')" || echo "liblzma not found for sshd"
# If the path is empty, the script will now continue instead of exiting due to set -e being removed.
if [ "$path" == "" ]
@Mohammad-Reihani
Mohammad-Reihani / starship.toml
Last active August 27, 2025 20:37
Starship configuration file | Reproduced Kali's default PS1 prompt
# ~/.config/starship.toml
add_newline = true
continuation_prompt = "[▸▹ ](dimmed white)"
format = """[┌──\\(](bold green)$username[㉿](bold green)$hostname[\\)-\\[](bold green)$time[\\]-\\[](bold green)$directory[\\]](bold green)\
(\n[│](green)( $python) |( $git_branch$git_commit$git_state))
[└](bold green)$cmd_duration[─](bold green)[\\$ ](bold blue)"""
right_format = '''$battery'''