Skip to content

Instantly share code, notes, and snippets.

View pforret's full-sized avatar

Peter Forret pforret

View GitHub Profile
@pforret
pforret / download_images.sh
Last active November 9, 2023 18:48
download all the URLS (images) from a long list
#!/usr/bin/env bash
# all image URLS are in a urls.tx file, 1 url per line
# let this run in the folder where you want to the downloaded images to appear
while read -r url ; do
wget "$url"
done < urls.txt
@pforret
pforret / jwt_get_token2.js
Last active October 12, 2022 13:55
checklyhq snippet to get a JWT token with client_id/client_secret
const axios = require('axios');
// get your secrets from Environment Variables
const email = process.env.SERVICE_CLIENT_ID
const password = process.env.SERVICE_CLIENT_SECRET
const url = process.env.SERVICE_LOGIN_URL
const scope = process.env.SERVICE_CLIENT_SCOPE
var token = "";
var config = {
method: 'post',
url: url,
@pforret
pforret / jwt_get_token.js
Created October 12, 2022 12:46
checklyhq snippet to get a JWT token with username/password
// this snippet is saved under https://app.checklyhq.com/snippets
var axios = require('axios');
// SERVICE_EMAIL/SERVICE_PASSWORD/SERVICE_LOGIN_URL are saved in the Environment Variables
// https://app.checklyhq.com/environment-variables
const email = process.env.SERVICE_EMAIL
const password = process.env.SERVICE_PASSWORD
const url = process.env.SERVICE_LOGIN_URL
var data = '{ "email": "' + email + '", "password": "' + password + '" }';
@pforret
pforret / clean_trojan_php.sh
Last active June 6, 2020 10:12
Clean PHP file of Mal/Badsrc-M - Troj/PHPShll-B infection
#!/bin/bash
# updated in 2020 because my bash skills were not that sophisticated in 2012
LIST=/tmp/LIST.TROJANS.$(date '+%Y%m%d').txt
PATT="eval(base64_decode"
REGEX="eval\(base64_decode"
if [[ ! -s "$LIST" ]] ; then
# find all infected php files and put them in $LIST file
grep -l -R --include=*.php "$PATT" * > "$LIST"
fi