Skip to content

Instantly share code, notes, and snippets.

View appleshan's full-sized avatar
💭
抛弃世俗之浮躁,留我钻研之刻苦.

Alec Shan appleshan

💭
抛弃世俗之浮躁,留我钻研之刻苦.
View GitHub Profile
@appleshan
appleshan / curl.md
Created April 10, 2023 02:25 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@appleshan
appleshan / i3-cheat-sheet.md
Created March 25, 2023 06:32 — forked from JeffPaine/i3-cheat-sheet.md
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@appleshan
appleshan / pre-commit.sh
Created March 13, 2023 10:28 — forked from tmelz/pre-commit.sh
auto format java files with google-java-format
#!/bin/bash
# Auto format changed java files using google-java-format.
# To install, copy this file into $repo/.git/hooks and remove the .sh extension.
# Download the google-java-format JAR from
# https://github.com/google/google-java-format
# A more mature implementation of this would be a plugin for Yelp's pre-commit library:
# http://pre-commit.com/
echo "Running auto-formatter for any changed Java files"
echo "(formatting changes will be automatically added to your commit)"
@appleshan
appleshan / pactl_list_sinks
Created March 5, 2023 09:14
pactl list sinks
Sink #799
State: RUNNING
Name: bluez_output.11_78_64_16_66_18.1
Description: SANSUI
Driver: PipeWire
Sample Specification: s16le 2ch 48000Hz
Channel Map: front-left,front-right
Owner Module: 4294967295
Mute: no
Volume: front-left: 47174 / 72% / -8.57 dB, front-right: 47174 / 72% / -8.57 dB
@appleshan
appleshan / pactl_list_sources
Created March 5, 2023 09:12
pactl list sources
Source #799
State: IDLE
Name: bluez_output.11_78_64_16_66_18.1.monitor
Description: Monitor of SANSUI
Driver: PipeWire
Sample Specification: s16le 2ch 48000Hz
Channel Map: front-left,front-right
Owner Module: 4294967295
Mute: no
Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
package my.netty.http.upload;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.HttpRequestDecoder;
@appleshan
appleshan / ssh-agent.md
Created February 15, 2023 11:52 — forked from mvneves/ssh-agent.md
"Could not open a connection to your authentication agent"

SSH authentication agent does not automatically start when using it from a remote server. This results in the following error message:

$ git pull
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
$ ssh-add ~/my-ssh-key.pem
Could not open a connection to your authentication agent.

To fix it requires manually starting ssh-agent:

@appleshan
appleshan / arch-i3gaps-install.md
Created February 4, 2023 16:06 — forked from fjpalacios/arch-i3gaps-install.md
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.FileCopyUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
package com.hytto.gfw.dpg.util.validation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.validation.Constraint;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.Payload;