Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commits from detached head #115

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
22468d0
Created a silly mad lib!
mackbullock Sep 20, 2024
114bcd3
Converting tsv file bundle
mackbullock Sep 20, 2024
e064083
Made Python file that fetches remote data
mackbullock Sep 21, 2024
bf61a1e
Moved Python file to my-work
mackbullock Sep 21, 2024
832c37a
Moved into lab3 dir
mackbullock Sep 21, 2024
37c0d35
Merge branch 'uvasds-systems:main' into main
mackbullock Sep 22, 2024
da0f650
Wrote 2st script that uploads pics
mackbullock Sep 27, 2024
6747287
Merge remote-tracking branch 'upstream/main'
mackbullock Sep 27, 2024
ee42fcd
Merge branch 'uvasds-systems:main' into main
mackbullock Sep 28, 2024
9949923
created second python script
mackbullock Sep 28, 2024
7d22bac
Made second script
mackbullock Sep 28, 2024
76c5458
Started second script for lab 4
mackbullock Sep 28, 2024
8c8c896
Merge branch 'uvasds-systems:main' into main
mackbullock Oct 1, 2024
3635872
Merge branch 'uvasds-systems:main' into main
mackbullock Oct 3, 2024
68c7992
Started python script
mackbullock Oct 3, 2024
59e5a51
Second python script
mackbullock Oct 3, 2024
e2ec288
Cleanup
mackbullock Oct 3, 2024
b18d550
Merge branch 'main' of https://github.com/mackbullock/DS2022
mackbullock Oct 3, 2024
7d45206
Almost done with second script
mackbullock Oct 3, 2024
e8efdb9
Working some more on the scripts
mackbullock Oct 4, 2024
2409ddc
Finishing up
mackbullock Oct 4, 2024
d6e0d85
Working bootstrap
mackbullock Oct 10, 2024
85ce2fd
Merge branch 'uvasds-systems:main' into commits-from-detached-head
mackbullock Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added my-work/lab3/.convert.swp
Binary file not shown.
20 changes: 20 additions & 0 deletions my-work/lab3/convert-bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

#fetching tarball
wget https://s3.amazonaws.com/ds2002-resources/labs/lab3-bundle.tar.gz

#decompress archive
tar -xzvf lab3-bundle.tar.gz

#removing empty rows
cat lab3-bundle.tsv | tr -s '\n' > lab3-bundle.tsv

#comma format
sed 's/'$'\t''/,/g' lab3-bundle.tsv > lab3-bundle.csv

#count lines
line_count=wc -l lab3-bundle.csv
echo line_count -1

#create new tarball
tar -czvf converted-archive.tar.gz lab3-bundle.csv
Binary file added my-work/lab3/converted-archive.tar.gz
Binary file not shown.
21 changes: 21 additions & 0 deletions my-work/lab3/github-events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/python3

import os
import json
import requests
GHUSER=os.getenv('GITHUB_USER')

print(GHUSER)

url = 'https://api.github.com/users/{0}/events'.format(GHUSER)

print(url)

# fetching GH activity using requests library
r = json.loads(requests.get(url).text)

for x in r[:5]:
event = x['type'] + ' :: ' + x['repo']['name']
print(event)

print(r)
Empty file added my-work/lab3/lab3-bundle.csv
Empty file.
Binary file added my-work/lab3/lab3-bundle.tar.gz
Binary file not shown.
Empty file added my-work/lab3/lab3-bundle.tsv
Empty file.
102 changes: 102 additions & 0 deletions my-work/lab3/lab3_data.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
practice [main]$ cat 03-cleaning/mock_data.tsv
id first_name last_name email ip_address dob
1 Evelyn Brockhurst ebrockhurst0@bing.com 40.101.189.143 04/02/1987
2 Carmelina Euler ceuler1@washington.edu 82.222.180.187 10/17/1980
3 Collin Pealing cpealing2@gnu.org 199.153.193.195 03/24/1985
4 Jaquenette Nan Carrow jnancarrow3@xinhuanet.com 116.16.126.137 08/25/1980
5 Malory Bramham mbramham4@g.co 4.255.16.78 11/23/1991
6 Bald Sheer bsheer5@moonfruit.com 109.203.212.215 08/13/1984
7 Augy Skippings askippings6@gizmodo.com 15.8.139.132 07/10/1984
8 Keenan Trebbett ktrebbett7@github.com 119.158.185.199 02/22/1982
9 Verge Colbourne vcolbourne8@lycos.com 140.130.58.7 09/13/1987
10 Weider Soans wsoans9@nhs.uk 64.217.202.186 06/28/1998
11 Codie Scorey cscoreya@ifeng.com 113.13.237.94 10/27/1986
12 Flori Palatini fpalatinib@dailymail.co.uk 133.188.164.70 06/29/1988
13 Susana Raven sravenc@rediff.com 93.26.138.131 04/07/1996
14 Adel Lamswood alamswoodd@noaa.gov 65.72.181.133 09/29/1983
15 Kit Surcombe ksurcombee@creativecommons.org 200.86.225.239 03/21/1983
16 Julian St Leger jstlegerf@barnesandnoble.com 20.150.228.198 09/24/1992
17 Selena Elix selixg@wikispaces.com 49.130.236.99 12/02/1991
18 Rorke Richichi rrichichih@gov.uk 223.19.109.23 04/13/1996

20 Vittoria Dack vdackj@techcrunch.com 52.75.120.100 06/20/1994
21 Brody Riggott briggottk@berkeley.edu 180.117.7.142 05/23/1997
22 Glynn Toovey gtooveyl@cnet.com 22.78.230.190 04/25/1986
23 Drusy Lembcke dlembckem@go.com 50.233.112.213 07/10/1992
24 Adan Elph aelphn@icio.us 217.74.174.210 02/26/1993
25 D'arcy Newiss dnewisso@prnewswire.com 67.230.17.235 06/28/1986
26 Aveline Bridgewood abridgewoodp@ask.com 124.67.167.20 12/17/1994
27 Neilla Ommanney nommanneyq@about.me 216.228.194.96 11/06/1987
28 Letty O'Brien lobrienr@sitemeter.com 92.108.176.181 03/23/1998
29 Laney Mearns lmearnss@unicef.org 80.187.167.67 12/22/1999
30 Kermie Trevain ktrevaint@desdev.cn 147.39.49.115 02/10/1991
31 Alice Pleasance apleasanceu@angelfire.com 170.83.241.188 02/02/1999
32 Ellissa Vockings evockingsv@spiegel.de 82.189.241.229 05/08/1981
33 Brandyn Tace btacew@miitbeian.gov.cn 177.213.56.112 06/04/1981
34 Jennica Mussard jmussardx@yolasite.com 248.122.107.88 06/10/1988
35 Malvin Richfield mrichfieldy@usnews.com 231.162.252.234 09/08/1993
36 Dorette Matzl dmatzlz@mit.edu 253.233.237.164 09/10/1991
37 Dannie Rayworth drayworth10@bbb.org 227.215.252.119 06/30/1984
38 Kristofer Dering kdering11@zimbio.com 200.222.214.216 08/20/1990
39 Hewe Bozier hbozier12@ehow.com 162.37.14.107 10/18/1991
40 Hildagard Twomey htwomey13@about.com 249.31.215.101 10/16/1995
41 Filip Greveson fgreveson14@mit.edu 194.164.255.182 06/26/1998
42 Harcourt Mounce hmounce15@microsoft.com 112.86.245.144 04/04/1983
43 Ofilia Brearty obrearty16@bing.com 162.11.119.21 12/01/2000
44 Barnaby O'Docherty bodocherty17@angelfire.com 141.177.51.203 08/28/1983
45 Kliment Arbor karbor18@weibo.com 41.172.124.123 08/18/1993
46 Clara Kantor ckantor19@gmpg.org 166.174.201.185 06/26/1992
47 Judye Bour jbour1a@examiner.com 243.64.205.174 06/08/1986
48 Cairistiona Andriolli candriolli1b@scientificamerican.com 134.137.231.40 08/01/1983
49 Christophe Curror ccurror1c@storify.com 188.108.186.85 06/18/1981
50 Yankee Lind ylind1d@ocn.ne.jp 229.75.126.48 10/24/1998
51 Park Boshers pboshers1e@blogtalkradio.com 214.180.127.83 04/21/1995
52 Zachariah Honisch zhonisch1f@ebay.co.uk 99.231.100.144 07/18/1990
53 Janice MacNeice jmacneice1g@istockphoto.com 30.254.111.172 07/01/1981
54 Chaim Creedland ccreedland1h@ibm.com 30.228.94.43 09/07/1994
55 Isabel Keeves ikeeves1i@cam.ac.uk 54.148.82.180 04/15/1992
56 Kale Grundle kgrundle1j@reddit.com 177.111.133.24 03/24/1986
57 Ulick Caldicot ucaldicot1k@blogspot.com 222.82.249.33 04/13/1982
58 Raye McHan rmchan1l@discuz.net 254.183.160.196 02/07/1995
59 Clair Bracken cbracken1m@mlb.com 49.227.205.10 04/12/1983
60 Rebe Killigrew rkilligrew1n@digg.com 111.143.117.213 03/08/1981
61 Dorene Muscat dmuscat1o@blogger.com 221.135.34.120 02/11/1991
62 Virgil Simanenko vsimanenko1p@bloomberg.com 15.225.157.64 10/10/1980
63 Fidole Norkett fnorkett1q@gmpg.org 16.241.104.94 06/23/1981
64 Annissa Barnfield abarnfield1r@shutterfly.com 197.48.176.149 07/03/1985


67 Jamesy Planque jplanque1u@usgs.gov 80.152.71.117 05/08/1997
68 Damiano Benardeau dbenardeau1v@japanpost.jp 237.225.77.130 06/30/1985
69 Cherri McDougald cmcdougald1w@toplist.cz 174.10.130.106 05/24/1990
70 Alick Tzarkov atzarkov1x@nationalgeographic.com 111.161.176.87 09/11/1983
71 Milly Wessing mwessing1y@hostgator.com 87.210.64.18 02/07/2000
72 Elinor Orwell eorwell1z@ibm.com 78.202.193.7 02/16/1995
73 Seana Sommerville ssommerville20@tiny.cc 90.66.11.112 04/09/1983
74 Drusilla Friedenbach dfriedenbach21@walmart.com 249.112.143.190 10/30/1995
75 Saw Sonnenschein ssonnenschein22@wisc.edu 158.152.13.68 08/05/1982
76 Chelsy Hughlin chughlin23@printfriendly.com 78.172.147.158 11/30/2000
77 Talia Almack talmack24@sourceforge.net 87.197.17.215 04/17/1990
78 Lotte Dewdeny ldewdeny25@dropbox.com 89.39.25.234 03/07/1987
79 Alonzo St Ledger astledger26@so-net.ne.jp 18.38.99.31 01/12/1993
80 Willa Hardaway whardaway27@harvard.edu 205.112.253.142 11/17/1985
81 Sibeal Bowld sbowld28@facebook.com 67.149.175.113 10/08/1990
82 Sondra Issacoff sissacoff29@webs.com 114.179.25.96 08/14/1995
83 Silvano Juschke sjuschke2a@homestead.com 240.165.154.75 07/30/1998
84 Cole Kindle ckindle2b@dot.gov 240.254.220.145 04/01/1991
85 Doe Whines dwhines2c@adobe.com 121.175.83.74 08/13/1988
86 Travus Kneath tkneath2d@sbwire.com 238.162.86.215 11/24/1994

88 Basil St. Ledger bstledger2f@imgur.com 196.72.84.51 04/10/1997
89 Janeczka Skipperbottom jskipperbottom2g@state.tx.us 71.11.240.157 04/15/1997
90 Robenia Verma rverma2h@cnn.com 220.86.10.16 05/21/1993
91 Stafani McCart smccart2i@google.com.au 176.23.39.157 04/05/1994
92 Danyette Mirfin dmirfin2j@ihg.com 236.106.32.75 04/05/1999
93 Heddi Boddam hboddam2k@shinystat.com 88.15.204.74 07/08/1985
94 Sheelagh Karlmann skarlmann2l@weebly.com 171.193.253.225 04/30/1994
95 Lela Willows lwillows2m@usgs.gov 165.134.215.107 04/15/1980
96 Celene Alyutin calyutin2n@time.com 1.97.67.151 05/13/1996
97 Ursa Werendell uwerendell2o@infoseek.co.jp 166.82.77.63 07/05/1987
98 Anny Jekyll ajekyll2p@skype.com 234.231.87.6 11/10/1980
99 Cyrillus Happel chappel2q@imageshack.us 224.103.26.159 04/21/1989
100 Eulalie Glynne eglynne2r@desdev.cn 190.180.105.45 07/06/1998
22 changes: 22 additions & 0 deletions my-work/lab3/madlib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

clear
echo "Let's build a mad-lib!"

#prompts
read -p "1. Name of a UVA professor: " NAME1
read -p "2. Name a verb: " VERB2
read -p "3. Name a building on Grounds: " PLACE3
read -p "4. Name an emotion: " EMOTE4
read -p "5. Name another building on Grounds: " PLACE5
read -p "6. Name a quantity greater than one: " QUANT6
read -p "7. Name a food (plural): " FOOD7
read -p "8. Name an unusual activity: " ACT8
read -p "9. Name a celebrity: " CELEB9

#composing the mad lib
echo "One day, $NAME1 was $VERB2 in $PLACE3."
echo "They suddenly felt $EMOTE4, so they decided to go to $PLACE5."
echo "There, they ate $QUANT6 $FOOD7 with Jim Ryan."
echo "The two decided to start a $ACT8 club."
echo "The club became so popular that $CELEB9 even joined!"
Empty file added my-work/lab4/$file_name
Empty file.
Empty file added my-work/lab4/${NAME}.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added my-work/lab4/.moo_deng..swp
Binary file not shown.
Empty file added my-work/lab4/.png
Empty file.
Binary file added my-work/lab4/.upload_pyth.py.swp
Binary file not shown.
Binary file added my-work/lab4/cool_cat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added my-work/lab4/deng_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added my-work/lab4/file_name
Empty file.
Binary file added my-work/lab4/moo_deng.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions my-work/lab4/python_uploads.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/python3

import boto3
import os

s3 = boto3.client('s3', region_name='us-east-1')

bucket = 'ds2022-ejv4pz'
local_file = 'deng2.jpg'
file_name = 'deng2.jpg'
expires_in = 604800 # 7 days

os.makedirs(os.path.dirname(local_file), exist_ok=True)

with open(local_file, 'rb') as file:
resp = s3.put_object(
Body=file,
Bucket=bucket,
ACL='public-read',
Key=file_name
)

response = s3.generate_presigned_url(
'get_object',
Params={'Bucket': bucket, 'Key': file_name},
ExpiresIn=expires_in
)

print("Presigned URL:", response)
Binary file added my-work/lab4/random_pic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added my-work/lab4/the_deng.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions my-work/lab4/upload_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

clear
read -p "Give me a png image url: " IMAGE
read -p "Enter a name for the image file (formatted as image_name.png): " NAME

curl $IMAGE > $NAME
aws s3 cp "${NAME}" s3://ds2022-ejv4pz/

#link expires in 7 days
the_link=$(aws s3 presign --expires-in 604800 "s3://ds2022-ejv4pz/$NAME")
echo "The file has been uploaded to my bin. Here is the link: " $the_link


# https://ds2022-ejv4pz.s3.amazonaws.com/moo_peng.png?AWSAccessKeyId=AKIA6ELKOJUI37Z7MFGA&Signature=4fCIFqrobcx0H1uYpRhJmlU8dgc=&Expires=1727462806
4 changes: 4 additions & 0 deletions my-work/lab5/boot_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

/usr/bin/apt update -y
/usr/bin/apt install jq git python3 -y