Commit d71ccef3 authored by NILESH GUPTA's avatar NILESH GUPTA

lab3

parent d44a7438
ssh-keygen
ssh-copy-id $1@$2
ssh-add
#!/bin/bash
x=1
while [ true ]
do
x=$(( $x + 1 ))
done
\ No newline at end of file
#!/bin/bash
printf '%b\n' '\033[33m _/ _/ _/_/_/_/ _/ _/ _/_/_/_/\033[39m'
printf '%b\n' '\033[34m _/ _/ _/ _/ _/ _/ _/\033[39m'
printf '%b\n' '\033[33m _/_/_/_/ _/_/_/_/ _/ _/ _/ _/\033[39m'
printf '%b\n' '\033[34m _/ _/ _/ _/ _/ _/ _/\033[39m'
printf '%b\n' '\033[33m_/ _/ _/_/_/_/ _/_/_/_/ _/_/_/_/ _/_/_/_/\033[39m'
export PS1="\u@\h - \t [\W]:$"
alias bk="cd $OLDPWD"
Group 11 - !nfinity
(Kartik Singhal, 150050025) (Pranay Agrawal, 150050026) (Nilesh Gupta, 150050059)
Student 1: 100%
Student 2: 100%
Student 3: 100%
Student 1: I pledge on my honour that I have not given or received any unauthorized assistance on this assignment or any previous task.
Student 2: I pledge on my honour that I have not given or received any unauthorized assistance on this assignment or any previous task.
Student 3: I pledge that i will NOT use any source which is unauthorized, violate copyrights of the source and without giving proper credits to owner of the source for all my assignments.
Citations:
http://www.thegeekstuff.com/
askubuntu.com
http://www.cyberciti.biz/faq/bash-while-loop/
http://wiki.bash-hackers.org/scripting/terminalcodes
TaskA-
printf- for subtask 5
export -subtask 3
alias for subtask 4
bash uses regex search in readline library. The Readline library includes functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those lines, and perform history expansion on previous commands.
TaskB-
The executable file is task2.sh
We are using the following command-
grep 'Mem' /proc/meminfo | tr -d " " | cut -d':' -f2
TaskC-
For ssh to mars account-
ssh kartiks@mars.cse.iitb.ac.in
for subtask 3
ssh -p 22 -X kartiks@mars.cse.iitb.ac.in
subl /tmp/lab3_inlab_C3.txt
for subtask 4
press enter when asked for "file in which to save the key"
press y if asked for overwrite
press enter when asked for passphrase both time
then enter your cse password and login by running the command : ssh <cse-username>@mars.cse.iitb.ac.in
TaskD-
Subtask 3
For running a script file in background just run the file by using command : ./<script-file-name>.sh & e.g. ./infiniteLoop.sh &
the & in last tells the shell to run the program in background. We figured it out by googling how to run a process in background and got answer at http://askubuntu.com/questions/562911/how-to-execute-a-task-in-background
Subtask 4
for killing a background process command used is : pkill <process name> e.g. pkill infiniteLoop.sh
We figured this by searching pkill on google.
Subtask 5
for killing cell.sh command used is : pkill -9 cell.sh
We figured this out firstly by searching what to do when ctrl+c don't work in ubuntu then we got the answer at http://superuser.com/questions/243460/what-to-do-when-ctrl-c-cant-kill-a-process then used pkill instead of kill to kill the process by its name.
grep 'Mem' /proc/meminfo | tr -d " " | cut -d':' -f2
\ No newline at end of file
Group 11 - !nfinity
(Kartik Singhal, 150050025) (Pranay Agrawal, 150050026) (Nilesh Gupta, 150050059)
Student 1: 100%
Student 2: 100%
Student 3: 100%
Student 1: I pledge on my honour that I have not given or received any unauthorized assistance on this assignment or any previous task.
Student 2: I pledge on my honour that I have not given or received any unauthorized assistance on this assignment or any previous task.
Student 3: I pledge that i will NOT use any source which is unauthorized, violate copyrights of the source and without giving proper credits to owner of the source for all my assignments.
Citations:
https://www.unix.stackexchange.com/
https://askubuntu.com/
https://www.stackoverflow.com/
https://digitalocean.com/
https://superuser.com/
https://unix.com/
https://experts-exchange.com/
https://youtube.com/ (for keeping ourselves motivated :p)
Reflection Essay-
1) learned to use grep,sed,cut,unzip,awk,ls,find,rm,cat,ncat,mv,echo commands in bash
2) learned to write while and for loops in bash script files. Also if and case statements.
3) It was an awesome task we enjoyed a lot doing the tasks, Cheers to the problem setters.
\ No newline at end of file
Tokyo
/home/kartik/Downloads/Earth/Asia/Japan
find -type f -size +50k -size -100k -perm 400 -name '[tT]*' -exec subl {} \;
\ No newline at end of file
GRASS Sceptile
/home/kartik/Downloads/Earth/Asia/China
grep '[^ ]* [^ ]*' Shanghai | grep -i -e 'grass\|water' | grep -x '[^ ]* .\{6,10\}' | sed '/b\|B\|m\|M/d'
\ 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 --data "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
10.5.11.14
10.5.11.94
Laptop-Bulbasaur: for sending Bulbasaur - ncat 10.5.11.94 60000 < Bulbasaur and for receiving Slowpoke - ncat -l 60000 > Slowpoke
Laptop-Slowpoke: for sending Slowpoke - ncat 10.5.11.14 60000 < Slowpoke and for receiving Bulbasaur - ncat -l 60000 > Bulbasaur
\ No newline at end of file
for f in *;
do
exten="$(file --mime-type -b $f | cut -d '/' -f2)";
case $exten in
["x-c"]*)
mv "$f" "$f.c"
;;
["plain"]*) #to avoid scrip file present
;;
*)
mv "$f" "$f.$exten"
;;
esac
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 -lrt | awk -F' ' '{print $5}'
\ No newline at end of file
HAWLUCHA
sed -i -e 's/flying\|fighting/255 0 0/g' corruptedPokémon.ppm
sed -i -e 's/\(Atk\|Sp.\(A\|D\)\|Def\):1[[:digit:]][[:digit:]]/255 8 153/g' corruptedPokémon.ppm
sed -i -e 's/HP-\([[:digit:]]\{1\,3\}\)\/[[:digit:]]\{1\,3\}/\1/g' corruptedPokémon.ppm
\ No newline at end of file
#!/bin/bash
#to run this file run chmod +x ./TaskI.sh then ./TaskI.sh
while read line; do
for word in $line; do
if yes | unzip -P "$word" legendaryPokemon.zip &> /dev/null;
then echo "$word";
fi
done
done < dictionary.txt
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