Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # a)
- # name: lazydog
- # filename: myfirstshell.sh
- # description: of no sense
- export SCRIPTNAME="$(cd "$(dirname $0)"; echo "$PWD/$(basename $0)")"
- bash -s <<-'EOF'
- perl -mPOSIX=strftime -E "$(perl -CSDA -pe \
- 's/^\s*\K#([a-z]+ \(.*?\))\)/say \"\n========== $1 ==========\";/g' <<'EOS'
- #b (greeting))
- $users = `cut -d: -f1 /etc/passwd`;
- chomp($cur_user = `grep -Po '^# name:\\s*\\K.*' $ENV{SCRIPTNAME}`);
- say +($users =~ $cur_user) ? "Hello! $cur_user" : "Fuck you, $cur_user!";
- #c (date & time))
- say strftime('%Y-%m-%d %T', localtime);
- #d (calendar))
- system('cal');
- #e (machine name))
- system('hostname');
- #f (operation system & version))
- system(q{grep -Pwo '(NAME|VERSION)="\K[^"]+' /etc/os-release |
- sed '1s/^/operation: /; 2s/^/version: /'});
- #g (file in parent path))
- system('ls ..');
- #h (processes ownered by root (keep 10 items))
- system(q{ps -ef | awk '/^root/&&$8!~/^\[/' | head -10});
- #i (env value: TERM PATH HOME))
- say "$_: @{[$ENV{$_} =~ s/:/\n /gr]}" for qw[TERM PATH HOME];
- #j (disk usage))
- system('df -h');
- #k (group id))
- system('id -g');
- #m (bye))
- system(q#
- python -c 'print("".join(chr(int([x[8:] + x[:8] for x in [format(((
- int(__import__("math").sqrt(((1 << 64) - 1) ^ int("".join(list(map(
- lambda x: "".join(x),zip(*[iter(b)] * 8)))[::-1]), 2))) >> 8) & ((1
- << 16) - 1)), "016b")]][0][::-1], 2))for b in map("".join,zip(*[
- iter([s1[(len(s1) % 64) // 2:(len(s1) - (len(s1) % 64 -(len(s1) % 64)
- // 2))]for s1 in ["".join("""
- ○ ● ● ● ● ○ ● ● ● ● ○ ● ● ● ● ● ● ● ○ ● ● ● ●
- ● ● ● ○ ● ● ● ○ ● ● ○ ● ○ ● ● ○ ○ ○ ○ ● ○ ○ ●
- ○ ● ● ○ ○ ○ ● ● ● ● ● ○ ● ○ ● ○ ● ● ● ● ● ○ ●
- ○ ● ○ ○ ● ● ● ● ○ ● ● ● ● ● ● ● ● ○ ○ ● ● ● ○
- ○ ● ○ ● ● ● ● ○ ○ ● ● ● ○ ● ○ ○ ○ ○ ● ● ○ ● ●
- ● ○ ○ ○ ○ ● ● ● ○ ○ ● ● ○ ● ● ● ● ● ○ ● ○ ● ●
- ○ ● ● ● ○ ● ○ ○ ● ● ● ● ○ ● ● ○ ○ ○ ○ ○ ○ ● ○
- ● ● ○ ● ● ● ○ ● ○ ○ ● ○ ● ● ○ ○ ○ ○ ● ● ○ ● ○
- ○ ○ ○ ● ● ● ○ ● ○ ○ ● ● ● ○ ● ○ ○ ● ○ ○ ○ ● ○
- ● ○ ○ ○ ● ● ● ● ● ● ○ ● ● ● ○ ● ● ● ● ● ● ● ●
- ● ○ ○ ○ ● ● ● ○ ● ○ ○ ● ● ○ ○ ● ● ● ● ● ● ○ ○
- ● ● ○ ● ● ● ○ ● ● ○ ● ● ● ○ ● ● ○ ● ● ● ○ ● ○
- ● ○ ○ ○ ● ● ● ● ○ ○ ● ● ● ○ ● ○ ● ● ○ ● ● ○ ○
- ● ● ○ ○ ○ ● ○ ● ● ○ ○ ● ● ○ ● ○ ○ ● ● ○ ● ○ ○
- ● ○ ○ ● ● ○ ● ○ ● ○ ● ● ○ ● ○ ● ● ● ● ○ ● ● ●
- ● ○ ○ ● ○ ● ○ ○ ○ ● ● ○ ○ ● ○ ● ● ● ● ○ ● ● ○
- ○ ● ● ○ ● ● ○ ● ● ● ● ● ○ ● ● ○ ○ ● ○ ○ ● ○ ○
- ○ ● ○ ● ○ ● ○ ○ ○ ○ ● ● ○ ● ● ● ● ● ● ● ● ● ○
- ● ● ● ● ● ○ ● ○ ○ ● ● ○ ● ● ○ ● ○ ○ ● ○ ● ● ●
- ○ ○ ○ ○ ● ● ● ● ○ ● ● ● ○ ○ ○ ○ ○ ● ○ ● ● ○ ●
- ○ ● ● ○ ○ ● ● ○ ● ○ ● ○ ○ ● ● ○ ● ○ ○ ● ● ○ ○
- ○ ○ ● ○ ○ ○ ● ○ ○ ○ ● ● ● ○ ● ● ● ○ ● ○ ○ ○ ○
- ○ ● ● ● ○ ● ○ ● ● ● ● ● ● ● ● ● ● ● ○ ○ ○ ● ●
- """.strip().split("\n")[::-1]).replace(" ", "").translate(
- str.maketrans(dict(zip("○●", "01"))))]][0])] * 64))))'
- #);
- EOS
- )"
- EOF
Add Comment
Please, Sign In to add comment