Skip to content

Instantly share code, notes, and snippets.

View uniquejava's full-sized avatar
👀
Bench-ish, seeking for a job. (RMB 2.5w+, $4.5k+)

cyper uniquejava

👀
Bench-ish, seeking for a job. (RMB 2.5w+, $4.5k+)
  • Wuhan,China
View GitHub Profile
@tuansoibk
tuansoibk / cryptography-file-formats.md
Last active June 10, 2024 07:35
Cryptography material conversion and verification commands
  1. Introduction
  2. Standards
  3. Common combinations
  4. Conversion
  5. Verification/Inspection
  6. Tips for recognising

Introduction

It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.

@soerenmartius
soerenmartius / _src_modules_auth_store_index.ts
Last active June 29, 2023 02:28
Vue 3 with Typescriptt and Vuex 4 Typed Modules Examples ( with real types )
import {
ActionContext,
ActionTree,
GetterTree,
MutationTree,
Module,
Store as VuexStore,
CommitOptions,
DispatchOptions,
} from 'vuex'
@Mardaneus86
Mardaneus86 / AppDelegate.swift
Last active November 5, 2020 00:46
Flutter iOS methodchannel for http calls (workaround for internal MobileIron base apps) - https://github.com/flutter/flutter/issues/41500
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
@lvxianchao
lvxianchao / npm.taobao.sh
Last active June 19, 2024 08:32
设置 npm 和 yarn 的镜像源为淘宝镜像源
# ==========================================================
# NPM
# ==========================================================
npm set registry https://registry.npmmirror.com # 注册模块镜像
npm set disturl https://npmmirror.com/mirrors/node # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://registry.npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://registry.npmmirror.com/mirrors/electron/ # electron 二进制包镜像
@Tamal
Tamal / git-ssh-error-fix.sh
Last active May 27, 2024 17:44
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@npearce
npearce / install-docker.md
Last active June 5, 2024 20:07
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@adriansr
adriansr / svg2icns.sh
Created February 19, 2018 15:21
Convert SVG file to macOS icon (icns) format
#!/bin/sh -x
set -e
SIZES="
16,16x16
32,16x16@2x
32,32x32
64,32x32@2x
128,128x128
@raisiqueira
raisiqueira / fileUpload.vue
Created December 22, 2017 13:06
Simple file upload with Vue and Axios
<style>
input[type="file"]{
position: absolute;
top: -500px;
}
div.file-listing{
width: 200px;
}
@timothystone
timothystone / zprofile-proxy.txt
Created November 23, 2017 00:39
How I set my proxy in ZSH
#in ZSH, add to ~/.zprofile
set_http_proxy() {
if [ -e $HOME/.proxyrc ]; then
. $HOME/.proxyrc
fi
if [ -z $http_proxy ]; then
echo "No proxy config, environment found, connection attempt failed."
echo "Let's setup a config or update your password."
@chriseidhof
chriseidhof / tableviews.swift
Last active October 15, 2023 20:56
trySwift
import UIKit
// If you enjoyed this talk (video link will be up soon), then you might also enjoy our book Advanced Swift: http://www.objc.io/books/advanced-swift
struct Person {
let name: String
let city: String
}
let people = [