#
0.#
source "/Users/d/Dropbox (Personal)/1f.ἡἔρις,κ/1.ontology/myenv/bin/activate"
(myenv) (base) d@Poseidon 1.ontology %
1.#
d@Poseidon 1.ontology % ls -l
total 16
-rw-r--r--@ 1 d staff 936 Aug 21 02:00 README.md
drwxr-xr-x@ 23 d staff 736 Aug 15 16:25 alpha
drwxr-xr-x@ 35 d staff 1120 Aug 21 02:32 bloc
drwxr-xr-x@ 9 d staff 288 Aug 21 12:45 cst
drwxr-xr-x@ 16 d staff 512 Aug 21 03:00 git
drwxr-xr-x@ 17 d staff 544 Aug 7 22:35 git-filter-repo
drwxr-xr-x@ 7 d staff 224 Aug 6 07:33 myenv
drwxr-xr-x@ 13 d staff 416 Aug 14 18:53 nh_projectbeta
-rw-r--r--@ 1 d staff 633 Aug 6 02:34 populate_be.ipynb
drwxr-xr-x@ 13 d staff 416 Aug 15 02:12 seasons_projectalpha
drwxr-xr-x@ 13 d staff 416 Aug 17 14:05 sibs
drwxr-xr-x@ 139 d staff 4448 Jun 25 08:29 summer
drwxr-xr-x@ 25 d staff 800 Jul 20 20:21 verano
2.#
#!/bin/bash
# Check if required commands are available
for cmd in git ssh-keygen jb ghp-import; do
if ! command -v $cmd &> /dev/null; then
echo "Error: $cmd is not installed."
exit 1
fi
done
# Input information
read -p "Enter your GitHub username: " GITHUB_USERNAME
read -p "Enter your GitHub repository name: " REPO_NAME
read -p "Enter your email address: " EMAIL_ADDRESS
read -p "Enter your root directory (e.g., ~/Dropbox/1f.ἡἔρις,κ/1.ontology): " ROOT_DIR
read -p "Enter the name of the subdirectory to be created within the root directory: " SUBDIR_NAME
read -p "Enter the name of the populate_be.ipynb file in ROOT_DIR: " POPULATE_BE
read -p "Enter your git commit message: " GIT_COMMIT_MESSAGE
read -p "Enter the number of acts: " NUMBER_OF_ACTS
read -p "Enter the number of files per act: " NUMBER_OF_FILES_PER_ACT
read -p "Enter the number of sub-files per file: " NUMBER_OF_SUB_FILES_PER_FILE
read -p "Enter the number of notebooks: " NUMBER_OF_NOTEBOOKS
# Set up directories and paths
git config --local user.name "$GITHUB_USERNAME"
git config --local user.email "$EMAIL_ADDRESS"
cd $(eval echo $ROOT_DIR)
rm -rf $REPO_NAME
mkdir -p $SUBDIR_NAME
cp $POPULATE_BE $SUBDIR_NAME/intro.ipynb
cd $SUBDIR_NAME
# Check if SSH keys already exist, and if not, generate a new one
SSH_KEY_PATH="$HOME/.ssh/id_${SUBDIR_NAME}${REPO_NAME}"
rm -rf $SSH_KEY_PATH*
if [ ! -f "$SSH_KEY_PATH" ]; then
ssh-keygen -t ed25519 -C "$EMAIL_ADDRESS" -f $SSH_KEY_PATH
fi
cat ${SSH_KEY_PATH}.pub
echo "Please manually add the above SSH public key to your GitHub account's SSH keys."
read -p "Once you have added the SSH key to your GitHub account, press Enter to continue..."
eval "$(ssh-agent -s)"
ssh-add --apple-use-keychain $SSH_KEY_PATH
# Create _toc.yml file
toc_file="_toc.yml"
echo "format: jb-book" > $toc_file
echo "root: intro.ipynb" >> $toc_file # Make sure this file exists
echo "title: Play" >> $toc_file
echo "parts:" >> $toc_file
# Iterate through the acts, files per act, and sub-files per file
for ((i=0; i<$NUMBER_OF_ACTS; i++)); do
mkdir -p "act_${i}"
echo " - caption: Part $(($i + 1))" >> $toc_file
echo " chapters:" >> $toc_file
for ((j=0; j<$NUMBER_OF_FILES_PER_ACT; j++)); do
mkdir -p "act_${i}/act_${i}_${j}"
for ((k=0; k<$NUMBER_OF_SUB_FILES_PER_FILE; k++)); do
mkdir -p "act_${i}/act_${i}_${j}/act_${i}_${j}_${k}"
for ((n=1; n<=$NUMBER_OF_NOTEBOOKS; n++)); do
new_file="act_${i}/act_${i}_${j}/act_${i}_${j}_${k}/act_${i}_${j}_${k}_${n}.ipynb"
touch "$new_file"
cp "intro.ipynb" "$new_file" # This line copies the content into the new file
echo " - file: $new_file" >> $toc_file
done
done
done
done
# Create _config.yml file
config_file="_config.yml"
echo "title: Your Book Title" > $config_file
echo "copyright: Mwaka" > $config_file
echo "author: Your Name" >> $config_file
echo "logo: https://raw.githubusercontent.com/jhutrc/jhutrc.github.io/main/hub_and_spoke.jpg" >> $config_file
# Build the book with Jupyter Book
cd ..
jb build $SUBDIR_NAME
git clone "https://github.com/$GITHUB_USERNAME/$REPO_NAME"
cp -r $SUBDIR_NAME/* $REPO_NAME
cd $REPO_NAME
git add ./*
git commit -m "$GIT_COMMIT_MESSAGE"
chmod 600 $SSH_KEY_PATH
# Configure the remote URL with SSH
git remote set-url origin "git@github.com:$GITHUB_USERNAME/$REPO_NAME"
# Push changes
git push -u origin main
ghp-import -n -p -f _build/html
rm -rf $REPO_NAME
echo "Jupyter Book content updated and pushed to $GITHUB_USERNAME/$REPO_NAME repository!"
3#
The script will create a directory structure for a Jupyter Book (using the jb
command) inside a given root directory. The structure will consist of a nested hierarchy of acts, files per act, and sub-files per file. Based on the provided script, here’s the directory structure that will be created:
ROOT_DIR/
├── SUBDIR_NAME/
│ ├── intro.ipynb
│ ├── act_0/
│ │ ├── act_0_0/
│ │ │ ├── act_0_0_0/
│ │ │ │ ├── act_0_0_0_1.ipynb
│ │ │ │ ├── act_0_0_0_2.ipynb
│ │ │ │ └── act_0_0_0_3.ipynb
│ │ │ ├── act_0_0_1/
│ │ │ │ └── ... (similar structure as above)
│ │ │ └── ...
│ │ ├── act_0_1/
│ │ └── ... (similar structure as above)
│ ├── act_1/
│ ├── ... (similar structure as above)
│ ├── _toc.yml
│ └── _config.yml
└── REPO_NAME/ (temporary clone of the GitHub repository)
Note: The value of ROOT_DIR
and SUBDIR_NAME
will be provided by the user, and the value of NUMBER_OF_NOTEBOOKS
is set to 3 in the script.
In addition, the _toc.yml
file will describe the structure of the book, linking the different acts, files per act, and sub-files per file together. The _config.yml
file will contain configuration details for the book.
The repository directory (REPO_NAME
) is temporarily created as part of the Git process and is removed at the end of the script.
Finally, the book content is built using Jupyter Book (jb build $SUBDIR_NAME
) and pushed to the GitHub repository provided by the user.
4#
Show code cell source
import networkx as nx
import matplotlib.pyplot as plt
# Set seed for layout
seed = 2
# Directory structure
structure = {
"Fena": ["Epilogue", "Project", "Skills", "Dramatis Personae", "Challenges"],
"Numbers": ["Variance", "R01", "K24", "U01"],
"Epilogue": ["Open-Science", "Self-Publish", "Peer-Reviewed", "Grants", "Proposals"],
"Skills": ["Python", "AI", "R", "Stata", "Numbers"],
"AI": ["ChatGPT", "Co-Pilot"],
"Project": ["Manuscript", "Code", "Git"],
"Estimates": ["Nonparametric", "Semiparametric", "Parametric", "Simulation", "Uses/Abuses"],
"Numbers": ["Estimates", "Variance"],
"Variance": ["Oneway", "Twoway", "Multivariable", "Hierarchical", "Clinical", "."],
"Dramatis Personae": ["High School Students", "Undergraduates", "Graduate Students", "Medical Students", "Residents", "Fellows", "Faculty", "Analysts", "Staff", "Collaborators", "Graduates"],
"Challenges": ["Truth", "Rigor", "Error", "Sloppiness", "Fraud", "Learning"],
}
# Gentle colors for children
child_colors = ["lightgreen", "lightpink", "lightyellow",
'lavender', 'lightcoral', 'honeydew', 'azure','lightblue',
]
# 'lightsteelblue', 'lightgray', 'mintcream','mintcream', 'azure', 'linen', 'aliceblue', 'lemonchiffon', 'mistyrose'
# List of nodes to color light blue
light_blue_nodes = ["Epilogue", "Skills", "Dramatis Personae", "Project", "Challenges"]
G = nx.Graph()
node_colors = {}
# Function to capitalize the first letter of each word
def capitalize_name(name):
return ' '.join(word.capitalize() for word in name.split(" "))
# Assign colors to nodes
for i, (parent, children) in enumerate(structure.items()):
parent_name = capitalize_name(parent.replace("_", " "))
G.add_node(parent_name)
# Set the color for Fena
if parent_name == "Fena":
node_colors[parent_name] = 'lightgray'
else:
node_colors[parent_name] = child_colors[i % len(child_colors)]
for child in children:
child_name = capitalize_name(child.replace("_", " "))
G.add_edge(parent_name, child_name)
if child_name in light_blue_nodes:
node_colors[child_name] = 'lightblue'
else:
node_colors[child_name] = child_colors[(i + 6) % len(child_colors)] # You can customize the logic here to assign colors
colors = [node_colors[node] for node in G.nodes()]
# Set figure size
plt.figure(figsize=(30, 30))
# Draw the graph
pos = nx.spring_layout(G, scale=30, seed=seed)
nx.draw_networkx_nodes(G, pos, node_size=10000, node_color=colors, edgecolors='black') # Boundary color set here
nx.draw_networkx_edges(G, pos)
nx.draw_networkx_labels(G, pos, font_size=20)
plt.show()
![../../../_images/185f4dfc8fee4cd6d6e20986bbaaf1fe8f70197fc303d67a79b30aa7a1578933.png](../../../_images/185f4dfc8fee4cd6d6e20986bbaaf1fe8f70197fc303d67a79b30aa7a1578933.png)
5#
Show code cell source
import random
import faker
# Set a seed for reproducibility
seed_value = 42
random.seed(seed_value)
fake = faker.Faker()
# Seed the Faker instance with the same value
fake.seed_instance(seed_value)
# Function to generate random GitHub account names
def generate_github_accounts():
fake = faker.Faker(['en_US', 'es_ES', 'fr_FR', 'ar_EG', 'ru_RU', 'ja_JP', 'ko_KR', 'zh_CN', 'hi_IN'])
github_accounts = [fake.user_name() for _ in range(100)]
return github_accounts
# Function to generate random repo names
def generate_repo_names():
fake = faker.Faker(['en_US', 'es_ES', 'fr_FR', 'ar_EG', 'ru_RU', 'ja_JP', 'ko_KR', 'zh_CN', 'hi_IN'])
repo_names = [fake.word() + "_repo" for _ in range(100)]
return repo_names
# Function to generate random email addresses for the GitHub accounts
def generate_email_addresses(github_accounts):
email_domains = {
'en_US': 'example.com',
'es_ES': 'ejemplo.com',
'fr_FR': 'exemple.com',
'ar_EG': 'مثال.موقع',
'ru_RU': 'пример.сайт',
'ja_JP': '例.com',
'ko_KR': '예시.com',
'zh_CN': '例子.com',
'hi_IN': 'उदाहरण.कॉम',
}
email_addresses = {}
for account in github_accounts:
locale = fake.locales[0]
email_domain = email_domains.get(locale, 'example.com')
email_addresses[account] = f"{account}@{email_domain}"
return email_addresses
# Function to generate random data for the table
def generate_table_data():
github_accounts = generate_github_accounts()
repo_names = generate_repo_names()
repo_statuses = [".", "."]
email_addresses = generate_email_addresses(github_accounts)
table_data = []
for i in range(99):
counter = i + 1
github_account = github_accounts[i]
repo_name = repo_names[i]
repo_status = random.choice(repo_statuses)
email = email_addresses[github_account]
table_data.append((counter, github_account, repo_name, repo_status, email))
return table_data
# Create the table and display it
def create_table(table_data):
print("{:<5} {:<20} {:<30} {:<10} {:<30}".format("No.", "GitHub Account", "Repo Name", "Status", "Email Address"))
print("=" * 110)
for data in table_data:
print("{:<5} {:<20} {:<30} {:<10} {:<30}".format(data[0], data[1], data[2], data[3], data[4]))
# Generate random data and create the table
table_data = generate_table_data()
create_table(table_data)
No. GitHub Account Repo Name Status Email Address
==============================================================================================================
1 salasrosa 符号_repo . salasrosa@example.com
2 adelaida24 natus_repo . adelaida24@example.com
3 jfoley монета_repo . jfoley@example.com
4 zgim commodi_repo . zgim@example.com
5 bjohnson id_repo . bjohnson@example.com
6 usnyder science_repo . usnyder@example.com
7 hortense71 new_repo . hortense71@example.com
8 oroman house_repo . oroman@example.com
9 maedaryosuke exercitationem_repo . maedaryosuke@example.com
10 dementevafinogen sapiente_repo . dementevafinogen@example.com
11 yongxu eum_repo . yongxu@example.com
12 lfeng 作品_repo . lfeng@example.com
13 milessandra chiffre_repo . milessandra@example.com
14 osaito molestiae_repo . osaito@example.com
15 ysh34 épaule_repo . ysh34@example.com
16 yvette37 est_repo . yvette37@example.com
17 jtimofeeva eligendi_repo . jtimofeeva@example.com
18 ohyeonu 表示_repo . ohyeonu@example.com
19 sgilles 我们_repo . sgilles@example.com
20 mendozakari distinctio_repo . mendozakari@example.com
21 morrisonkimberly 持つ_repo . morrisonkimberly@example.com
22 mengwei because_repo . mengwei@example.com
23 seosangho culpa_repo . seosangho@example.com
24 marclambert dolore_repo . marclambert@example.com
25 ykennedy 拥有_repo . ykennedy@example.com
26 poljakovaverki distance_repo . poljakovaverki@example.com
27 okirillov card_repo . okirillov@example.com
28 junhyeogbag 处理_repo . junhyeogbag@example.com
29 remy43 инструкция_repo . remy43@example.com
30 xding eum_repo . xding@example.com
31 scott47 officiis_repo . scott47@example.com
32 haletina 到了_repo . haletina@example.com
33 sitnikovjanuari modern_repo . sitnikovjanuari@example.com
34 jennifer46 suscipit_repo . jennifer46@example.com
35 olegario57 继续_repo . olegario57@example.com
36 robinsonstephen alias_repo . robinsonstephen@example.com
37 kraamllaa dolor_repo . kraamllaa@example.com
38 tanjun 任何_repo . tanjun@example.com
39 maria24 教育_repo . maria24@example.com
40 alekseevkallistrat eveniet_repo . alekseevkallistrat@example.com
41 vyang 美国_repo . vyang@example.com
42 igyeonghyi зато_repo . igyeonghyi@example.com
43 anani_2014 repellat_repo . anani_2014@example.com
44 gaavitdenyl quisquam_repo . gaavitdenyl@example.com
45 shasegawa хотеть_repo . shasegawa@example.com
46 zhou カラム_repo . zhou@example.com
47 dengmin aperiam_repo . dengmin@example.com
48 bragintvorimir in_repo . bragintvorimir@example.com
49 vfleming 免费_repo . vfleming@example.com
50 primitivocastellanos d'autres_repo . primitivocastellanos@example.com
51 gmays 賞賛する_repo . gmays@example.com
52 jieuni направо_repo . jieuni@example.com
53 gloriaharrison スペル_repo . gloriaharrison@example.com
54 nathalielesage soluta_repo . nathalielesage@example.com
55 mancebomanuela eos_repo . mancebomanuela@example.com
56 yeongil31 exécuter_repo . yeongil31@example.com
57 aditiidttaa ipsam_repo . aditiidttaa@example.com
58 robert96 協力_repo . robert96@example.com
59 ermola1978 запустить_repo . ermola1978@example.com
60 akira05 лиловый_repo . akira05@example.com
61 cndnaamaane fugiat_repo . cndnaamaane@example.com
62 kevin21 палец_repo . kevin21@example.com
63 coedohyeon accrocher_repo . coedohyeon@example.com
64 gimbyeongceol パン_repo . gimbyeongceol@example.com
65 robertmiles пропадать_repo . robertmiles@example.com
66 hshcherbakov reprehenderit_repo . hshcherbakov@example.com
67 qdossii présenter_repo . qdossii@example.com
68 arhip_98 business_repo . arhip_98@example.com
69 rijvaanmaan fuga_repo . rijvaanmaan@example.com
70 senaadhiishaditii проход_repo . senaadhiishaditii@example.com
71 sorokinaanna даль_repo . sorokinaanna@example.com
72 hlai yeah_repo . hlai@example.com
73 yangcai ブレーキ_repo . yangcai@example.com
74 athrvcaudhrii non_repo . athrvcaudhrii@example.com
75 thall magazine_repo . thall@example.com
76 fpineau sequi_repo . fpineau@example.com
77 madeleine14 natus_repo . madeleine14@example.com
78 gbuck 这里_repo . gbuck@example.com
79 trifonegorov nostrum_repo . trifonegorov@example.com
80 daniel48 район_repo . daniel48@example.com
81 ainara36 багровый_repo . ainara36@example.com
82 ujin86 コミュニケーション_repo . ujin86@example.com
83 carranzadafne 点击_repo . carranzadafne@example.com
84 matsumotoshohei alors_repo . matsumotoshohei@example.com
85 bilbaorosario autem_repo . bilbaorosario@example.com
86 laraplinio quia_repo . laraplinio@example.com
87 fanming космос_repo . fanming@example.com
88 nikola2002 eaque_repo . nikola2002@example.com
89 vivaan29 上海_repo . vivaan29@example.com
90 maksimovegor トス_repo . maksimovegor@example.com
91 tnvii92 dolore_repo . tnvii92@example.com
92 jeanfleury 记者_repo . jeanfleury@example.com
93 guy54 reprehenderit_repo . guy54@example.com
94 itoharuka salle_repo . itoharuka@example.com
95 michaudmichele 这样_repo . michaudmichele@example.com
96 melinda73 спасть_repo . melinda73@example.com
97 rlopez ヘア_repo . rlopez@example.com
98 albertmargot accepter_repo . albertmargot@example.com
99 vnaam est_repo . vnaam@example.com
6#
Show code cell source
from tabulate import tabulate
import random
from datetime import datetime, timedelta
# Adding new headers
headers = ["No.", "Deleted", "GitHub Account", "Repo Name", "Status", "Email Address"]
# Hardcoded 'Deleted' column
deleted_column = [
"No", "No", "No", "No", "No", "No", "No", "No", "No", "No",
"No", "No", "No", "No", "No", "No", "No", "No", "No", "No",
"No", "No", "No", "No", "No", "No", "No", "No", "No", "No",
"No", "No", "No", "No", "No", "No", "No", "No", "No", "No",
"No", "No", "No", "No", "No", "No", "No", "No", "No", "No",
"No", "No", "No", "No", "No", "No", "No", "No", "No", "No",
"No", "No", "No", "No", "No", "No", "No", "No", "No", "No",
"No", "No", "No", "No"
]
# Existing data
data = [
# ... (same as the previous data) ...
["1", "muzaale", "ds4ph-bme/ds4ph-spring-hw-1-muzaale", ".", "muzaale@gmail.com"],
["2", "muzaale", "ds4ph-bme/ds4ph-spring-hw-2-muzaale", ".", "muzaale@gmail.com"],
["3", "muzaale", "ds4ph-bme/ds4ph-spring-hw-3-muzaale", ".","muzaale@gmail.com"],
["4", "muzaale", "ds4ph-bme/ds4ph-spring-hw-4-muzaale", ".","muzaale@gmail.com"],
["5", "muzaale", "ds4ph-bme/ds4ph-spring-hw-5-muzaale", ".","muzaale@gmail.com"],
["6", "muzaale", "ds4ph-bme/ds4ph-spring-hw-6-muzaale", ".","muzaale@gmail.com"],
["7", "muzaale", "ds4ph-bme/ds4ph-spring-hw-7-muzaale", ".","muzaale@gmail.com"],
["8", "muzaale", "ds4ph-bme/ds4ph-spring-hw-8-muzaale", ".","muzaale@gmail.com"],
["9", "muzaale", "ds4ph-bme/ds4ph-spring-hw-9-muzaale", ".","muzaale@gmail.com"],
["10", "muzaale", "ds4ph-bme/ds4ph-spring-hw-10-muzaale", ".","muzaale@gmail.com"],
["11", "muzaale", "ds4ph-bme/capstone-project-muzaale", ".", "muzaale@gmail.com"],
["12", "muzaale-x", "desktop-tutorial ", ".","muzaale@gmail.com"],
# ... Add more rows here ...
["13", "muzaale", "private", "muzaale.github.io", "muzaale@gmail.com"],
["14", "muzaale", ".", "book", "muzaale@gmail.com"],
["15", "muzaale", "bloc", "denotas", "muzaale@gmail.com"],
["16", "muzaale", ".", "bcmodel","muzaale@gmail.com"],
["17", "muzaale", ".", "destruction","muzaale@gmail.com"],
["18", "muzaale", "buch ", ".","muzaale@gmail.com"],
["19", "muzaale", "idioms", ".","muzaale@gmail.com"],
["20", "muzaale", "kulala ", ".","muzaale@gmail.com"],
["21", "muzaale", "reduction ", ".","muzaale@gmail.com"],
["22", "muzaale", "capstone ", ".","muzaale@gmail.com"],
["23", "muzaale", "vscode ", ".","muzaale@gmail.com"],
["24", "muzaale", "ds4bio_book ", ".", "muzaale@gmail.com"],
["25", "muzaale", "ds4ph-bme ", ".","muzaale@gmail.com"],
# ... Add more rows here ...
["26", "jhustata", "jhustata.github.io", ".", "muzaale@jhmi.edu"],
["27", "jhustata", "libro", ".", "muzaale@jhmi.edu"],
["28", "jhustata", "livre", ".", "muzaale@jhmi.edu"],
["29", "jhustata-x", "c600y23s", ".", "muzaale@jhmi.edu"],
["30", "jhustata-x", "600y23s", ".", "muzaale@jhmi.edu"],
["31", "jhustata-x", "kitabo", ".", "muzaale@jhmi.edu"],
["32", "jhustata", "book", ".", "muzaale@jhmi.edu"],
["33", "jhustata-x", "class700", ".", "muzaale@jhmi.edu"],
["34", "jhustata-x", "science", ".", "muzaale@jhmi.edu"],
["35", "jhustata-x", "fix", ".", "muzaale@jhmi.edu"],
["36", "jhustata-x", "class600", ".", "muzaale@jhmi.edu"],
["37", "jhustata-x", "desktop", ".", "muzaale@jhmi.edu"],
["38", "jhustata-x", "nhanes", ".", "muzaale@jhmi.edu"],
["39", "jhustata-x", "notes", ".", "muzaale@jhmi.edu"],
# ... Add more rows here ...
["40", "jhutrc", "jhutrc.github.io", ".", "muzaale@icloud.com"],
["41", "jhutrc", "criteria", ".", "muzaale@icloud.com"],
["42", "jhutrc-x", "book", ".", "muzaale@icloud.com"],
["43", "jhutrc-x", "manuscripts", ".", "muzaale@icloud.com"],
["44", "jhutrc-x", "dofiles", ".", "muzaale@icloud.com"],
["45", "jhutrc-x", "book", ".", "muzaale@icloud.com"],
# ... Add more rows here ...
["46", "afecd-x", "ai ", ".", "afecd.lab@gmail.com"],
["47", "afecd-x", "afecd.github.io ", ".", "afecd.lab@gmail.com"],
["48", "muzaalefamily-x", "bukonte ", ".", "muzaale.family@gmail.com"],
["49", "muzaalefamily-x", "muzaalefamily.github.io ", ".", "muzaale.family@gmail.com"],
["49", "afecdvi-x", "og", ".", "afecdvi@gmail.com"],
["50", "afecdvi-x", "ai", ".", "afecdvi@gmail.com"],
["51", "afecdvi-x", "afecdvi.github.io", ".", "afecdvi@gmail.com"],
# ... Add more rows here ...
["52", "dhatemwakulala-x", "engoma", ".", "dhatemwakulala@gmail.com"],
["53", "dhatemwakulala-x", "tusirike ", ".", "dhatemwakulala@gmail.com"],
["54", "dhatemwakulala-x", "ffena ", ".", "dhatemwakulala@gmail.com"],
["55", "dhatemwakulala-x", "kelele ", ".", "dhatemwakulala@gmail.com"],
# ... Add more rows here ...
["56", "iagouganda-x", "iago.github.io", ".", "iago.uganda@gmail.com"],
["57", "muzaale-x", "imeela", ".", "muzaale@gmail.com"],
["58", "muzaale-x", "amagunju", ".", "muzaale@gmail.com"],
# ... Add more rows here ...
["58", "muzaale-x", "zeushadesposeidon", ".", "muzaale@gmail.com"],
["59", "muzaale", "track", "repos", "muzaale@gmail.com"],
["60", "muzaale-x", ".", "fenagas", "muzaale@gmail.com"],
["61", "jhutrc", "llc", "fenagas", "muzaale@icloud.com"],
# ... Add more rows here ...
["62", "jhustata-x", "three40", "six100", "muzaale@jhmi.edu"],
["63", "muzaale-x", "blank", "canvas", "muzaale@gmail.edu"],
# 08/03/2023
["64", "jhutrc", "alpha", "beta", "muzaale@icloud.com"],
["65", "muzaale", "be", "fe", "muzaale@gmail.com"],
["66", "muzaale", "ga", "de", "muzaale@gmail.com"],
["67", "muzaale-x", "gamma", "delta", "muzaale@gmail.com"],
["68", "jhurepos", ".", ".", "jhurepos@gmail.com"],
["69", "muzaale", "abi", "ikesa", "muzaale@gmail.com"],
["70", "jhutrc", "yafe", "fena", "muzaale@icloud.com"],
["71", "jhutrc", "nhanes", "jhutrc.github.io", "muzaale@icloud.com"],
]
# Insert the 'Deleted' column into each row
for idx, row in enumerate(data):
row.insert(1, deleted_column[idx])
# Function to generate random date
def generate_random_date(start_date, end_date):
time_delta = end_date - start_date
random_days = random.randint(0, time_delta.days)
return start_date + timedelta(days=random_days)
# Define the date range
start_date = datetime(2023, 4, 4)
end_date = datetime(2023, 7, 31)
# Add a random date for each row in the data
for row in data:
random_date = generate_random_date(start_date, end_date).strftime("%Y-%m-%d")
row.append(random_date)
# Update headers to include the new date column
headers.append("Random Date")
# Printing the table
table = tabulate(data, headers=headers, tablefmt="")
print(table)
No. Deleted GitHub Account Repo Name Status Email Address Random Date
----- --------- ---------------- ------------------------------------ ----------------- ------------------------ -------------
1 No muzaale ds4ph-bme/ds4ph-spring-hw-1-muzaale . muzaale@gmail.com 2023-05-23
2 No muzaale ds4ph-bme/ds4ph-spring-hw-2-muzaale . muzaale@gmail.com 2023-05-22
3 No muzaale ds4ph-bme/ds4ph-spring-hw-3-muzaale . muzaale@gmail.com 2023-06-19
4 No muzaale ds4ph-bme/ds4ph-spring-hw-4-muzaale . muzaale@gmail.com 2023-06-02
5 No muzaale ds4ph-bme/ds4ph-spring-hw-5-muzaale . muzaale@gmail.com 2023-06-10
6 No muzaale ds4ph-bme/ds4ph-spring-hw-6-muzaale . muzaale@gmail.com 2023-05-06
7 No muzaale ds4ph-bme/ds4ph-spring-hw-7-muzaale . muzaale@gmail.com 2023-06-13
8 No muzaale ds4ph-bme/ds4ph-spring-hw-8-muzaale . muzaale@gmail.com 2023-07-23
9 No muzaale ds4ph-bme/ds4ph-spring-hw-9-muzaale . muzaale@gmail.com 2023-04-05
10 No muzaale ds4ph-bme/ds4ph-spring-hw-10-muzaale . muzaale@gmail.com 2023-06-30
11 No muzaale ds4ph-bme/capstone-project-muzaale . muzaale@gmail.com 2023-07-05
12 No muzaale-x desktop-tutorial . muzaale@gmail.com 2023-04-18
13 No muzaale private muzaale.github.io muzaale@gmail.com 2023-06-30
14 No muzaale . book muzaale@gmail.com 2023-07-26
15 No muzaale bloc denotas muzaale@gmail.com 2023-06-11
16 No muzaale . bcmodel muzaale@gmail.com 2023-07-09
17 No muzaale . destruction muzaale@gmail.com 2023-05-08
18 No muzaale buch . muzaale@gmail.com 2023-07-11
19 No muzaale idioms . muzaale@gmail.com 2023-06-25
20 No muzaale kulala . muzaale@gmail.com 2023-05-17
21 No muzaale reduction . muzaale@gmail.com 2023-04-18
22 No muzaale capstone . muzaale@gmail.com 2023-05-11
23 No muzaale vscode . muzaale@gmail.com 2023-05-29
24 No muzaale ds4bio_book . muzaale@gmail.com 2023-04-24
25 No muzaale ds4ph-bme . muzaale@gmail.com 2023-06-01
26 No jhustata jhustata.github.io . muzaale@jhmi.edu 2023-04-04
27 No jhustata libro . muzaale@jhmi.edu 2023-07-05
28 No jhustata livre . muzaale@jhmi.edu 2023-07-25
29 No jhustata-x c600y23s . muzaale@jhmi.edu 2023-07-05
30 No jhustata-x 600y23s . muzaale@jhmi.edu 2023-05-07
31 No jhustata-x kitabo . muzaale@jhmi.edu 2023-06-07
32 No jhustata book . muzaale@jhmi.edu 2023-07-10
33 No jhustata-x class700 . muzaale@jhmi.edu 2023-04-26
34 No jhustata-x science . muzaale@jhmi.edu 2023-06-07
35 No jhustata-x fix . muzaale@jhmi.edu 2023-07-29
36 No jhustata-x class600 . muzaale@jhmi.edu 2023-04-17
37 No jhustata-x desktop . muzaale@jhmi.edu 2023-07-24
38 No jhustata-x nhanes . muzaale@jhmi.edu 2023-06-23
39 No jhustata-x notes . muzaale@jhmi.edu 2023-05-12
40 No jhutrc jhutrc.github.io . muzaale@icloud.com 2023-07-20
41 No jhutrc criteria . muzaale@icloud.com 2023-06-24
42 No jhutrc-x book . muzaale@icloud.com 2023-06-07
43 No jhutrc-x manuscripts . muzaale@icloud.com 2023-06-20
44 No jhutrc-x dofiles . muzaale@icloud.com 2023-04-29
45 No jhutrc-x book . muzaale@icloud.com 2023-04-23
46 No afecd-x ai . afecd.lab@gmail.com 2023-05-21
47 No afecd-x afecd.github.io . afecd.lab@gmail.com 2023-07-10
48 No muzaalefamily-x bukonte . muzaale.family@gmail.com 2023-04-24
49 No muzaalefamily-x muzaalefamily.github.io . muzaale.family@gmail.com 2023-06-12
49 No afecdvi-x og . afecdvi@gmail.com 2023-07-12
50 No afecdvi-x ai . afecdvi@gmail.com 2023-07-31
51 No afecdvi-x afecdvi.github.io . afecdvi@gmail.com 2023-06-10
52 No dhatemwakulala-x engoma . dhatemwakulala@gmail.com 2023-07-30
53 No dhatemwakulala-x tusirike . dhatemwakulala@gmail.com 2023-04-04
54 No dhatemwakulala-x ffena . dhatemwakulala@gmail.com 2023-06-19
55 No dhatemwakulala-x kelele . dhatemwakulala@gmail.com 2023-05-15
56 No iagouganda-x iago.github.io . iago.uganda@gmail.com 2023-06-05
57 No muzaale-x imeela . muzaale@gmail.com 2023-04-06
58 No muzaale-x amagunju . muzaale@gmail.com 2023-04-18
58 No muzaale-x zeushadesposeidon . muzaale@gmail.com 2023-07-31
59 No muzaale track repos muzaale@gmail.com 2023-05-20
60 No muzaale-x . fenagas muzaale@gmail.com 2023-07-25
61 No jhutrc llc fenagas muzaale@icloud.com 2023-07-19
62 No jhustata-x three40 six100 muzaale@jhmi.edu 2023-07-16
63 No muzaale-x blank canvas muzaale@gmail.edu 2023-05-13
64 No jhutrc alpha beta muzaale@icloud.com 2023-05-04
65 No muzaale be fe muzaale@gmail.com 2023-04-11
66 No muzaale ga de muzaale@gmail.com 2023-05-04
67 No muzaale-x gamma delta muzaale@gmail.com 2023-07-25
68 No jhurepos . . jhurepos@gmail.com 2023-06-15
69 No muzaale abi ikesa muzaale@gmail.com 2023-04-14
70 No jhutrc yafe fena muzaale@icloud.com 2023-04-14
71 No jhutrc nhanes jhutrc.github.io muzaale@icloud.com 2023-07-06
7#
Show code cell source
from IPython.display import HTML
# Create data for Roman and Greek alphabets
roman_letters = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
greek_upper_letters = [
'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ', 'Ι', 'Κ', 'Λ', 'Μ', 'Ν',
'Ξ', 'Ο', 'Π', 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω'
]
greek_lower_letters = [
'α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ', 'μ', 'ν',
'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'
]
greek_names = [
'Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu',
'Xi', 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'Phi', 'Chi', 'Psi', 'Omega'
]
# List of random words or project titles
project_titles = [
"Seasonal variation in living kidney donation", "Project2", "Project3", "Project4", "Project5", "Project6", "Project7", "Project8", "Project9", "Project10",
"Project11", "Project12", "Project13", "Project14", "Project15", "Project16", "Project17", "Project18", "Project19", "Project20",
"Project21", "Project22", "Project23", "Project24"
]
# List of random names
random_names = [
"Andrew", "Bob", "Charlie", "David", "Eva", "Frank", "Grace", "Hannah", "Isaac", "James", "Kathy", "Liam", "Molly",
"Nathan", "Olivia", "Paul", "Quinn", "Rachel", "Steve", "Tom", "Ursula", "Victoria", "Walter", "Xander", "Yara", "Zane"
]
# Variables to control the width of each column
column1_width = "5%"
column2_width = "5%"
column3_width = "5%"
column4_width = "5%"
column5_width = "90%"
column6_width = "5%"
# Create HTML table with custom styles
html_table = '<table style="border-collapse: collapse; width: 100%; margin-left: auto; margin-right: auto;">'
for roman, greek_upper, name, greek_lower, project, rname in zip(roman_letters, greek_upper_letters, greek_names, greek_lower_letters, project_titles, random_names):
html_table += f'<tr><td style="width: {column1_width}; border: none; text-align: center;">{roman}</td><td style="width: {column2_width}; border: none; text-align: center;">{greek_upper}</td><td style="width: {column3_width}; border: none; text-align: center;">{name}</td><td style="width: {column4_width}; border: none; text-align: center;">{greek_lower}</td><td style="width: {column5_width}; border: none; text-align: center;">{project}</td><td style="width: {column6_width}; border: none; text-align: center;">{rname}</td></tr>'
html_table += '</table>'
# Display the HTML table
display(HTML(html_table))
A | Α | Alpha | α | Seasonal variation in living kidney donation | Andrew |
B | Β | Beta | β | Project2 | Bob |
C | Γ | Gamma | γ | Project3 | Charlie |
D | Δ | Delta | δ | Project4 | David |
E | Ε | Epsilon | ε | Project5 | Eva |
F | Ζ | Zeta | ζ | Project6 | Frank |
G | Η | Eta | η | Project7 | Grace |
H | Θ | Theta | θ | Project8 | Hannah |
I | Ι | Iota | ι | Project9 | Isaac |
K | Κ | Kappa | κ | Project10 | James |
L | Λ | Lambda | λ | Project11 | Kathy |
M | Μ | Mu | μ | Project12 | Liam |
N | Ν | Nu | ν | Project13 | Molly |
O | Ξ | Xi | ξ | Project14 | Nathan |
P | Ο | Omicron | ο | Project15 | Olivia |
Q | Π | Pi | π | Project16 | Paul |
R | Ρ | Rho | ρ | Project17 | Quinn |
S | Σ | Sigma | σ | Project18 | Rachel |
T | Τ | Tau | τ | Project19 | Steve |
U | Υ | Upsilon | υ | Project20 | Tom |
V | Φ | Phi | φ | Project21 | Ursula |
W | Χ | Chi | χ | Project22 | Victoria |
X | Ψ | Psi | ψ | Project23 | Walter |
Y | Ω | Omega | ω | Project24 | Xander |
8#
notin’
9#
#!/bin/bash
# Repositories and file path; originally gchist.sh
OG_REPO="https://github.com/afecdvi/og" # Replace with the original repo URL
CANVAS_REPO="https://github.com/muzaale/canvas" # Replace with the target repo URL
FILE_PATH="seasons.docx"
# Temporary directories for cloning repositories
TEMP_DIR_OG="og_temp_$(date +%s)"
TEMP_DIR_CANVAS="canvas_temp_$(date +%s)"
# Clone the original and target repositories
git clone "$OG_REPO" "$TEMP_DIR_OG"
git clone "$CANVAS_REPO" "$TEMP_DIR_CANVAS"
# Enter the original repository and filter for the file
cd "$TEMP_DIR_OG"
git filter-repo --path "$FILE_PATH" --force
git branch temp_filtered_branch
# Enter the temporary target repository
cd "../$TEMP_DIR_CANVAS"
# Add the temporary directory of the original repository as a remote
git remote add temp_remote "../$TEMP_DIR_OG"
# Fetch the temporary branch
git fetch temp_remote temp_filtered_branch
# Create a new branch and merge the temporary branch into it
git checkout -b merge_seasons_docx
git merge temp_remote/temp_filtered_branch --allow-unrelated-histories
# Push the new branch to the actual 'canvas' repository
git push origin merge_seasons_docx
# Clean up temporary directories
rm -rf "../$TEMP_DIR_OG" "../$TEMP_DIR_CANVAS"
echo "Processing finished. Check the 'merge_seasons_docx' branch in the 'canvas' repository."
10#
rudimentary abikesa_jbc.sh removed
11#
Oldschool Vim to be handled this way:
It looks like the commit message is still not formatted correctly. You need to remove the quotation marks and type your commit message, then save and exit the text editor. Here’s what you can do:
Press the Esc
key to ensure you are in normal mode.
Press :
, and you’ll see a colon appear at the bottom of the screen.
Type i
to switch to insert mode.
Use the arrow keys to navigate to the line with "happy commit"
, and type your commit message there (e.g., “Merging history of seasons.docx from afecdvi/og to muzaale/canvas”).
Press the Esc
key to return to normal mode.
Type :wq
to write the file and quit Vim.
Press Enter
.
This sequence should allow you to exit the text editor and continue with your git operation. Make sure your commit message is on a new line and not inside quotation marks. If you still have trouble, you can always exit without saving by typing :q!
and then use a command-line text editor you’re more comfortable with to make the commit. For example, you can run git commit -m "Your commit message here"
in the command line.
12#
old irrelevant stuff#
13#
commit history of seasons.docx from afecdvi/og to muzaale/canvas
#!/bin/bash
# User-input
read -p "Enter original repo URL (e.g., https://github.com/afecdvi/og): " OG_REPO
read -p "Enter target repo URL (e.g. https://github.com/jhutrc/fena): " CANVAS_REPO
read -p "Enter filename (e.g. seasons.docx): " FILE_PATH
read -p "Enter your root directory (e.g., ~/Dropbox/1f.ἡἔρις,κ/1.ontology): " ROOT_DIR
read -p "Enter your SSH key location (e.g., ~/.ssh/id_yafefena): " SSH_KEY
read -p "Enter your email address for target repo: " GIT_EMAIL
# Expand the tilde if present
SSH_KEY_EXPANDED=$(eval echo $SSH_KEY)
if [ ! -f "$SSH_KEY_EXPANDED" ]; then
echo "SSH key not found at $SSH_KEY_EXPANDED. Exiting."
exit 1
fi
# Set working directory
cd "$(eval echo $ROOT_DIR)" || exit 1
# Configure SSH agent
eval "$(ssh-agent -s)"
ssh-add "$SSH_KEY_EXPANDED"
# Expand the tilde if present in ROOT_DIR
ROOT_DIR_EXPANDED=$(eval echo $ROOT_DIR)
# Temporary directories for cloning repositories
TEMP_DIR_OG="$ROOT_DIR_EXPANDED/OG_REPO_temp_$(date +%s)"
TEMP_DIR_CANVAS="$ROOT_DIR_EXPANDED/CANVAS_REPO_temp_$(date +%s)"
# Clone the original and target repositories
git clone "$OG_REPO" "$TEMP_DIR_OG"
git clone "$CANVAS_REPO" "$TEMP_DIR_CANVAS"
# Enter the original repository and filter for the file
cd "$TEMP_DIR_OG"
git filter-repo --path "$FILE_PATH" --force
git branch temp_filtered_branch
# Enter the temporary target repository
cd "$TEMP_DIR_CANVAS"
# Configure git email
git config user.email "$GIT_EMAIL"
# Add the temporary directory of the original repository as a remote
git remote add temp_remote "$TEMP_DIR_OG"
# Fetch the temporary branch
git fetch temp_remote temp_filtered_branch
# Create a new branch and merge the temporary branch into it
git checkout -b merge_$FILE_PATH
git merge temp_remote/temp_filtered_branch --allow-unrelated-histories
# Push the new branch to the actual 'canvas' repository
git push origin merge_$FILE_PATH
# Clean up temporary directories
rm -rf "$TEMP_DIR_OG" "$TEMP_DIR_CANVAS"
echo "Processing finished. Check the 'merge_$FILE_PATH' branch in the $CANVAS_REPO repository."
14#
of only historical importance… removed
–
16#
None of this was necessary: was merely a network delay
source "/Users/d/Dropbox (Personal)/1f.ἡἔρις,κ/1.ontology/myenv/bin/activate"
(base) d@Poseidon 1.ontology % source "/Users/d/Dropbox (Personal)/1f.ἡἔρις,κ/1.ontology/myenv/bin/activate"
(myenv) (base) d@Poseidon 1.ontology % git remote -v
book https://github.com/muzaale/book (fetch)
book https://github.com/muzaale/book (push)
og ../og (fetch)
og ../og (push)
origin git@github.com:jhutrc/fena (fetch)
origin git@github.com:jhutrc/fena (push)
source-repo ../source-repo (fetch)
source-repo ../source-repo (push)
(myenv) (base) d@Poseidon 1.ontology % cd CANVAS_REPO_temp_1691505000
(myenv) (base) d@Poseidon CANVAS_REPO_temp_1691505000 % git push --verbose origin merge_seasons.docx
Pushing to https://github.com/jhutrc/fena
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 20 threads
Compressing objects: 100% (10/10), done.
POST git-receive-pack (chunked)
Writing objects: 100% (14/14), 1.77 MiB | 2.57 MiB/s, done.
Total 14 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 1 local object.
remote:
remote: Create a pull request for 'merge_seasons.docx' on GitHub by visiting:
remote: https://github.com/jhutrc/fena/pull/new/merge_seasons.docx
remote:
To https://github.com/jhutrc/fena
* [new branch] merge_seasons.docx -> merge_seasons.docx
updating local tracking ref 'refs/remotes/origin/merge_seasons.docx'
17#
git config –global user.name “jhutrc”
Certainly! It sounds like you’re dealing with an authentication issue in Git while working in Visual Studio Code. You might be trying to push to a remote repository where your other account, jhutrc
, has permission, but your currently authenticated account, jhustata
, does not.
Here’s what you can do:
Switch Accounts in the Terminal: You can change your global Git username and email by running these commands in your terminal within VS Code:
git config --global user.name "jhutrc" git config --global user.email "jhutrc@example.com" # Replace with the actual email
If you want to set these just for the current repository (not globally), omit the
--global
flag.Re-authenticate with the Correct Account: If it’s an issue with the authentication (e.g., SSH keys or credentials), you might have to re-authenticate using the
jhutrc
account. Here’s how you might approach this:SSH Key: If you’re using SSH, make sure the SSH key associated with the
jhutrc
account is added to the ssh-agent:ssh-add /path/to/jhutrc-private-key
HTTPS Credentials: If you’re using HTTPS, you might need to update or remove the stored credentials. You can often do this through the credential manager on your OS. On Windows, this would be the Credential Manager; on macOS, the Keychain Access; and on Linux, it might vary depending on the distribution and desktop environment.
Use VS Code’s Integrated Authentication: Visual Studio Code has Git integration and might prompt you to sign in if authentication is needed. Ensure that you sign in with the correct account (i.e.,
jhutrc
) when prompted.
Remember, you’ll need to replace "jhutrc@example.com"
with the actual email address associated with the jhutrc
account.
Keep in mind that these changes will affect how Git identifies you in all of your repositories if you use the --global
flag. If you only want to make the change for the current repository, navigate to the repository directory in your terminal and run the commands without the --global
flag.
18#
(myenv) (base) d@Poseidon 1.ontology % git config --global user.name "jhutrc"
warning: user.name has multiple values
error: cannot overwrite multiple values with a single value
Use a regexp, --add or --replace-all to change user.name.
(myenv) (base) d@Poseidon 1.ontology %
19#
It seems like you’ve encountered an error when trying to set the user.name
configuration value in Git. This can happen if there are multiple entries for user.name
in your Git configuration files.
You can resolve this issue by choosing one of the following options:
Using
--replace-all
to Replace All Existing Values: If you want to set a single value foruser.name
globally and remove all existing entries, you can use the--replace-all
option:git config --global --replace-all user.name "jhutrc"
Use
--add
to Add Another Value: If you want to keep the existing values and add another one, use the--add
option:git config --global --add user.name "jhutrc"
Edit the Configuration Files Manually: You can also manually edit the Git configuration files to resolve the conflict. There are three levels of Git configuration files:
System-level (
/etc/gitconfig
)Global-level (usually in your home directory
~/.gitconfig
or~/.config/git/config
)Repository-level (in the repository’s
.git/config
file)
You’ll want to look in the global and possibly system-level files to see where the conflicting
user.name
entries are. Open the file in a text editor and find the lines withuser.name
, then edit as needed.
Remember to use the method that best fits your desired outcome. If you’re unsure, it might be best to manually inspect the configuration files to understand why there are multiple values for user.name
.
20#
you’ve neglected this: Use a regexp, --add or --replace-all
to change user.name.
21#
You are correct, and I apologize for not including that option in my initial response. Using a regular expression (regexp) to change the user.name
value is another approach you can take.
Here’s how you can do that:
Identify the Exact Value You Want to Replace: First, you’ll need to determine the exact value you want to replace. You can list all the values by running:
git config --get-all user.name
Use a Regular Expression to Replace the Specific Value: Once you have identified the value you want to change, you can use the
--replace-all
option with a regular expression that matches the value. Here’s an example:git config --global --replace-all user.name "jhutrc" "^old_username$"
Replace
old_username
with the exact value you want to replace.
This method allows you to target a specific value among multiple entries for user.name
and replace it with the new value “jhutrc.”
Thank you for pointing out this omission, and I hope this additional information helps!
22#
(myenv) (base) d@Poseidon 1.ontology % git config --get-all user.name
muzaale.family@gmail.com
muzaale
jhustata
(myenv) (base) d@Poseidon 1.ontology %
23#
User
(myenv) (base) d@Poseidon 1.ontology % git config --global --replace-all user.name "jhutrc" "muzaale@jhmi.edu"
(myenv) (base) d@Poseidon 1.ontology % git config --get-all user.name
jhutrc
jhutrc
jhutrc
jhutrc
jhutrc
jhutrc
jhutrc
jhustata
(myenv) (base) d@Poseidon 1.ontology %
why is jhustata persisting??
24#
It seems like you’re trying to set a global Git user name using the command git config --global --replace-all user.name "jhutrc" "muzaale@jhmi.edu"
and then using git config --get-all user.name
to verify the results.
From the output, you are seeing multiple “jhutrc” entries, and one “jhustata” entry. The command you provided doesn’t include any references to “jhustata,” so it’s not surprising that the command didn’t change that value.
Here’s why you might be encountering this behavior:
Local Configuration: Git configuration settings can be set at three different levels: system, global, and local (repository). If “jhustata” is set at the local level, then the global
git config
command you’re using won’t change it. You can check the local configuration withgit config --local --get-all user.name
.Syntax Error in Command: Your initial command seems to be incorrect. The extra email argument
"muzaale@jhmi.edu"
does not correspond to any standard behavior in Git’s configuration system. This could have caused an unexpected behavior in how Git processed the command.Previous Configuration Entries: If the “jhustata” value was set in the global or system-level configuration file, and the
--replace-all
option was not used with that value, then it will persist.
You might want to take the following steps to troubleshoot the issue:
Check Local Configuration: See if the value is set at the local level with
git config --local --get-all user.name
.Check Global Configuration: Look at the global configuration file directly. It is typically located in
~/.gitconfig
. You can open it in a text editor to see what is set there.Check System Configuration: It’s also possible the value is set at the system level. This file’s location can vary depending on the operating system and Git installation.
Correct the Command: If you intended to set the global username to “jhutrc”, then use the correct command:
git config --global user.name "jhutrc"
.Manually Edit the Configuration: If you still encounter issues, you can manually edit the Git configuration files using a text editor. Make sure to be cautious while editing these files manually, as incorrect changes can lead to unexpected behaviors in Git.
how about that?
(myenv) (base) d@Poseidon 1.ontology % git config --global --replace-all user.name "jhutrc" "jhustata"
(myenv) (base) d@Poseidon 1.ontology % git config --get-all user.name
jhutrc
jhutrc
jhutrc
jhutrc
jhutrc
jhutrc
jhutrc
jhutrc
jhustata
(myenv) (base) d@Poseidon 1.ontology %
25#
It seems like you’ve tried to replace the "jhustata"
value with "jhutrc"
globally, but the "jhustata"
value is still present. The command you’ve used seems to be misunderstood; it is not in the correct format.
The git config --global --replace-all
command is supposed to replace all values for a specific key with the new value. However, the extra argument "jhustata"
at the end of your command doesn’t correspond to how the command is intended to be used. Git might be ignoring it, leading to the unchanged behavior you’re witnessing.
Here’s the correct command to replace the global user name with “jhutrc”:
git config --global user.name "jhutrc"
Since the "jhustata"
entry is still persisting, it might be set at a different level, such as the local repository level. You might want to check for this configuration in the local repository with:
git config --local --get-all user.name
If you find the "jhustata"
value at the local level, you can change it with:
git config --local user.name "jhutrc"
If you’re still having trouble, you might want to manually check your Git configuration files (at the system, global, and local levels) to understand where the "jhustata"
value is coming from. As mentioned earlier, the global configuration is typically found in ~/.gitconfig
.
I like the restraint
this introduces. Nothing hardcoded and everything is user-defined.
Remove the Files from Git: If the
.dta
files are being tracked, you can remove them from the Git repository with the following command:git rm '*/*.dta'
This command removes all
.dta
files from the parent directory of your repository.Commit the Changes: Commit the removal with a descriptive message:
git commit -m "Removed all .dta files from parent directory"
Push the Changes to GitHub: Finally, push the changes to the remote GitHub repository:
git push origin <branch-name>
Replace <branch-name>
with the name of the branch you’re working on.
This approach will remove all the .dta
files from the parent directory of the repository, assuming they are being tracked by Git. If the files are not being tracked by Git, the git rm
command will not have any effect on them. Make sure to double-check the paths and wildcards to match the specific directory structure of your repository if needed.
30#
from IPython.display import HTML
# Create data for Roman and Greek alphabets
roman_letters = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
greek_upper_letters = [
'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ', 'Ι', 'Κ', 'Λ', 'Μ', 'Ν',
'Ξ', 'Ο', 'Π', 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω'
]
greek_lower_letters = [
'α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ', 'μ', 'ν',
'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'
]
greek_names = [
'Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu',
'Xi', 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'Phi', 'Chi', 'Psi', 'Omega'
]
# List of random words or project titles
project_titles = [
"Seasonal variation in living kidney donors in the United States from 1989-2019", "Project2", "Project3", "Project4", "Project5", "Project6", "Project7", "Project8", "Project9", "Project10",
"Project11", "Project12", "Project13", "Project14", "Project15", "Project16", "Project17", "Project18", "Project19", "Project20",
"Project21", "Project22", "Project23", "Project24"
]
# List of random names
random_names = [
"Andrew", "Bob", "Charlie", "David", "Eva", "Frank", "Grace", "Hannah", "Isaac", "James", "Kathy", "Liam", "Molly",
"Nathan", "Olivia", "Paul", "Quinn", "Rachel", "Steve", "Tom", "Ursula", "Victoria", "Walter", "Xander", "Yara", "Zane"
]
# Variables to control the width of each column
column1_width = "5%"
column2_width = "5%"
column3_width = "5%"
column4_width = "5%"
column5_width = "90%"
column6_width = "5%"
# Create HTML table with custom styles
html_table = '<table style="border-collapse: collapse; width: 100%; margin-left: auto; margin-right: auto;">'
for roman, greek_upper, name, greek_lower, project, rname in zip(roman_letters, greek_upper_letters, greek_names, greek_lower_letters, project_titles, random_names):
html_table += f'<tr><td style="width: {column1_width}; border: none; text-align: center;">{roman}</td><td style="width: {column2_width}; border: none; text-align: center;">{greek_upper}</td><td style="width: {column3_width}; border: none; text-align: center;">{name}</td><td style="width: {column4_width}; border: none; text-align: center;">{greek_lower}</td><td style="width: {column5_width}; border: none; text-align: center;">{project}</td><td style="width: {column6_width}; border: none; text-align: center;">{rname}</td></tr>'
html_table += '</table>'
# Display the HTML table
display(HTML(html_table))
31#
#!/bin/bash
# Repositories and file path; originally gchist.sh
OG_REPO="https://github.com/afecdvi/og" # Replace with the original repo URL
CANVAS_REPO="https://github.com/muzaale/canvas" # Replace with the target repo URL
FILE_PATH="seasons.docx"
# Temporary directories for cloning repositories
TEMP_DIR_OG="og_temp_$(date +%s)"
TEMP_DIR_CANVAS="canvas_temp_$(date +%s)"
# Clone the original and target repositories
git clone "$OG_REPO" "$TEMP_DIR_OG"
git clone "$CANVAS_REPO" "$TEMP_DIR_CANVAS"
# Enter the original repository and filter for the file
cd "$TEMP_DIR_OG"
git filter-repo --path "$FILE_PATH" --force
git branch temp_filtered_branch
# Enter the temporary target repository
cd "../$TEMP_DIR_CANVAS"
# Add the temporary directory of the original repository as a remote
git remote add temp_remote "../$TEMP_DIR_OG"
# Fetch the temporary branch
git fetch temp_remote temp_filtered_branch
# Create a new branch and merge the temporary branch into it
git checkout -b merge_seasons_docx
git merge temp_remote/temp_filtered_branch --allow-unrelated-histories
# Push the new branch to the actual 'canvas' repository
git push origin merge_seasons_docx
# Clean up temporary directories
rm -rf "../$TEMP_DIR_OG" "../$TEMP_DIR_CANVAS"
echo "Processing finished. Check the 'merge_seasons_docx' branch in the 'canvas' repository."
33.#
Removing files from a Git repository depends on whether you want to simply delete the file in the working directory or also erase it from the Git history. Here’s how you can do both:
Removing a File from the Working Directory and Staging the Deletion
Delete the file from your working directory. You can use a standard file deletion command for your operating system. For example, in a command line interface:
rm filename.txt
Stage the deletion with Git. You’ll need to tell Git to stage this change (removal) to include it in the next commit:
git add -A
Or, specifically for the file:
git add filename.txt
Commit the change. Now you can commit the change to save the file deletion:
git commit -m "Removed filename.txt"
Erasing a File from Git History
If you need to remove a file from all previous commits, such as to erase a file that contains sensitive information, you can use the filter-branch
command or the BFG Repo-Cleaner tool. Here’s how to do it using filter-branch
:
Open a command-line interface. Navigate to your Git repository.
Use
filter-branch
withindex-filter
. Replacefilename.txt
with the file you want to remove:git filter-branch --index-filter "git rm --cached --ignore-unmatch filename.txt" HEAD
Push the changes. If you’re working with a remote repository, you’ll need to force-push these changes:
git push origin --force --all
Warning!
Be very careful when rewriting history, as it can cause problems for anyone else who has a clone of the repository. Make sure to communicate with your team and ensure that everyone synchronizes their local copies with the modified history. Using tools like BFG Repo-Cleaner can simplify this process, but still require caution.