Commit 34c14f0f authored by ABHINAV GOYAL's avatar ABHINAV GOYAL

Lab 03

parent f14efcfc
Lab 3
Group Details:
Group Number: 31
Members:
Chitwan Saharia (150050011) (100%)
Sheshansh Agrawal (150050027) (100%)
Abhinav Goyal (150050108) (100%)
Honor Code:
I, Chitwan Saharia, pledge on my honour and religion that I have not given or received any unauthorized assistance which would be considered unethical and unacceptable on this assignment or any previous task.
I, Sheshansh Agrawal, pledge on my religion and patriotism that I have not given or received any unauthorized assistance which would be considered unethical and unacceptable on this assignment or any previous task.
I, Abhinav Goyal, pledge on my honour and patriotism that I have not given or received any unauthorized assistance which would be considered unethical and unacceptable on this assignment or any previous task.
Citations:
1. http://stackoverflow.com/questions/4277665/how-do-i-compare-two-string-variables-in-an-if-statement-in-bash
2. http://askubuntu.com/questions/3395/how-to-get-the-mime-type-of-a-file-from-the-command-line
3. http://www.unix.com/shell-programming-and-scripting/43379-suppress-error-message-unzip.html
4. http://askubuntu.com/questions/29370/how-to-check-if-a-command-succeeded
5. http://regexr.com/
6. http://ss64.com/bash/sed.html
7. http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_04_02.html
8. http://stackoverflow.com/questions/7857090/awk-extract-specific-columns-from-delimited-file
Reflection Essay:
Through this lab,
1. We enjoyed coding this much for the first time! Every task had a charm as to which pokemon were we going to catch this time.
2. Learned how to code up the solutions for problems related with a large numbers of files using shell scripts.
3. Learned how to use regex for finding strings with a particular condition.
4. Learned how to share files via terminal. (File transfer using ncat)
5. Learned how to login to a site using curl.
6. Learned how to get a file type without looking at its extention (which are misleading sometimes)
7. Came to know we can restrict the login to the page to some methods by changing some code at the server side(like the one done in Part D of this Lab)
\ No newline at end of file
Tokyo
~/Earth/Asia/Japan
subl "$(find . -type f -size +50k -size -100k -iname 't*' ! -executable ! -writable -perm u=r ! -perm g=r ! -perm o=r)"
\ No newline at end of file
GRASS Sceptile
~/Earth/Asia/China
grep -i -E "^grass|^water" Shanghai | sed 's/.* //' | grep -i -v "[bmBM]" | grep -x '.\{6,10\}'
\ No newline at end of file
Magikarp
find . -type d -exec rm -rf dir -v {} \;
find . -type f -name 'A*' -exec rm -v {} \;
find . -type f -regextype posix-extended -regex './[0-9]|./[1][0-9]|./[2][0]' -exec rm -v {} \;
find . -type f -name '*.jpg' |xargs rm -f
cat * > ultraball.html
\ No newline at end of file
Squirtle
alpha omega
curl -d "username=alpha&password=omega" https://www.cse.iitb.ac.in/~sharat/current/cs251/Assign/Lab03/support/verify.php
\ No newline at end of file
cf3c122f1dabdc0fc4e1c37a25556bc8
f24109a62a0422577119abeb0db4f801
192.168.0.101
192.168.0.106
Laptop-Bulbasaur: ncat -l 1111 > Slowpoke (receiving Slowpoke)
ncat 192.168.0.106 1111 < Bulbasaur (sending Bulbasaur)
Laptop-Slowpoke: ncat 192.168.0.101 1111 < Slowpoke (sending Slowpoke)
ncat -l 1111 > Bulbasaur (receiving Bulbasaur)
\ No newline at end of file
#!/bin/bash
for f in *
do
if [ "$(file --mime-type -b $f)" == "text/html" ]
then
mv $f $f.html
elif [ "$(file --mime-type -b $f)" == "application/gzip" ]
then
mv $f $f.gz
elif [ "$(file --mime-type -b $f)" == "image/jpeg" ]
then
mv $f $f.jpg
elif [ "$(file --mime-type -b $f)" == "text/x-c" ]
then
mv $f $f.cpp
fi
done
ROTOM
application/gzip
image/jpeg
text/html
text/x-c
\ No newline at end of file
Magicarp
ls -ltr | awk '{print $5}'
\ No newline at end of file
Hawlucha
sed -i 's/flying\|fighting/255 0 0/g' corruptedPokémon.ppm
sed -i 's/\(Atk\|Sp.A\|Def\|Sp.D\):1[0-9][0-9]/255 8 153/g' corruptedPokémon.ppm
sed -i 's/HP-\([0-9]\{1,3\}\)\/\([0-9]\{1,3\}\)/\1/g' corruptedPokémon.ppm
\ No newline at end of file
#!/bin/bash
while read p ;do
yes|unzip -q -o -P $p legendaryPokemon.zip > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo $p
fi
done < dictionary.txt
\ No newline at end of file
Mewtwo
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment