Skip to content

Instantly share code, notes, and snippets.

@pourmand1376
Last active March 29, 2025 08:03
Show Gist options
  • Save pourmand1376/965625a56c9e8ba4a82cd6f7dd98ed80 to your computer and use it in GitHub Desktop.
Save pourmand1376/965625a56c9e8ba4a82cd6f7dd98ed80 to your computer and use it in GitHub Desktop.
Sharif Login
function sharif_login
{
curl -d "username=$1&password=$2" -X POST "https://net2.sharif.edu/login" > /dev/null
curl -s https://net2.sharif.edu/status | grep -o '<td>.*</td>'
sleep 1s # To See login status
}
function sharif_ip
{
# from ping net2.sharif.edu
# this is written since sometimes DNS server doesn't work!
curl -d "username=$1&password=$2" -X POST -k "https://172.17.1.214/login" > /dev/null
curl -sk https://172.17.1.214/status | grep -o '<td>.*</td>'
sleep 1s # To See login status
}
function sharif_logout
{
curl -d "username=test&password=test" -X POST "https://net2.sharif.edu/logout"
sleep 1s
}
sharif_login1() {
sharif_login "YourUsername" "YourPassword"
}
sharif_ip1() {
sharif_ip "YourUsername" "YourPassword"
}
alias 1="sharif_login1 && exit"
alias ۱="1"
@pourmand1376
Copy link
Author

New Logout

curl -d "username=test&password=test" -X POST "https://172.17.1.214/logout" --insecure --compressed

New Login:

curl --output /dev/null -d "username=&password=" -X POST "https://172.17.1.214/login" --insecure --compressed > /dev/null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment