This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func handleNoCors(w http.ResponseWriter, req *http.Request) { | |
fmt.Println("Request received. Referer:", req.Header.Get("Referer")) | |
w.Write([]byte("Hello world!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tmp_dir='amass-temp-dir' | |
mkdir $temp_dir | |
cd $temp_dir | |
wget "https://github.com/OWASP/Amass/releases/download/v$1/amass_linux_amd64.zip" | |
unzip amass_linux_amd64.zip | |
rm amass_linux_amd64.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
json=$(curl -s 'https://hackerone.com/graphql' \ | |
-H 'authority: hackerone.com' \ | |
-H 'accept: */*' \ | |
-H 'x-auth-token: ----' \ | |
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36' \ | |
-H 'content-type: application/json' \ | |
-H 'sec-gpc: 1' \ | |
-H 'origin: https://hackerone.com' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/. | |
package main | |
import ( | |
"crypto/hmac" | |
"crypto/sha256" | |
"encoding/base64" | |
"fmt" | |
"io/ioutil" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
query := r.URL.Query() | |
name := query.Get("name") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {String} uri url of the file to download | |
* @param {String} filePath File Path | |
*/ | |
function _downloadFile(uri, filePath) { | |
return new Promise((resolve, reject) => { | |
axios({ | |
method: 'get', | |
url: uri, | |
responseType: 'stream', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source :: https://code.lengstorf.com/deploy-nodejs-ssl-digitalocean/ | |
# Install tools that Let’s Encrypt requires | |
sudo apt-get install bc | |
# Clone the Let’s Encrypt repository to your server | |
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt | |
# Move into the Let’s Encrypt directory | |
cd /opt/letsencrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const eratosthenes = (n) => { | |
// Eratosthenes algorithm to find all primes under n | |
let array = [] | |
let output = []; | |
let upperLimit = Math.sqrt(n) | |
// Make an array from 2 to (n - 1) | |
for (var i = 0; i < n; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* A function to map rgba value into better accessible pixels | |
* */ | |
// ========= Actual Pixels ( 2x2 image ) ========== | |
/* | |
let x = [ | |
[1, 2], | |
[3, 4] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TWIT = require('twit') | |
const config = require('./config'); | |
var Twit = new TWIT(config); | |
function makeTweet(tweet) { | |
Twit.post('statuses/update', { status: tweet }, function(err, data, response) { | |
if(err) { | |
console.log(err) | |
} else { |
NewerOlder