Skip to content

Instantly share code, notes, and snippets.

View guozi's full-sized avatar
🎯
Focusing

guozi_1989 guozi

🎯
Focusing
View GitHub Profile
@guozi
guozi / App.java
Created March 10, 2021 07:14 — forked from rponte/App.java
Downloading file using Apache HttpClient (>= v4.2) with support to HTTP REDIRECT 301 and 302 when using HTTP method GET or POST
public class App {
public static void main(String[] args) throws MalformedURLException {
URL rightUrl = new URL("http://cursos.triadworks.com.br/assets/css/main.css");
URL redirectableUrl = new URL("http://www.triadworks.com.br/assets/css/main.css"); // redirected to cursos.triadworks.com.br
Downloader downloader = new Downloader();
System.out.println("Downloading file through right Url...");
@guozi
guozi / HexUtils.java
Created November 17, 2021 09:25 — forked from keepingcoding/HexUtils.java
进制转换工具类
public class HexUtils {
private HexUtils() {
}
/**
* 16进制转2进制
*
* @param str
* @return
@Bean
public HttpClient httpClient(SSLContext sslContext) {
return HttpClients.custom()
.setMaxConnPerRoute(30)
.setMaxConnTotal(60)
.setSSLContext(sslContext).build();
}
@Bean
public ClientHttpRequestFactory clientHttpRequestFactory(HttpClient httpClient) {
return new HttpComponentsClientHttpRequestFactory(httpClient);
@guozi
guozi / HttpUtil.java
Created March 28, 2022 13:29 — forked from liujbo/HttpUtil.java
HTTP请求工具
package com.xilai.cuteBoy.common.util;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.AuthSchemes;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
@guozi
guozi / private_fork.md
Created July 27, 2022 02:31 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git