Skip to content

Instantly share code, notes, and snippets.

View dougg0k's full-sized avatar

Douglas Galdino dougg0k

  • Brazil
  • 14:21 (UTC -03:00)
View GitHub Profile
@dougg0k
dougg0k / edgerouter_doh.md
Last active April 25, 2024 15:18
Edgerouter / EdgeOS / DoH / Security Settings / NextDNS / Cloudflare

Edgerouter / EdgeOS / DoH / Security Settings

Notes

  • It seems that every firmware update, whatever was done to get nextdns into the router, will be gone, so you will have to redo the steps or at least some, if you confirm that it has happened.
  • Make sure to have NTP enabled and configured. To avoid bugs.
  • You can do through the UI CLI or using SSH, if you have enabled it and set a port.
  • You can delete any configuration done, by using delete, e.g., delete firewall all-ping.
  • These steps were confirmed to be working after a complete hardware reset.

In the screen with the Install button, do not press it.

  • Press Shift+F10 to open cmd
  • Type the following commands
REG ADD "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f
REG ADD "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f
REG ADD "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f
REG ADD "HKLM\SYSTEM\Setup\LabConfig" /v BypassStorageCheck /t REG_DWORD /d 1 /f
REG ADD "HKLM\SYSTEM\Setup\LabConfig" /v BypassCPUCheck /t REG_DWORD /d 1 /f
@dougg0k
dougg0k / GIT_SIGNING_KEY_VERIFIED.md
Last active May 15, 2023 19:29
Git Signing Commit Verification for Local and Yubikey - How to setup

How to

sudo apt install git gnupg gpg -y

Why I put this together? These informations came from different places, but I didnt find them all in one place, so I added them all here. I take no credit for it.

Generated Key Steps

@dougg0k
dougg0k / index.js
Created September 24, 2021 16:27
Get data from Cloudflare WAF protected url. In this case, was for GraphQL.
const puppeteer = require("puppeteer");
const Xvfb = require("xvfb");
async function getDataFromProtectedUrl({ url, operationName, query, variables }) {
const xvfb = new Xvfb({
silent: true,
xvfb_args: ["-screen", "0", "1280x720x24", "-ac"],
});
xvfb.start((err) => {
if (err) console.error(err);
@dougg0k
dougg0k / http_request_proxy_list.ts
Last active August 21, 2021 23:56
Bypass Rate Limiter by IP by making requests through a proxy list.
import got from "got";
import tunnel from "tunnel";
const PROXY_LIST = [
{ ip: "", port: 80 },
{ ip: "", port: 80 },
{ ip: "", port: 80 },
{ ip: "", port: 80 },
];
const getCountryFlagEmoji = countryCode => String.fromCodePoint(...[...countryCode.toUpperCase()].map(x => 0x1f1a5+x.charCodeAt(0)))
getFlagEmoji('GB') // 🇬🇧
getFlagEmoji('JP') // 🇯🇵
getFlagEmoji('ZA') // 🇿🇦
@dougg0k
dougg0k / App.tsx
Last active June 1, 2020 15:07
Unform ReactJS Radio
function App() {
return (
<RadioButton
name="type"
options={OPTIONS}
defaultValue={"Initial Value"}
isLoading={!!"Initial Value already loaded"}
/>
)
}
@dougg0k
dougg0k / netlify_cloudflare_cdn
Last active April 5, 2020 15:08
A way to use Cloudflare CDN with Netlify
1- Create Github account.
2- Create your private repo and push your files.
3- Login into Netlify with Github and add your repo there.
4- Given that you have your netlify.toml in your project already configured. Keep Post Process disabled.
5- Add your domain to Netlify, but do not configure the DNS nor Alias.
6- Create a Cloudflare account.
7- Add your domain there and configure the DNS to theirs where you bought your domain.
8- Configure the DNS adding CNAME @ with generated Netlify URL from your project in target and CNAME www with @ in target. Both with orange cloud activated (proxified).
9- SSL > Full.
10- Speed > Optimization, Activate Brotli and Rocket Loader and Minify all 3 options.
const ascendingOrderFrequency = arr => {
const convertObjToArray = obj => Object.keys(obj).map(key => [key, obj[key]]);
const frequencyOrderedObj = arr.reduce((acc, curr) => {
acc[curr] ? (acc[curr] += 1) : (acc[curr] = 1);
return acc;
}, {});
return convertObjToArray(frequencyOrderedObj);
};
const numbersMultipleOf = () => {
const arrayToFlat = [[1, 2, [3]], 4];
const arrayToFlat2 = [[1, 2, [3, [4]]], 5];
const arrayToFlat3 = [[1, 2, [3, [4, [5, 6, [7]]]]], 8];
const flatArray = arr => {
return arr.reduce(
(acc, curr) =>
Array.isArray(curr) ? acc.concat(flatArray(curr)) : acc.concat(curr),
[]
);