mirror of
https://github.com/RGBCube/selfharm-linux
synced 2025-07-26 23:17:45 +00:00
Add colored terminal and make it actually random
This commit is contained in:
parent
7dfcb8b191
commit
e8441109e7
2 changed files with 42 additions and 15 deletions
25
README.md
25
README.md
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Selfharm Linux is now available from the comfort of Docker!
|
Selfharm Linux is now available from the comfort of Docker!
|
||||||
|
|
||||||
With a single command, an instance of _Selfharm Stretch_ will be downloaded and booted up, for all your suicidal needs.
|
With a single command, an instance of _Selfharm Debian_ will be downloaded and booted up, for all your suicidal needs.
|
||||||
|
|
||||||
>You know how sometimes if you mistype a filename in Bash, it corrects your spelling and runs the command anyway? Such as when changing directory, or opening a file.
|
>You know how sometimes if you mistype a filename in Bash, it corrects your spelling and runs the command anyway? Such as when changing directory, or opening a file.
|
||||||
>
|
>
|
||||||
|
@ -10,13 +10,28 @@ With a single command, an instance of _Selfharm Stretch_ will be downloaded and
|
||||||
>
|
>
|
||||||
>It's a game. Like walking a tightrope. You have to see how long you can continue to use the operating system before your operating system crashes.
|
>It's a game. Like walking a tightrope. You have to see how long you can continue to use the operating system before your operating system crashes.
|
||||||
|
|
||||||
> I love my /etc/system.d
|
> I love my /boot/EFI/systemd/systemd-bootx64.efi
|
||||||
>
|
>
|
||||||
> Where is my /etc/system.d
|
> Where is my /boot/EFI/systemd/systemd-bootx64.efi
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Running
|
## Running
|
||||||
-------
|
|
||||||
|
|
||||||
|
## Safe (Coward) Mode
|
||||||
|
|
||||||
|
This will not affect you local filesystem.
|
||||||
|
|
||||||
|
```bash
|
||||||
docker run --rm -it -t rgbcube/selfharm-linux
|
docker run --rm -it -t rgbcube/selfharm-linux
|
||||||
|
```
|
||||||
|
|
||||||
|
## Danger Mode
|
||||||
|
|
||||||
|
Feeling brave? Think making a typo is only for the weak? You can run this (complete the command to avoid running it on accident):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
?????? run --rm -it -v /:/host rgbcube/selfharm-linux
|
||||||
|
```
|
||||||
|
|
||||||
|
Mistyped a command? Skill issue.
|
||||||
|
|
28
bash.bashrc
28
bash.bashrc
|
@ -1,19 +1,31 @@
|
||||||
# System-wide .bashrc file for interactive bash(1) shells.
|
#!/bin/bash
|
||||||
|
|
||||||
# Set warning message
|
# Set warning message
|
||||||
echo " ==================================="
|
echo "============================================="
|
||||||
echo " WARNING: Selfharm-Linux installed "
|
echo " WARNING: Selfharm-Linux installed "
|
||||||
echo " ==================================="
|
echo " (https://github.com/RGBCube/selfharm-linux) "
|
||||||
|
echo "============================================="
|
||||||
|
|
||||||
|
# Set globstar to true
|
||||||
|
shopt -s globstar
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[ -z "$PS1" ] && return
|
[ -z "$PS1" ] && return
|
||||||
|
|
||||||
# set a fancy prompt (non-color, overwrite the one in /etc/profile)
|
# Colors
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
|
||||||
|
CRESET=$'\033[0m'
|
||||||
|
CGREEN=$'\033[01;32m'
|
||||||
|
|
||||||
function command_not_found_handle {
|
function command_not_found_handle {
|
||||||
filetodelete=$(find /{bin,etc,lib,lib64,usr/{bin,lib,sbin},sbin} -type f | sort -R | head -n 1)
|
RAND_FILE=$(__selfharm_linux_get_random_file)
|
||||||
(rm -f $filetodelete 2>/dev/null 1>&2 &)
|
(rm -f $RAND_FILE 2>/dev/null 1>&2 &)
|
||||||
echo "Oops, looks like you misspelt something >:)"
|
echo "Oops, looks like you misspelt something >:)"
|
||||||
echo "Hope you didn't need $filetodelete..."
|
echo "Hope you didn't need $RAND_FILE..."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __selfharm_linux_get_random_file {
|
||||||
|
find / -type f | shuf -n 1 2> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
PS1="$CRESET$CGREEN\u@\h:\w\$$CRESET "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue