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
import requests | |
import csv | |
from datetime import datetime | |
# 设置 id 和 range 参数 | |
id = 1 # BTC | |
# id = 1027 # ETH | |
start = 2022 | |
end = 2022 + 1 |
Upstream test server source code: https://gist.github.com/madawei2699/760a896c442408bf6a4475bd98eff2c8
package main
import (
"encoding/json"
"net/http"
If the SameSite attribute is set to Strict, then the browser will not include the cookie in any requests that originate from another site
. This is the most defensive option, but it can impair the user experience
, because if a logged-in user follows a third-party link to a site, then they will appear not to be logged in, and will need to log in again before interacting with the site in the normal way.
If the SameSite attribute is set to Lax, then the browser will include the cookie in requests that originate from another site but only if two conditions are met:
- The request uses the GET method. Requests with other methods, such as POST, will not include the cookie.
- Imagine we have a very bad design and all our actions are performed on GET method. The attacker placed link saying "Save puppies" which links to
http://oursite.com/users/2981/delete
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
;; lein repl | |
(ns test (:require [clojure.core.async :as async] | |
[clj-http.client :as client])) | |
;; define test data | |
(def urls ["http://www.google.com" "http://www.google1.com" "http://255.255.33.44:8001/"]) | |
;; use async/go to build a async http client | |
(defn fetch-async |
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 org.example; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.StatusLine; | |
import org.apache.http.client.config.RequestConfig; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.client.methods.HttpUriRequest; | |
import org.apache.http.client.protocol.HttpClientContext; | |
import org.apache.http.concurrent.FutureCallback; | |
import org.apache.http.config.Registry; |
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
ip=$(curl http://169.254.169.254/latest/meta-data/public-ipv4) | |
echo "Code Server" | |
echo "http://$ip:8443" | |
security_group=$(ec2-metadata -s | cut -d " " -f 2); | |
aws ec2 authorize-security-group-ingress --group-name $security_group --protocol tcp --port 8443 --cidr 0.0.0.0/0 | |
version="1.32.0-310" | |
wget https://github.com/codercom/code-server/releases/download/$version/code-server-$version-linux-x64.tar.gz | |
tar -xvzf code-server-$version-linux-x64.tar.gz | |
cd code-server-$version-linux-x64 | |
chmod +x code-server |
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
/* | |
/* Theme custom css start | |
/* https://raw.githack.com/dracula/logseq/master/custom.css | |
*/ | |
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;700&family=Fira+Sans:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap"); | |
:root { | |
--background: #282a36; | |
--light-background: #343746; |
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
public class Rx { | |
public static void main(String[] args) { | |
int threadNum = Runtime.getRuntime().availableProcessors() + 1; | |
ExecutorService executor = Executors.newFixedThreadPool(threadNum); | |
final Scheduler scheduler = Schedulers.from(executor); | |
Observable.range(1, 20) | |
.flatMap(x -> { | |
Observable<Integer> observableA = Observable.just(x).observeOn(scheduler).map(a -> { | |
System.out.println(Thread.currentThread().getName() + ": =observableA=> " + a); | |
return a; |
NewerOlder