Skip to content

Instantly share code, notes, and snippets.

View excalq's full-sized avatar

Arthur Kepler excalq

View GitHub Profile
@excalq
excalq / gist:2961415
Last active March 19, 2024 17:45
Javacript: Set or Update a URL/QueryString Parameter, and update URL using HTML history.replaceState()
// 2024 Update, use URLSearchParams [https://caniuse.com/urlsearchparams]
export function createQueryString2(name: string, value: string, searchParams: any) {
const params = new URLSearchParams(searchParams);
params.set(name, value.toLowerCase());
return params.toString();
}
// ---- Original 2012 version, when browsers really sucked ----
// Explicitly save/update a url parameter using HTML5's replaceState().
@excalq
excalq / 185.130.226.118.log
Last active August 17, 2022 05:48
Malicious traffic originating from 185.130.226.118 (103,939 lines total). See tail at https://gist.github.com/excalq/bc8b1b912bedd49855311115c7cbd294
This file has been truncated, but you can view the full file.
185.130.226.118 - - [16/Aug/2022:08:08:20 +0000] "GET / HTTP/1.1" 301 194 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.0 Safari/537.36"
185.130.226.118 - - [16/Aug/2022:08:08:21 +0000] "GET / HTTP/1.1" 200 12170 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.0 Safari/537.36"
185.130.226.118 - - [16/Aug/2022:08:08:22 +0000] "PRI * HTTP/2.0" 500 202 "-" "-"
185.130.226.118 - - [16/Aug/2022:08:08:22 +0000] "GET / HTTP/1.1" 200 12170 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.0 Safari/537.36"
185.130.226.118 - - [16/Aug/2022:08:08:22 +0000] "GET /jQRBkVOtcxa0F3a1 HTTP/1.1" 404 3563 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.0 Safari/537.36"
185.130.226.118 - - [16/Aug/2022:08:08:22 +0000] "GET /?JtQn={tkhv}&pPzj=<> HTTP/1.1" 200 12155 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Ap
@excalq
excalq / gist:bc8b1b912bedd49855311115c7cbd294
Created August 17, 2022 05:46
Malicious traffic originating from 185.130.226.118 (last 1000 lines)
185.130.226.118 - - [16/Aug/2022:21:13:13 +0000] "GET /js/infortis/..%2f.%2f.%2f..%2f.%2f.%2f..%2f.%2f.%2f..%2f.%2f.%2f..%2f.%2f.%2f..%2f.%2f.%2f..%2f.%2f.%2f..%2f.%2f.%2f..%2f.%2f.%2f..%2f.%2f.%2fetc%2fpasswd/plugins/jquery.accordion.min.js HTTP/1.1" 500 202 "-" "-"
185.130.226.118 - - [16/Aug/2022:21:13:13 +0000] "GET /js/infortis/..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af..%c0%afetc/passwd/plugins/jquery.accordion.min.js HTTP/1.1" 404 5107 "https://product-components.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.0 Safari/537.36"
185.130.226.118 - - [16/Aug/2022:21:13:14 +0000] "GET /js/infortis/invalid../../../../../../../../../../etc/passwd/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././
@excalq
excalq / bridge.ts --destination moonbase --ship 1297
Created August 10, 2022 05:27
Bobabase -> Moonbase NFT Bridge (Revert due to L2_BOBA: approve is disabled)
$ npx ts-node scripts/bridge.ts --destination moonbase --ship 1297
Teleporting ship from Bobabase to Moonbase Alpha
Exit Fee is: 1.0 BOBA
/home/arthur/Documents/_Partavate/code/experimental/bobabeam/evm/node_modules/@ethersproject/logger/src.ts/index.ts:261
const error: any = new Error(message);
^
<ref *1> Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"execution reverted: L2_BOBA: approve is disabled pending further community discussion.","code":"UNPREDICTABLE_GAS_LIMIT","method":"estimateGas","transaction":{"from":"0x51F5c4154854c7Dc64642a8eE79DAAdB3da57569","gasPrice":{"type":"BigNumber","hex":"0x3b9aca00"},"to":"0x4200000000000000000000000000000000000006","data":"0x095ea7b300000000000000000000000064371c6b9acfdbc14a98cd794a531ff737ef0f980000000000000000000000000000000000000000000000000de0b6b3a7640000","accessList":null},"error":{"reason":"processing respo
@excalq
excalq / bridge.ts --destination bobabase --ship 1287
Created August 10, 2022 05:24
Moonbase -> Bobabase NFT Bridge (Revert due to lack of registration)
$ npx ts-node scripts/bridge.ts --destination bobabase --ship 1287
Teleporting ship from Moonbase Alpha to Bobabase
/home/arthur/Documents/_Partavate/code/experimental/bobabeam/evm/node_modules/@ethersproject/logger/src.ts/index.ts:261
const error: any = new Error(message);
^
<ref *1> Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32603,\"message\":\"VM Exception while processing transaction: revert Can't Find L2 NFT Contract\",\"data\":\"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a43616e27742046696e64204c32204e465420436f6e7472616374000000000000\"},\"id\":88}","error":{"code":-32603,"data":"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000
hardhat-project@
├─┬ @nomiclabs/hardhat-ethers@2.0.5
│ ├── ethers@5.6.4 deduped
│ └── hardhat@2.9.2 deduped
├─┬ @nomiclabs/hardhat-etherscan@3.0.3
│ ├─┬ @ethersproject/abi@5.6.1
│ │ ├── @ethersproject/address@5.6.0 deduped
│ │ ├── @ethersproject/bignumber@5.6.0 deduped
│ │ ├── @ethersproject/bytes@5.6.1 deduped
│ │ ├── @ethersproject/constants@5.6.0 deduped
@excalq
excalq / Hardhat Sample Project NPM Packages
Last active April 21, 2022 03:02
A small Hardhat project's NPM dependecy list
$ npm list --all
hardhat-project@
├─┬ @nomiclabs/hardhat-ethers@2.0.5
│ ├── ethers@5.6.2 deduped
│ └── hardhat@2.9.2 deduped
├─┬ @nomiclabs/hardhat-etherscan@3.0.3
│ ├─┬ @ethersproject/abi@5.6.0
│ │ ├── @ethersproject/address@5.6.0 deduped
│ │ ├── @ethersproject/bignumber@5.6.0 deduped
│ │ ├── @ethersproject/bytes@5.6.1 deduped
@excalq
excalq / kepler-dvorak.karabiner-elements.json
Last active February 21, 2020 22:48
Kepler Dvorak for Karabiner Elements for Mac: Dvorak with Undo,Cut,Copy,Paste preserved as QWERTY
{
"title": "Kepler Dvorak Improved",
"rules": [
{
"description": "Use with Dvorak KB Layout. This remaps Left⌘+z,x,c,v to preserve QWERTY shortcuts. Right⌘ acts as Dvorak for these.",
"manipulators": [
{
"type": "basic",
"from": {
@excalq
excalq / kepler-garage-readings.c
Last active September 8, 2019 19:33
ESP32 Sensors: DHT11 (Temp+Humidity), 150PSI Transducer [NodeMCU ESP32 Dev Board]
// ESP32 Sensors: DHT11 (Temp+Humidity), 150PSI Transducer [NodeMCU ESP32 Dev Board]
// REQUIRES the following Arduino libraries:
// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor
#include "DHT.h"
#define DHTPIN 23 // Digital pin connected to the DHT sensor
// Feather HUZZAH ESP8266 note: use pins 3, 4, 5, 12, 13 or 14 --
@excalq
excalq / rails.rb
Last active September 18, 2018 13:49
A Logstash Grok Pattern for Rails 3
####################################
### Rais3 Log Grok (Unicorn and Thin supported at :info level)
## There are many non-capturing groups. For debugging, change them to named groups and use http://grokconstructor.appspot.com/do/match
#
## Assumes Rails is prepending :uuid to log lines, with one log per unicorn worker.
## Assumes the whole request is sent multiline (by Filebeat, not Logstash mulitline plugin)
#
## Add this to the Filebeat.yml prospector
## multiline:
# pattern: '\[[a-fA-F0-9]{32}\]( Started |$)'