Skip to content

Instantly share code, notes, and snippets.

View douglarek's full-sized avatar

douglarek

View GitHub Profile
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@douglarek
douglarek / install-openjdk.txt
Last active February 13, 2024 14:51
How to install openJDK 11 on macOS
$ curl -C - https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz -O openjdk-11_osx-x64_bin.tar.gz
$ tar xf openjdk-11_osx-x64_bin.tar.gz
$ sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/
$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
@douglarek
douglarek / a-dae-init.sh
Last active February 3, 2024 06:10
Regarding how to better use DAE in OpenWRT, use `a-dae-init.sh -> /etc/init.d/dae` and `config.dae -> /etc/dae/config.dae`. For DAE version 0.5.1 or higher, you need to install kmod-veth additionally.
#!/bin/sh /etc/rc.common
# Copyright (C) 2023 Tianling Shen <cnsztl@immortalwrt.org>
USE_PROCD=1
START=99
CONF="dae"
PROG="/usr/bin/dae"
LOG_DIR="/var/log/dae"
from langchain.chat_models import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from langchain.schema.output_parser import StrOutputParser
import requests
from bs4 import BeautifulSoup
from langchain.schema.runnable import RunnablePassthrough, RunnableLambda
from langchain.utilities import DuckDuckGoSearchAPIWrapper
import json
RESULTS_PER_QUESTION = 3
#!/bin/sh
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
SKYBLUE='\033[0;36m'
PLAIN='\033[0m'
BrowserUA="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36"
function Next() {
@douglarek
douglarek / doom.txt
Created May 12, 2023 03:14 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@douglarek
douglarek / firefox-4k-kde.css
Created March 1, 2023 01:52
cat ~/.config/gtk-3.0/gtk.css
@import 'colors.css';
/*title btn config*/
button.titlebutton.close {
margin: 0px;
padding: 0px;
min-height: 30px;
min-width: 30px;
color: transparent;
background-size: 30px;
}
[Data]
DataCount=1
[Data_1]
Comment=Shortcuts for taking screenshots with Flameshot
DataCount=5
Enabled=true
Name=Flameshot
SystemGroup=0
Type=ACTION_DATA_GROUP

Get pbcopy and pbpaste in Arch Linux

First you need the 'xsel' package.

$> pacman -S xsel

Then create aliases.

alias pbcopy='xsel --clipboard --input'

alias pbpaste='xsel --clipboard --output'

package hello;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.encoders.Base64;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.security.spec.AlgorithmParameterSpec;