├── .gitignore ├── public ├── products │ ├── cds │ │ ├── childrens.txt │ │ ├── shortterm.txt │ │ └── estateplanning.txt │ ├── loans │ │ ├── mortgage.txt │ │ ├── jointloanshark.txt │ │ └── loweratesfortherich.txt │ ├── accounts │ │ ├── businessplus.txt │ │ ├── caymanislands.txt │ │ ├── familysavings.txt │ │ ├── jointchecking.txt │ │ ├── jointsavings.txt │ │ ├── familychecking.txt │ │ ├── personalchecking.txt │ │ └── personalsavings.txt │ └── credit_cards │ │ ├── creditplus.txt │ │ ├── economypoints.txt │ │ ├── freedomunited.txt │ │ ├── travelrewards.txt │ │ ├── worldbanccard.txt │ │ ├── jointrewardsplux.txt │ │ └── tbills.txt ├── company_info.md ├── pr_ideas.txt └── key.txt ├── README.md └── private ├── passwords └── passwords.txt ├── contacts └── emergency.txt ├── bin ├── genids.sh ├── worldbanc.sh ├── process_transactions.sh ├── warn.sh └── malicious.sh ├── customers └── records.csv └── cmd ├── genlogs └── main.go └── gentransactions └── main.go /.gitignore: -------------------------------------------------------------------------------- 1 | # should be created by the student 2 | temp 3 | -------------------------------------------------------------------------------- /public/products/cds/childrens.txt: -------------------------------------------------------------------------------- 1 | 6c52bbff-acf3-498d-b7d6-f2691cecfc3f 2 | -------------------------------------------------------------------------------- /public/products/cds/shortterm.txt: -------------------------------------------------------------------------------- 1 | d980efb7-2b65-4111-baec-925243377da5 2 | -------------------------------------------------------------------------------- /public/products/loans/mortgage.txt: -------------------------------------------------------------------------------- 1 | b791b59e-2a5b-4c66-867c-3fdd6edbbc82 2 | -------------------------------------------------------------------------------- /public/products/accounts/businessplus.txt: -------------------------------------------------------------------------------- 1 | f51dc745-df55-49e1-ba62-01b62a15415f 2 | -------------------------------------------------------------------------------- /public/products/accounts/caymanislands.txt: -------------------------------------------------------------------------------- 1 | 76843e3a-6b8b-4752-aeda-4999d7c3cba9 2 | -------------------------------------------------------------------------------- /public/products/accounts/familysavings.txt: -------------------------------------------------------------------------------- 1 | 9267f580-7035-46c7-90ee-cc27d16650fc 2 | -------------------------------------------------------------------------------- /public/products/accounts/jointchecking.txt: -------------------------------------------------------------------------------- 1 | 4b663f3a-0763-4a57-9050-76ce300ccbf2 2 | -------------------------------------------------------------------------------- /public/products/accounts/jointsavings.txt: -------------------------------------------------------------------------------- 1 | bd54ae32-cb0b-4961-b05f-6a5d525ef2b8 2 | -------------------------------------------------------------------------------- /public/products/cds/estateplanning.txt: -------------------------------------------------------------------------------- 1 | 5561caee-ba4c-4e57-8949-5db0f8e70429 2 | -------------------------------------------------------------------------------- /public/products/loans/jointloanshark.txt: -------------------------------------------------------------------------------- 1 | 0675f02a-d251-4033-ab8c-f3ef974194bd 2 | -------------------------------------------------------------------------------- /public/products/accounts/familychecking.txt: -------------------------------------------------------------------------------- 1 | ff04bf65-0ca6-44df-8af3-f92af5fd274c 2 | -------------------------------------------------------------------------------- /public/products/accounts/personalchecking.txt: -------------------------------------------------------------------------------- 1 | 27769880-5c6e-4df6-afd9-70e06ec6bd84 2 | -------------------------------------------------------------------------------- /public/products/accounts/personalsavings.txt: -------------------------------------------------------------------------------- 1 | b8d1e4db-0ba6-48af-bd1a-e649515f227a 2 | -------------------------------------------------------------------------------- /public/products/credit_cards/creditplus.txt: -------------------------------------------------------------------------------- 1 | 1dfbbe21-97fd-435c-afe1-eca37c1120bd 2 | -------------------------------------------------------------------------------- /public/products/credit_cards/economypoints.txt: -------------------------------------------------------------------------------- 1 | 950d22e4-65cc-440d-b3c6-04bae22b465e 2 | -------------------------------------------------------------------------------- /public/products/credit_cards/freedomunited.txt: -------------------------------------------------------------------------------- 1 | 7bf28ba7-f2c5-4c90-9b86-5c4f579547ee 2 | -------------------------------------------------------------------------------- /public/products/credit_cards/travelrewards.txt: -------------------------------------------------------------------------------- 1 | 9072e807-8a41-41a2-9135-a91bd3e8c492 2 | -------------------------------------------------------------------------------- /public/products/credit_cards/worldbanccard.txt: -------------------------------------------------------------------------------- 1 | fc56889b-0ccf-459c-b997-a90405e96d16 2 | -------------------------------------------------------------------------------- /public/products/loans/loweratesfortherich.txt: -------------------------------------------------------------------------------- 1 | b4a30618-c4ac-4079-a8e9-0777c27a7e67 2 | -------------------------------------------------------------------------------- /public/products/credit_cards/jointrewardsplux.txt: -------------------------------------------------------------------------------- 1 | 4dbfd6cd-c28c-43a1-909e-230a8d1830fd 2 | -------------------------------------------------------------------------------- /public/products/credit_cards/tbills.txt: -------------------------------------------------------------------------------- 1 | d2d20e13-37ef-48e6-810c-da99c235eaae 2 | 3 | # should this really belong in the credit cards directory? 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WorldBanc 2 | 3 | A repository for the WorldBanc project, a filesystem for the Learn Terminals and Shells course on [Boot.dev](https://www.boot.dev). 4 | -------------------------------------------------------------------------------- /private/passwords/passwords.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | thepasswordonmyluggage 3 | f00f1ghters 4 | b00kBook 5 | b00kcaseBookcase 6 | pa$$w0rd 7 | correcthorsebatterystaple 8 | higlety7igelty 9 | 1234person1234 10 | gandalfthegrey 11 | -------------------------------------------------------------------------------- /private/contacts/emergency.txt: -------------------------------------------------------------------------------- 1 | Susan, Wife of John, 555-0342 2 | Jordan, Husband of Gerald, 555-1342 3 | Tiffany, Wife of Grant, 555-0322 4 | Jim, Husband of Kathy, 555-9988 5 | Pam, Wife of Jim, 555-2121 6 | Nicole, Concubine of Chad, 555-2111 7 | -------------------------------------------------------------------------------- /public/company_info.md: -------------------------------------------------------------------------------- 1 | # Company Info 2 | 3 | * Company Name: Worldbanc Inc. 4 | * Company Address: 1234 Main St, New York, NY 10001 5 | * Company Phone: 212-555-1212 6 | * Company Email: worldbanc@example.com 7 | * Company Password: wrongdonkeychargertape 8 | -------------------------------------------------------------------------------- /private/bin/genids.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | generate_fake_id() { 4 | counter=$1 5 | echo -n "ID-" 6 | echo "fixed_seed_$counter" \ 7 | | cksum \ 8 | | cut -d ' ' -f 1 9 | } 10 | 11 | for i in $(seq 1 12); do 12 | generate_fake_id $i 13 | done 14 | -------------------------------------------------------------------------------- /private/bin/worldbanc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Welcome to the worldbanc CLI tool!" 4 | 5 | echo "Please enter your name:" 6 | read NAME 7 | 8 | echo "Please enter your email:" 9 | read EMAIL 10 | 11 | echo "============================================" 12 | echo "Your name is $NAME and your email is $EMAIL" 13 | echo "Your response has not been recorded because this is just a local script." 14 | echo "Goodbye!" 15 | -------------------------------------------------------------------------------- /private/customers/records.csv: -------------------------------------------------------------------------------- 1 | name,phone,email 2 | Lane,555-1234,lane@example.com 3 | Allan,555-4321,allan@example.com 4 | Hunter,555-5678,hunter@example.com 5 | Emily,555-2001,emily@example.com 6 | Jacob,555-2002,jacob@example.com 7 | Sophia,555-2003,sophia@example.com 8 | Michael,555-2004,michael@example.com 9 | Isabella,555-2005,isabella@example.com 10 | Ethan,555-2006,ethan@example.com 11 | Olivia,555-2007,olivia@example.com 12 | Joshua,555-2008,joshua@example.com 13 | Ava,555-2009,ava@example.com 14 | Daniel,555-2010,daniel@example.com 15 | -------------------------------------------------------------------------------- /private/bin/process_transactions.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Check if a file path is provided 4 | if [ "$#" -ne 1 ]; then 5 | echo "Usage: $0 " 6 | exit 1 7 | fi 8 | 9 | # Read the file line by line 10 | while IFS= read -r line; do 11 | 12 | # Extract the date from the line 13 | date="${line##*,}" 14 | 15 | # Extract the year from the date 16 | year="${date%%-*}" 17 | 18 | # Check if the year is before 2000 19 | if [[ $year -lt 2000 ]]; then 20 | # Print to stderr 21 | echo "$line" >&2 22 | else 23 | # Print to stdout 24 | echo "$line" 25 | fi 26 | # skip the first line (header) 27 | done < <(tail -n +2 "$1") 28 | -------------------------------------------------------------------------------- /private/bin/warn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script is used to print nice warning messages 4 | # branded in worldbanc style 5 | 6 | echo "============================================" 7 | echo "=========== WORLDBANC WARNING ==============" 8 | echo "============================================" 9 | echo "$WARN_MESSAGE" 10 | echo "============================================" 11 | echo "From: $WARN_FROM_NAME" 12 | echo "============================================" 13 | 14 | if [ -z "$WARN_MESSAGE" ]; then 15 | echo "WARN_MESSAGE is not set. Exiting with error." 16 | exit 69 17 | fi 18 | 19 | if [ -z "$WARN_FROM_NAME" ]; then 20 | echo "WARN_FROM_NAME is not set. Exiting with error." 21 | exit 69 22 | fi 23 | -------------------------------------------------------------------------------- /private/bin/malicious.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Function to handle SIGINT when 'force' is not used 4 | handle_sigint() { 5 | echo "" 6 | echo "Malicious skullduggery complete!" 7 | exit 0 # Exit the script gracefully 8 | } 9 | 10 | # Function to handle SIGINT when 'force' is used 11 | ignore_sigint() { 12 | echo "" 13 | echo "HAHA! You can't stop me!" 14 | # Do not exit, just print a message 15 | } 16 | 17 | # Check if the first argument is "force" 18 | if [ "$1" = "force" ]; then 19 | # Ignoring SIGINT (Ctrl+C) with custom function 20 | trap ignore_sigint SIGINT 21 | echo "SIGINT ignored due to 'force' argument" 22 | else 23 | # Normal SIGINT handling 24 | trap handle_sigint SIGINT 25 | fi 26 | 27 | # Infinite loop 28 | while true; do 29 | echo "Doing scary stuff..." 30 | sleep 1 # Sleep for 1 second to prevent overwhelming the CPU 31 | done 32 | -------------------------------------------------------------------------------- /public/pr_ideas.txt: -------------------------------------------------------------------------------- 1 | Money Trees for Everyone!: We are literally invested in the environment! 2 | WorldBanc will plant a tree for every new account opened. 3 | But here's the twist – each tree will be adorned with fake dollar bills featuring the CEO's face. 4 | Customers can come and 'harvest' the faux cash from their personal trees, exchanging it for real money at a hilariously low exchange rate. 5 | 6 | WorldBanc Cares: Recognizing the importance of personal touch in the digital age, 7 | we introduce a new campaign where the CEO personally writes an email to every customer Mr. Beast style. 8 | To top it off, each email signs off with a digitally autographed photo of the CEO giving a thumbs up. 9 | 10 | The WorldBanc Blimp Bonanza: The best way to stay 'above' the competition is quite literal – by investing in a fleet of blimps. 11 | These blimps, emblazoned with the WorldBanc logo, will hover over major cities, occasionally dropping WorldBanc-branded swag like pens, notepads, and stress balls. 12 | The pièce de résistance? Each blimp plays a jingle, the lyrics of which are just the company's stock ticker symbol repeated to a catchy tune. 13 | -------------------------------------------------------------------------------- /public/key.txt: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAqL7tDZyd7Pm5QbH9J0Wp5LHvRU4R8GkL6tBPk2G7G4U5X3hK 3 | OQITb6Y5VqoGgIgYRQwDkagMsKSkPLhIc4Yx4OJRAyF4nMn8ld8eeFVn+qLp1/2l 4 | D+3J5K5KddyzhH+ZPp2M7JW1O8KvW8YVJY5R3UWfwyRf9C2RvZVrRpuZRvBq+Qho 5 | nbEdC4f+OOwMmzDhIz4k/HBHBaLJFpVgJiK9U+JjVRR9AcQXkKyLbI0jS/RzCotL 6 | 3LT0vuRSL+eC2P7ojEVkSYZghs1+cLhM3ARL5QaGkL+YOa1pHhL5JlCl9zhY40DB 7 | Jx0V8n/AGKcCPsLq0U6K7gNfph4Gtq6IWzJF2wIDAQABAoIBAFwhGMDQz0HrHRWC 8 | qPMzFZRPZ2qE6D3sVTKsdQGo5NfJ2v4JLnBQN9TcI9jGy2OmZzTTZB9jWlWugV1O 9 | kx2VJ1s0Y3Y+R3CQFMBZQp9SYibeM7QVAxyUd2CmCQPiUiD6FP5hPd1QXa9x7yHf 10 | 2kD5Le/bD4RZC1ZSNoC3x6+QfTQ6D+qMW0WuL8InB3S5E+YpPyejLdI9bjjM8v3g 11 | Jy68D6xM0mGJyD6wHzT0Y3HJd3C3iFhk4tCp0sNH0PmhRFR5KlP6QFqmpp8T1rpN 12 | I8L+4tY9pZwFqP6rBzojzOx5JHJhZ3Hh2h4XZ0SMBj+R+Y0Z6ouf43C4C6gkY3sG 13 | AmUHKoECgYEA2LbQL8R8X02YoZzGi5vFb4kHdYHkANPQ6L9KgDwRpW+G0Wlk8UQJ 14 | 8vsEDyRYt4EiVHSTK8vjWUC4Y6jPTO7L7CzC35Qq6p7cTG1FWJfN2KbQL1U6R4p1 15 | 4sGFT9kaudU1Hkx4Z5W1z2h6+u5lmw2kDZp35kC1F3ajV5wPvynRj0UCgYEAxI4J 16 | iF4CmXp5gCwFbC7J2C1ZBvK5sy2Pi1Z6+H0gXYT9B9bTUvnw2G0CfHUX6XJwB6wL 17 | ZGgfJLERM1cNjq2R3Bm1SxNsRg0ZuhIg3cKa3RzKw6e7ZYzYb5H8QVY4uhjuYzMC 18 | XcLvGsG4Uo9TcHPfzF1L5hWZsXvU3C8lO1JfJX0CgYB58qvhfP4fB6Jn2/RN8WKh 19 | gY6SegDmFHd3QXbD6JLzS8ggdbBbRNX 20 | -------------------------------------------------------------------------------- /private/cmd/genlogs/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "math/rand" 7 | "os" 8 | "time" 9 | ) 10 | 11 | const ( 12 | numLogEntries = 10000 13 | maxIntervalSeconds = 18 14 | startTime = "2024-01-11 00:00:00" 15 | ) 16 | 17 | func main() { 18 | start, err := time.Parse("2006-01-02 15:04:05", startTime) 19 | if err != nil { 20 | log.Fatal(err) 21 | } 22 | 23 | file, err := os.Create(start.Format("2006-01-02") + ".log") 24 | if err != nil { 25 | log.Fatal(err) 26 | } 27 | defer file.Close() 28 | 29 | for i := 0; i < numLogEntries; i++ { 30 | logEntry := generateLogEntry(start) 31 | fmt.Fprintln(file, logEntry) 32 | 33 | // Increment the time for the next log entry 34 | interval := time.Duration(rand.Intn(maxIntervalSeconds)) * time.Second 35 | start = start.Add(interval) 36 | } 37 | 38 | fmt.Println("Log file created successfully.") 39 | } 40 | 41 | func generateLogEntry(timestamp time.Time) string { 42 | messages := []string{ 43 | "Server shutdown complete.", 44 | "Server rebooting.", 45 | "Server reboot complete. System ready.", 46 | "Database connection established successfully.", 47 | "Server startup complete. System ready.", 48 | "Server not connected to Network. Check network connection.", 49 | "Network connection re-established.", 50 | "Security scan initiated.", 51 | "Security scan completed. No threats found.", 52 | } 53 | 54 | levels := []string{"INFO", "WARNING", "ERROR", "ALERT"} 55 | 56 | message := messages[rand.Intn(len(messages))] 57 | level := levels[rand.Intn(len(levels))] 58 | 59 | return fmt.Sprintf("%s %s: %s", timestamp.Format("2006-01-02 15:04:05"), level, message) 60 | } 61 | -------------------------------------------------------------------------------- /private/cmd/gentransactions/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/csv" 5 | "fmt" 6 | "log" 7 | "math/rand" 8 | "os" 9 | "time" 10 | ) 11 | 12 | const ( 13 | numTransactions = 10000 14 | startDate = "2023-01-01" 15 | endDate = "2023-12-31" 16 | ) 17 | 18 | func main() { 19 | names := []string{"Alice", "Bob", "Charlie", "David", "Eva", "Frank", "Grace", "Hannah", "Ivan", "Julia", "Kyle", "Lily", "Mia", "Nora", "Oscar", "Paul", "Quinn", "Rachel", "Steve", "Tina"} 20 | 21 | start, err := time.Parse("2006-01-02", startDate) 22 | if err != nil { 23 | log.Fatal(err) 24 | } 25 | end, err := time.Parse("2006-01-02", endDate) 26 | if err != nil { 27 | log.Fatal(err) 28 | } 29 | 30 | file, err := os.Create(fmt.Sprintf("%v.csv", start.Year())) 31 | if err != nil { 32 | log.Fatal(err) 33 | } 34 | defer file.Close() 35 | 36 | writer := csv.NewWriter(file) 37 | defer writer.Flush() 38 | 39 | writer.Write([]string{"amount", "from_user_id", "to_user_id", "from_name", "to_name", "created_at"}) 40 | 41 | for i := 0; i < numTransactions; i++ { 42 | amount := fmt.Sprintf("%.2f", rand.Float64()*1000) 43 | fromUserID := rand.Intn(20) + 1 44 | toUserID := rand.Intn(20) + 1 45 | fromName := names[fromUserID%len(names)] 46 | toName := names[toUserID%len(names)] 47 | createdAt := randomDate(start, end) 48 | writer.Write([]string{amount, fmt.Sprint(fromUserID), fmt.Sprint(toUserID), fromName, toName, createdAt.Format("2006-01-02 15:04:05")}) 49 | } 50 | 51 | fmt.Println("CSV file 'transactions.csv' created successfully.") 52 | } 53 | 54 | func randomDate(start, end time.Time) time.Time { 55 | delta := end.Sub(start) 56 | sec := rand.Int63n(int64(delta.Seconds())) 57 | return start.Add(time.Second * time.Duration(sec)) 58 | } 59 | --------------------------------------------------------------------------------