Skip to content

Instantly share code, notes, and snippets.

View yusiwen's full-sized avatar

Siwen Yu yusiwen

View GitHub Profile
@yusiwen
yusiwen / jira-behing-nginx-ssl
Last active March 24, 2020 14:39 — forked from jtbonhomme/jira-behing-nginx-ssl
Atlassian JIRA behind Nginx + SSL #nginx #jira
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@yusiwen
yusiwen / mysql_blob_example.c
Last active March 24, 2020 14:38
[Store & retrieve blob data using MySQL C API] #c #mysql
// CREATE TABLE:
// create table images(id int not null primary key, data mediumblob);
#include <stdio.h>
#include "mysql.h"
int main(int argc, char **argv)
{
MYSQL *conn;
@yusiwen
yusiwen / exportCVS.java
Last active March 24, 2020 14:42
[Exporting from oracle database to csv file] Exporting from oracle database to csv file #java #cvs #oracle
import java.io.*;
import java.sql.*;
public class CsvF {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "system", "sandp");
conn.setAutoCommit(false);
{
"theme": "light",
"snippet": {
"expanded": true,
"newSnippetPrivate": false,
"sorting": "updated_at",
"sortingReverse": true
},
"editor" : {
"tabSize": 4
@yusiwen
yusiwen / git-config.txt
Created March 25, 2020 14:06
[Git proxy] Use proxy in git #git #proxy
Port: 1080
1. Create a file /YOUR PATH/gitproxy.sh with content:
#!/bin/sh
nc -X 5 -x 127.0.0.1:1080 "$@"
2. Edit your ~/.gitconfig
# For git://
@yusiwen
yusiwen / spring-boot-starter-parent.pom
Created March 25, 2020 14:20
[spring-boot-starter-parent.pom] #spring-boot #maven #pom
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.5.RELEASE</version>
@yusiwen
yusiwen / spring-boot-dependencies-2.2.5.RELEASE.pom.xml
Last active March 31, 2020 16:39
[spring-boot-dependencies.pom] #spring-boot #maven #pom
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.5.RELEASE</version>
<packaging>pom</packaging>
<name>Spring Boot Dependencies</name>
<description>Spring Boot Dependencies</description>
@yusiwen
yusiwen / 1.txt
Created March 25, 2020 16:11
[node-geckodriver use local pre-downloaded packages] #nodejs
Use GECKODRIVER_FILEPATH to point to a pre-downloaded geckodriver archive that should be extracted during installation.
@yusiwen
yusiwen / pom.xml
Created March 25, 2020 16:13
[frontend-maven-plugin use download mirrors] #java #maven #frontend-maven-plugin
<plugin>
...
<execution>
<!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
@yusiwen
yusiwen / SecurityConfig.java
Created March 26, 2020 04:14
[H2 console in Spring Boot show a blank screen] #spring-boot #h2
@Override
protected void configure(HttpSecurity http) throws Exception {
bla();
bla();
http.headers().frameOptions().sameOrigin();
}