Commit e8fd40d8 authored by ANUBHAW KUNTAL XESS's avatar ANUBHAW KUNTAL XESS

add lab03_outlab

parent 1c4c25af
Group 33 : Lab03_outlab
Group Members:
(Vinayak K, 150050098)
I pledge on my honour that I have not given or received any unauthorized assistance on this assignment or any previous task.
Percent contributed - 100%
(Shriram S B, 150050099)
I pledge on my honour that I have not given or received any unauthorized assistance on this assignment or any previous task.
Percent contributed - 100%
(Anubhaw Kuntal Xess, 150050100)
I pledge on my honour that I have not given or received any unauthorized assistance on this assignment or any previous task.
Percent contributed - 100%
Task A :
- command in line 3 of 'taskA.txt' finds the file and opens it in sublime editor.
Task B:
- We used 'grep' with options -E (--extended-regexp) and -i (--ignore-case).
- since case insensitivity does not matter for condition 3, using -i option will give desired result.
Task C :
- "cat *" concatenates files in ascending order of names by default
- full contents of ultraball is not visible in terminal because almost all characters of main content is followed by a [BS](backspace) ascii character. So characters get deleted when output to terminal.
Task E :
- command on Laptop-Slowpoke is run first.
- Laptop-Slowpoke waits to recieve data and Laptop-Bulbasaur sends Bulbasaur.
- After this Laptop-Slowpoke sleeps for 1 second giving time for Laptop Bulbasaur to get ready to recieve Slowpoke, and then they transfer Slowpoke.
Task F :
- (To find different mime types)
> file --mime-type -b * | sort -u | less
- (To compile all c files)
> gcc *.c
- (To redirect stdout and stderr)
> ./a.out &> masterball
Task G :
- (To print out after converting to chars)
> ls -ltr | sed 1d | awk '{ printf "%c", $5 }' | less
("sed 1d" is to delete first line in stdout of "ls -ltr", which is total no of files)
Citations :
- (taskF, script) http://askubuntu.com/questions/539282/batch-rename-multiple-image-types
- (taskG, awk|printf) https://www.gnu.org/software/gawk/manual/html_node/Printf-Examples.html
- (netcat) http://osxdaily.com/2014/03/27/send-data-across-network-netcat/
Tokyo
/home/crossroads/pro/CS251/Lab03/outlab/support
find . -type f -size +50k -size -100k -name "[tT]*" -perm 400 -exec subl {} +
\ No newline at end of file
GRASS Sceptile
/home/crossroads/pro/CS251/Lab03/outlab/support
find . -type f -name Shanghai -exec grep -Ei "^(grass|water) ([^bmBM]{6,10})$" {} +
\ No newline at end of file
Magikarp
rm -R ./*/
rm A*
rm {1..20}
rm *.jpg
cat * > ultraball.html
\ No newline at end of file
Squirtle
alpha omega
curl -X POST https://www.cse.iitb.ac.in/~sharat/current/cs251/Assign/Lab03/support/verify.php -d "username=alpha" -d "password=omega"
\ No newline at end of file
cf3c122f1dabdc0fc4e1c37a25556bc8
f24109a62a0422577119abeb0db4f801
192.168.0.104
192.168.0.113
cat Bulbasaur | nc 192.168.0.113 1234 && nc -l 1234 > Slowpoke
nc -l 1234 > Bulbasaur && sleep 1 && cat Slowpoke | nc 192.168.0.104
#!bin/bash
# should be run inside 'Kiev'
for f in ./*;
do
type=$(file --mime-type -b "$f" | cut -d/ -f2);
if [ "$type" = "x-c" ]; then
type="c";
fi
mv "$f" "$f.$type";
done
\ No newline at end of file
ROTOM
application/gzip
image/jpeg
text/html
text/x-c
\ No newline at end of file
Magikarp
ls -ltr | sed 1d | awk '{ print $5 }'
\ No newline at end of file
Hawlucha
sed -Ei "s/flying|fighting/255 0 0/g" corruptedPokémon.ppm
sed -Ei "s/((Atk|Sp.A|Def|Sp.D):1[0-9][0-9])/255 8 153/g" corruptedPokémon.ppm
sed -Ei "s/HP-([0-9]{1,3})\/([0-9]{1,3})/\1/g" corruptedPokémon.ppm
\ No newline at end of file
#!bin/bash
# script should be run in the directory which contains both
# 'dictionary.txt' & 'legendaryPokemon.zip'
for word in $(< dictionary.txt)
do
if yes | unzip -qq -P "$word" legendaryPokemon.zip
then
echo "$word"
break
fi
done
\ 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