Skip to content

Instantly share code, notes, and snippets.

@alawnchen
alawnchen / UnpackUnityAssets.py
Created March 23, 2023 05:44 — forked from jesliwang/UnpackUnityAssets.py
Unpack Assets For Unity Games From Apks or assetbundles
#!/Users/Jesli/opt/anaconda3/bin/python
# -*- coding: UTF-8 -*-
import io, os
import UnityPy
import sys, getopt
import traceback
import json
class UnPackUnityAsset:
@alawnchen
alawnchen / mime.html
Created September 22, 2022 09:43 — forked from topalex/mime.html
How to check real mime type of image in javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mime type checker</title>
<script type="text/javascript" src="/jquery.min.js"></script>
<script>
$(function () {
var result = $('div#result');
if (window.FileReader && window.Blob) {
@alawnchen
alawnchen / Readme.md
Created April 8, 2022 14:49 — forked from mapster/Readme.md
Export Google Authenticator secret OTP-keys

Export Google Authenticator secret OTP-keys

I recently got myself a Yubikey and wanted to set up the Yubico Authenticator with all the OTPs I had in Google Authenticator. Unfortunately Yubico Authenticator doesn't support scanning the QR-code that the Google Authenticator generates when you export the OTP-keys, and it seemed like quite the daunting task to log in to every service to generate new OTP-keys. So I decided to have a look at the contents of the QR code, to see if I could import the keys into Yubico Authenticator in one go. Luckily I found a blog post by Alex Bakker that describes the data format.

Transfer QR-code to computer

Unfortunately, but likely for the best, the security policy of Google Authenticator won't allow you to take a screenshot of

@alawnchen
alawnchen / twinkling
Created September 5, 2021 15:03 — forked from jkfzero/twinkling
图标闪烁的css动画
@keyframes twinkling{
0%{
opacity:0; /*透明度为0*/
}
100%{
opacity:1; /*透明度为1*/
}
}
@-ms-keyframes twinkling{
0%{
@alawnchen
alawnchen / main.py
Created August 7, 2020 23:45 — forked from cloverstd/main.py
Handle file upload by Tornado and Nginx Upload Module
#!/usr/bin/env python
# encoding: utf-8
import tornado.ioloop
import tornado.web
import tornado.log
import tornado.httpserver
from tornado.options import define, options
import logging
import tornado.gen
@alawnchen
alawnchen / axios.refresh_token.js
Created December 13, 2019 07:45 — forked from Godofbrowser/axios.refresh_token.1.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
@alawnchen
alawnchen / centos7_samba.sh
Created May 23, 2019 07:02 — forked from darcyliu/centos7_samba.sh
Samba install script for CentOS 7
#!/bin/sh
# Samba install script for CentOS 7
yum install -y samba samba-client samba-common
mv /etc/samba/smb.conf /etc/samba/_smb.conf
cat >> /etc/samba/smb.conf << EOF
[global]
workgroup = WORKGROUP
server string = Samba Server %v
@alawnchen
alawnchen / .htaccess
Created February 17, 2018 07:37 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/